netkitty 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/NetKitty.png +0 -0
- package/package.json +28 -4
- package/src/CodecExports.ts +33 -0
- package/src/CodecHeaderExports.ts +1 -0
- package/src/HelperExports.ts +78 -0
- package/src/NetKitty.ts +89 -90
- package/src/NetworkExports.ts +12 -0
- package/src/PcapExports.ts +16 -0
- package/src/lib/codec/Codec.ts +2 -29
- package/src/lib/codec/PacketHeaders.ts +13 -0
- package/src/lib/codec/headers/ARP.ts +7 -7
- package/src/lib/codec/headers/EthernetII.ts +1 -1
- package/src/lib/codec/headers/Goose.ts +6 -6
- package/src/lib/codec/headers/ICMP.ts +3 -3
- package/src/lib/codec/headers/ICMPv6.ts +4 -4
- package/src/lib/codec/headers/IEC61850SampledValues.ts +5 -5
- package/src/lib/codec/headers/IPv4.ts +8 -8
- package/src/lib/codec/headers/IPv6.ts +5 -5
- package/src/lib/codec/headers/IPv6HopByHopOptions.ts +3 -3
- package/src/lib/codec/headers/RawData.ts +1 -1
- package/src/lib/codec/headers/TCP.ts +5 -5
- package/src/lib/codec/headers/UDP.ts +3 -3
- package/src/lib/codec/headers/VLAN_802dot1Q.ts +2 -2
- package/src/lib/helper/HexToBuffer.ts +22 -0
- package/src/tests/units/Codec.spec.ts +1 -1
- package/dist/NetKitty.d.ts +0 -44
- package/dist/NetKitty.d.ts.map +0 -1
- package/dist/NetKitty.js +0 -107
- package/dist/errors/ActionNotFoundError.d.ts +0 -5
- package/dist/errors/ActionNotFoundError.d.ts.map +0 -1
- package/dist/errors/ActionNotFoundError.js +0 -12
- package/dist/errors/CodecSchemaValidateError.d.ts +0 -5
- package/dist/errors/CodecSchemaValidateError.d.ts.map +0 -1
- package/dist/errors/CodecSchemaValidateError.js +0 -12
- package/dist/errors/DeviceNotFoundError.d.ts +0 -5
- package/dist/errors/DeviceNotFoundError.d.ts.map +0 -1
- package/dist/errors/DeviceNotFoundError.js +0 -12
- package/dist/errors/NoAvailableCodecError.d.ts +0 -5
- package/dist/errors/NoAvailableCodecError.d.ts.map +0 -1
- package/dist/errors/NoAvailableCodecError.js +0 -12
- package/dist/errors/NpcapLoadError.d.ts +0 -5
- package/dist/errors/NpcapLoadError.d.ts.map +0 -1
- package/dist/errors/NpcapLoadError.js +0 -12
- package/dist/errors/SocketDownError.d.ts +0 -5
- package/dist/errors/SocketDownError.d.ts.map +0 -1
- package/dist/errors/SocketDownError.js +0 -12
- package/dist/errors/UnknownPipeMessageTypeError.d.ts +0 -5
- package/dist/errors/UnknownPipeMessageTypeError.d.ts.map +0 -1
- package/dist/errors/UnknownPipeMessageTypeError.js +0 -12
- package/dist/errors/common/ErrorCode.d.ts +0 -31
- package/dist/errors/common/ErrorCode.d.ts.map +0 -1
- package/dist/errors/common/ErrorCode.js +0 -33
- package/dist/lib/GeneratePipeAddress.d.ts +0 -7
- package/dist/lib/GeneratePipeAddress.d.ts.map +0 -1
- package/dist/lib/GeneratePipeAddress.js +0 -23
- package/dist/lib/GetBinding.d.ts +0 -2
- package/dist/lib/GetBinding.d.ts.map +0 -1
- package/dist/lib/GetBinding.js +0 -6
- package/dist/lib/GetCaptureTemporaryDirectory.d.ts +0 -7
- package/dist/lib/GetCaptureTemporaryDirectory.d.ts.map +0 -1
- package/dist/lib/GetCaptureTemporaryDirectory.js +0 -15
- package/dist/lib/GetDeviceCaptureTemporaryFilename.d.ts +0 -8
- package/dist/lib/GetDeviceCaptureTemporaryFilename.d.ts.map +0 -1
- package/dist/lib/GetDeviceCaptureTemporaryFilename.js +0 -18
- package/dist/lib/codec/Codec.d.ts +0 -33
- package/dist/lib/codec/Codec.d.ts.map +0 -1
- package/dist/lib/codec/Codec.js +0 -176
- package/dist/lib/codec/abstracts/BaseHeader.d.ts +0 -217
- package/dist/lib/codec/abstracts/BaseHeader.d.ts.map +0 -1
- package/dist/lib/codec/abstracts/BaseHeader.js +0 -356
- package/dist/lib/codec/headers/ARP.d.ts +0 -10
- package/dist/lib/codec/headers/ARP.d.ts.map +0 -1
- package/dist/lib/codec/headers/ARP.js +0 -224
- package/dist/lib/codec/headers/EthernetII.d.ts +0 -10
- package/dist/lib/codec/headers/EthernetII.d.ts.map +0 -1
- package/dist/lib/codec/headers/EthernetII.js +0 -81
- package/dist/lib/codec/headers/Goose.d.ts +0 -13
- package/dist/lib/codec/headers/Goose.d.ts.map +0 -1
- package/dist/lib/codec/headers/Goose.js +0 -720
- package/dist/lib/codec/headers/ICMP.d.ts +0 -15
- package/dist/lib/codec/headers/ICMP.d.ts.map +0 -1
- package/dist/lib/codec/headers/ICMP.js +0 -147
- package/dist/lib/codec/headers/ICMPv6.d.ts +0 -15
- package/dist/lib/codec/headers/ICMPv6.d.ts.map +0 -1
- package/dist/lib/codec/headers/ICMPv6.js +0 -128
- package/dist/lib/codec/headers/IEC61850SampledValues.d.ts +0 -13
- package/dist/lib/codec/headers/IEC61850SampledValues.d.ts.map +0 -1
- package/dist/lib/codec/headers/IEC61850SampledValues.js +0 -370
- package/dist/lib/codec/headers/IPv4.d.ts +0 -16
- package/dist/lib/codec/headers/IPv4.d.ts.map +0 -1
- package/dist/lib/codec/headers/IPv4.js +0 -339
- package/dist/lib/codec/headers/IPv6.d.ts +0 -10
- package/dist/lib/codec/headers/IPv6.d.ts.map +0 -1
- package/dist/lib/codec/headers/IPv6.js +0 -177
- package/dist/lib/codec/headers/IPv6HopByHopOptions.d.ts +0 -71
- package/dist/lib/codec/headers/IPv6HopByHopOptions.d.ts.map +0 -1
- package/dist/lib/codec/headers/IPv6HopByHopOptions.js +0 -497
- package/dist/lib/codec/headers/RawData.d.ts +0 -11
- package/dist/lib/codec/headers/RawData.d.ts.map +0 -1
- package/dist/lib/codec/headers/RawData.js +0 -36
- package/dist/lib/codec/headers/TCP.d.ts +0 -16
- package/dist/lib/codec/headers/TCP.d.ts.map +0 -1
- package/dist/lib/codec/headers/TCP.js +0 -899
- package/dist/lib/codec/headers/UDP.d.ts +0 -16
- package/dist/lib/codec/headers/UDP.d.ts.map +0 -1
- package/dist/lib/codec/headers/UDP.js +0 -192
- package/dist/lib/codec/headers/VLAN_802dot1Q.d.ts +0 -10
- package/dist/lib/codec/headers/VLAN_802dot1Q.d.ts.map +0 -1
- package/dist/lib/codec/headers/VLAN_802dot1Q.js +0 -78
- package/dist/lib/codec/lib/BufferToHex.d.ts +0 -2
- package/dist/lib/codec/lib/BufferToHex.d.ts.map +0 -1
- package/dist/lib/codec/lib/BufferToHex.js +0 -6
- package/dist/lib/codec/lib/BufferToIP.d.ts +0 -13
- package/dist/lib/codec/lib/BufferToIP.d.ts.map +0 -1
- package/dist/lib/codec/lib/BufferToIP.js +0 -21
- package/dist/lib/codec/lib/BufferToNumber.d.ts +0 -10
- package/dist/lib/codec/lib/BufferToNumber.d.ts.map +0 -1
- package/dist/lib/codec/lib/BufferToNumber.js +0 -22
- package/dist/lib/codec/lib/FixHexString.d.ts +0 -7
- package/dist/lib/codec/lib/FixHexString.d.ts.map +0 -1
- package/dist/lib/codec/lib/FixHexString.js +0 -11
- package/dist/lib/codec/lib/FlexibleObject.d.ts +0 -28
- package/dist/lib/codec/lib/FlexibleObject.d.ts.map +0 -1
- package/dist/lib/codec/lib/FlexibleObject.js +0 -102
- package/dist/lib/codec/lib/HexToNumber.d.ts +0 -10
- package/dist/lib/codec/lib/HexToNumber.d.ts.map +0 -1
- package/dist/lib/codec/lib/HexToNumber.js +0 -39
- package/dist/lib/codec/lib/IPToBuffer.d.ts +0 -13
- package/dist/lib/codec/lib/IPToBuffer.d.ts.map +0 -1
- package/dist/lib/codec/lib/IPToBuffer.js +0 -28
- package/dist/lib/codec/lib/NumberToBERBuffer.d.ts +0 -9
- package/dist/lib/codec/lib/NumberToBERBuffer.d.ts.map +0 -1
- package/dist/lib/codec/lib/NumberToBERBuffer.js +0 -20
- package/dist/lib/codec/lib/NumberToBERHex.d.ts +0 -9
- package/dist/lib/codec/lib/NumberToBERHex.d.ts.map +0 -1
- package/dist/lib/codec/lib/NumberToBERHex.js +0 -23
- package/dist/lib/codec/lib/NumberToBuffer.d.ts +0 -10
- package/dist/lib/codec/lib/NumberToBuffer.d.ts.map +0 -1
- package/dist/lib/codec/lib/NumberToBuffer.js +0 -22
- package/dist/lib/codec/lib/NumberToHex.d.ts +0 -10
- package/dist/lib/codec/lib/NumberToHex.d.ts.map +0 -1
- package/dist/lib/codec/lib/NumberToHex.js +0 -26
- package/dist/lib/codec/lib/ProcessPacketPostHandlers.d.ts +0 -14
- package/dist/lib/codec/lib/ProcessPacketPostHandlers.d.ts.map +0 -1
- package/dist/lib/codec/lib/ProcessPacketPostHandlers.js +0 -53
- package/dist/lib/codec/lib/SortPostHandlers.d.ts +0 -8
- package/dist/lib/codec/lib/SortPostHandlers.d.ts.map +0 -1
- package/dist/lib/codec/lib/SortPostHandlers.js +0 -11
- package/dist/lib/codec/lib/StringContentEncodingEnum.d.ts +0 -11
- package/dist/lib/codec/lib/StringContentEncodingEnum.d.ts.map +0 -1
- package/dist/lib/codec/lib/StringContentEncodingEnum.js +0 -14
- package/dist/lib/codec/types/CodecData.d.ts +0 -7
- package/dist/lib/codec/types/CodecData.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecData.js +0 -2
- package/dist/lib/codec/types/CodecDecodeResult.d.ts +0 -11
- package/dist/lib/codec/types/CodecDecodeResult.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecDecodeResult.js +0 -2
- package/dist/lib/codec/types/CodecEncodeInput.d.ts +0 -9
- package/dist/lib/codec/types/CodecEncodeInput.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecEncodeInput.js +0 -2
- package/dist/lib/codec/types/CodecEncodeResult.d.ts +0 -6
- package/dist/lib/codec/types/CodecEncodeResult.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecEncodeResult.js +0 -2
- package/dist/lib/codec/types/CodecErrorInfo.d.ts +0 -6
- package/dist/lib/codec/types/CodecErrorInfo.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecErrorInfo.js +0 -2
- package/dist/lib/codec/types/CodecModule.d.ts +0 -3
- package/dist/lib/codec/types/CodecModule.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecModule.js +0 -2
- package/dist/lib/codec/types/CodecModuleConstructor.d.ts +0 -3
- package/dist/lib/codec/types/CodecModuleConstructor.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecModuleConstructor.js +0 -2
- package/dist/lib/codec/types/CodecSchema.d.ts +0 -7
- package/dist/lib/codec/types/CodecSchema.d.ts.map +0 -1
- package/dist/lib/codec/types/CodecSchema.js +0 -2
- package/dist/lib/codec/types/HeaderTreeNode.d.ts +0 -5
- package/dist/lib/codec/types/HeaderTreeNode.d.ts.map +0 -1
- package/dist/lib/codec/types/HeaderTreeNode.js +0 -2
- package/dist/lib/codec/types/PostHandlerItem.d.ts +0 -5
- package/dist/lib/codec/types/PostHandlerItem.d.ts.map +0 -1
- package/dist/lib/codec/types/PostHandlerItem.js +0 -2
- package/dist/lib/nodepcap/Capture.d.ts +0 -75
- package/dist/lib/nodepcap/Capture.d.ts.map +0 -1
- package/dist/lib/nodepcap/Capture.js +0 -309
- package/dist/lib/nodepcap/GetNetworkInterfaces.d.ts +0 -7
- package/dist/lib/nodepcap/GetNetworkInterfaces.d.ts.map +0 -1
- package/dist/lib/nodepcap/GetNetworkInterfaces.js +0 -22
- package/dist/lib/nodepcap/interfaces/IBindingCapture.d.ts +0 -16
- package/dist/lib/nodepcap/interfaces/IBindingCapture.d.ts.map +0 -1
- package/dist/lib/nodepcap/interfaces/IBindingCapture.js +0 -2
- package/dist/lib/nodepcap/interfaces/IBindingCaptureOptions.d.ts +0 -5
- package/dist/lib/nodepcap/interfaces/IBindingCaptureOptions.d.ts.map +0 -1
- package/dist/lib/nodepcap/interfaces/IBindingCaptureOptions.js +0 -2
- package/dist/lib/nodepcap/interfaces/ICaptureOptions.d.ts +0 -19
- package/dist/lib/nodepcap/interfaces/ICaptureOptions.d.ts.map +0 -1
- package/dist/lib/nodepcap/interfaces/ICaptureOptions.js +0 -2
- package/dist/lib/nodepcap/interfaces/INetworkInterface.d.ts +0 -5
- package/dist/lib/nodepcap/interfaces/INetworkInterface.d.ts.map +0 -1
- package/dist/lib/nodepcap/interfaces/INetworkInterface.js +0 -2
- package/dist/lib/nodepcap/lib/BindingCapture.d.ts +0 -15
- package/dist/lib/nodepcap/lib/BindingCapture.d.ts.map +0 -1
- package/dist/lib/nodepcap/lib/BindingCapture.js +0 -35
- package/dist/lib/nodepcap/lib/GetNodePcapBinding.d.ts +0 -2
- package/dist/lib/nodepcap/lib/GetNodePcapBinding.d.ts.map +0 -1
- package/dist/lib/nodepcap/lib/GetNodePcapBinding.js +0 -55
- package/dist/lib/nodepcap/lib/GetNodePcapBindingCapture.d.ts +0 -3
- package/dist/lib/nodepcap/lib/GetNodePcapBindingCapture.d.ts.map +0 -1
- package/dist/lib/nodepcap/lib/GetNodePcapBindingCapture.js +0 -18
- package/dist/lib/nodepcap/workers/CaptureWorker.d.ts +0 -2
- package/dist/lib/nodepcap/workers/CaptureWorker.d.ts.map +0 -1
- package/dist/lib/nodepcap/workers/CaptureWorker.js +0 -25
- package/dist/lib/pcap/PCAPGenerator.d.ts +0 -34
- package/dist/lib/pcap/PCAPGenerator.d.ts.map +0 -1
- package/dist/lib/pcap/PCAPGenerator.js +0 -95
- package/dist/lib/pcap/PcapParser.d.ts +0 -27
- package/dist/lib/pcap/PcapParser.d.ts.map +0 -1
- package/dist/lib/pcap/PcapParser.js +0 -149
- package/dist/lib/pcap/PcapReader.d.ts +0 -89
- package/dist/lib/pcap/PcapReader.d.ts.map +0 -1
- package/dist/lib/pcap/PcapReader.js +0 -209
- package/dist/lib/pcap/PcapWriter.d.ts +0 -29
- package/dist/lib/pcap/PcapWriter.d.ts.map +0 -1
- package/dist/lib/pcap/PcapWriter.js +0 -80
- package/dist/lib/pcap/interfaces/IPcapPacketInfo.d.ts +0 -13
- package/dist/lib/pcap/interfaces/IPcapPacketInfo.d.ts.map +0 -1
- package/dist/lib/pcap/interfaces/IPcapPacketInfo.js +0 -2
- package/dist/lib/pipe/PipeClient.d.ts +0 -35
- package/dist/lib/pipe/PipeClient.d.ts.map +0 -1
- package/dist/lib/pipe/PipeClient.js +0 -71
- package/dist/lib/pipe/PipeClientSocket.d.ts +0 -39
- package/dist/lib/pipe/PipeClientSocket.d.ts.map +0 -1
- package/dist/lib/pipe/PipeClientSocket.js +0 -82
- package/dist/lib/pipe/PipeMessage.d.ts +0 -27
- package/dist/lib/pipe/PipeMessage.d.ts.map +0 -1
- package/dist/lib/pipe/PipeMessage.js +0 -61
- package/dist/lib/pipe/PipeMessageHandler.d.ts +0 -16
- package/dist/lib/pipe/PipeMessageHandler.d.ts.map +0 -1
- package/dist/lib/pipe/PipeMessageHandler.js +0 -95
- package/dist/lib/pipe/PipeServer.d.ts +0 -25
- package/dist/lib/pipe/PipeServer.d.ts.map +0 -1
- package/dist/lib/pipe/PipeServer.js +0 -59
- package/dist/lib/schema/ProtocolFieldJSONSchema.d.ts +0 -35
- package/dist/lib/schema/ProtocolFieldJSONSchema.d.ts.map +0 -1
- package/dist/lib/schema/ProtocolFieldJSONSchema.js +0 -2
- package/dist/lib/schema/ProtocolFieldJSONSchemaDefinition.d.ts +0 -3
- package/dist/lib/schema/ProtocolFieldJSONSchemaDefinition.d.ts.map +0 -1
- package/dist/lib/schema/ProtocolFieldJSONSchemaDefinition.js +0 -2
- package/dist/lib/schema/ProtocolJSONSchema.d.ts +0 -32
- package/dist/lib/schema/ProtocolJSONSchema.d.ts.map +0 -1
- package/dist/lib/schema/ProtocolJSONSchema.js +0 -2
- package/dist/tests/Test.spec.d.ts +0 -2
- package/dist/tests/Test.spec.d.ts.map +0 -1
- package/dist/tests/Test.spec.js +0 -25
- package/dist/tests/units/CaptureTest.spec.d.ts +0 -2
- package/dist/tests/units/CaptureTest.spec.d.ts.map +0 -1
- package/dist/tests/units/CaptureTest.spec.js +0 -31
- package/dist/tests/units/Codec.spec.d.ts +0 -2
- package/dist/tests/units/Codec.spec.d.ts.map +0 -1
- package/dist/tests/units/Codec.spec.js +0 -73
- package/dist/tests/units/ReadPCAP.spec.d.ts +0 -2
- package/dist/tests/units/ReadPCAP.spec.d.ts.map +0 -1
- package/dist/tests/units/ReadPCAP.spec.js +0 -14
- package/src/lib/codec/lib/FixHexString.ts +0 -8
- /package/src/lib/{codec/lib → helper}/BufferToHex.ts +0 -0
- /package/src/lib/{codec/lib → helper}/BufferToIP.ts +0 -0
- /package/src/lib/{codec/lib → helper}/BufferToNumber.ts +0 -0
- /package/src/lib/{codec/lib → helper}/HexToNumber.ts +0 -0
- /package/src/lib/{codec/lib → helper}/IPToBuffer.ts +0 -0
- /package/src/lib/{codec/lib → helper}/NumberToBERBuffer.ts +0 -0
- /package/src/lib/{codec/lib → helper}/NumberToBERHex.ts +0 -0
- /package/src/lib/{codec/lib → helper}/NumberToBuffer.ts +0 -0
- /package/src/lib/{codec/lib → helper}/NumberToHex.ts +0 -0
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NetKitty
|
|
2
2
|
miaowu~
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netkitty",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Network tools kit",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
"network": {
|
|
7
|
+
"types": "./dist/NetworkExports.d.ts",
|
|
8
|
+
"require": "./dist/NetworkExports.js"
|
|
9
|
+
},
|
|
10
|
+
"pcap": {
|
|
11
|
+
"types": "./dist/PcapExports.d.ts",
|
|
12
|
+
"require": "./dist/PcapExports.js"
|
|
13
|
+
},
|
|
14
|
+
"codec": {
|
|
15
|
+
"types": "./dist/CodecExports.d.ts",
|
|
16
|
+
"require": "./dist/CodecExports.js"
|
|
17
|
+
},
|
|
18
|
+
"codec/header": {
|
|
19
|
+
"types": "./dist/CodecHeaderExports.d.ts",
|
|
20
|
+
"require": "./dist/CodecHeaderExports.js"
|
|
21
|
+
},
|
|
22
|
+
"helper": {
|
|
23
|
+
"types": "./dist/HelperExports.d.ts",
|
|
24
|
+
"require": "./dist/HelperExports.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
7
27
|
"scripts": {
|
|
8
28
|
"clean": "npm run clean:js && npm run clean:cpp",
|
|
9
29
|
"clean:js": "shx rm -rf ./build && shx rm -rf ./dist",
|
|
@@ -20,7 +40,11 @@
|
|
|
20
40
|
"keywords": [
|
|
21
41
|
"netkitty",
|
|
22
42
|
"net-analysis",
|
|
23
|
-
"capture-net-packets"
|
|
43
|
+
"capture-net-packets",
|
|
44
|
+
"pcap",
|
|
45
|
+
"encode",
|
|
46
|
+
"decode",
|
|
47
|
+
"wireshark"
|
|
24
48
|
],
|
|
25
49
|
"author": "alex.ma",
|
|
26
50
|
"license": "MIT",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base header abstract class
|
|
3
|
+
*/
|
|
4
|
+
export {BaseHeader} from './lib/codec/abstracts/BaseHeader'
|
|
5
|
+
/**
|
|
6
|
+
* Network packet codec
|
|
7
|
+
*/
|
|
8
|
+
export {Codec} from './lib/codec/Codec'
|
|
9
|
+
/**
|
|
10
|
+
* Flexible Object for codec data instance
|
|
11
|
+
*/
|
|
12
|
+
export {FlexibleObject} from './lib/codec/lib/FlexibleObject'
|
|
13
|
+
/**
|
|
14
|
+
* Types
|
|
15
|
+
*/
|
|
16
|
+
export {type CodecEncodeResult} from './lib/codec/types/CodecEncodeResult'
|
|
17
|
+
export {type CodecEncodeInput} from './lib/codec/types/CodecEncodeInput'
|
|
18
|
+
export {type CodecDecodeResult} from './lib/codec/types/CodecDecodeResult'
|
|
19
|
+
export {type CodecSchema} from './lib/codec/types/CodecSchema'
|
|
20
|
+
export {type HeaderTreeNode} from './lib/codec/types/HeaderTreeNode'
|
|
21
|
+
export {type CodecModuleConstructor} from './lib/codec/types/CodecModuleConstructor'
|
|
22
|
+
export {type CodecModule} from './lib/codec/types/CodecModule'
|
|
23
|
+
/**
|
|
24
|
+
* Schemas
|
|
25
|
+
*/
|
|
26
|
+
export {type ProtocolFieldJSONSchema} from './lib/schema/ProtocolFieldJSONSchema'
|
|
27
|
+
export {type ProtocolFieldJSONSchemaDefinition} from './lib/schema/ProtocolFieldJSONSchemaDefinition'
|
|
28
|
+
export {type ProtocolJSONSchema} from './lib/schema/ProtocolJSONSchema'
|
|
29
|
+
/**
|
|
30
|
+
* Enums
|
|
31
|
+
*/
|
|
32
|
+
export {StringContentEncodingEnum} from './lib/codec/lib/StringContentEncodingEnum'
|
|
33
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/codec/PacketHeaders'
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export {
|
|
2
|
+
BufferToHex
|
|
3
|
+
} from './lib/helper/BufferToHex'
|
|
4
|
+
export {
|
|
5
|
+
HexToBuffer
|
|
6
|
+
} from './lib/helper/HexToBuffer'
|
|
7
|
+
export {
|
|
8
|
+
BufferToIPv4,
|
|
9
|
+
BufferToIPv6
|
|
10
|
+
} from './lib/helper/BufferToIP'
|
|
11
|
+
export {
|
|
12
|
+
IPv4ToBuffer,
|
|
13
|
+
IPv6ToBuffer
|
|
14
|
+
} from './lib/helper/IPToBuffer'
|
|
15
|
+
export {
|
|
16
|
+
BufferToFloat32,
|
|
17
|
+
BufferToInt16,
|
|
18
|
+
BufferToInt32,
|
|
19
|
+
BufferToInt64,
|
|
20
|
+
BufferToInt8,
|
|
21
|
+
BufferToUInt16,
|
|
22
|
+
BufferToUInt32,
|
|
23
|
+
BufferToUInt64,
|
|
24
|
+
BufferToUInt8
|
|
25
|
+
} from './lib/helper/BufferToNumber'
|
|
26
|
+
export {
|
|
27
|
+
HexToFloat32,
|
|
28
|
+
HexToInt16,
|
|
29
|
+
HexToInt32,
|
|
30
|
+
HexToInt64,
|
|
31
|
+
HexToInt8,
|
|
32
|
+
HexToUInt16,
|
|
33
|
+
HexToUInt32,
|
|
34
|
+
HexToUInt64,
|
|
35
|
+
HexToUInt8
|
|
36
|
+
} from './lib/helper/HexToNumber'
|
|
37
|
+
export {
|
|
38
|
+
Int16ToBERBuffer,
|
|
39
|
+
Int32ToBERBuffer,
|
|
40
|
+
Int64ToBERBuffer,
|
|
41
|
+
Int8ToBERBuffer,
|
|
42
|
+
UInt16ToBERBuffer,
|
|
43
|
+
UInt32ToBERBuffer,
|
|
44
|
+
UInt64ToBERBuffer,
|
|
45
|
+
UInt8ToBERBuffer
|
|
46
|
+
} from './lib/helper/NumberToBERBuffer'
|
|
47
|
+
export {
|
|
48
|
+
Int16ToBERHex,
|
|
49
|
+
Int32ToBERHex,
|
|
50
|
+
Int64ToBERHex,
|
|
51
|
+
Int8ToBERHex,
|
|
52
|
+
UInt16ToBERHex,
|
|
53
|
+
UInt32ToBERHex,
|
|
54
|
+
UInt64ToBERHex,
|
|
55
|
+
UInt8ToBERHex
|
|
56
|
+
} from './lib/helper/NumberToBERHex'
|
|
57
|
+
export {
|
|
58
|
+
Float32ToBuffer,
|
|
59
|
+
Int16ToBuffer,
|
|
60
|
+
Int32ToBuffer,
|
|
61
|
+
Int64ToBuffer,
|
|
62
|
+
Int8ToBuffer,
|
|
63
|
+
UInt16ToBuffer,
|
|
64
|
+
UInt32ToBuffer,
|
|
65
|
+
UInt64ToBuffer,
|
|
66
|
+
UInt8ToBuffer
|
|
67
|
+
} from './lib/helper/NumberToBuffer'
|
|
68
|
+
export {
|
|
69
|
+
Float32ToHex,
|
|
70
|
+
Int16ToHex,
|
|
71
|
+
Int32ToHex,
|
|
72
|
+
Int64ToHex,
|
|
73
|
+
Int8ToHex,
|
|
74
|
+
UInt16ToHex,
|
|
75
|
+
UInt32ToHex,
|
|
76
|
+
UInt64ToHex,
|
|
77
|
+
UInt8ToHex
|
|
78
|
+
} from './lib/helper/NumberToHex'
|
package/src/NetKitty.ts
CHANGED
|
@@ -1,92 +1,91 @@
|
|
|
1
|
-
export {BufferToHex} from './lib/
|
|
2
|
-
export {BufferToIPv4, BufferToIPv6} from './lib/
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from './lib/
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from './lib/
|
|
24
|
-
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} from './lib/codec/lib/
|
|
59
|
-
export {StringContentEncodingEnum} from './lib/codec/lib/StringContentEncodingEnum'
|
|
1
|
+
// export {BufferToHex} from './lib/helper/BufferToHex'
|
|
2
|
+
// export {BufferToIPv4, BufferToIPv6} from './lib/helper/BufferToIP'
|
|
3
|
+
// export {
|
|
4
|
+
// BufferToFloat32,
|
|
5
|
+
// BufferToInt16,
|
|
6
|
+
// BufferToInt32,
|
|
7
|
+
// BufferToInt64,
|
|
8
|
+
// BufferToInt8,
|
|
9
|
+
// BufferToUInt16, BufferToUInt32, BufferToUInt64,
|
|
10
|
+
// BufferToUInt8
|
|
11
|
+
// } from './lib/helper/BufferToNumber'
|
|
12
|
+
// export {FlexibleObject} from './lib/codec/lib/FlexibleObject'
|
|
13
|
+
// export {
|
|
14
|
+
// HexToFloat32,
|
|
15
|
+
// HexToInt16,
|
|
16
|
+
// HexToInt32,
|
|
17
|
+
// HexToInt64,
|
|
18
|
+
// HexToInt8,
|
|
19
|
+
// HexToUInt16,
|
|
20
|
+
// HexToUInt32, HexToUInt64,
|
|
21
|
+
// HexToUInt8
|
|
22
|
+
// } from './lib/helper/HexToNumber'
|
|
23
|
+
// export {IPv4ToBuffer, IPv6ToBuffer} from './lib/helper/IPToBuffer'
|
|
24
|
+
// export {
|
|
25
|
+
// Int16ToBERBuffer,
|
|
26
|
+
// Int32ToBERBuffer,
|
|
27
|
+
// Int64ToBERBuffer,
|
|
28
|
+
// Int8ToBERBuffer, UInt16ToBERBuffer, UInt32ToBERBuffer, UInt64ToBERBuffer,
|
|
29
|
+
// UInt8ToBERBuffer
|
|
30
|
+
// } from './lib/helper/NumberToBERBuffer'
|
|
31
|
+
// export {
|
|
32
|
+
// Int16ToBERHex,
|
|
33
|
+
// Int32ToBERHex,
|
|
34
|
+
// Int64ToBERHex,
|
|
35
|
+
// Int8ToBERHex,
|
|
36
|
+
// UInt16ToBERHex, UInt32ToBERHex, UInt64ToBERHex,
|
|
37
|
+
// UInt8ToBERHex
|
|
38
|
+
// } from './lib/helper/NumberToBERHex'
|
|
39
|
+
// export {
|
|
40
|
+
// Float32ToBuffer,
|
|
41
|
+
// Int16ToBuffer,
|
|
42
|
+
// Int32ToBuffer,
|
|
43
|
+
// Int64ToBuffer,
|
|
44
|
+
// Int8ToBuffer,
|
|
45
|
+
// UInt16ToBuffer, UInt32ToBuffer, UInt64ToBuffer,
|
|
46
|
+
// UInt8ToBuffer
|
|
47
|
+
// } from './lib/helper/NumberToBuffer'
|
|
48
|
+
// export {
|
|
49
|
+
// Float32ToHex,
|
|
50
|
+
// Int16ToHex,
|
|
51
|
+
// Int32ToHex,
|
|
52
|
+
// Int64ToHex,
|
|
53
|
+
// Int8ToHex,
|
|
54
|
+
// UInt16ToHex,
|
|
55
|
+
// UInt32ToHex, UInt64ToHex,
|
|
56
|
+
// UInt8ToHex
|
|
57
|
+
// } from './lib/helper/NumberToHex'
|
|
58
|
+
// export {StringContentEncodingEnum} from './lib/codec/lib/StringContentEncodingEnum'
|
|
60
59
|
|
|
61
|
-
export {type INetworkInterface} from './lib/nodepcap/interfaces/INetworkInterface'
|
|
62
|
-
export {type CodecEncodeResult} from './lib/codec/types/CodecEncodeResult'
|
|
63
|
-
export {type CodecEncodeInput} from './lib/codec/types/CodecEncodeInput'
|
|
64
|
-
export {type CodecDecodeResult} from './lib/codec/types/CodecDecodeResult'
|
|
65
|
-
export {type CodecSchema} from './lib/codec/types/CodecSchema'
|
|
66
|
-
export {type HeaderTreeNode} from './lib/codec/types/HeaderTreeNode'
|
|
67
|
-
export {type IPcapPacketInfo} from './lib/pcap/interfaces/IPcapPacketInfo'
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export {PcapReader} from './lib/pcap/PcapReader'
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export {PcapWriter} from './lib/pcap/PcapWriter'
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export {PcapParser} from './lib/pcap/PcapParser'
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export {GetNetworkInterfaces} from './lib/nodepcap/GetNetworkInterfaces'
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export {Capture} from './lib/nodepcap/Capture'
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export {Codec, Headers} from './lib/codec/Codec'
|
|
60
|
+
// export {type INetworkInterface} from './lib/nodepcap/interfaces/INetworkInterface'
|
|
61
|
+
// export {type CodecEncodeResult} from './lib/codec/types/CodecEncodeResult'
|
|
62
|
+
// export {type CodecEncodeInput} from './lib/codec/types/CodecEncodeInput'
|
|
63
|
+
// export {type CodecDecodeResult} from './lib/codec/types/CodecDecodeResult'
|
|
64
|
+
// export {type CodecSchema} from './lib/codec/types/CodecSchema'
|
|
65
|
+
// export {type HeaderTreeNode} from './lib/codec/types/HeaderTreeNode'
|
|
66
|
+
// export {type IPcapPacketInfo} from './lib/pcap/interfaces/IPcapPacketInfo'
|
|
67
|
+
// /**
|
|
68
|
+
// * PCAP reader
|
|
69
|
+
// */
|
|
70
|
+
// export {PcapReader} from './lib/pcap/PcapReader'
|
|
71
|
+
// /**
|
|
72
|
+
// * PCAP writer
|
|
73
|
+
// */
|
|
74
|
+
// export {PcapWriter} from './lib/pcap/PcapWriter'
|
|
75
|
+
// /**
|
|
76
|
+
// * PCAP parser
|
|
77
|
+
// */
|
|
78
|
+
// export {PcapParser} from './lib/pcap/PcapParser'
|
|
79
|
+
// /**
|
|
80
|
+
// * Fetch network interface
|
|
81
|
+
// */
|
|
82
|
+
// export {GetNetworkInterfaces} from './lib/nodepcap/GetNetworkInterfaces'
|
|
83
|
+
// /**
|
|
84
|
+
// * Network packet capture
|
|
85
|
+
// */
|
|
86
|
+
// export {Capture} from './lib/nodepcap/Capture'
|
|
87
|
+
// /**
|
|
88
|
+
// * Network packet codec
|
|
89
|
+
// */
|
|
90
|
+
// export {Codec, Headers} from './lib/codec/Codec'
|
|
92
91
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch network interface
|
|
3
|
+
*/
|
|
4
|
+
export {GetNetworkInterfaces} from './lib/nodepcap/GetNetworkInterfaces'
|
|
5
|
+
/**
|
|
6
|
+
* Network packet capture
|
|
7
|
+
*/
|
|
8
|
+
export {Capture} from './lib/nodepcap/Capture'
|
|
9
|
+
/**
|
|
10
|
+
* Types
|
|
11
|
+
*/
|
|
12
|
+
export {type INetworkInterface} from './lib/nodepcap/interfaces/INetworkInterface'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PCAP reader
|
|
3
|
+
*/
|
|
4
|
+
export {PcapReader} from './lib/pcap/PcapReader'
|
|
5
|
+
/**
|
|
6
|
+
* PCAP writer
|
|
7
|
+
*/
|
|
8
|
+
export {PcapWriter} from './lib/pcap/PcapWriter'
|
|
9
|
+
/**
|
|
10
|
+
* PCAP parser
|
|
11
|
+
*/
|
|
12
|
+
export {PcapParser} from './lib/pcap/PcapParser'
|
|
13
|
+
/**
|
|
14
|
+
* Types
|
|
15
|
+
*/
|
|
16
|
+
export {type IPcapPacketInfo} from './lib/pcap/interfaces/IPcapPacketInfo'
|
package/src/lib/codec/Codec.ts
CHANGED
|
@@ -10,35 +10,8 @@ import {FlexibleObject} from './lib/FlexibleObject'
|
|
|
10
10
|
import {CodecSchema} from './types/CodecSchema'
|
|
11
11
|
import {ProcessPacketDecodePostHandlers, ProcessPacketEncodePostHandlers} from './lib/ProcessPacketPostHandlers'
|
|
12
12
|
import {CodecEncodeResult} from './types/CodecEncodeResult'
|
|
13
|
-
import {ARP} from './headers/ARP'
|
|
14
|
-
import {EthernetII} from './headers/EthernetII'
|
|
15
|
-
import {Goose} from './headers/Goose'
|
|
16
|
-
import {IEC61850SampledValues} from './headers/IEC61850SampledValues'
|
|
17
|
-
import {IPv4} from './headers/IPv4'
|
|
18
13
|
import {RawData} from './headers/RawData'
|
|
19
|
-
import
|
|
20
|
-
import {UDP} from './headers/UDP'
|
|
21
|
-
import {VLAN_802dot1Q} from './headers/VLAN_802dot1Q'
|
|
22
|
-
import {IPv6} from './headers/IPv6'
|
|
23
|
-
import {IPv6HopByHopOptions} from './headers/IPv6HopByHopOptions'
|
|
24
|
-
import {ICMPv6} from './headers/ICMPv6'
|
|
25
|
-
import {ICMP} from './headers/ICMP'
|
|
26
|
-
|
|
27
|
-
export const Headers: CodecModuleConstructor[] = [
|
|
28
|
-
ARP,
|
|
29
|
-
EthernetII,
|
|
30
|
-
Goose,
|
|
31
|
-
IEC61850SampledValues,
|
|
32
|
-
ICMP,
|
|
33
|
-
IPv4,
|
|
34
|
-
IPv6,
|
|
35
|
-
IPv6HopByHopOptions,
|
|
36
|
-
ICMPv6,
|
|
37
|
-
RawData,
|
|
38
|
-
TCP,
|
|
39
|
-
UDP,
|
|
40
|
-
VLAN_802dot1Q
|
|
41
|
-
]
|
|
14
|
+
import * as packetHeaders from './PacketHeaders'
|
|
42
15
|
|
|
43
16
|
export class Codec {
|
|
44
17
|
|
|
@@ -91,7 +64,7 @@ export class Codec {
|
|
|
91
64
|
* @protected
|
|
92
65
|
*/
|
|
93
66
|
protected loadHeaderCodecs(): CodecModuleConstructor[] {
|
|
94
|
-
let headerCodecs: CodecModuleConstructor[] =
|
|
67
|
+
let headerCodecs: CodecModuleConstructor[] = [...Object.values(packetHeaders)]
|
|
95
68
|
headerCodecs = headerCodecs.filter((codec: CodecModuleConstructor): boolean => codec.PROTOCOL_ID !== RawData.PROTOCOL_ID)
|
|
96
69
|
//Ensure RawData codec is in the end of header codecs
|
|
97
70
|
headerCodecs.push(RawData)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export {ARP} from './headers/ARP'
|
|
2
|
+
export {EthernetII} from './headers/EthernetII'
|
|
3
|
+
export {Goose} from './headers/Goose'
|
|
4
|
+
export {IEC61850SampledValues} from './headers/IEC61850SampledValues'
|
|
5
|
+
export {ICMP} from './headers/ICMP'
|
|
6
|
+
export {IPv4} from './headers/IPv4'
|
|
7
|
+
export {IPv6} from './headers/IPv6'
|
|
8
|
+
export {IPv6HopByHopOptions} from './headers/IPv6HopByHopOptions'
|
|
9
|
+
export {ICMPv6} from './headers/ICMPv6'
|
|
10
|
+
export {RawData} from './headers/RawData'
|
|
11
|
+
export {TCP} from './headers/TCP'
|
|
12
|
+
export {UDP} from './headers/UDP'
|
|
13
|
+
export {VLAN_802dot1Q} from './headers/VLAN_802dot1Q'
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {UInt16ToHex, UInt8ToHex} from '
|
|
3
|
+
import {UInt16ToHex, UInt8ToHex} from '../../helper/NumberToHex'
|
|
4
4
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
5
|
-
import {HexToUInt16} from '
|
|
6
|
-
import {BufferToInt16, BufferToUInt16, BufferToUInt8} from '
|
|
7
|
-
import {BufferToHex} from '
|
|
8
|
-
import {UInt16ToBuffer, UInt8ToBuffer} from '
|
|
9
|
-
import {BufferToIPv4} from '
|
|
10
|
-
import {IPv4ToBuffer} from '
|
|
5
|
+
import {HexToUInt16} from '../../helper/HexToNumber'
|
|
6
|
+
import {BufferToInt16, BufferToUInt16, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
7
|
+
import {BufferToHex} from '../../helper/BufferToHex'
|
|
8
|
+
import {UInt16ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
9
|
+
import {BufferToIPv4} from '../../helper/BufferToIP'
|
|
10
|
+
import {IPv4ToBuffer} from '../../helper/IPToBuffer'
|
|
11
11
|
|
|
12
12
|
export class ARP extends BaseHeader {
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
2
2
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
3
|
-
import {UInt16ToHex} from '
|
|
3
|
+
import {UInt16ToHex} from '../../helper/NumberToHex'
|
|
4
4
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
5
5
|
|
|
6
6
|
export class EthernetII extends BaseHeader {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
HexToUInt16,
|
|
11
11
|
HexToUInt32,
|
|
12
12
|
HexToUInt8
|
|
13
|
-
} from '
|
|
13
|
+
} from '../../helper/HexToNumber'
|
|
14
14
|
import {
|
|
15
15
|
Int16ToBERHex,
|
|
16
16
|
Int32ToBERHex,
|
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
UInt16ToBERHex,
|
|
20
20
|
UInt32ToBERHex,
|
|
21
21
|
UInt8ToBERHex
|
|
22
|
-
} from '
|
|
23
|
-
import {Float32ToHex, UInt16ToHex} from '
|
|
22
|
+
} from '../../helper/NumberToBERHex'
|
|
23
|
+
import {Float32ToHex, UInt16ToHex} from '../../helper/NumberToHex'
|
|
24
24
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
25
|
-
import {UInt32ToBERBuffer} from '
|
|
26
|
-
import {BufferToUInt16} from '
|
|
27
|
-
import {UInt16ToBuffer} from '
|
|
25
|
+
import {UInt32ToBERBuffer} from '../../helper/NumberToBERBuffer'
|
|
26
|
+
import {BufferToUInt16} from '../../helper/BufferToNumber'
|
|
27
|
+
import {UInt16ToBuffer} from '../../helper/NumberToBuffer'
|
|
28
28
|
|
|
29
29
|
type AllDataItem = {
|
|
30
30
|
dataType: string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {BufferToUInt16, BufferToUInt8} from '
|
|
4
|
-
import {UInt16ToBuffer, UInt8ToBuffer} from '
|
|
3
|
+
import {BufferToUInt16, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
4
|
+
import {UInt16ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
5
5
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
6
|
-
import {BufferToHex} from '
|
|
6
|
+
import {BufferToHex} from '../../helper/BufferToHex'
|
|
7
7
|
|
|
8
8
|
export class ICMP extends BaseHeader {
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
3
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
4
|
-
import {BufferToUInt16, BufferToUInt8} from '
|
|
5
|
-
import {UInt16ToBuffer, UInt32ToBuffer, UInt8ToBuffer} from '
|
|
6
|
-
import {BufferToHex} from '
|
|
4
|
+
import {BufferToUInt16, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
5
|
+
import {UInt16ToBuffer, UInt32ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
6
|
+
import {BufferToHex} from '../../helper/BufferToHex'
|
|
7
7
|
import {CodecModule} from '../types/CodecModule'
|
|
8
|
-
import {IPv6ToBuffer} from '
|
|
8
|
+
import {IPv6ToBuffer} from '../../helper/IPToBuffer'
|
|
9
9
|
|
|
10
10
|
export class ICMPv6 extends BaseHeader {
|
|
11
11
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
3
|
import TLV from 'node-tlv'
|
|
4
|
-
import {HexToUInt16} from '
|
|
5
|
-
import {UInt16ToBERHex} from '
|
|
6
|
-
import {UInt16ToHex, UInt32ToHex, UInt8ToHex} from '
|
|
4
|
+
import {HexToUInt16} from '../../helper/HexToNumber'
|
|
5
|
+
import {UInt16ToBERHex} from '../../helper/NumberToBERHex'
|
|
6
|
+
import {UInt16ToHex, UInt32ToHex, UInt8ToHex} from '../../helper/NumberToHex'
|
|
7
7
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
8
|
-
import {BufferToUInt16, BufferToUInt32, BufferToUInt64, BufferToUInt8} from '
|
|
9
|
-
import {UInt16ToBuffer} from '
|
|
8
|
+
import {BufferToUInt16, BufferToUInt32, BufferToUInt64, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
9
|
+
import {UInt16ToBuffer} from '../../helper/NumberToBuffer'
|
|
10
10
|
|
|
11
11
|
type ASDUItem = {
|
|
12
12
|
svID: string
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {UInt16ToHex} from '
|
|
3
|
+
import {UInt16ToHex} from '../../helper/NumberToHex'
|
|
4
4
|
import {CodecModule} from '../types/CodecModule'
|
|
5
5
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import {BufferToUInt16, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
7
|
+
import {UInt16ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
8
|
+
import {BufferToHex} from '../../helper/BufferToHex'
|
|
9
|
+
import {IPv4ToBuffer} from '../../helper/IPToBuffer'
|
|
10
|
+
import {BufferToIPv4} from '../../helper/BufferToIP'
|
|
11
|
+
import {HexToBuffer} from '../../helper/HexToBuffer'
|
|
12
12
|
|
|
13
13
|
export class IPv4 extends BaseHeader {
|
|
14
14
|
|
|
@@ -301,7 +301,7 @@ export class IPv4 extends BaseHeader {
|
|
|
301
301
|
},
|
|
302
302
|
encode: (): void => {
|
|
303
303
|
if (!this.instance.options.isUndefined()) {
|
|
304
|
-
let optionsBuffer: Buffer =
|
|
304
|
+
let optionsBuffer: Buffer = HexToBuffer(this.instance.options.getValue(''))
|
|
305
305
|
if (optionsBuffer.length > 40) optionsBuffer = optionsBuffer.subarray(0, 40)
|
|
306
306
|
const estimateHdrLen: number = this.length + optionsBuffer.length
|
|
307
307
|
if (estimateHdrLen % 4) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {UInt16ToHex} from '
|
|
3
|
+
import {UInt16ToHex} from '../../helper/NumberToHex'
|
|
4
4
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
5
|
-
import {BufferToUInt16, BufferToUInt8} from '
|
|
6
|
-
import {UInt16ToBuffer, UInt8ToBuffer} from '
|
|
7
|
-
import {BufferToIPv6} from '
|
|
8
|
-
import {IPv6ToBuffer} from '
|
|
5
|
+
import {BufferToUInt16, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
6
|
+
import {UInt16ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
7
|
+
import {BufferToIPv6} from '../../helper/BufferToIP'
|
|
8
|
+
import {IPv6ToBuffer} from '../../helper/IPToBuffer'
|
|
9
9
|
import {CodecModule} from '../types/CodecModule'
|
|
10
10
|
|
|
11
11
|
export class IPv6 extends BaseHeader {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {BufferToUInt8} from '
|
|
4
|
-
import {UInt16ToBuffer, UInt32ToBuffer, UInt64ToBuffer, UInt8ToBuffer} from '
|
|
3
|
+
import {BufferToUInt8} from '../../helper/BufferToNumber'
|
|
4
|
+
import {UInt16ToBuffer, UInt32ToBuffer, UInt64ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
5
5
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
6
6
|
import TLV from 'node-tlv'
|
|
7
|
-
import {HexToUInt16, HexToUInt32, HexToUInt64, HexToUInt8} from '
|
|
7
|
+
import {HexToUInt16, HexToUInt32, HexToUInt64, HexToUInt8} from '../../helper/HexToNumber'
|
|
8
8
|
|
|
9
9
|
//Type=1 PadN
|
|
10
10
|
//Type=4 Tunnel Encapsulation Limit
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
2
|
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
3
|
import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
|
|
4
|
-
import {BufferToHex} from '
|
|
4
|
+
import {BufferToHex} from '../../helper/BufferToHex'
|
|
5
5
|
|
|
6
6
|
export class RawData extends BaseHeader {
|
|
7
7
|
|