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.
Files changed (428) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +91 -2
  3. package/README.zh-CN.md +89 -0
  4. package/dist/analysis.d.ts +4 -0
  5. package/dist/{CodecHeaderExports.js → analysis.js} +4 -1
  6. package/dist/capture.d.ts +5 -0
  7. package/dist/capture.js +21 -0
  8. package/dist/codec.d.ts +5 -0
  9. package/dist/codec.js +21 -0
  10. package/dist/iface.d.ts +4 -0
  11. package/dist/iface.js +20 -0
  12. package/dist/pcap.d.ts +10 -0
  13. package/dist/pcap.js +27 -0
  14. package/dist/replay.d.ts +5 -0
  15. package/dist/replay.js +21 -0
  16. package/package.json +65 -59
  17. package/.eslintrc.json +0 -53
  18. package/.idea/codeStyles/Project.xml +0 -18
  19. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  20. package/.idea/inspectionProfiles/Project_Default.xml +0 -11
  21. package/.idea/modules.xml +0 -8
  22. package/.idea/netkitty.iml +0 -12
  23. package/.idea/vcs.xml +0 -6
  24. package/assets/NetKitty.png +0 -0
  25. package/binding.gyp +0 -5
  26. package/cpp/nodepcap/deps/include/Packet32.h +0 -429
  27. package/cpp/nodepcap/deps/include/pcap/bluetooth.h +0 -56
  28. package/cpp/nodepcap/deps/include/pcap/bpf.h +0 -292
  29. package/cpp/nodepcap/deps/include/pcap/can_socketcan.h +0 -56
  30. package/cpp/nodepcap/deps/include/pcap/compiler-tests.h +0 -163
  31. package/cpp/nodepcap/deps/include/pcap/dlt.h +0 -1514
  32. package/cpp/nodepcap/deps/include/pcap/funcattrs.h +0 -325
  33. package/cpp/nodepcap/deps/include/pcap/ipnet.h +0 -43
  34. package/cpp/nodepcap/deps/include/pcap/namedb.h +0 -84
  35. package/cpp/nodepcap/deps/include/pcap/nflog.h +0 -94
  36. package/cpp/nodepcap/deps/include/pcap/pcap-inttypes.h +0 -101
  37. package/cpp/nodepcap/deps/include/pcap/pcap.h +0 -1219
  38. package/cpp/nodepcap/deps/include/pcap/sll.h +0 -149
  39. package/cpp/nodepcap/deps/include/pcap/socket.h +0 -84
  40. package/cpp/nodepcap/deps/include/pcap/usb.h +0 -143
  41. package/cpp/nodepcap/deps/include/pcap/vlan.h +0 -46
  42. package/cpp/nodepcap/deps/include/pcap-bpf.h +0 -45
  43. package/cpp/nodepcap/deps/include/pcap-namedb.h +0 -40
  44. package/cpp/nodepcap/deps/include/pcap.h +0 -43
  45. package/cpp/nodepcap/deps/lib/ARM64/Packet.lib +0 -0
  46. package/cpp/nodepcap/deps/lib/Packet.lib +0 -0
  47. package/cpp/nodepcap/deps/lib/wpcap.lib +0 -0
  48. package/cpp/nodepcap/deps/lib/x64/Packet.lib +0 -0
  49. package/cpp/nodepcap/deps/lib/x64/wpcap.lib +0 -0
  50. package/cpp/nodepcap/nodepcap.gypi +0 -104
  51. package/cpp/nodepcap/src/binding.cc +0 -14
  52. package/cpp/nodepcap/src/capture.cc +0 -400
  53. package/cpp/nodepcap/src/capture.h +0 -53
  54. package/cpp/nodepcap/src/utils.cc +0 -218
  55. package/cpp/nodepcap/src/utils.h +0 -13
  56. package/dist/CodecExports.d.ts +0 -34
  57. package/dist/CodecExports.d.ts.map +0 -1
  58. package/dist/CodecExports.js +0 -23
  59. package/dist/CodecHeaderExports.d.ts +0 -2
  60. package/dist/CodecHeaderExports.d.ts.map +0 -1
  61. package/dist/HelperExports.d.ts +0 -11
  62. package/dist/HelperExports.d.ts.map +0 -1
  63. package/dist/HelperExports.js +0 -72
  64. package/dist/NetworkExports.d.ts +0 -13
  65. package/dist/NetworkExports.d.ts.map +0 -1
  66. package/dist/NetworkExports.js +0 -13
  67. package/dist/PcapExports.d.ts +0 -30
  68. package/dist/PcapExports.d.ts.map +0 -1
  69. package/dist/PcapExports.js +0 -33
  70. package/dist/errors/ActionNotFoundError.d.ts +0 -5
  71. package/dist/errors/ActionNotFoundError.d.ts.map +0 -1
  72. package/dist/errors/ActionNotFoundError.js +0 -12
  73. package/dist/errors/CodecSchemaValidateError.d.ts +0 -5
  74. package/dist/errors/CodecSchemaValidateError.d.ts.map +0 -1
  75. package/dist/errors/CodecSchemaValidateError.js +0 -12
  76. package/dist/errors/DeviceNotFoundError.d.ts +0 -5
  77. package/dist/errors/DeviceNotFoundError.d.ts.map +0 -1
  78. package/dist/errors/DeviceNotFoundError.js +0 -12
  79. package/dist/errors/NoAvailableCodecError.d.ts +0 -5
  80. package/dist/errors/NoAvailableCodecError.d.ts.map +0 -1
  81. package/dist/errors/NoAvailableCodecError.js +0 -12
  82. package/dist/errors/NpcapLoadError.d.ts +0 -5
  83. package/dist/errors/NpcapLoadError.d.ts.map +0 -1
  84. package/dist/errors/NpcapLoadError.js +0 -12
  85. package/dist/errors/SocketDownError.d.ts +0 -5
  86. package/dist/errors/SocketDownError.d.ts.map +0 -1
  87. package/dist/errors/SocketDownError.js +0 -12
  88. package/dist/errors/UnknownPipeMessageTypeError.d.ts +0 -5
  89. package/dist/errors/UnknownPipeMessageTypeError.d.ts.map +0 -1
  90. package/dist/errors/UnknownPipeMessageTypeError.js +0 -12
  91. package/dist/errors/common/ErrorCode.d.ts +0 -31
  92. package/dist/errors/common/ErrorCode.d.ts.map +0 -1
  93. package/dist/errors/common/ErrorCode.js +0 -33
  94. package/dist/lib/GeneratePipeAddress.d.ts +0 -7
  95. package/dist/lib/GeneratePipeAddress.d.ts.map +0 -1
  96. package/dist/lib/GeneratePipeAddress.js +0 -23
  97. package/dist/lib/GetBinding.d.ts +0 -2
  98. package/dist/lib/GetBinding.d.ts.map +0 -1
  99. package/dist/lib/GetBinding.js +0 -6
  100. package/dist/lib/GetCaptureTemporaryDirectory.d.ts +0 -7
  101. package/dist/lib/GetCaptureTemporaryDirectory.d.ts.map +0 -1
  102. package/dist/lib/GetCaptureTemporaryDirectory.js +0 -15
  103. package/dist/lib/GetDeviceCaptureTemporaryFilename.d.ts +0 -8
  104. package/dist/lib/GetDeviceCaptureTemporaryFilename.d.ts.map +0 -1
  105. package/dist/lib/GetDeviceCaptureTemporaryFilename.js +0 -18
  106. package/dist/lib/codec/Codec.d.ts +0 -32
  107. package/dist/lib/codec/Codec.d.ts.map +0 -1
  108. package/dist/lib/codec/Codec.js +0 -183
  109. package/dist/lib/codec/PacketHeaders.d.ts +0 -22
  110. package/dist/lib/codec/PacketHeaders.d.ts.map +0 -1
  111. package/dist/lib/codec/PacketHeaders.js +0 -47
  112. package/dist/lib/codec/abstracts/BaseHeader.d.ts +0 -217
  113. package/dist/lib/codec/abstracts/BaseHeader.d.ts.map +0 -1
  114. package/dist/lib/codec/abstracts/BaseHeader.js +0 -356
  115. package/dist/lib/codec/headers/ARP.d.ts +0 -10
  116. package/dist/lib/codec/headers/ARP.d.ts.map +0 -1
  117. package/dist/lib/codec/headers/ARP.js +0 -224
  118. package/dist/lib/codec/headers/EthernetII.d.ts +0 -10
  119. package/dist/lib/codec/headers/EthernetII.d.ts.map +0 -1
  120. package/dist/lib/codec/headers/EthernetII.js +0 -81
  121. package/dist/lib/codec/headers/Goose.d.ts +0 -104
  122. package/dist/lib/codec/headers/Goose.d.ts.map +0 -1
  123. package/dist/lib/codec/headers/Goose.js +0 -1005
  124. package/dist/lib/codec/headers/ICMP.d.ts +0 -15
  125. package/dist/lib/codec/headers/ICMP.d.ts.map +0 -1
  126. package/dist/lib/codec/headers/ICMP.js +0 -147
  127. package/dist/lib/codec/headers/ICMPv6.d.ts +0 -15
  128. package/dist/lib/codec/headers/ICMPv6.d.ts.map +0 -1
  129. package/dist/lib/codec/headers/ICMPv6.js +0 -128
  130. package/dist/lib/codec/headers/IEC104_I_Frame.d.ts +0 -10
  131. package/dist/lib/codec/headers/IEC104_I_Frame.d.ts.map +0 -1
  132. package/dist/lib/codec/headers/IEC104_I_Frame.js +0 -6411
  133. package/dist/lib/codec/headers/IEC104_S_Frame.d.ts +0 -10
  134. package/dist/lib/codec/headers/IEC104_S_Frame.d.ts.map +0 -1
  135. package/dist/lib/codec/headers/IEC104_S_Frame.js +0 -105
  136. package/dist/lib/codec/headers/IEC104_U_Frame.d.ts +0 -10
  137. package/dist/lib/codec/headers/IEC104_U_Frame.d.ts.map +0 -1
  138. package/dist/lib/codec/headers/IEC104_U_Frame.js +0 -155
  139. package/dist/lib/codec/headers/IEC61850SampledValues.d.ts +0 -13
  140. package/dist/lib/codec/headers/IEC61850SampledValues.d.ts.map +0 -1
  141. package/dist/lib/codec/headers/IEC61850SampledValues.js +0 -370
  142. package/dist/lib/codec/headers/IPv4.d.ts +0 -16
  143. package/dist/lib/codec/headers/IPv4.d.ts.map +0 -1
  144. package/dist/lib/codec/headers/IPv4.js +0 -339
  145. package/dist/lib/codec/headers/IPv6.d.ts +0 -10
  146. package/dist/lib/codec/headers/IPv6.d.ts.map +0 -1
  147. package/dist/lib/codec/headers/IPv6.js +0 -177
  148. package/dist/lib/codec/headers/IPv6HopByHopOptions.d.ts +0 -71
  149. package/dist/lib/codec/headers/IPv6HopByHopOptions.d.ts.map +0 -1
  150. package/dist/lib/codec/headers/IPv6HopByHopOptions.js +0 -517
  151. package/dist/lib/codec/headers/RawData.d.ts +0 -11
  152. package/dist/lib/codec/headers/RawData.d.ts.map +0 -1
  153. package/dist/lib/codec/headers/RawData.js +0 -36
  154. package/dist/lib/codec/headers/TCP.d.ts +0 -16
  155. package/dist/lib/codec/headers/TCP.d.ts.map +0 -1
  156. package/dist/lib/codec/headers/TCP.js +0 -917
  157. package/dist/lib/codec/headers/TLS_Alert.d.ts +0 -10
  158. package/dist/lib/codec/headers/TLS_Alert.d.ts.map +0 -1
  159. package/dist/lib/codec/headers/TLS_Alert.js +0 -624
  160. package/dist/lib/codec/headers/TLS_ApplicationData.d.ts +0 -10
  161. package/dist/lib/codec/headers/TLS_ApplicationData.d.ts.map +0 -1
  162. package/dist/lib/codec/headers/TLS_ApplicationData.js +0 -155
  163. package/dist/lib/codec/headers/TLS_ChangeCipherSpec.d.ts +0 -10
  164. package/dist/lib/codec/headers/TLS_ChangeCipherSpec.d.ts.map +0 -1
  165. package/dist/lib/codec/headers/TLS_ChangeCipherSpec.js +0 -154
  166. package/dist/lib/codec/headers/TLS_Handshake.d.ts +0 -10
  167. package/dist/lib/codec/headers/TLS_Handshake.d.ts.map +0 -1
  168. package/dist/lib/codec/headers/TLS_Handshake.js +0 -339
  169. package/dist/lib/codec/headers/TLS_Heartbeat.d.ts +0 -10
  170. package/dist/lib/codec/headers/TLS_Heartbeat.d.ts.map +0 -1
  171. package/dist/lib/codec/headers/TLS_Heartbeat.js +0 -206
  172. package/dist/lib/codec/headers/UDP.d.ts +0 -16
  173. package/dist/lib/codec/headers/UDP.d.ts.map +0 -1
  174. package/dist/lib/codec/headers/UDP.js +0 -192
  175. package/dist/lib/codec/headers/VLAN_802dot1Q.d.ts +0 -10
  176. package/dist/lib/codec/headers/VLAN_802dot1Q.d.ts.map +0 -1
  177. package/dist/lib/codec/headers/VLAN_802dot1Q.js +0 -82
  178. package/dist/lib/codec/lib/FlexibleObject.d.ts +0 -28
  179. package/dist/lib/codec/lib/FlexibleObject.d.ts.map +0 -1
  180. package/dist/lib/codec/lib/FlexibleObject.js +0 -102
  181. package/dist/lib/codec/lib/GetBERIntegerLengthFromBuffer.d.ts +0 -7
  182. package/dist/lib/codec/lib/GetBERIntegerLengthFromBuffer.d.ts.map +0 -1
  183. package/dist/lib/codec/lib/GetBERIntegerLengthFromBuffer.js +0 -16
  184. package/dist/lib/codec/lib/ProcessPacketPostHandlers.d.ts +0 -14
  185. package/dist/lib/codec/lib/ProcessPacketPostHandlers.d.ts.map +0 -1
  186. package/dist/lib/codec/lib/ProcessPacketPostHandlers.js +0 -53
  187. package/dist/lib/codec/lib/SortPostHandlers.d.ts +0 -8
  188. package/dist/lib/codec/lib/SortPostHandlers.d.ts.map +0 -1
  189. package/dist/lib/codec/lib/SortPostHandlers.js +0 -11
  190. package/dist/lib/codec/lib/StringContentEncodingEnum.d.ts +0 -11
  191. package/dist/lib/codec/lib/StringContentEncodingEnum.d.ts.map +0 -1
  192. package/dist/lib/codec/lib/StringContentEncodingEnum.js +0 -14
  193. package/dist/lib/codec/types/CodecData.d.ts +0 -7
  194. package/dist/lib/codec/types/CodecData.d.ts.map +0 -1
  195. package/dist/lib/codec/types/CodecData.js +0 -2
  196. package/dist/lib/codec/types/CodecDecodeResult.d.ts +0 -11
  197. package/dist/lib/codec/types/CodecDecodeResult.d.ts.map +0 -1
  198. package/dist/lib/codec/types/CodecDecodeResult.js +0 -2
  199. package/dist/lib/codec/types/CodecEncodeInput.d.ts +0 -9
  200. package/dist/lib/codec/types/CodecEncodeInput.d.ts.map +0 -1
  201. package/dist/lib/codec/types/CodecEncodeInput.js +0 -2
  202. package/dist/lib/codec/types/CodecEncodeResult.d.ts +0 -6
  203. package/dist/lib/codec/types/CodecEncodeResult.d.ts.map +0 -1
  204. package/dist/lib/codec/types/CodecEncodeResult.js +0 -2
  205. package/dist/lib/codec/types/CodecErrorInfo.d.ts +0 -6
  206. package/dist/lib/codec/types/CodecErrorInfo.d.ts.map +0 -1
  207. package/dist/lib/codec/types/CodecErrorInfo.js +0 -2
  208. package/dist/lib/codec/types/CodecModule.d.ts +0 -3
  209. package/dist/lib/codec/types/CodecModule.d.ts.map +0 -1
  210. package/dist/lib/codec/types/CodecModule.js +0 -2
  211. package/dist/lib/codec/types/CodecModuleConstructor.d.ts +0 -3
  212. package/dist/lib/codec/types/CodecModuleConstructor.d.ts.map +0 -1
  213. package/dist/lib/codec/types/CodecModuleConstructor.js +0 -2
  214. package/dist/lib/codec/types/CodecSchema.d.ts +0 -7
  215. package/dist/lib/codec/types/CodecSchema.d.ts.map +0 -1
  216. package/dist/lib/codec/types/CodecSchema.js +0 -2
  217. package/dist/lib/codec/types/HeaderTreeNode.d.ts +0 -5
  218. package/dist/lib/codec/types/HeaderTreeNode.d.ts.map +0 -1
  219. package/dist/lib/codec/types/HeaderTreeNode.js +0 -2
  220. package/dist/lib/codec/types/PostHandlerItem.d.ts +0 -5
  221. package/dist/lib/codec/types/PostHandlerItem.d.ts.map +0 -1
  222. package/dist/lib/codec/types/PostHandlerItem.js +0 -2
  223. package/dist/lib/helper/BufferToHex.d.ts +0 -2
  224. package/dist/lib/helper/BufferToHex.d.ts.map +0 -1
  225. package/dist/lib/helper/BufferToHex.js +0 -6
  226. package/dist/lib/helper/BufferToIP.d.ts +0 -13
  227. package/dist/lib/helper/BufferToIP.d.ts.map +0 -1
  228. package/dist/lib/helper/BufferToIP.js +0 -21
  229. package/dist/lib/helper/BufferToNumber.d.ts +0 -10
  230. package/dist/lib/helper/BufferToNumber.d.ts.map +0 -1
  231. package/dist/lib/helper/BufferToNumber.js +0 -22
  232. package/dist/lib/helper/HexToBuffer.d.ts +0 -8
  233. package/dist/lib/helper/HexToBuffer.d.ts.map +0 -1
  234. package/dist/lib/helper/HexToBuffer.js +0 -27
  235. package/dist/lib/helper/HexToNumber.d.ts +0 -10
  236. package/dist/lib/helper/HexToNumber.d.ts.map +0 -1
  237. package/dist/lib/helper/HexToNumber.js +0 -39
  238. package/dist/lib/helper/IPToBuffer.d.ts +0 -13
  239. package/dist/lib/helper/IPToBuffer.d.ts.map +0 -1
  240. package/dist/lib/helper/IPToBuffer.js +0 -28
  241. package/dist/lib/helper/NumberToBERBuffer.d.ts +0 -10
  242. package/dist/lib/helper/NumberToBERBuffer.d.ts.map +0 -1
  243. package/dist/lib/helper/NumberToBERBuffer.js +0 -22
  244. package/dist/lib/helper/NumberToBERHex.d.ts +0 -10
  245. package/dist/lib/helper/NumberToBERHex.d.ts.map +0 -1
  246. package/dist/lib/helper/NumberToBERHex.js +0 -27
  247. package/dist/lib/helper/NumberToBuffer.d.ts +0 -10
  248. package/dist/lib/helper/NumberToBuffer.d.ts.map +0 -1
  249. package/dist/lib/helper/NumberToBuffer.js +0 -22
  250. package/dist/lib/helper/NumberToHex.d.ts +0 -10
  251. package/dist/lib/helper/NumberToHex.d.ts.map +0 -1
  252. package/dist/lib/helper/NumberToHex.js +0 -26
  253. package/dist/lib/nodepcap/Capture.d.ts +0 -81
  254. package/dist/lib/nodepcap/Capture.d.ts.map +0 -1
  255. package/dist/lib/nodepcap/Capture.js +0 -323
  256. package/dist/lib/nodepcap/GetNetworkInterfaces.d.ts +0 -7
  257. package/dist/lib/nodepcap/GetNetworkInterfaces.d.ts.map +0 -1
  258. package/dist/lib/nodepcap/GetNetworkInterfaces.js +0 -22
  259. package/dist/lib/nodepcap/interfaces/IBindingCapture.d.ts +0 -16
  260. package/dist/lib/nodepcap/interfaces/IBindingCapture.d.ts.map +0 -1
  261. package/dist/lib/nodepcap/interfaces/IBindingCapture.js +0 -2
  262. package/dist/lib/nodepcap/interfaces/IBindingCaptureOptions.d.ts +0 -5
  263. package/dist/lib/nodepcap/interfaces/IBindingCaptureOptions.d.ts.map +0 -1
  264. package/dist/lib/nodepcap/interfaces/IBindingCaptureOptions.js +0 -2
  265. package/dist/lib/nodepcap/interfaces/ICaptureOptions.d.ts +0 -23
  266. package/dist/lib/nodepcap/interfaces/ICaptureOptions.d.ts.map +0 -1
  267. package/dist/lib/nodepcap/interfaces/ICaptureOptions.js +0 -2
  268. package/dist/lib/nodepcap/interfaces/INetworkInterface.d.ts +0 -5
  269. package/dist/lib/nodepcap/interfaces/INetworkInterface.d.ts.map +0 -1
  270. package/dist/lib/nodepcap/interfaces/INetworkInterface.js +0 -2
  271. package/dist/lib/nodepcap/lib/BindingCapture.d.ts +0 -15
  272. package/dist/lib/nodepcap/lib/BindingCapture.d.ts.map +0 -1
  273. package/dist/lib/nodepcap/lib/BindingCapture.js +0 -35
  274. package/dist/lib/nodepcap/lib/GetNodePcapBinding.d.ts +0 -2
  275. package/dist/lib/nodepcap/lib/GetNodePcapBinding.d.ts.map +0 -1
  276. package/dist/lib/nodepcap/lib/GetNodePcapBinding.js +0 -55
  277. package/dist/lib/nodepcap/lib/GetNodePcapBindingCapture.d.ts +0 -3
  278. package/dist/lib/nodepcap/lib/GetNodePcapBindingCapture.d.ts.map +0 -1
  279. package/dist/lib/nodepcap/lib/GetNodePcapBindingCapture.js +0 -18
  280. package/dist/lib/nodepcap/workers/CaptureWorker.d.ts +0 -2
  281. package/dist/lib/nodepcap/workers/CaptureWorker.d.ts.map +0 -1
  282. package/dist/lib/nodepcap/workers/CaptureWorker.js +0 -25
  283. package/dist/lib/pcap/PCAPGenerator.d.ts +0 -34
  284. package/dist/lib/pcap/PCAPGenerator.d.ts.map +0 -1
  285. package/dist/lib/pcap/PCAPGenerator.js +0 -101
  286. package/dist/lib/pcap/PcapParser.d.ts +0 -27
  287. package/dist/lib/pcap/PcapParser.d.ts.map +0 -1
  288. package/dist/lib/pcap/PcapParser.js +0 -149
  289. package/dist/lib/pcap/PcapReader.d.ts +0 -112
  290. package/dist/lib/pcap/PcapReader.d.ts.map +0 -1
  291. package/dist/lib/pcap/PcapReader.js +0 -263
  292. package/dist/lib/pcap/PcapWriter.d.ts +0 -29
  293. package/dist/lib/pcap/PcapWriter.d.ts.map +0 -1
  294. package/dist/lib/pcap/PcapWriter.js +0 -86
  295. package/dist/lib/pcap/interfaces/IPcapPacketInfo.d.ts +0 -13
  296. package/dist/lib/pcap/interfaces/IPcapPacketInfo.d.ts.map +0 -1
  297. package/dist/lib/pcap/interfaces/IPcapPacketInfo.js +0 -2
  298. package/dist/lib/pipe/PipeClient.d.ts +0 -35
  299. package/dist/lib/pipe/PipeClient.d.ts.map +0 -1
  300. package/dist/lib/pipe/PipeClient.js +0 -71
  301. package/dist/lib/pipe/PipeClientSocket.d.ts +0 -39
  302. package/dist/lib/pipe/PipeClientSocket.d.ts.map +0 -1
  303. package/dist/lib/pipe/PipeClientSocket.js +0 -82
  304. package/dist/lib/pipe/PipeMessage.d.ts +0 -27
  305. package/dist/lib/pipe/PipeMessage.d.ts.map +0 -1
  306. package/dist/lib/pipe/PipeMessage.js +0 -61
  307. package/dist/lib/pipe/PipeMessageHandler.d.ts +0 -16
  308. package/dist/lib/pipe/PipeMessageHandler.d.ts.map +0 -1
  309. package/dist/lib/pipe/PipeMessageHandler.js +0 -95
  310. package/dist/lib/pipe/PipeServer.d.ts +0 -25
  311. package/dist/lib/pipe/PipeServer.d.ts.map +0 -1
  312. package/dist/lib/pipe/PipeServer.js +0 -59
  313. package/dist/lib/schema/ProtocolFieldJSONSchema.d.ts +0 -36
  314. package/dist/lib/schema/ProtocolFieldJSONSchema.d.ts.map +0 -1
  315. package/dist/lib/schema/ProtocolFieldJSONSchema.js +0 -2
  316. package/dist/lib/schema/ProtocolFieldJSONSchemaDefinition.d.ts +0 -3
  317. package/dist/lib/schema/ProtocolFieldJSONSchemaDefinition.d.ts.map +0 -1
  318. package/dist/lib/schema/ProtocolFieldJSONSchemaDefinition.js +0 -2
  319. package/dist/lib/schema/ProtocolJSONSchema.d.ts +0 -32
  320. package/dist/lib/schema/ProtocolJSONSchema.d.ts.map +0 -1
  321. package/dist/lib/schema/ProtocolJSONSchema.js +0 -2
  322. package/dist/tests/Test.spec.d.ts +0 -2
  323. package/dist/tests/Test.spec.d.ts.map +0 -1
  324. package/dist/tests/Test.spec.js +0 -25
  325. package/dist/tests/units/CaptureTest.spec.d.ts +0 -2
  326. package/dist/tests/units/CaptureTest.spec.d.ts.map +0 -1
  327. package/dist/tests/units/CaptureTest.spec.js +0 -32
  328. package/dist/tests/units/Codec.spec.d.ts +0 -2
  329. package/dist/tests/units/Codec.spec.d.ts.map +0 -1
  330. package/dist/tests/units/Codec.spec.js +0 -86
  331. package/dist/tests/units/ReadPCAP.spec.d.ts +0 -2
  332. package/dist/tests/units/ReadPCAP.spec.d.ts.map +0 -1
  333. package/dist/tests/units/ReadPCAP.spec.js +0 -14
  334. package/src/CodecExports.ts +0 -33
  335. package/src/CodecHeaderExports.ts +0 -1
  336. package/src/HelperExports.ts +0 -78
  337. package/src/NetworkExports.ts +0 -12
  338. package/src/PcapExports.ts +0 -32
  339. package/src/errors/ActionNotFoundError.ts +0 -6
  340. package/src/errors/CodecSchemaValidateError.ts +0 -6
  341. package/src/errors/DeviceNotFoundError.ts +0 -6
  342. package/src/errors/NoAvailableCodecError.ts +0 -6
  343. package/src/errors/NpcapLoadError.ts +0 -6
  344. package/src/errors/SocketDownError.ts +0 -6
  345. package/src/errors/UnknownPipeMessageTypeError.ts +0 -6
  346. package/src/errors/common/ErrorCode.ts +0 -30
  347. package/src/lib/GeneratePipeAddress.ts +0 -17
  348. package/src/lib/GetBinding.ts +0 -3
  349. package/src/lib/GetCaptureTemporaryDirectory.ts +0 -12
  350. package/src/lib/GetDeviceCaptureTemporaryFilename.ts +0 -13
  351. package/src/lib/codec/Codec.ts +0 -164
  352. package/src/lib/codec/PacketHeaders.ts +0 -23
  353. package/src/lib/codec/abstracts/BaseHeader.ts +0 -435
  354. package/src/lib/codec/headers/ARP.ts +0 -220
  355. package/src/lib/codec/headers/EthernetII.ts +0 -79
  356. package/src/lib/codec/headers/Goose.ts +0 -1033
  357. package/src/lib/codec/headers/ICMP.ts +0 -151
  358. package/src/lib/codec/headers/ICMPv6.ts +0 -128
  359. package/src/lib/codec/headers/IEC104_I_Frame.ts +0 -7373
  360. package/src/lib/codec/headers/IEC104_S_Frame.ts +0 -97
  361. package/src/lib/codec/headers/IEC104_U_Frame.ts +0 -139
  362. package/src/lib/codec/headers/IEC61850SampledValues.ts +0 -361
  363. package/src/lib/codec/headers/IPv4.ts +0 -331
  364. package/src/lib/codec/headers/IPv6.ts +0 -176
  365. package/src/lib/codec/headers/IPv6HopByHopOptions.ts +0 -552
  366. package/src/lib/codec/headers/RawData.ts +0 -38
  367. package/src/lib/codec/headers/TCP.ts +0 -952
  368. package/src/lib/codec/headers/TLS_Alert.ts +0 -539
  369. package/src/lib/codec/headers/TLS_ApplicationData.ts +0 -145
  370. package/src/lib/codec/headers/TLS_ChangeCipherSpec.ts +0 -146
  371. package/src/lib/codec/headers/TLS_Handshake.ts +0 -313
  372. package/src/lib/codec/headers/TLS_Heartbeat.ts +0 -188
  373. package/src/lib/codec/headers/UDP.ts +0 -182
  374. package/src/lib/codec/headers/VLAN_802dot1Q.ts +0 -79
  375. package/src/lib/codec/lib/FlexibleObject.ts +0 -100
  376. package/src/lib/codec/lib/GetBERIntegerLengthFromBuffer.ts +0 -12
  377. package/src/lib/codec/lib/ProcessPacketPostHandlers.ts +0 -53
  378. package/src/lib/codec/lib/SortPostHandlers.ts +0 -10
  379. package/src/lib/codec/lib/StringContentEncodingEnum.ts +0 -10
  380. package/src/lib/codec/types/CodecData.ts +0 -7
  381. package/src/lib/codec/types/CodecDecodeResult.ts +0 -11
  382. package/src/lib/codec/types/CodecEncodeInput.ts +0 -9
  383. package/src/lib/codec/types/CodecEncodeResult.ts +0 -6
  384. package/src/lib/codec/types/CodecErrorInfo.ts +0 -5
  385. package/src/lib/codec/types/CodecModule.ts +0 -3
  386. package/src/lib/codec/types/CodecModuleConstructor.ts +0 -3
  387. package/src/lib/codec/types/CodecSchema.ts +0 -7
  388. package/src/lib/codec/types/HeaderTreeNode.ts +0 -5
  389. package/src/lib/codec/types/PostHandlerItem.ts +0 -4
  390. package/src/lib/helper/BufferToHex.ts +0 -3
  391. package/src/lib/helper/BufferToIP.ts +0 -19
  392. package/src/lib/helper/BufferToNumber.ts +0 -31
  393. package/src/lib/helper/HexToBuffer.ts +0 -22
  394. package/src/lib/helper/HexToNumber.ts +0 -25
  395. package/src/lib/helper/IPToBuffer.ts +0 -25
  396. package/src/lib/helper/NumberToBERBuffer.ts +0 -21
  397. package/src/lib/helper/NumberToBERHex.ts +0 -17
  398. package/src/lib/helper/NumberToBuffer.ts +0 -21
  399. package/src/lib/helper/NumberToHex.ts +0 -15
  400. package/src/lib/nodepcap/Capture.ts +0 -304
  401. package/src/lib/nodepcap/GetNetworkInterfaces.ts +0 -18
  402. package/src/lib/nodepcap/interfaces/IBindingCapture.ts +0 -27
  403. package/src/lib/nodepcap/interfaces/IBindingCaptureOptions.ts +0 -4
  404. package/src/lib/nodepcap/interfaces/ICaptureOptions.ts +0 -24
  405. package/src/lib/nodepcap/interfaces/INetworkInterface.ts +0 -4
  406. package/src/lib/nodepcap/lib/BindingCapture.ts +0 -46
  407. package/src/lib/nodepcap/lib/GetNodePcapBinding.ts +0 -17
  408. package/src/lib/nodepcap/lib/GetNodePcapBindingCapture.ts +0 -15
  409. package/src/lib/nodepcap/workers/CaptureWorker.ts +0 -30
  410. package/src/lib/pcap/PCAPGenerator.ts +0 -123
  411. package/src/lib/pcap/PcapParser.ts +0 -170
  412. package/src/lib/pcap/PcapReader.ts +0 -306
  413. package/src/lib/pcap/PcapWriter.ts +0 -98
  414. package/src/lib/pcap/interfaces/IPcapPacketInfo.ts +0 -12
  415. package/src/lib/pipe/PipeClient.ts +0 -91
  416. package/src/lib/pipe/PipeClientSocket.ts +0 -99
  417. package/src/lib/pipe/PipeMessage.ts +0 -74
  418. package/src/lib/pipe/PipeMessageHandler.ts +0 -91
  419. package/src/lib/pipe/PipeServer.ts +0 -74
  420. package/src/lib/schema/ProtocolFieldJSONSchema.ts +0 -47
  421. package/src/lib/schema/ProtocolFieldJSONSchemaDefinition.ts +0 -3
  422. package/src/lib/schema/ProtocolJSONSchema.ts +0 -37
  423. package/src/tests/Test.spec.ts +0 -22
  424. package/src/tests/units/CaptureTest.spec.ts +0 -31
  425. package/src/tests/units/Codec.spec.ts +0 -102
  426. package/src/tests/units/ReadPCAP.spec.ts +0 -13
  427. package/test.pcap +0 -0
  428. package/tsconfig.json +0 -42
