netkitty 0.0.35 → 1.1.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 +31 -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,292 +0,0 @@
|
|
|
1
|
-
/*-
|
|
2
|
-
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
|
|
3
|
-
* The Regents of the University of California. All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This code is derived from the Stanford/CMU enet packet filter,
|
|
6
|
-
* (net/enet.c) distributed as part of 4.3BSD, and code contributed
|
|
7
|
-
* to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
|
|
8
|
-
* Berkeley Laboratory.
|
|
9
|
-
*
|
|
10
|
-
* Redistribution and use in source and binary forms, with or without
|
|
11
|
-
* modification, are permitted provided that the following conditions
|
|
12
|
-
* are met:
|
|
13
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
14
|
-
* notice, this list of conditions and the following disclaimer.
|
|
15
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
16
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
17
|
-
* documentation and/or other materials provided with the distribution.
|
|
18
|
-
* 3. Neither the name of the University nor the names of its contributors
|
|
19
|
-
* may be used to endorse or promote products derived from this software
|
|
20
|
-
* without specific prior written permission.
|
|
21
|
-
*
|
|
22
|
-
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
23
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
24
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
25
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
26
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
27
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
28
|
-
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
29
|
-
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
30
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
31
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
32
|
-
* SUCH DAMAGE.
|
|
33
|
-
*
|
|
34
|
-
* @(#)bpf.h 7.1 (Berkeley) 5/7/91
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
/*
|
|
38
|
-
* This is libpcap's cut-down version of bpf.h; it includes only
|
|
39
|
-
* the stuff needed for the code generator and the userland BPF
|
|
40
|
-
* interpreter, and the libpcap APIs for setting filters, etc..
|
|
41
|
-
*
|
|
42
|
-
* "pcap-bpf.c" will include the native OS version, as it deals with
|
|
43
|
-
* the OS's BPF implementation.
|
|
44
|
-
*
|
|
45
|
-
* At least two programs found by Google Code Search explicitly includes
|
|
46
|
-
* <pcap/bpf.h> (even though <pcap.h>/<pcap/pcap.h> includes it for you),
|
|
47
|
-
* so moving that stuff to <pcap/pcap.h> would break the build for some
|
|
48
|
-
* programs.
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/*
|
|
52
|
-
* If we've already included <net/bpf.h>, don't re-define this stuff.
|
|
53
|
-
* We assume BSD-style multiple-include protection in <net/bpf.h>,
|
|
54
|
-
* which is true of all but the oldest versions of FreeBSD and NetBSD,
|
|
55
|
-
* or Tru64 UNIX-style multiple-include protection (or, at least,
|
|
56
|
-
* Tru64 UNIX 5.x-style; I don't have earlier versions available to check),
|
|
57
|
-
* or AIX-style multiple-include protection (or, at least, AIX 5.x-style;
|
|
58
|
-
* I don't have earlier versions available to check), or QNX-style
|
|
59
|
-
* multiple-include protection (as per GitHub pull request #394).
|
|
60
|
-
*
|
|
61
|
-
* We trust that they will define structures and macros and types in
|
|
62
|
-
* a fashion that's source-compatible and binary-compatible with our
|
|
63
|
-
* definitions.
|
|
64
|
-
*
|
|
65
|
-
* We do not check for BPF_MAJOR_VERSION, as that's defined by
|
|
66
|
-
* <linux/filter.h>, which is directly or indirectly included in some
|
|
67
|
-
* programs that also include pcap.h, and <linux/filter.h> doesn't
|
|
68
|
-
* define stuff we need. We *do* protect against <linux/filter.h>
|
|
69
|
-
* defining various macros for BPF code itself; <linux/filter.h> says
|
|
70
|
-
*
|
|
71
|
-
* Try and keep these values and structures similar to BSD, especially
|
|
72
|
-
* the BPF code definitions which need to match so you can share filters
|
|
73
|
-
*
|
|
74
|
-
* so we trust that it will define them in a fashion that's source-compatible
|
|
75
|
-
* and binary-compatible with our definitions.
|
|
76
|
-
*
|
|
77
|
-
* This also provides our own multiple-include protection.
|
|
78
|
-
*/
|
|
79
|
-
#if !defined(_NET_BPF_H_) && !defined(_NET_BPF_H_INCLUDED) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h)
|
|
80
|
-
#define lib_pcap_bpf_h
|
|
81
|
-
|
|
82
|
-
#include <pcap/funcattrs.h>
|
|
83
|
-
|
|
84
|
-
#include <pcap/dlt.h>
|
|
85
|
-
|
|
86
|
-
#ifdef __cplusplus
|
|
87
|
-
extern "C" {
|
|
88
|
-
#endif
|
|
89
|
-
|
|
90
|
-
/* BSD style release date */
|
|
91
|
-
#define BPF_RELEASE 199606
|
|
92
|
-
|
|
93
|
-
#ifdef MSDOS /* must be 32-bit */
|
|
94
|
-
typedef long bpf_int32;
|
|
95
|
-
typedef unsigned long bpf_u_int32;
|
|
96
|
-
#else
|
|
97
|
-
typedef int bpf_int32;
|
|
98
|
-
typedef u_int bpf_u_int32;
|
|
99
|
-
#endif
|
|
100
|
-
|
|
101
|
-
/*
|
|
102
|
-
* Alignment macros. BPF_WORDALIGN rounds up to the next
|
|
103
|
-
* even multiple of BPF_ALIGNMENT.
|
|
104
|
-
*
|
|
105
|
-
* Tcpdump's print-pflog.c uses this, so we define it here.
|
|
106
|
-
*/
|
|
107
|
-
#ifndef __NetBSD__
|
|
108
|
-
#define BPF_ALIGNMENT sizeof(bpf_int32)
|
|
109
|
-
#else
|
|
110
|
-
#define BPF_ALIGNMENT sizeof(long)
|
|
111
|
-
#endif
|
|
112
|
-
#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
|
|
113
|
-
|
|
114
|
-
/*
|
|
115
|
-
* Structure for "pcap_compile()", "pcap_setfilter()", etc..
|
|
116
|
-
*/
|
|
117
|
-
struct bpf_program {
|
|
118
|
-
u_int bf_len;
|
|
119
|
-
struct bpf_insn *bf_insns;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/*
|
|
123
|
-
* The instruction encodings.
|
|
124
|
-
*
|
|
125
|
-
* Please inform tcpdump-workers@lists.tcpdump.org if you use any
|
|
126
|
-
* of the reserved values, so that we can note that they're used
|
|
127
|
-
* (and perhaps implement it in the reference BPF implementation
|
|
128
|
-
* and encourage its implementation elsewhere).
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
/*
|
|
132
|
-
* The upper 8 bits of the opcode aren't used. BSD/OS used 0x8000.
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
/* instruction classes */
|
|
136
|
-
#define BPF_CLASS(code) ((code) & 0x07)
|
|
137
|
-
#define BPF_LD 0x00
|
|
138
|
-
#define BPF_LDX 0x01
|
|
139
|
-
#define BPF_ST 0x02
|
|
140
|
-
#define BPF_STX 0x03
|
|
141
|
-
#define BPF_ALU 0x04
|
|
142
|
-
#define BPF_JMP 0x05
|
|
143
|
-
#define BPF_RET 0x06
|
|
144
|
-
#define BPF_MISC 0x07
|
|
145
|
-
|
|
146
|
-
/* ld/ldx fields */
|
|
147
|
-
#define BPF_SIZE(code) ((code) & 0x18)
|
|
148
|
-
#define BPF_W 0x00
|
|
149
|
-
#define BPF_H 0x08
|
|
150
|
-
#define BPF_B 0x10
|
|
151
|
-
/* 0x18 reserved; used by BSD/OS */
|
|
152
|
-
#define BPF_MODE(code) ((code) & 0xe0)
|
|
153
|
-
#define BPF_IMM 0x00
|
|
154
|
-
#define BPF_ABS 0x20
|
|
155
|
-
#define BPF_IND 0x40
|
|
156
|
-
#define BPF_MEM 0x60
|
|
157
|
-
#define BPF_LEN 0x80
|
|
158
|
-
#define BPF_MSH 0xa0
|
|
159
|
-
/* 0xc0 reserved; used by BSD/OS */
|
|
160
|
-
/* 0xe0 reserved; used by BSD/OS */
|
|
161
|
-
|
|
162
|
-
/* alu/jmp fields */
|
|
163
|
-
#define BPF_OP(code) ((code) & 0xf0)
|
|
164
|
-
#define BPF_ADD 0x00
|
|
165
|
-
#define BPF_SUB 0x10
|
|
166
|
-
#define BPF_MUL 0x20
|
|
167
|
-
#define BPF_DIV 0x30
|
|
168
|
-
#define BPF_OR 0x40
|
|
169
|
-
#define BPF_AND 0x50
|
|
170
|
-
#define BPF_LSH 0x60
|
|
171
|
-
#define BPF_RSH 0x70
|
|
172
|
-
#define BPF_NEG 0x80
|
|
173
|
-
#define BPF_MOD 0x90
|
|
174
|
-
#define BPF_XOR 0xa0
|
|
175
|
-
/* 0xb0 reserved */
|
|
176
|
-
/* 0xc0 reserved */
|
|
177
|
-
/* 0xd0 reserved */
|
|
178
|
-
/* 0xe0 reserved */
|
|
179
|
-
/* 0xf0 reserved */
|
|
180
|
-
|
|
181
|
-
#define BPF_JA 0x00
|
|
182
|
-
#define BPF_JEQ 0x10
|
|
183
|
-
#define BPF_JGT 0x20
|
|
184
|
-
#define BPF_JGE 0x30
|
|
185
|
-
#define BPF_JSET 0x40
|
|
186
|
-
/* 0x50 reserved; used on BSD/OS */
|
|
187
|
-
/* 0x60 reserved */
|
|
188
|
-
/* 0x70 reserved */
|
|
189
|
-
/* 0x80 reserved */
|
|
190
|
-
/* 0x90 reserved */
|
|
191
|
-
/* 0xa0 reserved */
|
|
192
|
-
/* 0xb0 reserved */
|
|
193
|
-
/* 0xc0 reserved */
|
|
194
|
-
/* 0xd0 reserved */
|
|
195
|
-
/* 0xe0 reserved */
|
|
196
|
-
/* 0xf0 reserved */
|
|
197
|
-
#define BPF_SRC(code) ((code) & 0x08)
|
|
198
|
-
#define BPF_K 0x00
|
|
199
|
-
#define BPF_X 0x08
|
|
200
|
-
|
|
201
|
-
/* ret - BPF_K and BPF_X also apply */
|
|
202
|
-
#define BPF_RVAL(code) ((code) & 0x18)
|
|
203
|
-
#define BPF_A 0x10
|
|
204
|
-
/* 0x18 reserved */
|
|
205
|
-
|
|
206
|
-
/* misc */
|
|
207
|
-
#define BPF_MISCOP(code) ((code) & 0xf8)
|
|
208
|
-
#define BPF_TAX 0x00
|
|
209
|
-
/* 0x08 reserved */
|
|
210
|
-
/* 0x10 reserved */
|
|
211
|
-
/* 0x18 reserved */
|
|
212
|
-
/* #define BPF_COP 0x20 NetBSD "coprocessor" extensions */
|
|
213
|
-
/* 0x28 reserved */
|
|
214
|
-
/* 0x30 reserved */
|
|
215
|
-
/* 0x38 reserved */
|
|
216
|
-
/* #define BPF_COPX 0x40 NetBSD "coprocessor" extensions */
|
|
217
|
-
/* also used on BSD/OS */
|
|
218
|
-
/* 0x48 reserved */
|
|
219
|
-
/* 0x50 reserved */
|
|
220
|
-
/* 0x58 reserved */
|
|
221
|
-
/* 0x60 reserved */
|
|
222
|
-
/* 0x68 reserved */
|
|
223
|
-
/* 0x70 reserved */
|
|
224
|
-
/* 0x78 reserved */
|
|
225
|
-
#define BPF_TXA 0x80
|
|
226
|
-
/* 0x88 reserved */
|
|
227
|
-
/* 0x90 reserved */
|
|
228
|
-
/* 0x98 reserved */
|
|
229
|
-
/* 0xa0 reserved */
|
|
230
|
-
/* 0xa8 reserved */
|
|
231
|
-
/* 0xb0 reserved */
|
|
232
|
-
/* 0xb8 reserved */
|
|
233
|
-
/* 0xc0 reserved; used on BSD/OS */
|
|
234
|
-
/* 0xc8 reserved */
|
|
235
|
-
/* 0xd0 reserved */
|
|
236
|
-
/* 0xd8 reserved */
|
|
237
|
-
/* 0xe0 reserved */
|
|
238
|
-
/* 0xe8 reserved */
|
|
239
|
-
/* 0xf0 reserved */
|
|
240
|
-
/* 0xf8 reserved */
|
|
241
|
-
|
|
242
|
-
/*
|
|
243
|
-
* The instruction data structure.
|
|
244
|
-
*/
|
|
245
|
-
struct bpf_insn {
|
|
246
|
-
u_short code;
|
|
247
|
-
u_char jt;
|
|
248
|
-
u_char jf;
|
|
249
|
-
bpf_u_int32 k;
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
/*
|
|
253
|
-
* Macros for insn array initializers.
|
|
254
|
-
*
|
|
255
|
-
* In case somebody's included <linux/filter.h>, or something else that
|
|
256
|
-
* gives the kernel's definitions of BPF statements, get rid of its
|
|
257
|
-
* definitions, so we can supply ours instead. If some kernel's
|
|
258
|
-
* definitions aren't *binary-compatible* with what BPF has had
|
|
259
|
-
* since it first sprung from the brows of Van Jacobson and Steve
|
|
260
|
-
* McCanne, that kernel should be fixed.
|
|
261
|
-
*/
|
|
262
|
-
#ifdef BPF_STMT
|
|
263
|
-
#undef BPF_STMT
|
|
264
|
-
#endif
|
|
265
|
-
#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
|
|
266
|
-
#ifdef BPF_JUMP
|
|
267
|
-
#undef BPF_JUMP
|
|
268
|
-
#endif
|
|
269
|
-
#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
|
|
270
|
-
|
|
271
|
-
PCAP_AVAILABLE_0_4
|
|
272
|
-
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
|
|
273
|
-
|
|
274
|
-
PCAP_AVAILABLE_0_6
|
|
275
|
-
PCAP_API int bpf_validate(const struct bpf_insn *f, int len);
|
|
276
|
-
|
|
277
|
-
PCAP_AVAILABLE_0_4
|
|
278
|
-
PCAP_API char *bpf_image(const struct bpf_insn *, int);
|
|
279
|
-
|
|
280
|
-
PCAP_AVAILABLE_0_6
|
|
281
|
-
PCAP_API void bpf_dump(const struct bpf_program *, int);
|
|
282
|
-
|
|
283
|
-
/*
|
|
284
|
-
* Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
|
|
285
|
-
*/
|
|
286
|
-
#define BPF_MEMWORDS 16
|
|
287
|
-
|
|
288
|
-
#ifdef __cplusplus
|
|
289
|
-
}
|
|
290
|
-
#endif
|
|
291
|
-
|
|
292
|
-
#endif /* !defined(_NET_BPF_H_) && !defined(_BPF_H_) && !defined(_H_BPF) && !defined(lib_pcap_bpf_h) */
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*-
|
|
2
|
-
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
|
|
3
|
-
* The Regents of the University of California. All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This code is derived from the Stanford/CMU enet packet filter,
|
|
6
|
-
* (net/enet.c) distributed as part of 4.3BSD, and code contributed
|
|
7
|
-
* to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
|
|
8
|
-
* Berkeley Laboratory.
|
|
9
|
-
*
|
|
10
|
-
* Redistribution and use in source and binary forms, with or without
|
|
11
|
-
* modification, are permitted provided that the following conditions
|
|
12
|
-
* are met:
|
|
13
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
14
|
-
* notice, this list of conditions and the following disclaimer.
|
|
15
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
16
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
17
|
-
* documentation and/or other materials provided with the distribution.
|
|
18
|
-
* 3. All advertising materials mentioning features or use of this software
|
|
19
|
-
* must display the following acknowledgement:
|
|
20
|
-
* This product includes software developed by the University of
|
|
21
|
-
* California, Berkeley and its contributors.
|
|
22
|
-
* 4. Neither the name of the University nor the names of its contributors
|
|
23
|
-
* may be used to endorse or promote products derived from this software
|
|
24
|
-
* without specific prior written permission.
|
|
25
|
-
*
|
|
26
|
-
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
27
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
28
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
29
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
30
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
31
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
32
|
-
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
33
|
-
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
34
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
35
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
36
|
-
* SUCH DAMAGE.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
#ifndef lib_pcap_can_socketcan_h
|
|
40
|
-
#define lib_pcap_can_socketcan_h
|
|
41
|
-
|
|
42
|
-
#include <pcap/pcap-inttypes.h>
|
|
43
|
-
|
|
44
|
-
/*
|
|
45
|
-
* SocketCAN header, as per Documentation/networking/can.txt in the
|
|
46
|
-
* Linux source.
|
|
47
|
-
*/
|
|
48
|
-
typedef struct {
|
|
49
|
-
uint32_t can_id;
|
|
50
|
-
uint8_t payload_length;
|
|
51
|
-
uint8_t pad;
|
|
52
|
-
uint8_t reserved1;
|
|
53
|
-
uint8_t reserved2;
|
|
54
|
-
} pcap_can_socketcan_hdr;
|
|
55
|
-
|
|
56
|
-
#endif
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 1993, 1994, 1995, 1996, 1997
|
|
4
|
-
* The Regents of the University of California. All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* Redistribution and use in source and binary forms, with or without
|
|
7
|
-
* modification, are permitted provided that the following conditions
|
|
8
|
-
* are met:
|
|
9
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
10
|
-
* notice, this list of conditions and the following disclaimer.
|
|
11
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
12
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
13
|
-
* documentation and/or other materials provided with the distribution.
|
|
14
|
-
* 3. All advertising materials mentioning features or use of this software
|
|
15
|
-
* must display the following acknowledgement:
|
|
16
|
-
* This product includes software developed by the Computer Systems
|
|
17
|
-
* Engineering Group at Lawrence Berkeley Laboratory.
|
|
18
|
-
* 4. Neither the name of the University nor of the Laboratory may be used
|
|
19
|
-
* to endorse or promote products derived from this software without
|
|
20
|
-
* specific prior written permission.
|
|
21
|
-
*
|
|
22
|
-
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
23
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
24
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
25
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
26
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
27
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
28
|
-
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
29
|
-
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
30
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
31
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
32
|
-
* SUCH DAMAGE.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
#ifndef lib_pcap_compiler_tests_h
|
|
36
|
-
#define lib_pcap_compiler_tests_h
|
|
37
|
-
|
|
38
|
-
/*
|
|
39
|
-
* This was introduced by Clang:
|
|
40
|
-
*
|
|
41
|
-
* https://clang.llvm.org/docs/LanguageExtensions.html#has-attribute
|
|
42
|
-
*
|
|
43
|
-
* in some version (which version?); it has been picked up by GCC 5.0.
|
|
44
|
-
*/
|
|
45
|
-
#ifndef __has_attribute
|
|
46
|
-
/*
|
|
47
|
-
* It's a macro, so you can check whether it's defined to check
|
|
48
|
-
* whether it's supported.
|
|
49
|
-
*
|
|
50
|
-
* If it's not, define it to always return 0, so that we move on to
|
|
51
|
-
* the fallback checks.
|
|
52
|
-
*/
|
|
53
|
-
#define __has_attribute(x) 0
|
|
54
|
-
#endif
|
|
55
|
-
|
|
56
|
-
/*
|
|
57
|
-
* Note that the C90 spec's "6.8.1 Conditional inclusion" and the
|
|
58
|
-
* C99 spec's and C11 spec's "6.10.1 Conditional inclusion" say:
|
|
59
|
-
*
|
|
60
|
-
* Prior to evaluation, macro invocations in the list of preprocessing
|
|
61
|
-
* tokens that will become the controlling constant expression are
|
|
62
|
-
* replaced (except for those macro names modified by the defined unary
|
|
63
|
-
* operator), just as in normal text. If the token "defined" is
|
|
64
|
-
* generated as a result of this replacement process or use of the
|
|
65
|
-
* "defined" unary operator does not match one of the two specified
|
|
66
|
-
* forms prior to macro replacement, the behavior is undefined.
|
|
67
|
-
*
|
|
68
|
-
* so you shouldn't use defined() in a #define that's used in #if or
|
|
69
|
-
* #elif. Some versions of Clang, for example, will warn about this.
|
|
70
|
-
*
|
|
71
|
-
* Instead, we check whether the pre-defined macros for particular
|
|
72
|
-
* compilers are defined and, if not, define the "is this version XXX
|
|
73
|
-
* or a later version of this compiler" macros as 0.
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
/*
|
|
77
|
-
* Check whether this is GCC major.minor or a later release, or some
|
|
78
|
-
* compiler that claims to be "just like GCC" of that version or a
|
|
79
|
-
* later release.
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
#if ! defined(__GNUC__)
|
|
83
|
-
#define PCAP_IS_AT_LEAST_GNUC_VERSION(major, minor) 0
|
|
84
|
-
#else
|
|
85
|
-
#define PCAP_IS_AT_LEAST_GNUC_VERSION(major, minor) \
|
|
86
|
-
(__GNUC__ > (major) || \
|
|
87
|
-
(__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
|
|
88
|
-
#endif
|
|
89
|
-
|
|
90
|
-
/*
|
|
91
|
-
* Check whether this is Clang major.minor or a later release.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
#if !defined(__clang__)
|
|
95
|
-
#define PCAP_IS_AT_LEAST_CLANG_VERSION(major, minor) 0
|
|
96
|
-
#else
|
|
97
|
-
#define PCAP_IS_AT_LEAST_CLANG_VERSION(major, minor) \
|
|
98
|
-
(__clang_major__ > (major) || \
|
|
99
|
-
(__clang_major__ == (major) && __clang_minor__ >= (minor)))
|
|
100
|
-
#endif
|
|
101
|
-
|
|
102
|
-
/*
|
|
103
|
-
* Check whether this is Sun C/SunPro C/Oracle Studio major.minor
|
|
104
|
-
* or a later release.
|
|
105
|
-
*
|
|
106
|
-
* The version number in __SUNPRO_C is encoded in hex BCD, with the
|
|
107
|
-
* uppermost hex digit being the major version number, the next
|
|
108
|
-
* one or two hex digits being the minor version number, and
|
|
109
|
-
* the last digit being the patch version.
|
|
110
|
-
*
|
|
111
|
-
* It represents the *compiler* version, not the product version;
|
|
112
|
-
* see
|
|
113
|
-
*
|
|
114
|
-
* https://sourceforge.net/p/predef/wiki/Compilers/
|
|
115
|
-
*
|
|
116
|
-
* for a partial mapping, which we assume continues for later
|
|
117
|
-
* 12.x product releases.
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
#if ! defined(__SUNPRO_C)
|
|
121
|
-
#define PCAP_IS_AT_LEAST_SUNC_VERSION(major,minor) 0
|
|
122
|
-
#else
|
|
123
|
-
#define PCAP_SUNPRO_VERSION_TO_BCD(major, minor) \
|
|
124
|
-
(((minor) >= 10) ? \
|
|
125
|
-
(((major) << 12) | (((minor)/10) << 8) | (((minor)%10) << 4)) : \
|
|
126
|
-
(((major) << 8) | ((minor) << 4)))
|
|
127
|
-
#define PCAP_IS_AT_LEAST_SUNC_VERSION(major,minor) \
|
|
128
|
-
(__SUNPRO_C >= PCAP_SUNPRO_VERSION_TO_BCD((major), (minor)))
|
|
129
|
-
#endif
|
|
130
|
-
|
|
131
|
-
/*
|
|
132
|
-
* Check whether this is IBM XL C major.minor or a later release.
|
|
133
|
-
*
|
|
134
|
-
* The version number in __xlC__ has the major version in the
|
|
135
|
-
* upper 8 bits and the minor version in the lower 8 bits.
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
#if ! defined(__xlC__)
|
|
139
|
-
#define PCAP_IS_AT_LEAST_XL_C_VERSION(major,minor) 0
|
|
140
|
-
#else
|
|
141
|
-
#define PCAP_IS_AT_LEAST_XL_C_VERSION(major, minor) \
|
|
142
|
-
(__xlC__ >= (((major) << 8) | (minor)))
|
|
143
|
-
#endif
|
|
144
|
-
|
|
145
|
-
/*
|
|
146
|
-
* Check whether this is HP aC++/HP C major.minor or a later release.
|
|
147
|
-
*
|
|
148
|
-
* The version number in __HP_aCC is encoded in zero-padded decimal BCD,
|
|
149
|
-
* with the "A." stripped off, the uppermost two decimal digits being
|
|
150
|
-
* the major version number, the next two decimal digits being the minor
|
|
151
|
-
* version number, and the last two decimal digits being the patch version.
|
|
152
|
-
* (Strip off the A., remove the . between the major and minor version
|
|
153
|
-
* number, and add two digits of patch.)
|
|
154
|
-
*/
|
|
155
|
-
|
|
156
|
-
#if ! defined(__HP_aCC)
|
|
157
|
-
#define PCAP_IS_AT_LEAST_HP_C_VERSION(major,minor) 0
|
|
158
|
-
#else
|
|
159
|
-
#define PCAP_IS_AT_LEAST_HP_C_VERSION(major,minor) \
|
|
160
|
-
(__HP_aCC >= ((major)*10000 + (minor)*100))
|
|
161
|
-
#endif
|
|
162
|
-
|
|
163
|
-
#endif /* lib_pcap_compiler_tests_h */
|