mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Made variables non-private, and followed convention for the references to the IP lib.
This commit is contained in:
parent
ea36687205
commit
3ba12ae9ac
7 changed files with 70 additions and 70 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
import Operation from "../Operation";
|
||||
import Utils from "../Utils";
|
||||
import {fromHex, toHex} from "../lib/Hex";
|
||||
import {_ipv4ToStr, _protocolLookup, calculateTCPIPChecksum} from "../lib/Ip";
|
||||
import {fromHex, toHex} from "../lib/Hex.mjs";
|
||||
import {ipv4ToStr, protocolLookup, calculateTCPIPChecksum} from "../lib/Ip.mjs";
|
||||
|
||||
/**
|
||||
* Parse IPv4 header operation
|
||||
|
@ -83,7 +83,7 @@ class ParseIPv4Header extends Operation {
|
|||
}
|
||||
|
||||
// Protocol
|
||||
const protocolInfo = _protocolLookup[protocol] || {keyword: "", protocol: ""};
|
||||
const protocolInfo = protocolLookup[protocol] || {keyword: "", protocol: ""};
|
||||
|
||||
// Checksum
|
||||
const correctChecksum = calculateTCPIPChecksum(checksumHeader),
|
||||
|
@ -112,8 +112,8 @@ class ParseIPv4Header extends Operation {
|
|||
"<tr><td>Time-To-Live</td><td>" + ttl + "</td></tr>" +
|
||||
"<tr><td>Protocol</td><td>" + protocol + ", " + protocolInfo.protocol + " (" + protocolInfo.keyword + ")</td></tr>" +
|
||||
"<tr><td>Header checksum</td><td>" + checksumResult + "</td></tr>" +
|
||||
"<tr><td>Source IP address</td><td>" + _ipv4ToStr(srcIP) + "</td></tr>" +
|
||||
"<tr><td>Destination IP address</td><td>" + _ipv4ToStr(dstIP) + "</td></tr>";
|
||||
"<tr><td>Source IP address</td><td>" + ipv4ToStr(srcIP) + "</td></tr>" +
|
||||
"<tr><td>Destination IP address</td><td>" + ipv4ToStr(dstIP) + "</td></tr>";
|
||||
|
||||
if (ihl > 5) {
|
||||
output += "<tr><td>Options</td><td>" + toHex(options) + "</td></tr>";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue