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,325 +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_funcattrs_h
|
|
36
|
-
#define lib_pcap_funcattrs_h
|
|
37
|
-
|
|
38
|
-
#include <pcap/compiler-tests.h>
|
|
39
|
-
|
|
40
|
-
/*
|
|
41
|
-
* Attributes to apply to functions and their arguments, using various
|
|
42
|
-
* compiler-specific extensions.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/*
|
|
46
|
-
* PCAP_API_DEF must be used when defining *data* exported from
|
|
47
|
-
* libpcap. It can be used when defining *functions* exported
|
|
48
|
-
* from libpcap, but it doesn't have to be used there. It
|
|
49
|
-
* should not be used in declarations in headers.
|
|
50
|
-
*
|
|
51
|
-
* PCAP_API must be used when *declaring* data or functions
|
|
52
|
-
* exported from libpcap; PCAP_API_DEF won't work on all platforms.
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
#if defined(_WIN32)
|
|
56
|
-
/*
|
|
57
|
-
* For Windows:
|
|
58
|
-
*
|
|
59
|
-
* when building libpcap:
|
|
60
|
-
*
|
|
61
|
-
* if we're building it as a DLL, we have to declare API
|
|
62
|
-
* functions with __declspec(dllexport);
|
|
63
|
-
*
|
|
64
|
-
* if we're building it as a static library, we don't want
|
|
65
|
-
* to do so.
|
|
66
|
-
*
|
|
67
|
-
* when using libpcap:
|
|
68
|
-
*
|
|
69
|
-
* if we're using the DLL, calls to its functions are a
|
|
70
|
-
* little more efficient if they're declared with
|
|
71
|
-
* __declspec(dllimport);
|
|
72
|
-
*
|
|
73
|
-
* if we're not using the dll, we don't want to declare
|
|
74
|
-
* them that way.
|
|
75
|
-
*
|
|
76
|
-
* So:
|
|
77
|
-
*
|
|
78
|
-
* if pcap_EXPORTS is defined, we define PCAP_API_DEF as
|
|
79
|
-
* __declspec(dllexport);
|
|
80
|
-
*
|
|
81
|
-
* if PCAP_DLL is defined, we define PCAP_API_DEF as
|
|
82
|
-
* __declspec(dllimport);
|
|
83
|
-
*
|
|
84
|
-
* otherwise, we define PCAP_API_DEF as nothing.
|
|
85
|
-
*/
|
|
86
|
-
#if defined(pcap_EXPORTS)
|
|
87
|
-
/*
|
|
88
|
-
* We're compiling libpcap as a DLL, so we should export functions
|
|
89
|
-
* in our API.
|
|
90
|
-
*/
|
|
91
|
-
#define PCAP_API_DEF __declspec(dllexport)
|
|
92
|
-
#elif defined(PCAP_DLL)
|
|
93
|
-
/*
|
|
94
|
-
* We're using libpcap as a DLL, so the calls will be a little more
|
|
95
|
-
* efficient if we explicitly import the functions.
|
|
96
|
-
*/
|
|
97
|
-
#define PCAP_API_DEF __declspec(dllimport)
|
|
98
|
-
#else
|
|
99
|
-
/*
|
|
100
|
-
* Either we're building libpcap as a static library, or we're using
|
|
101
|
-
* it as a static library, or we don't know for certain that we're
|
|
102
|
-
* using it as a dynamic library, so neither import nor export the
|
|
103
|
-
* functions explicitly.
|
|
104
|
-
*/
|
|
105
|
-
#define PCAP_API_DEF
|
|
106
|
-
#endif
|
|
107
|
-
#elif defined(MSDOS)
|
|
108
|
-
/* XXX - does this need special treatment? */
|
|
109
|
-
#define PCAP_API_DEF
|
|
110
|
-
#else /* UN*X */
|
|
111
|
-
#ifdef pcap_EXPORTS
|
|
112
|
-
/*
|
|
113
|
-
* We're compiling libpcap as a (dynamic) shared library, so we should
|
|
114
|
-
* export functions in our API. The compiler might be configured not
|
|
115
|
-
* to export functions from a shared library by default, so we might
|
|
116
|
-
* have to explicitly mark functions as exported.
|
|
117
|
-
*/
|
|
118
|
-
#if PCAP_IS_AT_LEAST_GNUC_VERSION(3,4) \
|
|
119
|
-
|| PCAP_IS_AT_LEAST_XL_C_VERSION(12,0)
|
|
120
|
-
/*
|
|
121
|
-
* GCC 3.4 or later, or some compiler asserting compatibility with
|
|
122
|
-
* GCC 3.4 or later, or XL C 13.0 or later, so we have
|
|
123
|
-
* __attribute__((visibility()).
|
|
124
|
-
*/
|
|
125
|
-
#define PCAP_API_DEF __attribute__((visibility("default")))
|
|
126
|
-
#elif PCAP_IS_AT_LEAST_SUNC_VERSION(5,5)
|
|
127
|
-
/*
|
|
128
|
-
* Sun C 5.5 or later, so we have __global.
|
|
129
|
-
* (Sun C 5.9 and later also have __attribute__((visibility()),
|
|
130
|
-
* but there's no reason to prefer it with Sun C.)
|
|
131
|
-
*/
|
|
132
|
-
#define PCAP_API_DEF __global
|
|
133
|
-
#else
|
|
134
|
-
/*
|
|
135
|
-
* We don't have anything to say.
|
|
136
|
-
*/
|
|
137
|
-
#define PCAP_API_DEF
|
|
138
|
-
#endif
|
|
139
|
-
#else
|
|
140
|
-
/*
|
|
141
|
-
* We're not building libpcap.
|
|
142
|
-
*/
|
|
143
|
-
#define PCAP_API_DEF
|
|
144
|
-
#endif
|
|
145
|
-
#endif /* _WIN32/MSDOS/UN*X */
|
|
146
|
-
|
|
147
|
-
#define PCAP_API PCAP_API_DEF extern
|
|
148
|
-
|
|
149
|
-
/*
|
|
150
|
-
* Definitions to 1) indicate what version of libpcap first had a given
|
|
151
|
-
* API and 2) allow upstream providers whose build environments allow
|
|
152
|
-
* APIs to be designated as "first available in this release" to do so
|
|
153
|
-
* by appropriately defining them.
|
|
154
|
-
*
|
|
155
|
-
* Yes, that's you, Apple. :-) Please define PCAP_AVAILABLE_MACOS()
|
|
156
|
-
* as necessary to make various APIs "weak exports" to make it easier
|
|
157
|
-
* for software that's distributed in binary form and that uses libpcap
|
|
158
|
-
* to run on multiple macOS versions and use new APIs when available.
|
|
159
|
-
* (Yes, such third-party software exists - Wireshark provides binary
|
|
160
|
-
* packages for macOS, for example. tcpdump doesn't count, as that's
|
|
161
|
-
* provided by Apple, so each release can come with a version compiled
|
|
162
|
-
* to use the APIs present in that release.)
|
|
163
|
-
*
|
|
164
|
-
* We don't define it ourselves because, if you're building and
|
|
165
|
-
* installing libpcap on macOS yourself, the APIs will be available
|
|
166
|
-
* no matter what OS version you're installing it on.
|
|
167
|
-
*
|
|
168
|
-
* For other platforms, we don't define them, leaving it up to
|
|
169
|
-
* others to do so based on their OS versions, if appropriate.
|
|
170
|
-
*
|
|
171
|
-
* We start with libpcap 0.4, as that was the last LBL release, and
|
|
172
|
-
* I've never seen earlier releases.
|
|
173
|
-
*/
|
|
174
|
-
#ifdef __APPLE__
|
|
175
|
-
#define PCAP_AVAILABLE_MACOS(v) /* define to say "first appears in v" */
|
|
176
|
-
#define PCAP_AVAILABLE_0_4 PCAP_AVAILABLE_MACOS(10.0) /* Did any version of Mac OS X ship with this? */
|
|
177
|
-
#define PCAP_AVAILABLE_0_5 PCAP_AVAILABLE_MACOS(10.0) /* Did any version of Mac OS X ship with this? */
|
|
178
|
-
#define PCAP_AVAILABLE_0_6 PCAP_AVAILABLE_MACOS(10.1)
|
|
179
|
-
#define PCAP_AVAILABLE_0_7 PCAP_AVAILABLE_MACOS(10.4)
|
|
180
|
-
#define PCAP_AVAILABLE_0_8 PCAP_AVAILABLE_MACOS(10.4)
|
|
181
|
-
#define PCAP_AVAILABLE_0_9 PCAP_AVAILABLE_MACOS(10.5)
|
|
182
|
-
#define PCAP_AVAILABLE_1_0 PCAP_AVAILABLE_MACOS(10.6)
|
|
183
|
-
/* #define PCAP_AVAILABLE_1_1 no routines added to the API */
|
|
184
|
-
#define PCAP_AVAILABLE_1_2 PCAP_AVAILABLE_MACOS(10.9)
|
|
185
|
-
/* #define PCAP_AVAILABLE_1_3 no routines added to the API */
|
|
186
|
-
/* #define PCAP_AVAILABLE_1_4 no routines added to the API */
|
|
187
|
-
#define PCAP_AVAILABLE_1_5 PCAP_AVAILABLE_MACOS(10.10)
|
|
188
|
-
/* #define PCAP_AVAILABLE_1_6 no routines added to the API */
|
|
189
|
-
#define PCAP_AVAILABLE_1_7 PCAP_AVAILABLE_MACOS(10.12)
|
|
190
|
-
#define PCAP_AVAILABLE_1_8 PCAP_AVAILABLE_MACOS(10.13) /* only Windows adds routines to the API; XXX - what version first had it? */
|
|
191
|
-
#define PCAP_AVAILABLE_1_9 PCAP_AVAILABLE_MACOS(10.13)
|
|
192
|
-
#define PCAP_AVAILABLE_1_10 /* not in macOS yet */
|
|
193
|
-
#define PCAP_AVAILABLE_1_11 /* not released yet, so not in macOS yet */
|
|
194
|
-
#else /* __APPLE__ */
|
|
195
|
-
#define PCAP_AVAILABLE_0_4
|
|
196
|
-
#define PCAP_AVAILABLE_0_5
|
|
197
|
-
#define PCAP_AVAILABLE_0_6
|
|
198
|
-
#define PCAP_AVAILABLE_0_7
|
|
199
|
-
#define PCAP_AVAILABLE_0_8
|
|
200
|
-
#define PCAP_AVAILABLE_0_9
|
|
201
|
-
#define PCAP_AVAILABLE_1_0
|
|
202
|
-
/* #define PCAP_AVAILABLE_1_1 no routines added to the API */
|
|
203
|
-
#define PCAP_AVAILABLE_1_2
|
|
204
|
-
/* #define PCAP_AVAILABLE_1_3 no routines added to the API */
|
|
205
|
-
/* #define PCAP_AVAILABLE_1_4 no routines added to the API */
|
|
206
|
-
#define PCAP_AVAILABLE_1_5
|
|
207
|
-
/* #define PCAP_AVAILABLE_1_6 no routines added to the API */
|
|
208
|
-
#define PCAP_AVAILABLE_1_7
|
|
209
|
-
#define PCAP_AVAILABLE_1_8
|
|
210
|
-
#define PCAP_AVAILABLE_1_9
|
|
211
|
-
#define PCAP_AVAILABLE_1_10
|
|
212
|
-
#define PCAP_AVAILABLE_1_11
|
|
213
|
-
#endif /* __APPLE__ */
|
|
214
|
-
|
|
215
|
-
/*
|
|
216
|
-
* PCAP_NORETURN, before a function declaration, means "this function
|
|
217
|
-
* never returns". (It must go before the function declaration, e.g.
|
|
218
|
-
* "extern PCAP_NORETURN func(...)" rather than after the function
|
|
219
|
-
* declaration, as the MSVC version has to go before the declaration.)
|
|
220
|
-
*
|
|
221
|
-
* PCAP_NORETURN_DEF, before a function *definition*, means "this
|
|
222
|
-
* function never returns"; it would be used only for static functions
|
|
223
|
-
* that are defined before any use, and thus have no declaration.
|
|
224
|
-
* (MSVC doesn't support that; I guess the "decl" in "__declspec"
|
|
225
|
-
* means "declaration", and __declspec doesn't work with definitions.)
|
|
226
|
-
*/
|
|
227
|
-
#if __has_attribute(noreturn) \
|
|
228
|
-
|| PCAP_IS_AT_LEAST_GNUC_VERSION(2,5) \
|
|
229
|
-
|| PCAP_IS_AT_LEAST_SUNC_VERSION(5,9) \
|
|
230
|
-
|| PCAP_IS_AT_LEAST_XL_C_VERSION(10,1) \
|
|
231
|
-
|| PCAP_IS_AT_LEAST_HP_C_VERSION(6,10)
|
|
232
|
-
/*
|
|
233
|
-
* Compiler with support for __attribute((noreturn)), or GCC 2.5 or
|
|
234
|
-
* later, or some compiler asserting compatibility with GCC 2.5 or
|
|
235
|
-
* later, or Solaris Studio 12 (Sun C 5.9) or later, or IBM XL C 10.1
|
|
236
|
-
* or later (do any earlier versions of XL C support this?), or HP aCC
|
|
237
|
-
* A.06.10 or later.
|
|
238
|
-
*/
|
|
239
|
-
#define PCAP_NORETURN __attribute((noreturn))
|
|
240
|
-
#define PCAP_NORETURN_DEF __attribute((noreturn))
|
|
241
|
-
#elif defined(_MSC_VER)
|
|
242
|
-
/*
|
|
243
|
-
* MSVC.
|
|
244
|
-
*/
|
|
245
|
-
#define PCAP_NORETURN __declspec(noreturn)
|
|
246
|
-
#define PCAP_NORETURN_DEF
|
|
247
|
-
#else
|
|
248
|
-
#define PCAP_NORETURN
|
|
249
|
-
#define PCAP_NORETURN_DEF
|
|
250
|
-
#endif
|
|
251
|
-
|
|
252
|
-
/*
|
|
253
|
-
* PCAP_PRINTFLIKE(x,y), after a function declaration, means "this function
|
|
254
|
-
* does printf-style formatting, with the xth argument being the format
|
|
255
|
-
* string and the yth argument being the first argument for the format
|
|
256
|
-
* string".
|
|
257
|
-
*/
|
|
258
|
-
#if __has_attribute(__format__) \
|
|
259
|
-
|| PCAP_IS_AT_LEAST_GNUC_VERSION(2,3) \
|
|
260
|
-
|| PCAP_IS_AT_LEAST_XL_C_VERSION(10,1) \
|
|
261
|
-
|| PCAP_IS_AT_LEAST_HP_C_VERSION(6,10)
|
|
262
|
-
/*
|
|
263
|
-
* Compiler with support for it, or GCC 2.3 or later, or some compiler
|
|
264
|
-
* asserting compatibility with GCC 2.3 or later, or IBM XL C 10.1
|
|
265
|
-
* and later (do any earlier versions of XL C support this?),
|
|
266
|
-
* or HP aCC A.06.10 and later.
|
|
267
|
-
*/
|
|
268
|
-
#define PCAP_PRINTFLIKE(x,y) __attribute__((__format__(__printf__,x,y)))
|
|
269
|
-
#else
|
|
270
|
-
#define PCAP_PRINTFLIKE(x,y)
|
|
271
|
-
#endif
|
|
272
|
-
|
|
273
|
-
/*
|
|
274
|
-
* PCAP_DEPRECATED(func, msg), after a function declaration, marks the
|
|
275
|
-
* function as deprecated.
|
|
276
|
-
*
|
|
277
|
-
* The first argument is the name of the function; the second argument is
|
|
278
|
-
* a string giving the warning message to use if the compiler supports that.
|
|
279
|
-
*
|
|
280
|
-
* (Thank you, Microsoft, for requiring the function name.)
|
|
281
|
-
*/
|
|
282
|
-
#if __has_attribute(deprecated) \
|
|
283
|
-
|| PCAP_IS_AT_LEAST_GNUC_VERSION(4,5) \
|
|
284
|
-
|| PCAP_IS_AT_LEAST_SUNC_VERSION(5,13)
|
|
285
|
-
/*
|
|
286
|
-
* Compiler that supports __has_attribute and __attribute__((deprecated)),
|
|
287
|
-
* or GCC 4.5 or later, or Sun/Oracle C 12.4 (Sun C 5.13) or later.
|
|
288
|
-
*
|
|
289
|
-
* Those support __attribute__((deprecated(msg))) (we assume, perhaps
|
|
290
|
-
* incorrectly, that anything that supports __has_attribute() is
|
|
291
|
-
* recent enough to support __attribute__((deprecated(msg)))).
|
|
292
|
-
*/
|
|
293
|
-
#define PCAP_DEPRECATED(func, msg) __attribute__((deprecated(msg)))
|
|
294
|
-
#elif PCAP_IS_AT_LEAST_GNUC_VERSION(3,1)
|
|
295
|
-
/*
|
|
296
|
-
* GCC 3.1 through 4.4.
|
|
297
|
-
*
|
|
298
|
-
* Those support __attribute__((deprecated)) but not
|
|
299
|
-
* __attribute__((deprecated(msg))).
|
|
300
|
-
*/
|
|
301
|
-
#define PCAP_DEPRECATED(func, msg) __attribute__((deprecated))
|
|
302
|
-
#elif defined(_MSC_VER) && !defined(BUILDING_PCAP)
|
|
303
|
-
/*
|
|
304
|
-
* MSVC, and we're not building libpcap itself; it's VS 2015
|
|
305
|
-
* or later, so we have the deprecated pragma.
|
|
306
|
-
*
|
|
307
|
-
* If we *are* building libpcap, we don't want this, as it'll warn
|
|
308
|
-
* us even if we *define* the function.
|
|
309
|
-
*/
|
|
310
|
-
#define PCAP_DEPRECATED(func, msg) __pragma(deprecated(func))
|
|
311
|
-
#else
|
|
312
|
-
#define PCAP_DEPRECATED(func, msg)
|
|
313
|
-
#endif
|
|
314
|
-
|
|
315
|
-
/*
|
|
316
|
-
* For flagging arguments as format strings in MSVC.
|
|
317
|
-
*/
|
|
318
|
-
#ifdef _MSC_VER
|
|
319
|
-
#include <sal.h>
|
|
320
|
-
#define PCAP_FORMAT_STRING(p) _Printf_format_string_ p
|
|
321
|
-
#else
|
|
322
|
-
#define PCAP_FORMAT_STRING(p) p
|
|
323
|
-
#endif
|
|
324
|
-
|
|
325
|
-
#endif /* lib_pcap_funcattrs_h */
|
|
@@ -1,43 +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
|
-
#define IPH_AF_INET 2 /* Matches Solaris's AF_INET */
|
|
40
|
-
#define IPH_AF_INET6 26 /* Matches Solaris's AF_INET6 */
|
|
41
|
-
|
|
42
|
-
#define IPNET_OUTBOUND 1
|
|
43
|
-
#define IPNET_INBOUND 2
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 1994, 1996
|
|
3
|
-
* The Regents of the University of California. All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
|
6
|
-
* modification, are permitted provided that the following conditions
|
|
7
|
-
* are met:
|
|
8
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
9
|
-
* notice, this list of conditions and the following disclaimer.
|
|
10
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
* 3. All advertising materials mentioning features or use of this software
|
|
14
|
-
* must display the following acknowledgement:
|
|
15
|
-
* This product includes software developed by the Computer Systems
|
|
16
|
-
* Engineering Group at Lawrence Berkeley Laboratory.
|
|
17
|
-
* 4. Neither the name of the University nor of the Laboratory may be used
|
|
18
|
-
* to endorse or promote products derived from this software without
|
|
19
|
-
* specific prior written permission.
|
|
20
|
-
*
|
|
21
|
-
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
22
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
23
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
24
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
25
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
26
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
27
|
-
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
28
|
-
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
29
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
30
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
31
|
-
* SUCH DAMAGE.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
#ifndef lib_pcap_namedb_h
|
|
35
|
-
#define lib_pcap_namedb_h
|
|
36
|
-
|
|
37
|
-
#ifdef __cplusplus
|
|
38
|
-
extern "C" {
|
|
39
|
-
#endif
|
|
40
|
-
|
|
41
|
-
/*
|
|
42
|
-
* As returned by the pcap_next_etherent()
|
|
43
|
-
* XXX this stuff doesn't belong in this interface, but this
|
|
44
|
-
* library already must do name to address translation, so
|
|
45
|
-
* on systems that don't have support for /etc/ethers, we
|
|
46
|
-
* export these hooks since they're already being used by
|
|
47
|
-
* some applications (such as tcpdump) and already being
|
|
48
|
-
* marked as exported in some OSes offering libpcap (such
|
|
49
|
-
* as Debian).
|
|
50
|
-
*/
|
|
51
|
-
struct pcap_etherent {
|
|
52
|
-
u_char addr[6];
|
|
53
|
-
char name[122];
|
|
54
|
-
};
|
|
55
|
-
#ifndef PCAP_ETHERS_FILE
|
|
56
|
-
#define PCAP_ETHERS_FILE "/etc/ethers"
|
|
57
|
-
#endif
|
|
58
|
-
PCAP_API struct pcap_etherent *pcap_next_etherent(FILE *);
|
|
59
|
-
PCAP_API u_char *pcap_ether_hostton(const char*);
|
|
60
|
-
PCAP_API u_char *pcap_ether_aton(const char *);
|
|
61
|
-
|
|
62
|
-
PCAP_API bpf_u_int32 **pcap_nametoaddr(const char *)
|
|
63
|
-
PCAP_DEPRECATED(pcap_nametoaddr, "this is not reentrant; use 'pcap_nametoaddrinfo' instead");
|
|
64
|
-
PCAP_API struct addrinfo *pcap_nametoaddrinfo(const char *);
|
|
65
|
-
PCAP_API bpf_u_int32 pcap_nametonetaddr(const char *);
|
|
66
|
-
|
|
67
|
-
PCAP_API int pcap_nametoport(const char *, int *, int *);
|
|
68
|
-
PCAP_API int pcap_nametoportrange(const char *, int *, int *, int *);
|
|
69
|
-
PCAP_API int pcap_nametoproto(const char *);
|
|
70
|
-
PCAP_API int pcap_nametoeproto(const char *);
|
|
71
|
-
PCAP_API int pcap_nametollc(const char *);
|
|
72
|
-
/*
|
|
73
|
-
* If a protocol is unknown, PROTO_UNDEF is returned.
|
|
74
|
-
* Also, pcap_nametoport() returns the protocol along with the port number.
|
|
75
|
-
* If there are ambiguous entried in /etc/services (i.e. domain
|
|
76
|
-
* can be either tcp or udp) PROTO_UNDEF is returned.
|
|
77
|
-
*/
|
|
78
|
-
#define PROTO_UNDEF -1
|
|
79
|
-
|
|
80
|
-
#ifdef __cplusplus
|
|
81
|
-
}
|
|
82
|
-
#endif
|
|
83
|
-
|
|
84
|
-
#endif
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2013, Petar Alilovic,
|
|
3
|
-
* Faculty of Electrical Engineering and Computing, University of Zagreb
|
|
4
|
-
* 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 are met:
|
|
8
|
-
*
|
|
9
|
-
* * Redistributions of source code must retain the above copyright notice,
|
|
10
|
-
* this list of conditions and the following disclaimer.
|
|
11
|
-
* * 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
|
-
*
|
|
15
|
-
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
|
|
16
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
17
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
-
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
19
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
20
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
23
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
24
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
25
|
-
* DAMAGE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
#ifndef lib_pcap_nflog_h
|
|
29
|
-
#define lib_pcap_nflog_h
|
|
30
|
-
|
|
31
|
-
#include <pcap/pcap-inttypes.h>
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
* Structure of an NFLOG header and TLV parts, as described at
|
|
35
|
-
* https://www.tcpdump.org/linktypes/LINKTYPE_NFLOG.html
|
|
36
|
-
*
|
|
37
|
-
* The NFLOG header is big-endian.
|
|
38
|
-
*
|
|
39
|
-
* The TLV length and type are in host byte order. The value is either
|
|
40
|
-
* big-endian or is an array of bytes in some externally-specified byte
|
|
41
|
-
* order (text string, link-layer address, link-layer header, packet
|
|
42
|
-
* data, etc.).
|
|
43
|
-
*/
|
|
44
|
-
typedef struct nflog_hdr {
|
|
45
|
-
uint8_t nflog_family; /* address family */
|
|
46
|
-
uint8_t nflog_version; /* version */
|
|
47
|
-
uint16_t nflog_rid; /* resource ID */
|
|
48
|
-
} nflog_hdr_t;
|
|
49
|
-
|
|
50
|
-
typedef struct nflog_tlv {
|
|
51
|
-
uint16_t tlv_length; /* tlv length */
|
|
52
|
-
uint16_t tlv_type; /* tlv type */
|
|
53
|
-
/* value follows this */
|
|
54
|
-
} nflog_tlv_t;
|
|
55
|
-
|
|
56
|
-
typedef struct nflog_packet_hdr {
|
|
57
|
-
uint16_t hw_protocol; /* hw protocol */
|
|
58
|
-
uint8_t hook; /* netfilter hook */
|
|
59
|
-
uint8_t pad; /* padding to 32 bits */
|
|
60
|
-
} nflog_packet_hdr_t;
|
|
61
|
-
|
|
62
|
-
typedef struct nflog_hwaddr {
|
|
63
|
-
uint16_t hw_addrlen; /* address length */
|
|
64
|
-
uint16_t pad; /* padding to 32-bit boundary */
|
|
65
|
-
uint8_t hw_addr[8]; /* address, up to 8 bytes */
|
|
66
|
-
} nflog_hwaddr_t;
|
|
67
|
-
|
|
68
|
-
typedef struct nflog_timestamp {
|
|
69
|
-
uint64_t sec;
|
|
70
|
-
uint64_t usec;
|
|
71
|
-
} nflog_timestamp_t;
|
|
72
|
-
|
|
73
|
-
/*
|
|
74
|
-
* TLV types.
|
|
75
|
-
*/
|
|
76
|
-
#define NFULA_PACKET_HDR 1 /* nflog_packet_hdr_t */
|
|
77
|
-
#define NFULA_MARK 2 /* packet mark from skbuff */
|
|
78
|
-
#define NFULA_TIMESTAMP 3 /* nflog_timestamp_t for skbuff's time stamp */
|
|
79
|
-
#define NFULA_IFINDEX_INDEV 4 /* ifindex of device on which packet received (possibly bridge group) */
|
|
80
|
-
#define NFULA_IFINDEX_OUTDEV 5 /* ifindex of device on which packet transmitted (possibly bridge group) */
|
|
81
|
-
#define NFULA_IFINDEX_PHYSINDEV 6 /* ifindex of physical device on which packet received (not bridge group) */
|
|
82
|
-
#define NFULA_IFINDEX_PHYSOUTDEV 7 /* ifindex of physical device on which packet transmitted (not bridge group) */
|
|
83
|
-
#define NFULA_HWADDR 8 /* nflog_hwaddr_t for hardware address */
|
|
84
|
-
#define NFULA_PAYLOAD 9 /* packet payload */
|
|
85
|
-
#define NFULA_PREFIX 10 /* text string - null-terminated, count includes NUL */
|
|
86
|
-
#define NFULA_UID 11 /* UID owning socket on which packet was sent/received */
|
|
87
|
-
#define NFULA_SEQ 12 /* sequence number of packets on this NFLOG socket */
|
|
88
|
-
#define NFULA_SEQ_GLOBAL 13 /* sequence number of pakets on all NFLOG sockets */
|
|
89
|
-
#define NFULA_GID 14 /* GID owning socket on which packet was sent/received */
|
|
90
|
-
#define NFULA_HWTYPE 15 /* ARPHRD_ type of skbuff's device */
|
|
91
|
-
#define NFULA_HWHEADER 16 /* skbuff's MAC-layer header */
|
|
92
|
-
#define NFULA_HWLEN 17 /* length of skbuff's MAC-layer header */
|
|
93
|
-
|
|
94
|
-
#endif
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
|
|
3
|
-
* Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
|
|
4
|
-
* 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
|
-
*
|
|
10
|
-
* 1. Redistributions of source code must retain the above copyright
|
|
11
|
-
* notice, this list of conditions and the following disclaimer.
|
|
12
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
14
|
-
* documentation and/or other materials provided with the distribution.
|
|
15
|
-
* 3. Neither the name of the Politecnico di Torino nor the names of its
|
|
16
|
-
* contributors may be used to endorse or promote products derived from
|
|
17
|
-
* this software without specific prior written permission.
|
|
18
|
-
*
|
|
19
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
-
*/
|
|
31
|
-
#ifndef pcap_pcap_inttypes_h
|
|
32
|
-
#define pcap_pcap_inttypes_h
|
|
33
|
-
|
|
34
|
-
/*
|
|
35
|
-
* If we're compiling with Visual Studio, make sure the C99 integer
|
|
36
|
-
* types are defined, by hook or by crook.
|
|
37
|
-
*
|
|
38
|
-
* XXX - verify that we have at least C99 support on UN*Xes?
|
|
39
|
-
*
|
|
40
|
-
* What about MinGW or various DOS toolchains? We're currently assuming
|
|
41
|
-
* sufficient C99 support there.
|
|
42
|
-
*/
|
|
43
|
-
#if defined(_MSC_VER)
|
|
44
|
-
/*
|
|
45
|
-
* Compiler is MSVC.
|
|
46
|
-
*/
|
|
47
|
-
#if _MSC_VER >= 1800
|
|
48
|
-
/*
|
|
49
|
-
* VS 2013 or newer; we have <inttypes.h>.
|
|
50
|
-
*/
|
|
51
|
-
#include <inttypes.h>
|
|
52
|
-
#else
|
|
53
|
-
/*
|
|
54
|
-
* Earlier VS; we have to define this stuff ourselves.
|
|
55
|
-
* We don't support building libpcap with earlier versions of VS,
|
|
56
|
-
* but SDKs for Npcap have to support building applications using
|
|
57
|
-
* earlier versions of VS, so we work around this by defining
|
|
58
|
-
* those types ourselves, as some files use them.
|
|
59
|
-
*/
|
|
60
|
-
typedef unsigned char uint8_t;
|
|
61
|
-
typedef signed char int8_t;
|
|
62
|
-
typedef unsigned short uint16_t;
|
|
63
|
-
typedef signed short int16_t;
|
|
64
|
-
typedef unsigned int uint32_t;
|
|
65
|
-
typedef signed int int32_t;
|
|
66
|
-
#ifdef _MSC_EXTENSIONS
|
|
67
|
-
typedef unsigned _int64 uint64_t;
|
|
68
|
-
typedef _int64 int64_t;
|
|
69
|
-
#else /* _MSC_EXTENSIONS */
|
|
70
|
-
typedef unsigned long long uint64_t;
|
|
71
|
-
typedef long long int64_t;
|
|
72
|
-
#endif
|
|
73
|
-
#endif
|
|
74
|
-
#else /* defined(_MSC_VER) */
|
|
75
|
-
/*
|
|
76
|
-
* Not Visual Studio.
|
|
77
|
-
* Include <inttypes.h> to get the integer types and PRi[doux]64 values
|
|
78
|
-
* defined.
|
|
79
|
-
*
|
|
80
|
-
* If the compiler is MinGW, we assume we have <inttypes.h> - and
|
|
81
|
-
* support for %zu in the formatted printing functions.
|
|
82
|
-
*
|
|
83
|
-
* If the target is UN*X, we assume we have a C99-or-later development
|
|
84
|
-
* environment, and thus have <inttypes.h> - and support for %zu in
|
|
85
|
-
* the formatted printing functions.
|
|
86
|
-
*
|
|
87
|
-
* If the target is MS-DOS, we assume we have <inttypes.h> - and support
|
|
88
|
-
* for %zu in the formatted printing functions.
|
|
89
|
-
*
|
|
90
|
-
* I.e., assume we have <inttypes.h> and that it suffices.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/*
|
|
94
|
-
* XXX - somehow make sure we have enough C99 support with other
|
|
95
|
-
* compilers and support libraries?
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
#include <inttypes.h>
|
|
99
|
-
#endif /* defined(_MSC_VER) */
|
|
100
|
-
|
|
101
|
-
#endif /* pcap/pcap-inttypes.h */
|