package/binding.gyp DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "includes": [
3
- "cpp/nodepcap/nodepcap.gypi"
4
- ]
5
- }
@@ -1,429 +0,0 @@
1
- /***********************IMPORTANT NPCAP LICENSE TERMS***********************
2
- * *
3
- * Npcap is a Windows packet sniffing driver and library and is copyright *
4
- * (c) 2013-2021 by Insecure.Com LLC ("The Nmap Project"). All rights *
5
- * reserved. *
6
- * *
7
- * Even though Npcap source code is publicly available for review, it is *
8
- * not open source software and the free version may not be redistributed *
9
- * or incorporated into other software without special permission from *
10
- * the Nmap Project. It also has certain usage limitations described in *
11
- * the LICENSE file included with Npcap and also available at *
12
- * https://github.com/nmap/npcap/blob/master/LICENSE. This header *
13
- * summarizes a few important aspects of the Npcap license, but is not a *
14
- * substitute for that full Npcap license agreement. *
15
- * *
16
- * We fund the Npcap project by selling two commercial licenses: *
17
- * *
18
- * The Npcap OEM Redistribution License allows companies distribute Npcap *
19
- * OEM within their products. Licensees generally use the Npcap OEM *
20
- * silent installer, ensuring a seamless experience for end *
21
- * users. Licensees may choose between a perpetual unlimited license or *
22
- * an annual term license, along with options for commercial support and *
23
- * updates. Prices and details: https://nmap.org/npcap/oem/redist.html *
24
- * *
25
- * The Npcap OEM Internal-Use License is for organizations that wish to *
26
- * use Npcap OEM internally, without redistribution outside their *
27
- * organization. This allows them to bypass the 5-system usage cap of the *
28
- * Npcap free edition. It includes commercial support and update options, *
29
- * and provides the extra Npcap OEM features such as the silent installer *
30
- * for automated deployment. Prices and details: *
31
- * https://nmap.org/npcap/oem/internal.html *
32
- * *
33
- * Free and open source software producers are also welcome to contact us *
34
- * for redistribution requests, but we normally recommend that such *
35
- * authors instead ask their users to download and install Npcap *
36
- * themselves. *
37
- * *
38
- * Since the Npcap source code is available for download and review, *
39
- * users sometimes contribute code patches to fix bugs or add new *
40
- * features. You are encouraged to submit such patches as Github pull *
41
- * requests or by email to fyodor@nmap.org. If you wish to specify *
42
- * special license conditions or restrictions on your contributions, just *
43
- * say so when you send them. Otherwise, it is understood that you are *
44
- * offering the Nmap Project the unlimited, non-exclusive right to reuse, *
45
- * modify, and relicence your code contributions so that we may (but are *
46
- * not obligated to) incorporate them into Npcap. *
47
- * *
48
- * This software is distributed in the hope that it will be useful, but *
49
- * WITHOUT ANY WARRANTY; without even the implied warranty of *
50
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Warranty rights *
51
- * and commercial support are available for the OEM Edition described *
52
- * above. *
53
- * *
54
- * Other copyright notices and attribution may appear below this license *
55
- * header. We have kept those for attribution purposes, but any license *
56
- * terms granted by those notices apply only to their original work, and *
57
- * not to any changes made by the Nmap Project or to this entire file. *
58
- * *
59
- ***************************************************************************/
60
- /*
61
- * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
62
- * Copyright (c) 2005 - 2007 CACE Technologies, Davis (California)
63
- * All rights reserved.
64
- *
65
- * Redistribution and use in source and binary forms, with or without
66
- * modification, are permitted provided that the following conditions
67
- * are met:
68
- *
69
- * 1. Redistributions of source code must retain the above copyright
70
- * notice, this list of conditions and the following disclaimer.
71
- * 2. Redistributions in binary form must reproduce the above copyright
72
- * notice, this list of conditions and the following disclaimer in the
73
- * documentation and/or other materials provided with the distribution.
74
- * 3. Neither the name of the Politecnico di Torino, CACE Technologies
75
- * nor the names of its contributors may be used to endorse or promote
76
- * products derived from this software without specific prior written
77
- * permission.
78
- *
79
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
80
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
81
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
82
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
83
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
84
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
85
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
86
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
87
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
88
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
89
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90
- *
91
- */
92
-
93
- /** @ingroup packetapi
94
- * @{
95
- */
96
-
97
- /** @defgroup packet32h Packet.dll definitions and data structures
98
- * Packet32.h contains the data structures and the definitions used by packet.dll.
99
- * The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included
100
- * by the applications that use the functions of this library
101
- * @{
102
- */
103
-
104
- #ifndef __PACKET32
105
- #define __PACKET32
106
-
107
- #include <winsock2.h>
108
-
109
- #ifdef HAVE_AIRPCAP_API
110
- #include <airpcap.h>
111
- #else
112
- #if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)
113
- #define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
114
- typedef struct _AirpcapHandle* PAirpcapHandle;
115
- #endif /* AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ */
116
- #endif /* HAVE_AIRPCAP_API */
117
-
118
- // Libpcap/wpcap recognizes this macro and knows Npcap Packet API is provided for compilation.
119
- #define HAVE_NPCAP_PACKET_API
120
-
121
- // Working modes, a bitfield
122
- // 0b00000000
123
- // | ||_ STAT or CAPT
124
- // | |__ MON (TME extensions, not supported)
125
- // | UNUSED
126
- // | UNUSED
127
- // |_____ DUMP (not supported)
128
- #define PACKET_MODE_CAPT 0x0 ///< Capture mode
129
- #define PACKET_MODE_STAT 0x1 ///< Statistical mode
130
- #define PACKET_MODE_MON 0x2 ///< Monitoring mode
131
- #define PACKET_MODE_DUMP 0x10 ///< Dump mode
132
- #define PACKET_MODE_STAT_DUMP PACKET_MODE_DUMP | PACKET_MODE_STAT ///< Statistical dump Mode
133
-
134
-
135
- /// Alignment macro. Defines the alignment size.
136
- #define Packet_ALIGNMENT sizeof(int)
137
- /// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
138
- #define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
139
-
140
- #define NdisMediumNull -1 ///< Custom linktype: NDIS doesn't provide an equivalent
141
- #define NdisMediumCHDLC -2 ///< Custom linktype: NDIS doesn't provide an equivalent
142
- #define NdisMediumPPPSerial -3 ///< Custom linktype: NDIS doesn't provide an equivalent
143
- #define NdisMediumBare80211 -4 ///< Custom linktype: NDIS doesn't provide an equivalent
144
- #define NdisMediumRadio80211 -5 ///< Custom linktype: NDIS doesn't provide an equivalent
145
- #define NdisMediumPpi -6 ///< Custom linktype: NDIS doesn't provide an equivalent
146
-
147
- // Loopback behaviour definitions
148
- #define NPF_DISABLE_LOOPBACK 1 ///< Drop the packets sent by the NPF driver
149
- #define NPF_ENABLE_LOOPBACK 2 ///< Capture the packets sent by the NPF driver
150
-
151
- // Timestamp Modes
152
- #define TIMESTAMPMODE_SINGLE_SYNCHRONIZATION 0 // KeQueryPerformanceCounter
153
- #define TIMESTAMPMODE_QUERYSYSTEMTIME 2 // KeQuerySystemTime
154
- #define TIMESTAMPMODE_QUERYSYSTEMTIME_PRECISE 4 // KeQuerySystemTimePrecise, Windows 8 and newer
155
-
156
- /*!
157
- \brief Network type structure.
158
-
159
- This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.
160
- */
161
- typedef struct NetType
162
- {
163
- UINT LinkType; ///< The MAC of the current network adapter (see function PacketGetNetType() for more information)
164
- ULONGLONG LinkSpeed; ///< The speed of the network in bits per second
165
- }NetType;
166
-
167
-
168
- //some definitions stolen from libpcap
169
-
170
- #ifndef BPF_MAJOR_VERSION
171
-
172
- /*!
173
- \brief A BPF pseudo-assembly program.
174
-
175
- The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet.
176
- */
177
- struct bpf_program
178
- {
179
- UINT bf_len; ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.
180
- struct bpf_insn* bf_insns; ///< A pointer to the first instruction of the program.
181
- };
182
-
183
- /*!
184
- \brief A single BPF pseudo-instruction.
185
-
186
- bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.
187
- */
188
- struct bpf_insn
189
- {
190
- USHORT code; ///< Instruction type and addressing mode.
191
- UCHAR jt; ///< Jump if true
192
- UCHAR jf; ///< Jump if false
193
- int k; ///< Generic field used for various purposes.
194
- };
195
-
196
- /*!
197
- \brief Structure that contains a couple of statistics values on the current capture.
198
-
199
- It is used by packet.dll to return statistics about a capture session.
200
- */
201
- struct bpf_stat
202
- {
203
- UINT bs_recv; ///< Number of packets that the driver received from the network adapter
204
- ///< from the beginning of the current capture. This value includes the packets
205
- ///< lost by the driver.
206
- UINT bs_drop; ///< number of packets that the driver lost from the beginning of a capture.
207
- ///< Basically, a packet is lost when the the buffer of the driver is full.
208
- ///< In this situation the packet cannot be stored and the driver rejects it.
209
- UINT ps_ifdrop; ///< drops by interface. XXX not yet supported
210
- UINT bs_capt; ///< number of packets that pass the filter, find place in the kernel buffer and
211
- ///< thus reach the application.
212
- };
213
-
214
- /*!
215
- \brief Packet header.
216
-
217
- This structure defines the header associated with every packet delivered to the application.
218
- */
219
- struct bpf_hdr
220
- {
221
- struct timeval bh_tstamp; ///< The timestamp associated with the captured packet.
222
- ///< It is stored in a TimeVal structure.
223
- UINT bh_caplen; ///< Length of captured portion. The captured portion <b>can be different</b>
224
- ///< from the original packet, because it is possible (with a proper filter)
225
- ///< to instruct the driver to capture only a portion of the packets.
226
- UINT bh_datalen; ///< Original length of packet
227
- USHORT bh_hdrlen; ///< Length of bpf header (this struct plus alignment padding). In some cases,
228
- ///< a padding could be added between the end of this structure and the packet
229
- ///< data for performance reasons. This filed can be used to retrieve the actual data
230
- ///< of the packet.
231
- };
232
-
233
- /*!
234
- \brief Dump packet header.
235
-
236
- This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().
237
- It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a
238
- packet in a dump file. This makes straightforward sending WinPcap dump files to the network.
239
- */
240
- struct dump_bpf_hdr
241
- {
242
- struct timeval ts; ///< Time stamp of the packet
243
- UINT caplen; ///< Length of captured portion. The captured portion can smaller than the
244
- ///< the original packet, because it is possible (with a proper filter) to
245
- ///< instruct the driver to capture only a portion of the packets.
246
- UINT len; ///< Length of the original packet (off wire).
247
- };
248
-
249
-
250
- #endif
251
-
252
- struct bpf_stat;
253
-
254
- #define DOSNAMEPREFIX TEXT("Packet_") ///< Prefix added to the adapters device names to create the WinPcap devices
255
- #define MAX_LINK_NAME_LENGTH 64 //< Maximum length of the devices symbolic links
256
- #define NMAX_PACKET 65535
257
-
258
- /*!
259
- \brief Addresses of a network adapter.
260
-
261
- This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with
262
- an adapter.
263
- */
264
- typedef struct npf_if_addr
265
- {
266
- struct sockaddr_storage IPAddress; ///< IP address.
267
- struct sockaddr_storage SubnetMask; ///< Netmask for that address.
268
- struct sockaddr_storage Broadcast; ///< Broadcast address.
269
- }npf_if_addr;
270
-
271
-
272
- #define ADAPTER_NAME_LENGTH 256 + 12 ///< Maximum length for the name of an adapter. The value is the same used by the IP Helper API.
273
- #define ADAPTER_DESC_LENGTH 128 ///< Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
274
- #define MAX_MAC_ADDR_LENGTH 8 ///< Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.
275
- #define MAX_NETWORK_ADDRESSES 16 ///< Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.
276
-
277
-
278
- typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
279
- typedef WAN_ADAPTER* PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
280
-
281
- #define INFO_FLAG_NDIS_ADAPTER 0 ///< Flag for ADAPTER_INFO: this is a traditional ndis adapter
282
- #define INFO_FLAG_NDISWAN_ADAPTER 1 ///< Flag for ADAPTER_INFO: this is a NdisWan adapter, and it's managed by WANPACKET
283
- #define INFO_FLAG_DAG_CARD 2 ///< Flag for ADAPTER_INFO: this is a DAG card
284
- #define INFO_FLAG_DAG_FILE 6 ///< Flag for ADAPTER_INFO: this is a DAG file
285
- #define INFO_FLAG_DONT_EXPORT 8 ///< Flag for ADAPTER_INFO: when this flag is set, the adapter will not be listed or openend by winpcap. This allows to prevent exporting broken network adapters, like for example FireWire ones.
286
- #define INFO_FLAG_AIRPCAP_CARD 16 ///< Flag for ADAPTER_INFO: this is an airpcap card
287
- #define INFO_FLAG_NPFIM_DEVICE 32 /// NPFIM device, not supported
288
-
289
- /*!
290
- \brief Describes an opened network adapter.
291
-
292
- This structure is the most important for the functioning of packet.dll, but the great part of its fields
293
- should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters
294
- */
295
- typedef struct _ADAPTER
296
- {
297
- HANDLE hFile; ///< \internal Handle to an open instance of the NPF driver.
298
- CHAR SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.
299
- int NumWrites; ///< \internal Number of times a packets written on this adapter will be repeated
300
- ///< on the wire.
301
- HANDLE ReadEvent; ///< A notification event associated with the read calls on the adapter.
302
- ///< It can be passed to standard Win32 functions (like WaitForSingleObject
303
- ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some
304
- ///< data. It is particularly useful in GUI applications that need to wait
305
- ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()
306
- ///< function can be used to define the minimum amount of data in the kernel buffer
307
- ///< that will cause the event to be signalled.
308
-
309
- UINT ReadTimeOut; ///< \internal The amount of time after which a read on the driver will be released and
310
- ///< ReadEvent will be signaled, also if no packets were captured
311
- CHAR Name[ADAPTER_NAME_LENGTH];
312
- PWAN_ADAPTER pWanAdapter;
313
- UINT Flags; ///< Adapter's flags. Tell if this adapter must be treated in a different way.
314
-
315
- #ifdef HAVE_AIRPCAP_API
316
- PAirpcapHandle AirpcapAd;
317
- #endif // HAVE_AIRPCAP_API
318
- } ADAPTER, * LPADAPTER;
319
-
320
- /*!
321
- \brief Structure that contains a group of packets coming from the driver.
322
-
323
- This structure defines the header associated with every packet delivered to the application.
324
- */
325
- typedef struct _PACKET
326
- {
327
- HANDLE hEvent; ///< \deprecated Still present for compatibility with old applications.
328
- OVERLAPPED OverLapped; ///< \deprecated Still present for compatibility with old applications.
329
- PVOID Buffer; ///< Buffer with containing the packets. See the PacketReceivePacket() for
330
- ///< details about the organization of the data in this buffer
331
- UINT Length; ///< Length of the buffer
332
- DWORD ulBytesReceived; ///< Number of valid bytes present in the buffer, i.e. amount of data
333
- ///< received by the last call to PacketReceivePacket()
334
- BOOLEAN bIoComplete; ///< \deprecated Still present for compatibility with old applications.
335
- } PACKET, * LPPACKET;
336
-
337
- /*!
338
- \brief Structure containing an OID request.
339
-
340
- It is used by the PacketRequest() function to send an OID to the interface card driver.
341
- It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address,
342
- the list of the multicast groups defined on it, and so on.
343
- */
344
- struct _PACKET_OID_DATA
345
- {
346
- ULONG Oid; ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h
347
- ///< for a complete list of valid codes.
348
- ULONG Length; ///< Length of the data field
349
- UCHAR Data[1]; ///< variable-lenght field that contains the information passed to or received
350
- ///< from the adapter.
351
- };
352
- typedef struct _PACKET_OID_DATA PACKET_OID_DATA, * PPACKET_OID_DATA;
353
-
354
- #ifdef __cplusplus
355
- extern "C"
356
- {
357
- #endif
358
-
359
- /**
360
- * @}
361
- */
362
-
363
- /*
364
- BOOLEAN QueryWinPcapRegistryStringA(CHAR *SubKeyName,
365
- CHAR *Value,
366
- UINT *pValueLen,
367
- CHAR *DefaultVal);
368
- BOOLEAN QueryWinPcapRegistryStringW(WCHAR *SubKeyName,
369
- WCHAR *Value,
370
- UINT *pValueLen,
371
- WCHAR *DefaultVal);
372
- */
373
-
374
- //---------------------------------------------------------------------------
375
- // EXPORTED FUNCTIONS
376
- //---------------------------------------------------------------------------
377
-
378
- LPCSTR PacketGetVersion();
379
- LPCSTR PacketGetDriverVersion();
380
- LPCSTR PacketGetDriverName();
381
- BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject, int nbytes);
382
- BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject, int nwrites);
383
- BOOLEAN PacketSetMode(LPADAPTER AdapterObject, int mode);
384
- BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject, int timeout);
385
- BOOLEAN PacketSetBpf(LPADAPTER AdapterObject, struct bpf_program* fp);
386
- BOOLEAN PacketSetLoopbackBehavior(LPADAPTER AdapterObject, UINT LoopbackBehavior);
387
- BOOLEAN PacketSetTimestampMode(LPADAPTER AdapterObject, ULONG mode);
388
- BOOLEAN PacketGetTimestampModes(LPADAPTER AdapterObject, PULONG pModes);
389
- INT PacketSetSnapLen(LPADAPTER AdapterObject, int snaplen);
390
- BOOLEAN PacketGetStats(LPADAPTER AdapterObject, struct bpf_stat* s);
391
- BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject, struct bpf_stat* s);
392
- BOOLEAN PacketSetBuff(LPADAPTER AdapterObject, int dim);
393
- BOOLEAN PacketGetNetType(LPADAPTER AdapterObject, NetType* type);
394
- BOOLEAN PacketIsLoopbackAdapter(PCCH AdapterName);
395
- int PacketIsMonitorModeSupported(PCCH AdapterName);
396
- int PacketSetMonitorMode(PCCH AdapterName, int mode);
397
- int PacketGetMonitorMode(PCCH AdapterName);
398
- LPADAPTER PacketOpenAdapter(PCCH AdapterName);
399
- BOOLEAN PacketSendPacket(LPADAPTER AdapterObject, LPPACKET pPacket, BOOLEAN Sync);
400
- INT PacketSendPackets(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync);
401
- LPPACKET PacketAllocatePacket(void);
402
- VOID PacketInitPacket(LPPACKET lpPacket, PVOID Buffer, UINT Length);
403
- VOID PacketFreePacket(LPPACKET lpPacket);
404
- BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject, LPPACKET lpPacket, BOOLEAN Sync);
405
- BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject, ULONG Filter);
406
- BOOLEAN PacketGetAdapterNames(PCHAR pStr, PULONG BufferSize);
407
- BOOLEAN PacketGetNetInfoEx(PCCH AdapterName, npf_if_addr* buffer, PLONG NEntries);
408
- BOOLEAN PacketRequest(LPADAPTER AdapterObject, BOOLEAN Set, PPACKET_OID_DATA OidData);
409
- HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);
410
- BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void* name, int len);
411
- BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
412
- BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);
413
- BOOL PacketStopDriver();
414
- BOOL PacketStopDriver60();
415
- VOID PacketCloseAdapter(LPADAPTER lpAdapter);
416
- BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength);
417
- BOOLEAN PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags);
418
- PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject);
419
-
420
- //
421
- // Used by PacketStartOemEx
422
- //
423
- #define PACKET_START_OEM_NO_NETMON 0x00000001
424
-
425
- #ifdef __cplusplus
426
- }
427
- #endif
428
-
429
- #endif //__PACKET32
@@ -1,56 +0,0 @@
1
- /*
2
- * Copyright (c) 2006 Paolo Abeni (Italy)
3
- * 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
- *
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. The name of the author may not be used to endorse or promote
15
- * products derived from this software without specific prior written
16
- * permission.
17
- *
18
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- *
30
- * bluetooth data struct
31
- * By Paolo Abeni <paolo.abeni@email.it>
32
- */
33
-
34
- #ifndef lib_pcap_bluetooth_h
35
- #define lib_pcap_bluetooth_h
36
-
37
- #include <pcap/pcap-inttypes.h>
38
-
39
- /*
40
- * Header prepended libpcap to each bluetooth h4 frame,
41
- * fields are in network byte order
42
- */
43
- typedef struct _pcap_bluetooth_h4_header {
44
- uint32_t direction; /* if first bit is set direction is incoming */
45
- } pcap_bluetooth_h4_header;
46
-
47
- /*
48
- * Header prepended libpcap to each bluetooth linux monitor frame,
49
- * fields are in network byte order
50
- */
51
- typedef struct _pcap_bluetooth_linux_monitor_header {
52
- uint16_t adapter_id;
53
- uint16_t opcode;
54
- } pcap_bluetooth_linux_monitor_header;
55
-
56
- #endif