netkitty 0.0.35 → 1.0.0
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/CHANGELOG.md +13 -0
- package/README.md +91 -2
- package/README.zh-CN.md +89 -0
- package/dist/analysis.d.ts +4 -0
- package/dist/{CodecHeaderExports.js → analysis.js} +4 -1
- package/dist/capture.d.ts +5 -0
- package/dist/capture.js +21 -0
- package/dist/codec.d.ts +5 -0
- package/dist/codec.js +21 -0
- package/dist/iface.d.ts +4 -0
- package/dist/iface.js +20 -0
- package/dist/pcap.d.ts +10 -0
- package/dist/pcap.js +27 -0
- package/dist/replay.d.ts +5 -0
- package/dist/replay.js +21 -0
- package/package.json +65 -59
- package/.eslintrc.json +0 -53
- package/.idea/codeStyles/Project.xml +0 -18
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -11
- package/.idea/modules.xml +0 -8
- package/.idea/netkitty.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/assets/NetKitty.png +0 -0
- package/binding.gyp +0 -5
- package/cpp/nodepcap/deps/include/Packet32.h +0 -429
- package/cpp/nodepcap/deps/include/pcap/bluetooth.h +0 -56
- package/cpp/nodepcap/deps/include/pcap/bpf.h +0 -292
- package/cpp/nodepcap/deps/include/pcap/can_socketcan.h +0 -56
- package/cpp/nodepcap/deps/include/pcap/compiler-tests.h +0 -163
- package/cpp/nodepcap/deps/include/pcap/dlt.h +0 -1514
- package/cpp/nodepcap/deps/include/pcap/funcattrs.h +0 -325
- package/cpp/nodepcap/deps/include/pcap/ipnet.h +0 -43
- package/cpp/nodepcap/deps/include/pcap/namedb.h +0 -84
- package/cpp/nodepcap/deps/include/pcap/nflog.h +0 -94
- package/cpp/nodepcap/deps/include/pcap/pcap-inttypes.h +0 -101
- package/cpp/nodepcap/deps/include/pcap/pcap.h +0 -1219
- package/cpp/nodepcap/deps/include/pcap/sll.h +0 -149
- package/cpp/nodepcap/deps/include/pcap/socket.h +0 -84
- package/cpp/nodepcap/deps/include/pcap/usb.h +0 -143
- package/cpp/nodepcap/deps/include/pcap/vlan.h +0 -46
- package/cpp/nodepcap/deps/include/pcap-bpf.h +0 -45
- package/cpp/nodepcap/deps/include/pcap-namedb.h +0 -40
- package/cpp/nodepcap/deps/include/pcap.h +0 -43
- package/cpp/nodepcap/deps/lib/ARM64/Packet.lib +0 -0
- package/cpp/nodepcap/deps/lib/Packet.lib +0 -0
- package/cpp/nodepcap/deps/lib/wpcap.lib +0 -0
- package/cpp/nodepcap/deps/lib/x64/Packet.lib +0 -0
- package/cpp/nodepcap/deps/lib/x64/wpcap.lib +0 -0
- package/cpp/nodepcap/nodepcap.gypi +0 -104
- package/cpp/nodepcap/src/binding.cc +0 -14
- package/cpp/nodepcap/src/capture.cc +0 -400
- package/cpp/nodepcap/src/capture.h +0 -53
- package/cpp/nodepcap/src/utils.cc +0 -218
- package/cpp/nodepcap/src/utils.h +0 -13
- package/dist/CodecExports.d.ts +0 -34
- package/dist/CodecExports.d.ts.map +0 -1
- package/dist/CodecExports.js +0 -23
- package/dist/CodecHeaderExports.d.ts +0 -2
- package/dist/CodecHeaderExports.d.ts.map +0 -1
- package/dist/HelperExports.d.ts +0 -11
- package/dist/HelperExports.d.ts.map +0 -1
- package/dist/HelperExports.js +0 -72
- package/dist/NetworkExports.d.ts +0 -13
- package/dist/NetworkExports.d.ts.map +0 -1
- package/dist/NetworkExports.js +0 -13
- package/dist/PcapExports.d.ts +0 -30
- package/dist/PcapExports.d.ts.map +0 -1
- package/dist/PcapExports.js +0 -33
- 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 -32
- package/dist/lib/codec/Codec.d.ts.map +0 -1
- package/dist/lib/codec/Codec.js +0 -183
- package/dist/lib/codec/PacketHeaders.d.ts +0 -22
- package/dist/lib/codec/PacketHeaders.d.ts.map +0 -1
- package/dist/lib/codec/PacketHeaders.js +0 -47
- 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 -104
- package/dist/lib/codec/headers/Goose.d.ts.map +0 -1
- package/dist/lib/codec/headers/Goose.js +0 -1005
- 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/IEC104_I_Frame.d.ts +0 -10
- package/dist/lib/codec/headers/IEC104_I_Frame.d.ts.map +0 -1
- package/dist/lib/codec/headers/IEC104_I_Frame.js +0 -6411
- package/dist/lib/codec/headers/IEC104_S_Frame.d.ts +0 -10
- package/dist/lib/codec/headers/IEC104_S_Frame.d.ts.map +0 -1
- package/dist/lib/codec/headers/IEC104_S_Frame.js +0 -105
- package/dist/lib/codec/headers/IEC104_U_Frame.d.ts +0 -10
- package/dist/lib/codec/headers/IEC104_U_Frame.d.ts.map +0 -1
- package/dist/lib/codec/headers/IEC104_U_Frame.js +0 -155
- 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 -517
- 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 -917
- package/dist/lib/codec/headers/TLS_Alert.d.ts +0 -10
- package/dist/lib/codec/headers/TLS_Alert.d.ts.map +0 -1
- package/dist/lib/codec/headers/TLS_Alert.js +0 -624
- package/dist/lib/codec/headers/TLS_ApplicationData.d.ts +0 -10
- package/dist/lib/codec/headers/TLS_ApplicationData.d.ts.map +0 -1
- package/dist/lib/codec/headers/TLS_ApplicationData.js +0 -155
- package/dist/lib/codec/headers/TLS_ChangeCipherSpec.d.ts +0 -10
- package/dist/lib/codec/headers/TLS_ChangeCipherSpec.d.ts.map +0 -1
- package/dist/lib/codec/headers/TLS_ChangeCipherSpec.js +0 -154
- package/dist/lib/codec/headers/TLS_Handshake.d.ts +0 -10
- package/dist/lib/codec/headers/TLS_Handshake.d.ts.map +0 -1
- package/dist/lib/codec/headers/TLS_Handshake.js +0 -339
- package/dist/lib/codec/headers/TLS_Heartbeat.d.ts +0 -10
- package/dist/lib/codec/headers/TLS_Heartbeat.d.ts.map +0 -1
- package/dist/lib/codec/headers/TLS_Heartbeat.js +0 -206
- 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 -82
- 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/GetBERIntegerLengthFromBuffer.d.ts +0 -7
- package/dist/lib/codec/lib/GetBERIntegerLengthFromBuffer.d.ts.map +0 -1
- package/dist/lib/codec/lib/GetBERIntegerLengthFromBuffer.js +0 -16
- 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/helper/BufferToHex.d.ts +0 -2
- package/dist/lib/helper/BufferToHex.d.ts.map +0 -1
- package/dist/lib/helper/BufferToHex.js +0 -6
- package/dist/lib/helper/BufferToIP.d.ts +0 -13
- package/dist/lib/helper/BufferToIP.d.ts.map +0 -1
- package/dist/lib/helper/BufferToIP.js +0 -21
- package/dist/lib/helper/BufferToNumber.d.ts +0 -10
- package/dist/lib/helper/BufferToNumber.d.ts.map +0 -1
- package/dist/lib/helper/BufferToNumber.js +0 -22
- package/dist/lib/helper/HexToBuffer.d.ts +0 -8
- package/dist/lib/helper/HexToBuffer.d.ts.map +0 -1
- package/dist/lib/helper/HexToBuffer.js +0 -27
- package/dist/lib/helper/HexToNumber.d.ts +0 -10
- package/dist/lib/helper/HexToNumber.d.ts.map +0 -1
- package/dist/lib/helper/HexToNumber.js +0 -39
- package/dist/lib/helper/IPToBuffer.d.ts +0 -13
- package/dist/lib/helper/IPToBuffer.d.ts.map +0 -1
- package/dist/lib/helper/IPToBuffer.js +0 -28
- package/dist/lib/helper/NumberToBERBuffer.d.ts +0 -10
- package/dist/lib/helper/NumberToBERBuffer.d.ts.map +0 -1
- package/dist/lib/helper/NumberToBERBuffer.js +0 -22
- package/dist/lib/helper/NumberToBERHex.d.ts +0 -10
- package/dist/lib/helper/NumberToBERHex.d.ts.map +0 -1
- package/dist/lib/helper/NumberToBERHex.js +0 -27
- package/dist/lib/helper/NumberToBuffer.d.ts +0 -10
- package/dist/lib/helper/NumberToBuffer.d.ts.map +0 -1
- package/dist/lib/helper/NumberToBuffer.js +0 -22
- package/dist/lib/helper/NumberToHex.d.ts +0 -10
- package/dist/lib/helper/NumberToHex.d.ts.map +0 -1
- package/dist/lib/helper/NumberToHex.js +0 -26
- package/dist/lib/nodepcap/Capture.d.ts +0 -81
- package/dist/lib/nodepcap/Capture.d.ts.map +0 -1
- package/dist/lib/nodepcap/Capture.js +0 -323
- 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 -23
- 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 -101
- 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 -112
- package/dist/lib/pcap/PcapReader.d.ts.map +0 -1
- package/dist/lib/pcap/PcapReader.js +0 -263
- 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 -86
- 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 -36
- 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 -32
- 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 -86
- 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/CodecExports.ts +0 -33
- package/src/CodecHeaderExports.ts +0 -1
- package/src/HelperExports.ts +0 -78
- package/src/NetworkExports.ts +0 -12
- package/src/PcapExports.ts +0 -32
- package/src/errors/ActionNotFoundError.ts +0 -6
- package/src/errors/CodecSchemaValidateError.ts +0 -6
- package/src/errors/DeviceNotFoundError.ts +0 -6
- package/src/errors/NoAvailableCodecError.ts +0 -6
- package/src/errors/NpcapLoadError.ts +0 -6
- package/src/errors/SocketDownError.ts +0 -6
- package/src/errors/UnknownPipeMessageTypeError.ts +0 -6
- package/src/errors/common/ErrorCode.ts +0 -30
- package/src/lib/GeneratePipeAddress.ts +0 -17
- package/src/lib/GetBinding.ts +0 -3
- package/src/lib/GetCaptureTemporaryDirectory.ts +0 -12
- package/src/lib/GetDeviceCaptureTemporaryFilename.ts +0 -13
- package/src/lib/codec/Codec.ts +0 -164
- package/src/lib/codec/PacketHeaders.ts +0 -23
- package/src/lib/codec/abstracts/BaseHeader.ts +0 -435
- package/src/lib/codec/headers/ARP.ts +0 -220
- package/src/lib/codec/headers/EthernetII.ts +0 -79
- package/src/lib/codec/headers/Goose.ts +0 -1033
- package/src/lib/codec/headers/ICMP.ts +0 -151
- package/src/lib/codec/headers/ICMPv6.ts +0 -128
- package/src/lib/codec/headers/IEC104_I_Frame.ts +0 -7373
- package/src/lib/codec/headers/IEC104_S_Frame.ts +0 -97
- package/src/lib/codec/headers/IEC104_U_Frame.ts +0 -139
- package/src/lib/codec/headers/IEC61850SampledValues.ts +0 -361
- package/src/lib/codec/headers/IPv4.ts +0 -331
- package/src/lib/codec/headers/IPv6.ts +0 -176
- package/src/lib/codec/headers/IPv6HopByHopOptions.ts +0 -552
- package/src/lib/codec/headers/RawData.ts +0 -38
- package/src/lib/codec/headers/TCP.ts +0 -952
- package/src/lib/codec/headers/TLS_Alert.ts +0 -539
- package/src/lib/codec/headers/TLS_ApplicationData.ts +0 -145
- package/src/lib/codec/headers/TLS_ChangeCipherSpec.ts +0 -146
- package/src/lib/codec/headers/TLS_Handshake.ts +0 -313
- package/src/lib/codec/headers/TLS_Heartbeat.ts +0 -188
- package/src/lib/codec/headers/UDP.ts +0 -182
- package/src/lib/codec/headers/VLAN_802dot1Q.ts +0 -79
- package/src/lib/codec/lib/FlexibleObject.ts +0 -100
- package/src/lib/codec/lib/GetBERIntegerLengthFromBuffer.ts +0 -12
- package/src/lib/codec/lib/ProcessPacketPostHandlers.ts +0 -53
- package/src/lib/codec/lib/SortPostHandlers.ts +0 -10
- package/src/lib/codec/lib/StringContentEncodingEnum.ts +0 -10
- package/src/lib/codec/types/CodecData.ts +0 -7
- package/src/lib/codec/types/CodecDecodeResult.ts +0 -11
- package/src/lib/codec/types/CodecEncodeInput.ts +0 -9
- package/src/lib/codec/types/CodecEncodeResult.ts +0 -6
- package/src/lib/codec/types/CodecErrorInfo.ts +0 -5
- package/src/lib/codec/types/CodecModule.ts +0 -3
- package/src/lib/codec/types/CodecModuleConstructor.ts +0 -3
- package/src/lib/codec/types/CodecSchema.ts +0 -7
- package/src/lib/codec/types/HeaderTreeNode.ts +0 -5
- package/src/lib/codec/types/PostHandlerItem.ts +0 -4
- package/src/lib/helper/BufferToHex.ts +0 -3
- package/src/lib/helper/BufferToIP.ts +0 -19
- package/src/lib/helper/BufferToNumber.ts +0 -31
- package/src/lib/helper/HexToBuffer.ts +0 -22
- package/src/lib/helper/HexToNumber.ts +0 -25
- package/src/lib/helper/IPToBuffer.ts +0 -25
- package/src/lib/helper/NumberToBERBuffer.ts +0 -21
- package/src/lib/helper/NumberToBERHex.ts +0 -17
- package/src/lib/helper/NumberToBuffer.ts +0 -21
- package/src/lib/helper/NumberToHex.ts +0 -15
- package/src/lib/nodepcap/Capture.ts +0 -304
- package/src/lib/nodepcap/GetNetworkInterfaces.ts +0 -18
- package/src/lib/nodepcap/interfaces/IBindingCapture.ts +0 -27
- package/src/lib/nodepcap/interfaces/IBindingCaptureOptions.ts +0 -4
- package/src/lib/nodepcap/interfaces/ICaptureOptions.ts +0 -24
- package/src/lib/nodepcap/interfaces/INetworkInterface.ts +0 -4
- package/src/lib/nodepcap/lib/BindingCapture.ts +0 -46
- package/src/lib/nodepcap/lib/GetNodePcapBinding.ts +0 -17
- package/src/lib/nodepcap/lib/GetNodePcapBindingCapture.ts +0 -15
- package/src/lib/nodepcap/workers/CaptureWorker.ts +0 -30
- package/src/lib/pcap/PCAPGenerator.ts +0 -123
- package/src/lib/pcap/PcapParser.ts +0 -170
- package/src/lib/pcap/PcapReader.ts +0 -306
- package/src/lib/pcap/PcapWriter.ts +0 -98
- package/src/lib/pcap/interfaces/IPcapPacketInfo.ts +0 -12
- package/src/lib/pipe/PipeClient.ts +0 -91
- package/src/lib/pipe/PipeClientSocket.ts +0 -99
- package/src/lib/pipe/PipeMessage.ts +0 -74
- package/src/lib/pipe/PipeMessageHandler.ts +0 -91
- package/src/lib/pipe/PipeServer.ts +0 -74
- package/src/lib/schema/ProtocolFieldJSONSchema.ts +0 -47
- package/src/lib/schema/ProtocolFieldJSONSchemaDefinition.ts +0 -3
- package/src/lib/schema/ProtocolJSONSchema.ts +0 -37
- package/src/tests/Test.spec.ts +0 -22
- package/src/tests/units/CaptureTest.spec.ts +0 -31
- package/src/tests/units/Codec.spec.ts +0 -102
- package/src/tests/units/ReadPCAP.spec.ts +0 -13
- package/test.pcap +0 -0
- package/tsconfig.json +0 -42
|
@@ -1,539 +0,0 @@
|
|
|
1
|
-
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
|
-
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {BufferToInt8, BufferToUInt16, BufferToUInt8} from '../../helper/BufferToNumber'
|
|
4
|
-
import {UInt16ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
5
|
-
|
|
6
|
-
enum TLSver {
|
|
7
|
-
SSL_3_0 = 'SSL3.0',
|
|
8
|
-
TLS_1_0 = 'TLS1.0',
|
|
9
|
-
TLS_1_1 = 'TLS1.1',
|
|
10
|
-
TLS_1_2 = 'TLS1.2',
|
|
11
|
-
TLS_1_3 = 'TLS1.3',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
enum Description_type {
|
|
15
|
-
code_0 = 'Close notify',
|
|
16
|
-
code_10 = 'Unexpected message',
|
|
17
|
-
code_20 = 'Bad record MAC',
|
|
18
|
-
code_21 = 'Decryption failed',
|
|
19
|
-
code_22 = 'Record overflow',
|
|
20
|
-
code_30 = 'Decompression failure',
|
|
21
|
-
code_40 = 'Handshake failure',
|
|
22
|
-
code_41 = 'No certificate',
|
|
23
|
-
code_42 = 'Bad certificate',
|
|
24
|
-
code_43 = 'Unsupported certificate',
|
|
25
|
-
code_44 = 'Certificate revoked',
|
|
26
|
-
code_45 = 'Certificate expired',
|
|
27
|
-
code_46 = 'Certificate unknown',
|
|
28
|
-
code_47 = 'Illegal parameter',
|
|
29
|
-
code_48 = 'Unknown CA (Certificate authority)',
|
|
30
|
-
code_49 = 'Access denied',
|
|
31
|
-
code_50 = 'Decode error',
|
|
32
|
-
code_51 = 'Decrypt error',
|
|
33
|
-
code_60 = 'Export restriction',
|
|
34
|
-
code_70 = 'Protocol version',
|
|
35
|
-
code_71 = 'Insufficient security',
|
|
36
|
-
code_80 = 'Internal error',
|
|
37
|
-
code_86 = 'Inappropriate fallback',
|
|
38
|
-
code_90 = 'User canceled',
|
|
39
|
-
code_100 = 'No renegotiation',
|
|
40
|
-
code_110 = 'Unsupported extension',
|
|
41
|
-
code_111 = 'Certificate unobtainable',
|
|
42
|
-
code_112 = 'Unrecognized name',
|
|
43
|
-
code_113 = 'Bad certificate status response',
|
|
44
|
-
code_114 = 'Bad certificate hash value ',
|
|
45
|
-
code_115 = 'Unknown PSK identity (used in TLS-PSK and TLS-SRP)',
|
|
46
|
-
code_116 = 'Certificate required',
|
|
47
|
-
code_120 = 'No application protocol',
|
|
48
|
-
code_255 = 'No application protocol',
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class TLS_Alert extends BaseHeader {
|
|
52
|
-
public SCHEMA: ProtocolJSONSchema = {
|
|
53
|
-
type: 'object',
|
|
54
|
-
properties: {
|
|
55
|
-
contentType: {
|
|
56
|
-
type: 'integer',
|
|
57
|
-
label: 'Content Type',
|
|
58
|
-
minimum: 0,
|
|
59
|
-
maximum: 65535,
|
|
60
|
-
decode: (): void => {
|
|
61
|
-
this.instance.contentType.setValue(BufferToUInt8(this.readBytes(0, 1)))
|
|
62
|
-
},
|
|
63
|
-
encode: (): void => {
|
|
64
|
-
const contentTyppe: number = this.instance.contentType.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
65
|
-
this.writeBytes(0, UInt8ToBuffer(contentTyppe))
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
version: {
|
|
69
|
-
type: 'string',
|
|
70
|
-
label: 'Legacy Version',
|
|
71
|
-
minimum: 0,
|
|
72
|
-
maximum: 65535,
|
|
73
|
-
decode: (): void => {
|
|
74
|
-
this.instance.version.setValue(BufferToUInt16(this.readBytes(1, 2)))
|
|
75
|
-
const version: number = this.instance.version.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not Found'))
|
|
76
|
-
switch (version) {
|
|
77
|
-
case 768: {
|
|
78
|
-
this.instance.version.setValue(TLSver.SSL_3_0)
|
|
79
|
-
}
|
|
80
|
-
break
|
|
81
|
-
case 769: {
|
|
82
|
-
this.instance.version.setValue(TLSver.TLS_1_0)
|
|
83
|
-
}
|
|
84
|
-
break
|
|
85
|
-
case 770: {
|
|
86
|
-
this.instance.version.setValue(TLSver.TLS_1_1)
|
|
87
|
-
}
|
|
88
|
-
break
|
|
89
|
-
case 771: {
|
|
90
|
-
this.instance.version.setValue(TLSver.TLS_1_2)
|
|
91
|
-
}
|
|
92
|
-
break
|
|
93
|
-
case 772: {
|
|
94
|
-
this.instance.version.setValue(TLSver.TLS_1_3)
|
|
95
|
-
}
|
|
96
|
-
break
|
|
97
|
-
default: {
|
|
98
|
-
this.instance.version.setValue('0')
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
encode: (): void => {
|
|
103
|
-
const version: string = this.instance.version.getValue('0', (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
104
|
-
switch (version) {
|
|
105
|
-
case TLSver.SSL_3_0: {
|
|
106
|
-
const version: Buffer = UInt16ToBuffer(768)
|
|
107
|
-
this.writeBytes(1, version)
|
|
108
|
-
}
|
|
109
|
-
break
|
|
110
|
-
case TLSver.TLS_1_0: {
|
|
111
|
-
const version: Buffer = UInt16ToBuffer(769)
|
|
112
|
-
this.writeBytes(1, version)
|
|
113
|
-
}
|
|
114
|
-
break
|
|
115
|
-
case TLSver.TLS_1_1: {
|
|
116
|
-
const version: Buffer = UInt16ToBuffer(770)
|
|
117
|
-
this.writeBytes(1, version)
|
|
118
|
-
}
|
|
119
|
-
break
|
|
120
|
-
case TLSver.TLS_1_2: {
|
|
121
|
-
const version: Buffer = UInt16ToBuffer(771)
|
|
122
|
-
this.writeBytes(1, version)
|
|
123
|
-
}
|
|
124
|
-
break
|
|
125
|
-
case TLSver.TLS_1_3: {
|
|
126
|
-
const version: Buffer = UInt16ToBuffer(772)
|
|
127
|
-
this.writeBytes(1, version)
|
|
128
|
-
}
|
|
129
|
-
break
|
|
130
|
-
default: {
|
|
131
|
-
this.writeBytes(1, UInt16ToBuffer(0))
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
length: {
|
|
137
|
-
type: 'integer',
|
|
138
|
-
label: 'Legacy Version',
|
|
139
|
-
minimum: 0,
|
|
140
|
-
maximum: 255,
|
|
141
|
-
decode: (): void => {
|
|
142
|
-
this.instance.length.setValue(BufferToUInt16(this.readBytes(3, 2)))
|
|
143
|
-
},
|
|
144
|
-
encode: (): void => {
|
|
145
|
-
const length: Buffer = UInt16ToBuffer(this.instance.length.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not found')))
|
|
146
|
-
this.writeBytes(3, length)
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
levelType: {
|
|
151
|
-
type: 'string',
|
|
152
|
-
label: 'Alert Level Type ',
|
|
153
|
-
minimum: 0,
|
|
154
|
-
maximum: 255,
|
|
155
|
-
decode: (): void => {
|
|
156
|
-
this.instance.levelType.setValue(BufferToUInt8(this.readBytes(5, 1)))
|
|
157
|
-
const type: number = this.instance.levelType.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
158
|
-
switch (type) {
|
|
159
|
-
case 1: {
|
|
160
|
-
this.instance.levelType.setValue('Warning')
|
|
161
|
-
}
|
|
162
|
-
break
|
|
163
|
-
case 2: {
|
|
164
|
-
this.instance.levelType.setValue('Fatal')
|
|
165
|
-
}
|
|
166
|
-
break
|
|
167
|
-
default: {
|
|
168
|
-
this.instance.levelType.setValue(BufferToUInt8(this.readBytes(5, 1)))
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
encode: (): void => {
|
|
173
|
-
const type: string = this.instance.levelType.getValue('0', (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
174
|
-
switch (type) {
|
|
175
|
-
case 'Warning': {
|
|
176
|
-
const type: Buffer = UInt8ToBuffer(1)
|
|
177
|
-
this.writeBytes(5, type)
|
|
178
|
-
}
|
|
179
|
-
break
|
|
180
|
-
case 'Fatal': {
|
|
181
|
-
const type: Buffer = UInt8ToBuffer(2)
|
|
182
|
-
this.writeBytes(5, type)
|
|
183
|
-
}
|
|
184
|
-
break
|
|
185
|
-
default: {
|
|
186
|
-
const type1: number = parseInt(type, 10)
|
|
187
|
-
this.writeBytes(5, UInt8ToBuffer(type1))
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
descriptionType: {
|
|
193
|
-
type: 'string',
|
|
194
|
-
label: 'Alert Description Types',
|
|
195
|
-
minimum: 0,
|
|
196
|
-
maximum: 255,
|
|
197
|
-
decode: (): void => {
|
|
198
|
-
this.instance.descriptionType.setValue(BufferToUInt8(this.readBytes(6, 1)))
|
|
199
|
-
const type: number = this.instance.descriptionType.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
200
|
-
switch (type) {
|
|
201
|
-
case 0: {
|
|
202
|
-
this.instance.descriptionType.setValue(Description_type.code_0)
|
|
203
|
-
}
|
|
204
|
-
break
|
|
205
|
-
case 10: {
|
|
206
|
-
this.instance.descriptionType.setValue(Description_type.code_10)
|
|
207
|
-
}
|
|
208
|
-
break
|
|
209
|
-
case 20: {
|
|
210
|
-
this.instance.descriptionType.setValue(Description_type.code_20)
|
|
211
|
-
}
|
|
212
|
-
break
|
|
213
|
-
case 21: {
|
|
214
|
-
this.instance.descriptionType.setValue(Description_type.code_21)
|
|
215
|
-
}
|
|
216
|
-
break
|
|
217
|
-
case 22: {
|
|
218
|
-
this.instance.descriptionType.setValue(Description_type.code_22)
|
|
219
|
-
}
|
|
220
|
-
break
|
|
221
|
-
case 30: {
|
|
222
|
-
this.instance.descriptionType.setValue(Description_type.code_30)
|
|
223
|
-
}
|
|
224
|
-
break
|
|
225
|
-
case 40: {
|
|
226
|
-
this.instance.descriptionType.setValue(Description_type.code_40)
|
|
227
|
-
}
|
|
228
|
-
break
|
|
229
|
-
case 41: {
|
|
230
|
-
this.instance.descriptionType.setValue(Description_type.code_41)
|
|
231
|
-
}
|
|
232
|
-
break
|
|
233
|
-
case 42: {
|
|
234
|
-
this.instance.descriptionType.setValue(Description_type.code_42)
|
|
235
|
-
}
|
|
236
|
-
break
|
|
237
|
-
case 43: {
|
|
238
|
-
this.instance.descriptionType.setValue(Description_type.code_43)
|
|
239
|
-
}
|
|
240
|
-
break
|
|
241
|
-
case 44: {
|
|
242
|
-
this.instance.descriptionType.setValue(Description_type.code_44)
|
|
243
|
-
}
|
|
244
|
-
break
|
|
245
|
-
case 45: {
|
|
246
|
-
this.instance.descriptionType.setValue(Description_type.code_45)
|
|
247
|
-
}
|
|
248
|
-
break
|
|
249
|
-
case 46: {
|
|
250
|
-
this.instance.descriptionType.setValue(Description_type.code_46)
|
|
251
|
-
}
|
|
252
|
-
break
|
|
253
|
-
case 47: {
|
|
254
|
-
this.instance.descriptionType.setValue(Description_type.code_47)
|
|
255
|
-
}
|
|
256
|
-
break
|
|
257
|
-
case 48: {
|
|
258
|
-
this.instance.descriptionType.setValue(Description_type.code_48)
|
|
259
|
-
}
|
|
260
|
-
break
|
|
261
|
-
case 49: {
|
|
262
|
-
this.instance.descriptionType.setValue(Description_type.code_49)
|
|
263
|
-
}
|
|
264
|
-
break
|
|
265
|
-
case 50: {
|
|
266
|
-
this.instance.descriptionType.setValue(Description_type.code_50)
|
|
267
|
-
}
|
|
268
|
-
break
|
|
269
|
-
case 51: {
|
|
270
|
-
this.instance.descriptionType.setValue(Description_type.code_51)
|
|
271
|
-
}
|
|
272
|
-
break
|
|
273
|
-
case 60: {
|
|
274
|
-
this.instance.descriptionType.setValue(Description_type.code_60)
|
|
275
|
-
}
|
|
276
|
-
break
|
|
277
|
-
case 70: {
|
|
278
|
-
this.instance.descriptionType.setValue(Description_type.code_70)
|
|
279
|
-
}
|
|
280
|
-
break
|
|
281
|
-
case 71: {
|
|
282
|
-
this.instance.descriptionType.setValue(Description_type.code_71)
|
|
283
|
-
}
|
|
284
|
-
break
|
|
285
|
-
case 80: {
|
|
286
|
-
this.instance.descriptionType.setValue(Description_type.code_80)
|
|
287
|
-
}
|
|
288
|
-
break
|
|
289
|
-
case 86: {
|
|
290
|
-
this.instance.descriptionType.setValue(Description_type.code_86)
|
|
291
|
-
}
|
|
292
|
-
break
|
|
293
|
-
case 90: {
|
|
294
|
-
this.instance.descriptionType.setValue(Description_type.code_90)
|
|
295
|
-
}
|
|
296
|
-
break
|
|
297
|
-
case 100: {
|
|
298
|
-
this.instance.descriptionType.setValue(Description_type.code_100)
|
|
299
|
-
}
|
|
300
|
-
break
|
|
301
|
-
case 110: {
|
|
302
|
-
this.instance.descriptionType.setValue(Description_type.code_110)
|
|
303
|
-
}
|
|
304
|
-
break
|
|
305
|
-
case 111: {
|
|
306
|
-
this.instance.descriptionType.setValue(Description_type.code_111)
|
|
307
|
-
}
|
|
308
|
-
break
|
|
309
|
-
case 112: {
|
|
310
|
-
this.instance.descriptionType.setValue(Description_type.code_112)
|
|
311
|
-
}
|
|
312
|
-
break
|
|
313
|
-
case 113: {
|
|
314
|
-
this.instance.descriptionType.setValue(Description_type.code_113)
|
|
315
|
-
}
|
|
316
|
-
break
|
|
317
|
-
case 114: {
|
|
318
|
-
this.instance.descriptionType.setValue(Description_type.code_114)
|
|
319
|
-
}
|
|
320
|
-
break
|
|
321
|
-
case 115: {
|
|
322
|
-
this.instance.descriptionType.setValue(Description_type.code_115)
|
|
323
|
-
}
|
|
324
|
-
break
|
|
325
|
-
case 116: {
|
|
326
|
-
this.instance.descriptionType.setValue(Description_type.code_116)
|
|
327
|
-
}
|
|
328
|
-
break
|
|
329
|
-
case 120: {
|
|
330
|
-
this.instance.descriptionType.setValue(Description_type.code_120)
|
|
331
|
-
}
|
|
332
|
-
break
|
|
333
|
-
case 255: {
|
|
334
|
-
this.instance.descriptionType.setValue(Description_type.code_255)
|
|
335
|
-
}
|
|
336
|
-
break
|
|
337
|
-
default: {
|
|
338
|
-
this.instance.descriptionType.setValue(BufferToUInt8(this.readBytes(6, 1)))
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
encode: (): void => {
|
|
343
|
-
const type: string = this.instance.descriptionType.getValue('0', (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
344
|
-
switch (type) {
|
|
345
|
-
case Description_type.code_0: {
|
|
346
|
-
const type: Buffer = UInt8ToBuffer(0)
|
|
347
|
-
this.writeBytes(6, type)
|
|
348
|
-
}
|
|
349
|
-
break
|
|
350
|
-
case Description_type.code_10: {
|
|
351
|
-
const type: Buffer = UInt8ToBuffer(10)
|
|
352
|
-
this.writeBytes(6, type)
|
|
353
|
-
}
|
|
354
|
-
break
|
|
355
|
-
case Description_type.code_20: {
|
|
356
|
-
const type: Buffer = UInt8ToBuffer(20)
|
|
357
|
-
this.writeBytes(6, type)
|
|
358
|
-
}
|
|
359
|
-
break
|
|
360
|
-
case Description_type.code_21: {
|
|
361
|
-
const type: Buffer = UInt8ToBuffer(21)
|
|
362
|
-
this.writeBytes(6, type)
|
|
363
|
-
}
|
|
364
|
-
break
|
|
365
|
-
case Description_type.code_22: {
|
|
366
|
-
const type: Buffer = UInt8ToBuffer(22)
|
|
367
|
-
this.writeBytes(6, type)
|
|
368
|
-
}
|
|
369
|
-
break
|
|
370
|
-
case Description_type.code_30: {
|
|
371
|
-
const type: Buffer = UInt8ToBuffer(30)
|
|
372
|
-
this.writeBytes(6, type)
|
|
373
|
-
}
|
|
374
|
-
break
|
|
375
|
-
case Description_type.code_40: {
|
|
376
|
-
const type: Buffer = UInt8ToBuffer(40)
|
|
377
|
-
this.writeBytes(6, type)
|
|
378
|
-
}
|
|
379
|
-
break
|
|
380
|
-
case Description_type.code_41: {
|
|
381
|
-
const type: Buffer = UInt8ToBuffer(41)
|
|
382
|
-
this.writeBytes(6, type)
|
|
383
|
-
}
|
|
384
|
-
break
|
|
385
|
-
case Description_type.code_42: {
|
|
386
|
-
const type: Buffer = UInt8ToBuffer(42)
|
|
387
|
-
this.writeBytes(6, type)
|
|
388
|
-
}
|
|
389
|
-
break
|
|
390
|
-
case Description_type.code_43: {
|
|
391
|
-
const type: Buffer = UInt8ToBuffer(43)
|
|
392
|
-
this.writeBytes(6, type)
|
|
393
|
-
}
|
|
394
|
-
break
|
|
395
|
-
case Description_type.code_44: {
|
|
396
|
-
const type: Buffer = UInt8ToBuffer(44)
|
|
397
|
-
this.writeBytes(6, type)
|
|
398
|
-
}
|
|
399
|
-
break
|
|
400
|
-
case Description_type.code_45: {
|
|
401
|
-
const type: Buffer = UInt8ToBuffer(45)
|
|
402
|
-
this.writeBytes(6, type)
|
|
403
|
-
}
|
|
404
|
-
break
|
|
405
|
-
case Description_type.code_46: {
|
|
406
|
-
const type: Buffer = UInt8ToBuffer(46)
|
|
407
|
-
this.writeBytes(6, type)
|
|
408
|
-
}
|
|
409
|
-
break
|
|
410
|
-
case Description_type.code_47: {
|
|
411
|
-
const type: Buffer = UInt8ToBuffer(47)
|
|
412
|
-
this.writeBytes(6, type)
|
|
413
|
-
}
|
|
414
|
-
break
|
|
415
|
-
case Description_type.code_48: {
|
|
416
|
-
const type: Buffer = UInt8ToBuffer(48)
|
|
417
|
-
this.writeBytes(6, type)
|
|
418
|
-
}
|
|
419
|
-
break
|
|
420
|
-
case Description_type.code_49: {
|
|
421
|
-
const type: Buffer = UInt8ToBuffer(49)
|
|
422
|
-
this.writeBytes(6, type)
|
|
423
|
-
}
|
|
424
|
-
break
|
|
425
|
-
case Description_type.code_50: {
|
|
426
|
-
const type: Buffer = UInt8ToBuffer(50)
|
|
427
|
-
this.writeBytes(6, type)
|
|
428
|
-
}
|
|
429
|
-
break
|
|
430
|
-
case Description_type.code_51: {
|
|
431
|
-
const type: Buffer = UInt8ToBuffer(51)
|
|
432
|
-
this.writeBytes(6, type)
|
|
433
|
-
}
|
|
434
|
-
break
|
|
435
|
-
case Description_type.code_60: {
|
|
436
|
-
const type: Buffer = UInt8ToBuffer(60)
|
|
437
|
-
this.writeBytes(6, type)
|
|
438
|
-
}
|
|
439
|
-
break
|
|
440
|
-
case Description_type.code_70: {
|
|
441
|
-
const type: Buffer = UInt8ToBuffer(70)
|
|
442
|
-
this.writeBytes(6, type)
|
|
443
|
-
}
|
|
444
|
-
break
|
|
445
|
-
case Description_type.code_71: {
|
|
446
|
-
const type: Buffer = UInt8ToBuffer(71)
|
|
447
|
-
this.writeBytes(6, type)
|
|
448
|
-
}
|
|
449
|
-
break
|
|
450
|
-
case Description_type.code_80: {
|
|
451
|
-
const type: Buffer = UInt8ToBuffer(80)
|
|
452
|
-
this.writeBytes(6, type)
|
|
453
|
-
}
|
|
454
|
-
break
|
|
455
|
-
case Description_type.code_86: {
|
|
456
|
-
const type: Buffer = UInt8ToBuffer(86)
|
|
457
|
-
this.writeBytes(6, type)
|
|
458
|
-
}
|
|
459
|
-
break
|
|
460
|
-
case Description_type.code_90: {
|
|
461
|
-
const type: Buffer = UInt8ToBuffer(90)
|
|
462
|
-
this.writeBytes(6, type)
|
|
463
|
-
}
|
|
464
|
-
break
|
|
465
|
-
case Description_type.code_100: {
|
|
466
|
-
const type: Buffer = UInt8ToBuffer(100)
|
|
467
|
-
this.writeBytes(6, type)
|
|
468
|
-
}
|
|
469
|
-
break
|
|
470
|
-
case Description_type.code_110: {
|
|
471
|
-
const type: Buffer = UInt8ToBuffer(110)
|
|
472
|
-
this.writeBytes(6, type)
|
|
473
|
-
}
|
|
474
|
-
break
|
|
475
|
-
case Description_type.code_111: {
|
|
476
|
-
const type: Buffer = UInt8ToBuffer(111)
|
|
477
|
-
this.writeBytes(6, type)
|
|
478
|
-
}
|
|
479
|
-
break
|
|
480
|
-
case Description_type.code_112: {
|
|
481
|
-
const type: Buffer = UInt8ToBuffer(112)
|
|
482
|
-
this.writeBytes(6, type)
|
|
483
|
-
}
|
|
484
|
-
break
|
|
485
|
-
case Description_type.code_113: {
|
|
486
|
-
const type: Buffer = UInt8ToBuffer(113)
|
|
487
|
-
this.writeBytes(6, type)
|
|
488
|
-
}
|
|
489
|
-
break
|
|
490
|
-
case Description_type.code_114: {
|
|
491
|
-
const type: Buffer = UInt8ToBuffer(114)
|
|
492
|
-
this.writeBytes(6, type)
|
|
493
|
-
}
|
|
494
|
-
break
|
|
495
|
-
case Description_type.code_115: {
|
|
496
|
-
const type: Buffer = UInt8ToBuffer(115)
|
|
497
|
-
this.writeBytes(6, type)
|
|
498
|
-
}
|
|
499
|
-
break
|
|
500
|
-
case Description_type.code_116: {
|
|
501
|
-
const type: Buffer = UInt8ToBuffer(116)
|
|
502
|
-
this.writeBytes(6, type)
|
|
503
|
-
}
|
|
504
|
-
break
|
|
505
|
-
case Description_type.code_120: {
|
|
506
|
-
const type: Buffer = UInt8ToBuffer(120)
|
|
507
|
-
this.writeBytes(6, type)
|
|
508
|
-
}
|
|
509
|
-
break
|
|
510
|
-
case Description_type.code_255: {
|
|
511
|
-
const type: Buffer = UInt8ToBuffer(255)
|
|
512
|
-
this.writeBytes(6, type)
|
|
513
|
-
}
|
|
514
|
-
break
|
|
515
|
-
default: {
|
|
516
|
-
const type1: number = parseInt(type, 10)
|
|
517
|
-
const type2: Buffer = UInt8ToBuffer(type1)
|
|
518
|
-
this.writeBytes(6, type2)
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
public id: string = 'tls-alert'
|
|
528
|
-
public name: string = 'Transport Layer Security(Alert Protocol)'
|
|
529
|
-
public nickname: string = 'TLS-Alert'
|
|
530
|
-
|
|
531
|
-
public match(): boolean {
|
|
532
|
-
if (!this.prevCodecModule) return false
|
|
533
|
-
const type: number = BufferToInt8(this.readBytes(0, 1))
|
|
534
|
-
if (type != 21) return false
|
|
535
|
-
const version: number = BufferToUInt16(this.readBytes(1, 2))
|
|
536
|
-
const validVersions: number[] = [768, 769, 770, 771, 772]
|
|
537
|
-
return validVersions.includes(version)
|
|
538
|
-
}
|
|
539
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import {ProtocolJSONSchema} from '../../schema/ProtocolJSONSchema'
|
|
2
|
-
import {BaseHeader} from '../abstracts/BaseHeader'
|
|
3
|
-
import {BufferToInt8, BufferToUInt16} from '../../helper/BufferToNumber'
|
|
4
|
-
import {BufferToHex} from '../../helper/BufferToHex'
|
|
5
|
-
import {UInt16ToBuffer, UInt8ToBuffer} from '../../helper/NumberToBuffer'
|
|
6
|
-
import {HexToBuffer} from '../../helper/HexToBuffer'
|
|
7
|
-
|
|
8
|
-
enum TLSver {
|
|
9
|
-
SSL_3_0 = 'SSL3.0',
|
|
10
|
-
TLS_1_0 = 'TLS1.0',
|
|
11
|
-
TLS_1_1 = 'TLS1.1',
|
|
12
|
-
TLS_1_2 = 'TLS1.2',
|
|
13
|
-
TLS_1_3 = 'TLS1.3',
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class TLS_ApplicationData extends BaseHeader {
|
|
17
|
-
public SCHEMA: ProtocolJSONSchema = {
|
|
18
|
-
type: 'object',
|
|
19
|
-
properties: {
|
|
20
|
-
contentType: {
|
|
21
|
-
type: 'integer',
|
|
22
|
-
label: 'Content Type',
|
|
23
|
-
minimum: 0,
|
|
24
|
-
maximum: 255,
|
|
25
|
-
decode: (): void => {
|
|
26
|
-
this.instance.contentType.setValue(BufferToInt8(this.readBytes(0, 1)))
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
encode: (): void => {
|
|
30
|
-
const contentType: Buffer = UInt8ToBuffer(this.instance.contentType.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not found')))
|
|
31
|
-
this.writeBytes(0, contentType)
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
version: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
label: 'Legacy Version',
|
|
38
|
-
minimum: 0,
|
|
39
|
-
maximum: 65535,
|
|
40
|
-
decode: (): void => {
|
|
41
|
-
const version: number = BufferToUInt16(this.readBytes(1, 2))
|
|
42
|
-
switch (version) {
|
|
43
|
-
case 768: {
|
|
44
|
-
this.instance.version.setValue(TLSver.SSL_3_0)
|
|
45
|
-
}
|
|
46
|
-
break
|
|
47
|
-
case 769: {
|
|
48
|
-
this.instance.version.setValue(TLSver.TLS_1_0)
|
|
49
|
-
}
|
|
50
|
-
break
|
|
51
|
-
case 770: {
|
|
52
|
-
this.instance.version.setValue(TLSver.TLS_1_1)
|
|
53
|
-
}
|
|
54
|
-
break
|
|
55
|
-
case 771: {
|
|
56
|
-
this.instance.version.setValue(TLSver.TLS_1_2)
|
|
57
|
-
}
|
|
58
|
-
break
|
|
59
|
-
case 772: {
|
|
60
|
-
this.instance.version.setValue(TLSver.TLS_1_3)
|
|
61
|
-
}
|
|
62
|
-
break
|
|
63
|
-
default: {
|
|
64
|
-
this.instance.version.setValue('0')
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
encode: (): void => {
|
|
71
|
-
const version: string = this.instance.version.getValue('0', (nodePath: string): void => this.recordError(nodePath, 'Not found'))
|
|
72
|
-
switch (version) {
|
|
73
|
-
case TLSver.SSL_3_0: {
|
|
74
|
-
const version: Buffer = UInt16ToBuffer(768)
|
|
75
|
-
this.writeBytes(1, version)
|
|
76
|
-
}
|
|
77
|
-
break
|
|
78
|
-
case TLSver.TLS_1_0: {
|
|
79
|
-
const version: Buffer = UInt16ToBuffer(769)
|
|
80
|
-
this.writeBytes(1, version)
|
|
81
|
-
}
|
|
82
|
-
break
|
|
83
|
-
case TLSver.TLS_1_1: {
|
|
84
|
-
const version: Buffer = UInt16ToBuffer(770)
|
|
85
|
-
this.writeBytes(1, version)
|
|
86
|
-
}
|
|
87
|
-
break
|
|
88
|
-
case TLSver.TLS_1_2: {
|
|
89
|
-
const version: Buffer = UInt16ToBuffer(771)
|
|
90
|
-
this.writeBytes(1, version)
|
|
91
|
-
}
|
|
92
|
-
break
|
|
93
|
-
case TLSver.TLS_1_3: {
|
|
94
|
-
const version: Buffer = UInt16ToBuffer(772)
|
|
95
|
-
this.writeBytes(1, version)
|
|
96
|
-
}
|
|
97
|
-
break
|
|
98
|
-
default: {
|
|
99
|
-
this.writeBytes(1, UInt16ToBuffer(0))
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
length: {
|
|
105
|
-
type: 'integer',
|
|
106
|
-
label: 'Length',
|
|
107
|
-
minimum: 0,
|
|
108
|
-
maximum: 65535,
|
|
109
|
-
decode: (): void => {
|
|
110
|
-
this.instance.length.setValue(BufferToUInt16(this.readBytes(3, 2)))
|
|
111
|
-
},
|
|
112
|
-
encode: (): void => {
|
|
113
|
-
const length: Buffer = UInt16ToBuffer(this.instance.length.getValue(0, (nodePath: string): void => this.recordError(nodePath, 'Not found')))
|
|
114
|
-
this.writeBytes(3, length)
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
appData: {
|
|
118
|
-
type: 'string',
|
|
119
|
-
label: 'Encrypted Application Data',
|
|
120
|
-
minimum: 0,
|
|
121
|
-
maximum: 65535,
|
|
122
|
-
decode: (): void => {
|
|
123
|
-
this.instance.appData.setValue(BufferToHex(this.readBytes(5, this.instance.length.getValue())))
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
encode: (): void => {
|
|
127
|
-
const appData: Buffer = HexToBuffer(this.instance.appData.getValue('0', (nodePath: string): void => this.recordError(nodePath, 'Not found')))
|
|
128
|
-
this.writeBytes(5, appData)
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
public id: string = 'tls-appdata'
|
|
134
|
-
public name: string = 'Transport Layer Security(Application Data Protocol)'
|
|
135
|
-
public nickname: string = 'TLS-AppData'
|
|
136
|
-
|
|
137
|
-
public match(): boolean {
|
|
138
|
-
if (!this.prevCodecModule) return false
|
|
139
|
-
if (BufferToHex(this.readBytes(0, 1)) != '17') return false
|
|
140
|
-
const version: number = BufferToUInt16(this.readBytes(1, 2))
|
|
141
|
-
const validVersions: number[] = [768, 769, 770, 771, 772]
|
|
142
|
-
return validVersions.includes(version)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
}
|