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,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Float32ToBERHex = exports.UInt64ToBERHex = exports.UInt32ToBERHex = exports.UInt16ToBERHex = exports.UInt8ToBERHex = exports.Int64ToBERHex = exports.Int32ToBERHex = exports.Int16ToBERHex = exports.Int8ToBERHex = void 0;
|
|
4
|
-
const NumberToHex_1 = require("./NumberToHex");
|
|
5
|
-
function toBERHex(rawHex) {
|
|
6
|
-
const hex = rawHex.padStart(rawHex.length + rawHex.length % 2, '0');
|
|
7
|
-
return Buffer.from(hex, 'hex')[0].toString(2).padStart(8, '0').startsWith('1') ? `00${hex}` : hex;
|
|
8
|
-
}
|
|
9
|
-
const Int8ToBERHex = (value) => toBERHex(new Uint8Array(Int8Array.from([value]).buffer)[0].toString(16));
|
|
10
|
-
exports.Int8ToBERHex = Int8ToBERHex;
|
|
11
|
-
const Int16ToBERHex = (value) => toBERHex(new Uint16Array(Int16Array.from([value]).buffer)[0].toString(16));
|
|
12
|
-
exports.Int16ToBERHex = Int16ToBERHex;
|
|
13
|
-
const Int32ToBERHex = (value) => toBERHex(new Uint32Array(Int32Array.from([value]).buffer)[0].toString(16));
|
|
14
|
-
exports.Int32ToBERHex = Int32ToBERHex;
|
|
15
|
-
const Int64ToBERHex = (value) => toBERHex(BigInt(value).toString(16));
|
|
16
|
-
exports.Int64ToBERHex = Int64ToBERHex;
|
|
17
|
-
const UInt8ToBERHex = (value) => toBERHex(value.toString(16));
|
|
18
|
-
exports.UInt8ToBERHex = UInt8ToBERHex;
|
|
19
|
-
const UInt16ToBERHex = (value) => toBERHex(value.toString(16));
|
|
20
|
-
exports.UInt16ToBERHex = UInt16ToBERHex;
|
|
21
|
-
const UInt32ToBERHex = (value) => toBERHex(value.toString(16));
|
|
22
|
-
exports.UInt32ToBERHex = UInt32ToBERHex;
|
|
23
|
-
const UInt64ToBERHex = (value) => toBERHex(BigInt(value).toString(16));
|
|
24
|
-
exports.UInt64ToBERHex = UInt64ToBERHex;
|
|
25
|
-
//Float32 precision is always 8, therefore add '08' prefix for Float32ToHex result
|
|
26
|
-
const Float32ToBERHex = (value) => `08${(0, NumberToHex_1.Float32ToHex)(value)}`;
|
|
27
|
-
exports.Float32ToBERHex = Float32ToBERHex;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const Int8ToBuffer: (value: number) => Buffer;
|
|
2
|
-
export declare const Int16ToBuffer: (value: number) => Buffer;
|
|
3
|
-
export declare const Int32ToBuffer: (value: number) => Buffer;
|
|
4
|
-
export declare const Int64ToBuffer: (value: bigint) => Buffer;
|
|
5
|
-
export declare const UInt8ToBuffer: (value: number) => Buffer;
|
|
6
|
-
export declare const UInt16ToBuffer: (value: number) => Buffer;
|
|
7
|
-
export declare const UInt32ToBuffer: (value: number) => Buffer;
|
|
8
|
-
export declare const UInt64ToBuffer: (value: bigint) => Buffer;
|
|
9
|
-
export declare const Float32ToBuffer: (value: number) => Buffer;
|
|
10
|
-
//# sourceMappingURL=NumberToBuffer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberToBuffer.d.ts","sourceRoot":"","sources":["../../../src/lib/helper/NumberToBuffer.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAwE,CAAA;AACtH,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAyE,CAAA;AACxH,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAyE,CAAA;AACxH,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAyE,CAAA;AACxH,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAyE,CAAA;AACxH,eAAO,MAAM,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAA0E,CAAA;AAC1H,eAAO,MAAM,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAA0E,CAAA;AAC1H,eAAO,MAAM,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAA0E,CAAA;AAC1H,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAA2E,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Float32ToBuffer = exports.UInt64ToBuffer = exports.UInt32ToBuffer = exports.UInt16ToBuffer = exports.UInt8ToBuffer = exports.Int64ToBuffer = exports.Int32ToBuffer = exports.Int16ToBuffer = exports.Int8ToBuffer = void 0;
|
|
4
|
-
const NumberToHex_1 = require("./NumberToHex");
|
|
5
|
-
const Int8ToBuffer = (value) => Buffer.from((0, NumberToHex_1.Int8ToHex)(value), 'hex');
|
|
6
|
-
exports.Int8ToBuffer = Int8ToBuffer;
|
|
7
|
-
const Int16ToBuffer = (value) => Buffer.from((0, NumberToHex_1.Int16ToHex)(value), 'hex');
|
|
8
|
-
exports.Int16ToBuffer = Int16ToBuffer;
|
|
9
|
-
const Int32ToBuffer = (value) => Buffer.from((0, NumberToHex_1.Int32ToHex)(value), 'hex');
|
|
10
|
-
exports.Int32ToBuffer = Int32ToBuffer;
|
|
11
|
-
const Int64ToBuffer = (value) => Buffer.from((0, NumberToHex_1.Int64ToHex)(value), 'hex');
|
|
12
|
-
exports.Int64ToBuffer = Int64ToBuffer;
|
|
13
|
-
const UInt8ToBuffer = (value) => Buffer.from((0, NumberToHex_1.UInt8ToHex)(value), 'hex');
|
|
14
|
-
exports.UInt8ToBuffer = UInt8ToBuffer;
|
|
15
|
-
const UInt16ToBuffer = (value) => Buffer.from((0, NumberToHex_1.UInt16ToHex)(value), 'hex');
|
|
16
|
-
exports.UInt16ToBuffer = UInt16ToBuffer;
|
|
17
|
-
const UInt32ToBuffer = (value) => Buffer.from((0, NumberToHex_1.UInt32ToHex)(value), 'hex');
|
|
18
|
-
exports.UInt32ToBuffer = UInt32ToBuffer;
|
|
19
|
-
const UInt64ToBuffer = (value) => Buffer.from((0, NumberToHex_1.UInt64ToHex)(value), 'hex');
|
|
20
|
-
exports.UInt64ToBuffer = UInt64ToBuffer;
|
|
21
|
-
const Float32ToBuffer = (value) => Buffer.from((0, NumberToHex_1.Float32ToHex)(value), 'hex');
|
|
22
|
-
exports.Float32ToBuffer = Float32ToBuffer;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const Int8ToHex: (value: number) => string;
|
|
2
|
-
export declare const Int16ToHex: (value: number) => string;
|
|
3
|
-
export declare const Int32ToHex: (value: number) => string;
|
|
4
|
-
export declare const Int64ToHex: (value: bigint) => string;
|
|
5
|
-
export declare const UInt8ToHex: (value: number) => string;
|
|
6
|
-
export declare const UInt16ToHex: (value: number) => string;
|
|
7
|
-
export declare const UInt32ToHex: (value: number) => string;
|
|
8
|
-
export declare const UInt64ToHex: (value: bigint) => string;
|
|
9
|
-
export declare const Float32ToHex: (value: number) => string;
|
|
10
|
-
//# sourceMappingURL=NumberToHex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberToHex.d.ts","sourceRoot":"","sources":["../../../src/lib/helper/NumberToHex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAmH,CAAA;AAC9J,eAAO,MAAM,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAqH,CAAA;AACjK,eAAO,MAAM,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAqH,CAAA;AACjK,eAAO,MAAM,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAgF,CAAA;AAC5H,eAAO,MAAM,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAuE,CAAA;AACnH,eAAO,MAAM,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAuE,CAAA;AACpH,eAAO,MAAM,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAuE,CAAA;AACpH,eAAO,MAAM,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAgF,CAAA;AAE7H,eAAO,MAAM,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAK7C,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Float32ToHex = exports.UInt64ToHex = exports.UInt32ToHex = exports.UInt16ToHex = exports.UInt8ToHex = exports.Int64ToHex = exports.Int32ToHex = exports.Int16ToHex = exports.Int8ToHex = void 0;
|
|
4
|
-
const Int8ToHex = (value) => new Uint8Array(Int8Array.from([value]).buffer)[0].toString(16).padStart(2, '0');
|
|
5
|
-
exports.Int8ToHex = Int8ToHex;
|
|
6
|
-
const Int16ToHex = (value) => new Uint16Array(Int16Array.from([value]).buffer)[0].toString(16).padStart(4, '0');
|
|
7
|
-
exports.Int16ToHex = Int16ToHex;
|
|
8
|
-
const Int32ToHex = (value) => new Uint32Array(Int32Array.from([value]).buffer)[0].toString(16).padStart(8, '0');
|
|
9
|
-
exports.Int32ToHex = Int32ToHex;
|
|
10
|
-
const Int64ToHex = (value) => BigInt(value).toString(16).padStart(16, '0');
|
|
11
|
-
exports.Int64ToHex = Int64ToHex;
|
|
12
|
-
const UInt8ToHex = (value) => value.toString(16).padStart(2, '0');
|
|
13
|
-
exports.UInt8ToHex = UInt8ToHex;
|
|
14
|
-
const UInt16ToHex = (value) => value.toString(16).padStart(4, '0');
|
|
15
|
-
exports.UInt16ToHex = UInt16ToHex;
|
|
16
|
-
const UInt32ToHex = (value) => value.toString(16).padStart(8, '0');
|
|
17
|
-
exports.UInt32ToHex = UInt32ToHex;
|
|
18
|
-
const UInt64ToHex = (value) => BigInt(value).toString(16).padStart(16, '0');
|
|
19
|
-
exports.UInt64ToHex = UInt64ToHex;
|
|
20
|
-
const Float32ToHex = (value) => {
|
|
21
|
-
const buffer = new ArrayBuffer(4);
|
|
22
|
-
const dataView = new DataView(buffer);
|
|
23
|
-
dataView.setFloat32(0, value, false);
|
|
24
|
-
return dataView.getUint32(0, false).toString(16).padStart(8, '0');
|
|
25
|
-
};
|
|
26
|
-
exports.Float32ToHex = Float32ToHex;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ICaptureOptions } from './interfaces/ICaptureOptions';
|
|
2
|
-
import { PipeClientSocket } from '../pipe/PipeClientSocket';
|
|
3
|
-
import EventEmitter from 'events';
|
|
4
|
-
import { IPcapPacketInfo } from '../pcap/interfaces/IPcapPacketInfo';
|
|
5
|
-
export declare class Capture extends EventEmitter {
|
|
6
|
-
#private;
|
|
7
|
-
get filter(): string;
|
|
8
|
-
get temporaryFilename(): string;
|
|
9
|
-
get count(): number;
|
|
10
|
-
/**
|
|
11
|
-
* Constructor
|
|
12
|
-
* @param options
|
|
13
|
-
*/
|
|
14
|
-
constructor(options: ICaptureOptions);
|
|
15
|
-
/**
|
|
16
|
-
* Create and initialize capture worker
|
|
17
|
-
* @protected
|
|
18
|
-
*/
|
|
19
|
-
protected createCaptureWorker(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Destroy capture worker
|
|
22
|
-
* @protected
|
|
23
|
-
*/
|
|
24
|
-
protected destroyCaptureWorker(): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Get worker socket
|
|
27
|
-
* @protected
|
|
28
|
-
*/
|
|
29
|
-
protected getWorkerSocket(): Promise<PipeClientSocket>;
|
|
30
|
-
/**
|
|
31
|
-
* Clean resources before start capture
|
|
32
|
-
* @param removeTmpFile
|
|
33
|
-
* @protected
|
|
34
|
-
*/
|
|
35
|
-
protected cleanResources(removeTmpFile?: boolean): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Clean temporary pcap file
|
|
38
|
-
* @protected
|
|
39
|
-
*/
|
|
40
|
-
protected cleanTemporaryFile(): void;
|
|
41
|
-
/**
|
|
42
|
-
* Wait other operation done
|
|
43
|
-
* @protected
|
|
44
|
-
*/
|
|
45
|
-
protected waitOperationDone(): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Start capture packets
|
|
48
|
-
*/
|
|
49
|
-
start(): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Stop capture packets
|
|
52
|
-
*/
|
|
53
|
-
stop(): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Pause capture packets
|
|
56
|
-
*/
|
|
57
|
-
pause(): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Resume capture packets
|
|
60
|
-
*/
|
|
61
|
-
resume(): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Set capture filter
|
|
64
|
-
* @param filter
|
|
65
|
-
*/
|
|
66
|
-
setFilter(filter: string): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Save captured pcap to destination
|
|
69
|
-
* @param destination
|
|
70
|
-
*/
|
|
71
|
-
saveTo(destination: string): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Dispose capture
|
|
74
|
-
*/
|
|
75
|
-
dispose(): Promise<void>;
|
|
76
|
-
on(eventName: 'packet', listener: (pcapPacketInfo: IPcapPacketInfo) => void): this;
|
|
77
|
-
on(eventName: 'rawPacket', listener: (index: number, packet: string, seconds: number, microseconds: number) => void): this;
|
|
78
|
-
once(eventName: 'packet', listener: (pcapPacketInfo: IPcapPacketInfo) => void): this;
|
|
79
|
-
once(eventName: 'rawPacket', listener: (index: number, packet: string, seconds: number, microseconds: number) => void): this;
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=Capture.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Capture.d.ts","sourceRoot":"","sources":["../../../src/lib/nodepcap/Capture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAA;AAS5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AAGzD,OAAO,YAAY,MAAM,QAAQ,CAAA;AAGjC,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAA;AAGlE,qBAAa,OAAQ,SAAQ,YAAY;;IAgCrC,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,iBAAiB,IAAI,MAAM,CAErC;IAED,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED;;;OAGG;gBACS,OAAO,EAAE,eAAe;IAgBpC;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAoBrC;;;OAGG;cACa,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BrD;;;OAGG;cACa,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAa5D;;;;OAIG;cACa,cAAc,CAAC,aAAa,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5E;;;OAGG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAOpC;;;OAGG;cACa,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIlD;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBnC;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAalC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAanC;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAYpC;;;OAGG;IACU,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYrD;;;OAGG;IACU,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI;IAClF,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAM1H,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI;IACpF,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;CAKtI"}
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Capture = void 0;
|
|
40
|
-
const GetNetworkInterfaces_1 = require("./GetNetworkInterfaces");
|
|
41
|
-
const node_fs_1 = require("node:fs");
|
|
42
|
-
const GetDeviceCaptureTemporaryFilename_1 = require("../GetDeviceCaptureTemporaryFilename");
|
|
43
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
44
|
-
const is_electron_1 = __importDefault(require("is-electron"));
|
|
45
|
-
const childProcess = __importStar(require("child_process"));
|
|
46
|
-
const electron_1 = require("electron");
|
|
47
|
-
const PipeServer_1 = require("../pipe/PipeServer");
|
|
48
|
-
const crypto_1 = require("crypto");
|
|
49
|
-
const promises_1 = require("node:fs/promises");
|
|
50
|
-
const events_1 = __importDefault(require("events"));
|
|
51
|
-
const DeviceNotFoundError_1 = require("../../errors/DeviceNotFoundError");
|
|
52
|
-
const node_os_1 = require("node:os");
|
|
53
|
-
const PCAPGenerator_1 = require("../pcap/PCAPGenerator");
|
|
54
|
-
class Capture extends events_1.default {
|
|
55
|
-
#workerModule = node_path_1.default.resolve(__dirname, './workers/CaptureWorker.js');
|
|
56
|
-
#device;
|
|
57
|
-
#tmpDir;
|
|
58
|
-
#temporaryFilename;
|
|
59
|
-
#pipeServer;
|
|
60
|
-
#hasWorker = false;
|
|
61
|
-
#worker;
|
|
62
|
-
#workerId;
|
|
63
|
-
#workerSocket;
|
|
64
|
-
#workerDestroying = false;
|
|
65
|
-
#started = false;
|
|
66
|
-
#paused = false;
|
|
67
|
-
#operating = false;
|
|
68
|
-
#filter = '';
|
|
69
|
-
#count = 0;
|
|
70
|
-
get filter() {
|
|
71
|
-
return this.#filter;
|
|
72
|
-
}
|
|
73
|
-
get temporaryFilename() {
|
|
74
|
-
return this.#temporaryFilename;
|
|
75
|
-
}
|
|
76
|
-
get count() {
|
|
77
|
-
return this.#count;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Constructor
|
|
81
|
-
* @param options
|
|
82
|
-
*/
|
|
83
|
-
constructor(options) {
|
|
84
|
-
super();
|
|
85
|
-
this.#workerModule = options.workerModule ? options.workerModule : this.#workerModule;
|
|
86
|
-
this.#device = options.device;
|
|
87
|
-
this.#filter = options.filter ? options.filter : '';
|
|
88
|
-
this.#tmpDir = options.tmpDir ? options.tmpDir : node_path_1.default.resolve((0, node_os_1.tmpdir)(), 'netkitty-tmp');
|
|
89
|
-
if (!options.workerModule) {
|
|
90
|
-
//Use origin worker module, check capture device is available
|
|
91
|
-
if (!(0, GetNetworkInterfaces_1.GetNetworkInterfaces)().filter((availableDevice) => availableDevice.name === this.#device).length)
|
|
92
|
-
throw new DeviceNotFoundError_1.DeviceNotFoundError(`Device ${this.#device} not found`);
|
|
93
|
-
}
|
|
94
|
-
this.#temporaryFilename = options.temporaryFilename ? options.temporaryFilename : (0, GetDeviceCaptureTemporaryFilename_1.GetDeviceCaptureTemporaryFilename)(this.#device, this.#tmpDir);
|
|
95
|
-
this.#pipeServer = new PipeServer_1.PipeServer();
|
|
96
|
-
this.cleanTemporaryFile();
|
|
97
|
-
(0, node_fs_1.writeFileSync)(this.#temporaryFilename, (0, PCAPGenerator_1.GeneratePCAPHeader)());
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Create and initialize capture worker
|
|
101
|
-
* @protected
|
|
102
|
-
*/
|
|
103
|
-
createCaptureWorker() {
|
|
104
|
-
this.#hasWorker = true;
|
|
105
|
-
this.#workerId = `CW_${Date.now().toString(16)}${(0, crypto_1.randomInt)(32).toString(16)}`;
|
|
106
|
-
const env = {
|
|
107
|
-
captureWorkerId: this.#workerId,
|
|
108
|
-
captureDevice: this.#device,
|
|
109
|
-
captureFilter: this.#filter,
|
|
110
|
-
captureTemporaryFilename: this.#temporaryFilename,
|
|
111
|
-
socketPath: this.#pipeServer.socketPath
|
|
112
|
-
};
|
|
113
|
-
this.getWorkerSocket().then((socket) => {
|
|
114
|
-
socket.on('packet', (packetInfo) => {
|
|
115
|
-
this.emit('rawPacket', packetInfo.index, packetInfo.packet, packetInfo.seconds, packetInfo.microseconds);
|
|
116
|
-
this.emit('packet', packetInfo);
|
|
117
|
-
this.#count += 1;
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
this.#worker = (0, is_electron_1.default)() ? electron_1.utilityProcess.fork(this.#workerModule, [], { env: env }) : childProcess.fork(this.#workerModule, [], { env: env });
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Destroy capture worker
|
|
124
|
-
* @protected
|
|
125
|
-
*/
|
|
126
|
-
async destroyCaptureWorker() {
|
|
127
|
-
if (!this.#hasWorker)
|
|
128
|
-
return;
|
|
129
|
-
if (this.#workerDestroying) {
|
|
130
|
-
while (this.#workerDestroying)
|
|
131
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
this.#workerDestroying = true;
|
|
135
|
-
await new Promise(resolve => {
|
|
136
|
-
if (this.#workerSocket && this.#worker) {
|
|
137
|
-
const disconnectHandler = () => {
|
|
138
|
-
clearTimeout(notifyExitTimeout);
|
|
139
|
-
return resolve();
|
|
140
|
-
};
|
|
141
|
-
this.#workerSocket.once('disconnect', disconnectHandler);
|
|
142
|
-
this.#workerSocket.notify('exit');
|
|
143
|
-
const notifyExitTimeout = setTimeout(() => {
|
|
144
|
-
this.#workerSocket?.off('disconnect', disconnectHandler);
|
|
145
|
-
this.#worker?.kill('SIGINT');
|
|
146
|
-
return resolve();
|
|
147
|
-
}, 10000);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
this.#workerSocket = undefined;
|
|
151
|
-
this.#worker = undefined;
|
|
152
|
-
this.#workerId = undefined;
|
|
153
|
-
this.#workerDestroying = false;
|
|
154
|
-
this.#hasWorker = false;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Get worker socket
|
|
158
|
-
* @protected
|
|
159
|
-
*/
|
|
160
|
-
async getWorkerSocket() {
|
|
161
|
-
return new Promise(resolve => {
|
|
162
|
-
if (!this.#workerSocket) {
|
|
163
|
-
this.#pipeServer.once('connect', (clientSocket) => {
|
|
164
|
-
this.#workerSocket = clientSocket;
|
|
165
|
-
return resolve(this.#workerSocket);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
return resolve(this.#workerSocket);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Clean resources before start capture
|
|
175
|
-
* @param removeTmpFile
|
|
176
|
-
* @protected
|
|
177
|
-
*/
|
|
178
|
-
async cleanResources(removeTmpFile = true) {
|
|
179
|
-
//Clean cached capture data
|
|
180
|
-
if ((0, node_fs_1.existsSync)(this.#temporaryFilename) && removeTmpFile)
|
|
181
|
-
this.cleanTemporaryFile();
|
|
182
|
-
//Clean old worker resources
|
|
183
|
-
if (this.#worker && this.#workerSocket)
|
|
184
|
-
await this.destroyCaptureWorker();
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Clean temporary pcap file
|
|
188
|
-
* @protected
|
|
189
|
-
*/
|
|
190
|
-
cleanTemporaryFile() {
|
|
191
|
-
(0, node_fs_1.rmSync)(this.#temporaryFilename, {
|
|
192
|
-
recursive: true,
|
|
193
|
-
force: true
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Wait other operation done
|
|
198
|
-
* @protected
|
|
199
|
-
*/
|
|
200
|
-
async waitOperationDone() {
|
|
201
|
-
while (this.#operating)
|
|
202
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Start capture packets
|
|
206
|
-
*/
|
|
207
|
-
async start() {
|
|
208
|
-
if (this.#paused)
|
|
209
|
-
return await this.resume();
|
|
210
|
-
if (this.#started)
|
|
211
|
-
return;
|
|
212
|
-
await this.waitOperationDone();
|
|
213
|
-
this.#operating = true;
|
|
214
|
-
try {
|
|
215
|
-
this.#started = true;
|
|
216
|
-
await this.cleanResources(false);
|
|
217
|
-
this.createCaptureWorker();
|
|
218
|
-
const workerSocket = await this.getWorkerSocket();
|
|
219
|
-
await workerSocket.invoke('start');
|
|
220
|
-
}
|
|
221
|
-
catch (e) {
|
|
222
|
-
this.#started = false;
|
|
223
|
-
this.#operating = false;
|
|
224
|
-
throw e;
|
|
225
|
-
}
|
|
226
|
-
this.#operating = false;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Stop capture packets
|
|
230
|
-
*/
|
|
231
|
-
async stop() {
|
|
232
|
-
if (!this.#started)
|
|
233
|
-
return;
|
|
234
|
-
if (this.#workerDestroying)
|
|
235
|
-
return;
|
|
236
|
-
await this.waitOperationDone();
|
|
237
|
-
this.#operating = true;
|
|
238
|
-
const workerSocket = await this.getWorkerSocket();
|
|
239
|
-
await workerSocket.invoke('stop');
|
|
240
|
-
while (await workerSocket.invoke('count') !== this.count)
|
|
241
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
242
|
-
await this.destroyCaptureWorker();
|
|
243
|
-
this.#started = false;
|
|
244
|
-
this.#operating = false;
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Pause capture packets
|
|
248
|
-
*/
|
|
249
|
-
async pause() {
|
|
250
|
-
if (!this.#started)
|
|
251
|
-
return;
|
|
252
|
-
if (!this.#hasWorker)
|
|
253
|
-
return;
|
|
254
|
-
if (this.#workerDestroying)
|
|
255
|
-
return;
|
|
256
|
-
await this.waitOperationDone();
|
|
257
|
-
this.#operating = true;
|
|
258
|
-
const workerSocket = await this.getWorkerSocket();
|
|
259
|
-
await workerSocket.invoke('stop');
|
|
260
|
-
while (await workerSocket.invoke('count') !== this.count)
|
|
261
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
262
|
-
this.#paused = true;
|
|
263
|
-
this.#operating = false;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Resume capture packets
|
|
267
|
-
*/
|
|
268
|
-
async resume() {
|
|
269
|
-
if (!this.#started)
|
|
270
|
-
return;
|
|
271
|
-
if (!this.#hasWorker)
|
|
272
|
-
return;
|
|
273
|
-
if (this.#workerDestroying)
|
|
274
|
-
return;
|
|
275
|
-
await this.waitOperationDone();
|
|
276
|
-
this.#operating = true;
|
|
277
|
-
const workerSocket = await this.getWorkerSocket();
|
|
278
|
-
await workerSocket.invoke('start');
|
|
279
|
-
this.#paused = false;
|
|
280
|
-
this.#operating = false;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Set capture filter
|
|
284
|
-
* @param filter
|
|
285
|
-
*/
|
|
286
|
-
async setFilter(filter) {
|
|
287
|
-
if (!this.#started)
|
|
288
|
-
return;
|
|
289
|
-
if (!this.#hasWorker)
|
|
290
|
-
return;
|
|
291
|
-
if (this.#workerDestroying)
|
|
292
|
-
return;
|
|
293
|
-
await this.waitOperationDone();
|
|
294
|
-
this.#operating = true;
|
|
295
|
-
const workerSocket = await this.getWorkerSocket();
|
|
296
|
-
await workerSocket.invoke('setFilter', filter);
|
|
297
|
-
this.#filter = filter;
|
|
298
|
-
this.#operating = false;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Save captured pcap to destination
|
|
302
|
-
* @param destination
|
|
303
|
-
*/
|
|
304
|
-
async saveTo(destination) {
|
|
305
|
-
await (0, promises_1.cp)(this.temporaryFilename, destination);
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Dispose capture
|
|
309
|
-
*/
|
|
310
|
-
async dispose() {
|
|
311
|
-
await this.stop();
|
|
312
|
-
await this.cleanResources();
|
|
313
|
-
}
|
|
314
|
-
on(eventName, listener) {
|
|
315
|
-
super.on(eventName, listener);
|
|
316
|
-
return this;
|
|
317
|
-
}
|
|
318
|
-
once(eventName, listener) {
|
|
319
|
-
super.once(eventName, listener);
|
|
320
|
-
return this;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
exports.Capture = Capture;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetNetworkInterfaces.d.ts","sourceRoot":"","sources":["../../../src/lib/nodepcap/GetNetworkInterfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAA;AAIhE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,EAAE,CAS1D"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GetNetworkInterfaces = GetNetworkInterfaces;
|
|
7
|
-
const GetNodePcapBinding_1 = require("./lib/GetNodePcapBinding");
|
|
8
|
-
const sort_array_1 = __importDefault(require("sort-array"));
|
|
9
|
-
/**
|
|
10
|
-
* Get network interfaces
|
|
11
|
-
* @constructor
|
|
12
|
-
*/
|
|
13
|
-
function GetNetworkInterfaces() {
|
|
14
|
-
const ifaces = (0, GetNodePcapBinding_1.GetNodePcapBinding)().GetNetworkInterfaces();
|
|
15
|
-
return (0, sort_array_1.default)(ifaces.map((iface) => ({
|
|
16
|
-
name: iface.name,
|
|
17
|
-
mac: iface.mac.toLowerCase()
|
|
18
|
-
})), {
|
|
19
|
-
by: 'name',
|
|
20
|
-
order: 'asc'
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'events';
|
|
2
|
-
import { IBindingCaptureOptions } from './IBindingCaptureOptions';
|
|
3
|
-
export interface IBindingCapture extends EventEmitter {
|
|
4
|
-
new (options: IBindingCaptureOptions): IBindingCapture;
|
|
5
|
-
start(): void;
|
|
6
|
-
stop(): void;
|
|
7
|
-
setFilter(filter: string): void;
|
|
8
|
-
send(packet: Buffer): void;
|
|
9
|
-
on(eventName: 'data', callback: (data: Buffer, sec: number, usec: number) => void): this;
|
|
10
|
-
on(eventName: string, listener: (...args: any[]) => void): this;
|
|
11
|
-
off(eventName: 'data', callback: (data: Buffer, sec: number, usec: number) => void): this;
|
|
12
|
-
off(eventName: string, listener: (...args: any[]) => void): this;
|
|
13
|
-
removeAllListeners(eventName?: 'data'): this;
|
|
14
|
-
removeAllListeners(eventName?: string): this;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=IBindingCapture.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBindingCapture.d.ts","sourceRoot":"","sources":["../../../../src/lib/nodepcap/interfaces/IBindingCapture.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAA;AAE/D,MAAM,WAAW,eAAgB,SAAQ,YAAY;IAEjD,KAAI,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAAA;IAErD,KAAK,IAAI,IAAI,CAAA;IAEb,IAAI,IAAI,IAAI,CAAA;IAEZ,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAE/B,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAE1B,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAA;IAExF,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;IAE/D,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAA;IAEzF,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;IAEhE,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5C,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBindingCaptureOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/nodepcap/interfaces/IBindingCaptureOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface ICaptureOptions {
|
|
2
|
-
/**
|
|
3
|
-
* Ethernet interface
|
|
4
|
-
*/
|
|
5
|
-
device: string;
|
|
6
|
-
/**
|
|
7
|
-
* Capture filter
|
|
8
|
-
*/
|
|
9
|
-
filter?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Custom capture worker module path
|
|
12
|
-
*/
|
|
13
|
-
workerModule?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The temporary folder path for storing captured pcap files
|
|
16
|
-
*/
|
|
17
|
-
tmpDir?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Temporary filename
|
|
20
|
-
*/
|
|
21
|
-
temporaryFilename?: string;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=ICaptureOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICaptureOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/nodepcap/interfaces/ICaptureOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,iBAAiB,CAAC,EAAC,MAAM,CAAA;CAC5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"INetworkInterface.d.ts","sourceRoot":"","sources":["../../../../src/lib/nodepcap/interfaces/INetworkInterface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IBindingCapture } from '../interfaces/IBindingCapture';
|
|
2
|
-
import { IBindingCaptureOptions } from '../interfaces/IBindingCaptureOptions';
|
|
3
|
-
declare const BindingCaptureClass: IBindingCapture;
|
|
4
|
-
export declare class BindingCapture extends BindingCaptureClass {
|
|
5
|
-
constructor(options: IBindingCaptureOptions);
|
|
6
|
-
start(): void;
|
|
7
|
-
stop(): void;
|
|
8
|
-
setFilter(filter: string): void;
|
|
9
|
-
send(packet: Buffer): void;
|
|
10
|
-
on(eventName: 'data', callback: (data: Buffer, sec: number, usec: number) => void): this;
|
|
11
|
-
off(eventName: 'data', callback: (data: Buffer, sec: number, usec: number) => void): this;
|
|
12
|
-
removeAllListeners(eventName?: 'data'): this;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=BindingCapture.d.ts.map
|