Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operation: Parse UDP #614

Merged
merged 3 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Spelling
  • Loading branch information
h345983745 committed Aug 19, 2019
commit b8dbb111364346d027ce252f6bb2ec9f5c4b68e9
4 changes: 2 additions & 2 deletions src/core/operations/ParseUDP.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ParseUDP extends Operation {

this.name = "Parse UDP";
this.module = "Default";
this.description = "Parses a UDP header and payload if present.";
this.description = "Parses a UDP header and payload (if present).";
this.infoURL = "https://wikipedia.org/wiki/User_Datagram_Protocol";
this.inputType = "byteArray";
this.outputType = "json";
Expand All @@ -44,7 +44,7 @@ class ParseUDP extends Operation {
//Parse Header
const UDPPacket = {
"Source port": s.readInt(2),
"Desination port": s.readInt(2),
"Destination port": s.readInt(2),
"Length": s.readInt(2),
"Checksum": toHex(s.getBytes(2), "0x")
};
Expand Down
4 changes: 2 additions & 2 deletions tests/operations/tests/ParseUDP.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TestRegister.addTests([
{
name: "Parse UDP: No Data - JSON",
input: "04 89 00 35 00 2c 01 01",
expectedOutput: "{\"Source port\":1161,\"Desination port\":53,\"Length\":44,\"Checksum\":\"0x010x01\"}",
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"0x010x01\"}",
recipeConfig: [
{
op: "From Hex",
Expand All @@ -30,7 +30,7 @@ TestRegister.addTests([
}, {
name: "Parse UDP: With Data - JSON",
input: "04 89 00 35 00 2c 01 01 02 02",
expectedOutput: "{\"Source port\":1161,\"Desination port\":53,\"Length\":44,\"Checksum\":\"0x010x01\",\"Data\":\"0x020x02\"}",
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"0x010x01\",\"Data\":\"0x020x02\"}",
recipeConfig: [
{
op: "From Hex",
Expand Down