fix(ui): уточнить подписи ICMPv6 и портов IPv6
This commit is contained in:
1 parent
d569932b2a
commit
979dc3cfb0
13 files changed
+235
-14
No files matched your search
@@ -53,6 +53,7 @@ const WELL_KNOWN: Record<string, string> = {
|
||||
|
||||
export function applicationName(proto: number, dstPort: number, srcPort = 0): string {
|
||||
if (proto === 1) return "ICMP"
|
||||
if (proto === 58) return "ICMPv6"
|
||||
if (proto === 47) return "GRE"
|
||||
if (proto === 50) return "ESP"
|
||||
if (proto === 89) return "OSPF"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import assert from "node:assert/strict"
|
||||
import { applicationName } from "./traffic-flow-apps.js"
|
||||
import { parseFlowPacket, protoName, resetFlowTemplatesForTests, templateExporterCountForTests } from "./traffic-flow-parse.js"
|
||||
import { allocateOverlayAddress, FLOW_CACHE_ENTRIES, FLOW_TARGET_SRC_AUTO, usablePublicHost } from "./traffic-flow-overlay.js"
|
||||
|
||||
@@ -26,6 +27,10 @@ assert.equal(flows[0]?.proto, 6)
|
||||
assert.equal(flows[0]?.bytes, 1500)
|
||||
assert.equal(flows[0]?.inIface, "1")
|
||||
assert.equal(protoName(6), "TCP")
|
||||
assert.equal(protoName(58), "ICMPv6")
|
||||
assert.equal(applicationName(58, 0), "ICMPv6")
|
||||
assert.equal(applicationName(1, 0), "ICMP")
|
||||
assert.equal(protoName(255), "255")
|
||||
assert.equal(parseFlowPacket(Buffer.from([0, 1]), "1.1.1.1").length, 0)
|
||||
|
||||
const taken = new Set(["10.255.254.2"])
|
||||
|
||||
@@ -434,6 +434,7 @@ export function protoName(proto: number): string {
|
||||
case 17: return "UDP"
|
||||
case 47: return "GRE"
|
||||
case 50: return "ESP"
|
||||
case 58: return "ICMPv6"
|
||||
case 89: return "OSPF"
|
||||
default: return String(proto)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user