@netkitty/codec 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 (463) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +352 -0
  4. package/README.zh-CN.md +342 -0
  5. package/dist/Codec.d.ts +133 -0
  6. package/dist/Codec.js +632 -0
  7. package/dist/PacketHeaders.d.ts +189 -0
  8. package/dist/PacketHeaders.js +384 -0
  9. package/dist/abstracts/BaseHeader.d.ts +325 -0
  10. package/dist/abstracts/BaseHeader.js +734 -0
  11. package/dist/errors/CodecSchemaValidateError.d.ts +4 -0
  12. package/dist/errors/CodecSchemaValidateError.js +11 -0
  13. package/dist/headers/ADSAMS.d.ts +33 -0
  14. package/dist/headers/ADSAMS.js +208 -0
  15. package/dist/headers/AH.d.ts +28 -0
  16. package/dist/headers/AH.js +137 -0
  17. package/dist/headers/AMQP.d.ts +31 -0
  18. package/dist/headers/AMQP.js +316 -0
  19. package/dist/headers/ARP.d.ts +26 -0
  20. package/dist/headers/ARP.js +243 -0
  21. package/dist/headers/BACnetIP.d.ts +27 -0
  22. package/dist/headers/BACnetIP.js +97 -0
  23. package/dist/headers/BFD.d.ts +28 -0
  24. package/dist/headers/BFD.js +155 -0
  25. package/dist/headers/BGP.d.ts +27 -0
  26. package/dist/headers/BGP.js +111 -0
  27. package/dist/headers/BSAPIP.d.ts +33 -0
  28. package/dist/headers/BSAPIP.js +78 -0
  29. package/dist/headers/Babel.d.ts +32 -0
  30. package/dist/headers/Babel.js +224 -0
  31. package/dist/headers/BitTorrent.d.ts +28 -0
  32. package/dist/headers/BitTorrent.js +72 -0
  33. package/dist/headers/C37118.d.ts +26 -0
  34. package/dist/headers/C37118.js +147 -0
  35. package/dist/headers/CAPWAP.d.ts +38 -0
  36. package/dist/headers/CAPWAP.js +275 -0
  37. package/dist/headers/CDP.d.ts +25 -0
  38. package/dist/headers/CDP.js +117 -0
  39. package/dist/headers/CMS.d.ts +33 -0
  40. package/dist/headers/CMS.js +238 -0
  41. package/dist/headers/COTP.d.ts +30 -0
  42. package/dist/headers/COTP.js +193 -0
  43. package/dist/headers/CassandraCQL.d.ts +28 -0
  44. package/dist/headers/CassandraCQL.js +117 -0
  45. package/dist/headers/CoAP.d.ts +29 -0
  46. package/dist/headers/CoAP.js +140 -0
  47. package/dist/headers/Codesys.d.ts +32 -0
  48. package/dist/headers/Codesys.js +119 -0
  49. package/dist/headers/Collectd.d.ts +29 -0
  50. package/dist/headers/Collectd.js +154 -0
  51. package/dist/headers/DCCP.d.ts +30 -0
  52. package/dist/headers/DCCP.js +204 -0
  53. package/dist/headers/DHCP.d.ts +26 -0
  54. package/dist/headers/DHCP.js +148 -0
  55. package/dist/headers/DHCPFailover.d.ts +30 -0
  56. package/dist/headers/DHCPFailover.js +104 -0
  57. package/dist/headers/DHCPv6.d.ts +25 -0
  58. package/dist/headers/DHCPv6.js +145 -0
  59. package/dist/headers/DNP3.d.ts +27 -0
  60. package/dist/headers/DNP3.js +150 -0
  61. package/dist/headers/DNS.d.ts +55 -0
  62. package/dist/headers/DNS.js +309 -0
  63. package/dist/headers/DTLS.d.ts +33 -0
  64. package/dist/headers/DTLS.js +142 -0
  65. package/dist/headers/Diameter.d.ts +34 -0
  66. package/dist/headers/Diameter.js +229 -0
  67. package/dist/headers/EAPOL.d.ts +32 -0
  68. package/dist/headers/EAPOL.js +135 -0
  69. package/dist/headers/EIGRP.d.ts +28 -0
  70. package/dist/headers/EIGRP.js +165 -0
  71. package/dist/headers/ENIP.d.ts +31 -0
  72. package/dist/headers/ENIP.js +164 -0
  73. package/dist/headers/ESP.d.ts +27 -0
  74. package/dist/headers/ESP.js +140 -0
  75. package/dist/headers/Elasticsearch.d.ts +30 -0
  76. package/dist/headers/Elasticsearch.js +125 -0
  77. package/dist/headers/EtherCAT.d.ts +35 -0
  78. package/dist/headers/EtherCAT.js +150 -0
  79. package/dist/headers/EthernetII.d.ts +28 -0
  80. package/dist/headers/EthernetII.js +117 -0
  81. package/dist/headers/FCoE.d.ts +38 -0
  82. package/dist/headers/FCoE.js +210 -0
  83. package/dist/headers/FTP.d.ts +34 -0
  84. package/dist/headers/FTP.js +158 -0
  85. package/dist/headers/Finger.d.ts +41 -0
  86. package/dist/headers/Finger.js +135 -0
  87. package/dist/headers/FoundationFieldbusHSE.d.ts +43 -0
  88. package/dist/headers/FoundationFieldbusHSE.js +163 -0
  89. package/dist/headers/GELF.d.ts +35 -0
  90. package/dist/headers/GELF.js +261 -0
  91. package/dist/headers/GENEVE.d.ts +26 -0
  92. package/dist/headers/GENEVE.js +209 -0
  93. package/dist/headers/GESRTP.d.ts +32 -0
  94. package/dist/headers/GESRTP.js +141 -0
  95. package/dist/headers/GLBP.d.ts +29 -0
  96. package/dist/headers/GLBP.js +159 -0
  97. package/dist/headers/GRE.d.ts +27 -0
  98. package/dist/headers/GRE.js +181 -0
  99. package/dist/headers/GTPU.d.ts +25 -0
  100. package/dist/headers/GTPU.js +203 -0
  101. package/dist/headers/GTPv2C.d.ts +30 -0
  102. package/dist/headers/GTPv2C.js +281 -0
  103. package/dist/headers/GitProtocol.d.ts +34 -0
  104. package/dist/headers/GitProtocol.js +141 -0
  105. package/dist/headers/Goose.d.ts +115 -0
  106. package/dist/headers/Goose.js +1067 -0
  107. package/dist/headers/Gopher.d.ts +43 -0
  108. package/dist/headers/Gopher.js +182 -0
  109. package/dist/headers/HARTIP.d.ts +30 -0
  110. package/dist/headers/HARTIP.js +145 -0
  111. package/dist/headers/HSR.d.ts +27 -0
  112. package/dist/headers/HSR.js +105 -0
  113. package/dist/headers/HSRP.d.ts +26 -0
  114. package/dist/headers/HSRP.js +173 -0
  115. package/dist/headers/HTTP.d.ts +32 -0
  116. package/dist/headers/HTTP.js +153 -0
  117. package/dist/headers/HTTP2.d.ts +34 -0
  118. package/dist/headers/HTTP2.js +190 -0
  119. package/dist/headers/IAX2.d.ts +33 -0
  120. package/dist/headers/IAX2.js +274 -0
  121. package/dist/headers/ICMP.d.ts +15 -0
  122. package/dist/headers/ICMP.js +148 -0
  123. package/dist/headers/ICMPv6.d.ts +15 -0
  124. package/dist/headers/ICMPv6.js +129 -0
  125. package/dist/headers/IEC104_I_Frame.d.ts +23 -0
  126. package/dist/headers/IEC104_I_Frame.js +6489 -0
  127. package/dist/headers/IEC104_S_Frame.d.ts +26 -0
  128. package/dist/headers/IEC104_S_Frame.js +135 -0
  129. package/dist/headers/IEC104_U_Frame.d.ts +27 -0
  130. package/dist/headers/IEC104_U_Frame.js +176 -0
  131. package/dist/headers/IEC61850SampledValues.d.ts +20 -0
  132. package/dist/headers/IEC61850SampledValues.js +420 -0
  133. package/dist/headers/IGMP.d.ts +31 -0
  134. package/dist/headers/IGMP.js +274 -0
  135. package/dist/headers/IMAP.d.ts +32 -0
  136. package/dist/headers/IMAP.js +185 -0
  137. package/dist/headers/IPFIX.d.ts +29 -0
  138. package/dist/headers/IPFIX.js +156 -0
  139. package/dist/headers/IPv4.d.ts +20 -0
  140. package/dist/headers/IPv4.js +370 -0
  141. package/dist/headers/IPv6.d.ts +29 -0
  142. package/dist/headers/IPv6.js +209 -0
  143. package/dist/headers/IPv6HopByHopOptions.d.ts +81 -0
  144. package/dist/headers/IPv6HopByHopOptions.js +495 -0
  145. package/dist/headers/IRC.d.ts +34 -0
  146. package/dist/headers/IRC.js +175 -0
  147. package/dist/headers/ISAKMP.d.ts +29 -0
  148. package/dist/headers/ISAKMP.js +197 -0
  149. package/dist/headers/ISCSI.d.ts +39 -0
  150. package/dist/headers/ISCSI.js +289 -0
  151. package/dist/headers/ISIS.d.ts +25 -0
  152. package/dist/headers/ISIS.js +79 -0
  153. package/dist/headers/ISOSession.d.ts +27 -0
  154. package/dist/headers/ISOSession.js +343 -0
  155. package/dist/headers/Ident.d.ts +42 -0
  156. package/dist/headers/Ident.js +184 -0
  157. package/dist/headers/KNXnetIP.d.ts +30 -0
  158. package/dist/headers/KNXnetIP.js +135 -0
  159. package/dist/headers/Kafka.d.ts +35 -0
  160. package/dist/headers/Kafka.js +128 -0
  161. package/dist/headers/Kerberos.d.ts +30 -0
  162. package/dist/headers/Kerberos.js +217 -0
  163. package/dist/headers/L2TP.d.ts +26 -0
  164. package/dist/headers/L2TP.js +297 -0
  165. package/dist/headers/LACP.d.ts +31 -0
  166. package/dist/headers/LACP.js +151 -0
  167. package/dist/headers/LDAP.d.ts +31 -0
  168. package/dist/headers/LDAP.js +226 -0
  169. package/dist/headers/LDP.d.ts +31 -0
  170. package/dist/headers/LDP.js +138 -0
  171. package/dist/headers/LISP.d.ts +30 -0
  172. package/dist/headers/LISP.js +103 -0
  173. package/dist/headers/LLC.d.ts +27 -0
  174. package/dist/headers/LLC.js +81 -0
  175. package/dist/headers/LLDP.d.ts +26 -0
  176. package/dist/headers/LLDP.js +126 -0
  177. package/dist/headers/LLMNR.d.ts +23 -0
  178. package/dist/headers/LLMNR.js +40 -0
  179. package/dist/headers/LPD.d.ts +31 -0
  180. package/dist/headers/LPD.js +159 -0
  181. package/dist/headers/MACsec.d.ts +34 -0
  182. package/dist/headers/MACsec.js +178 -0
  183. package/dist/headers/MDNS.d.ts +26 -0
  184. package/dist/headers/MDNS.js +45 -0
  185. package/dist/headers/MGCP.d.ts +30 -0
  186. package/dist/headers/MGCP.js +155 -0
  187. package/dist/headers/MMS.d.ts +29 -0
  188. package/dist/headers/MMS.js +243 -0
  189. package/dist/headers/MPLS.d.ts +31 -0
  190. package/dist/headers/MPLS.js +145 -0
  191. package/dist/headers/MQTT.d.ts +30 -0
  192. package/dist/headers/MQTT.js +173 -0
  193. package/dist/headers/MQTTSN.d.ts +34 -0
  194. package/dist/headers/MQTTSN.js +177 -0
  195. package/dist/headers/MarkerProtocol.d.ts +32 -0
  196. package/dist/headers/MarkerProtocol.js +153 -0
  197. package/dist/headers/Megaco.d.ts +32 -0
  198. package/dist/headers/Megaco.js +144 -0
  199. package/dist/headers/Memcached.d.ts +44 -0
  200. package/dist/headers/Memcached.js +285 -0
  201. package/dist/headers/ModbusTCP.d.ts +25 -0
  202. package/dist/headers/ModbusTCP.js +99 -0
  203. package/dist/headers/ModbusUDP.d.ts +26 -0
  204. package/dist/headers/ModbusUDP.js +100 -0
  205. package/dist/headers/MongoDB.d.ts +33 -0
  206. package/dist/headers/MongoDB.js +143 -0
  207. package/dist/headers/MySQL.d.ts +30 -0
  208. package/dist/headers/MySQL.js +114 -0
  209. package/dist/headers/NATS.d.ts +29 -0
  210. package/dist/headers/NATS.js +135 -0
  211. package/dist/headers/NBDS.d.ts +34 -0
  212. package/dist/headers/NBDS.js +176 -0
  213. package/dist/headers/NBNS.d.ts +34 -0
  214. package/dist/headers/NBNS.js +78 -0
  215. package/dist/headers/NBSS.d.ts +36 -0
  216. package/dist/headers/NBSS.js +137 -0
  217. package/dist/headers/NFS.d.ts +36 -0
  218. package/dist/headers/NFS.js +273 -0
  219. package/dist/headers/NHRP.d.ts +32 -0
  220. package/dist/headers/NHRP.js +154 -0
  221. package/dist/headers/NNTP.d.ts +35 -0
  222. package/dist/headers/NNTP.js +162 -0
  223. package/dist/headers/NTP.d.ts +18 -0
  224. package/dist/headers/NTP.js +73 -0
  225. package/dist/headers/NetFlowV5.d.ts +28 -0
  226. package/dist/headers/NetFlowV5.js +205 -0
  227. package/dist/headers/OLSR.d.ts +31 -0
  228. package/dist/headers/OLSR.js +213 -0
  229. package/dist/headers/OPCUA.d.ts +33 -0
  230. package/dist/headers/OPCUA.js +165 -0
  231. package/dist/headers/OPCUAPubSub.d.ts +33 -0
  232. package/dist/headers/OPCUAPubSub.js +144 -0
  233. package/dist/headers/OSPF.d.ts +31 -0
  234. package/dist/headers/OSPF.js +365 -0
  235. package/dist/headers/OmronFINS.d.ts +31 -0
  236. package/dist/headers/OmronFINS.js +90 -0
  237. package/dist/headers/OpenFlow.d.ts +30 -0
  238. package/dist/headers/OpenFlow.js +113 -0
  239. package/dist/headers/OpenVPN.d.ts +35 -0
  240. package/dist/headers/OpenVPN.js +214 -0
  241. package/dist/headers/PCWorx.d.ts +35 -0
  242. package/dist/headers/PCWorx.js +115 -0
  243. package/dist/headers/PIM.d.ts +27 -0
  244. package/dist/headers/PIM.js +129 -0
  245. package/dist/headers/POP3.d.ts +31 -0
  246. package/dist/headers/POP3.js +152 -0
  247. package/dist/headers/POWERLINK.d.ts +28 -0
  248. package/dist/headers/POWERLINK.js +116 -0
  249. package/dist/headers/PPPoEDiscovery.d.ts +29 -0
  250. package/dist/headers/PPPoEDiscovery.js +198 -0
  251. package/dist/headers/PPPoESession.d.ts +28 -0
  252. package/dist/headers/PPPoESession.js +125 -0
  253. package/dist/headers/PPTP.d.ts +30 -0
  254. package/dist/headers/PPTP.js +122 -0
  255. package/dist/headers/PROFINETRT.d.ts +28 -0
  256. package/dist/headers/PROFINETRT.js +74 -0
  257. package/dist/headers/PTP.d.ts +34 -0
  258. package/dist/headers/PTP.js +213 -0
  259. package/dist/headers/PostgreSQL.d.ts +40 -0
  260. package/dist/headers/PostgreSQL.js +236 -0
  261. package/dist/headers/QUIC.d.ts +34 -0
  262. package/dist/headers/QUIC.js +308 -0
  263. package/dist/headers/RADIUS.d.ts +24 -0
  264. package/dist/headers/RADIUS.js +138 -0
  265. package/dist/headers/RDP.d.ts +27 -0
  266. package/dist/headers/RDP.js +93 -0
  267. package/dist/headers/RFB.d.ts +39 -0
  268. package/dist/headers/RFB.js +151 -0
  269. package/dist/headers/RGoose.d.ts +72 -0
  270. package/dist/headers/RGoose.js +340 -0
  271. package/dist/headers/RIP.d.ts +29 -0
  272. package/dist/headers/RIP.js +133 -0
  273. package/dist/headers/RIPng.d.ts +26 -0
  274. package/dist/headers/RIPng.js +140 -0
  275. package/dist/headers/RMCP.d.ts +26 -0
  276. package/dist/headers/RMCP.js +155 -0
  277. package/dist/headers/RSVP.d.ts +31 -0
  278. package/dist/headers/RSVP.js +263 -0
  279. package/dist/headers/RTCP.d.ts +34 -0
  280. package/dist/headers/RTCP.js +217 -0
  281. package/dist/headers/RTP.d.ts +33 -0
  282. package/dist/headers/RTP.js +291 -0
  283. package/dist/headers/RTPS.d.ts +33 -0
  284. package/dist/headers/RTPS.js +182 -0
  285. package/dist/headers/RTSP.d.ts +36 -0
  286. package/dist/headers/RTSP.js +184 -0
  287. package/dist/headers/RawData.d.ts +17 -0
  288. package/dist/headers/RawData.js +43 -0
  289. package/dist/headers/Redis.d.ts +32 -0
  290. package/dist/headers/Redis.js +202 -0
  291. package/dist/headers/Rlogin.d.ts +42 -0
  292. package/dist/headers/Rlogin.js +139 -0
  293. package/dist/headers/Rsync.d.ts +28 -0
  294. package/dist/headers/Rsync.js +117 -0
  295. package/dist/headers/S7comm.d.ts +36 -0
  296. package/dist/headers/S7comm.js +244 -0
  297. package/dist/headers/SCTP.d.ts +35 -0
  298. package/dist/headers/SCTP.js +174 -0
  299. package/dist/headers/SFlow.d.ts +29 -0
  300. package/dist/headers/SFlow.js +242 -0
  301. package/dist/headers/SIP.d.ts +27 -0
  302. package/dist/headers/SIP.js +146 -0
  303. package/dist/headers/SLMP.d.ts +36 -0
  304. package/dist/headers/SLMP.js +154 -0
  305. package/dist/headers/SLP.d.ts +30 -0
  306. package/dist/headers/SLP.js +207 -0
  307. package/dist/headers/SLPv1.d.ts +32 -0
  308. package/dist/headers/SLPv1.js +138 -0
  309. package/dist/headers/SMB1.d.ts +37 -0
  310. package/dist/headers/SMB1.js +200 -0
  311. package/dist/headers/SMB2.d.ts +36 -0
  312. package/dist/headers/SMB2.js +203 -0
  313. package/dist/headers/SMPP.d.ts +33 -0
  314. package/dist/headers/SMPP.js +119 -0
  315. package/dist/headers/SMTP.d.ts +33 -0
  316. package/dist/headers/SMTP.js +157 -0
  317. package/dist/headers/SNAP.d.ts +22 -0
  318. package/dist/headers/SNAP.js +68 -0
  319. package/dist/headers/SNMP.d.ts +28 -0
  320. package/dist/headers/SNMP.js +302 -0
  321. package/dist/headers/SOCKS4.d.ts +42 -0
  322. package/dist/headers/SOCKS4.js +302 -0
  323. package/dist/headers/SOCKS5.d.ts +45 -0
  324. package/dist/headers/SOCKS5.js +223 -0
  325. package/dist/headers/SSDP.d.ts +27 -0
  326. package/dist/headers/SSDP.js +161 -0
  327. package/dist/headers/SSH.d.ts +44 -0
  328. package/dist/headers/SSH.js +274 -0
  329. package/dist/headers/STOMP.d.ts +48 -0
  330. package/dist/headers/STOMP.js +177 -0
  331. package/dist/headers/STP.d.ts +26 -0
  332. package/dist/headers/STP.js +150 -0
  333. package/dist/headers/STUN.d.ts +25 -0
  334. package/dist/headers/STUN.js +183 -0
  335. package/dist/headers/SercosIII.d.ts +43 -0
  336. package/dist/headers/SercosIII.js +199 -0
  337. package/dist/headers/Skinny.d.ts +32 -0
  338. package/dist/headers/Skinny.js +139 -0
  339. package/dist/headers/StatsD.d.ts +27 -0
  340. package/dist/headers/StatsD.js +134 -0
  341. package/dist/headers/SunRPC.d.ts +34 -0
  342. package/dist/headers/SunRPC.js +268 -0
  343. package/dist/headers/Syslog.d.ts +21 -0
  344. package/dist/headers/Syslog.js +91 -0
  345. package/dist/headers/TCP.d.ts +19 -0
  346. package/dist/headers/TCP.js +905 -0
  347. package/dist/headers/TFTP.d.ts +28 -0
  348. package/dist/headers/TFTP.js +224 -0
  349. package/dist/headers/TLS_Alert.d.ts +24 -0
  350. package/dist/headers/TLS_Alert.js +639 -0
  351. package/dist/headers/TLS_ApplicationData.d.ts +24 -0
  352. package/dist/headers/TLS_ApplicationData.js +170 -0
  353. package/dist/headers/TLS_ChangeCipherSpec.d.ts +23 -0
  354. package/dist/headers/TLS_ChangeCipherSpec.js +168 -0
  355. package/dist/headers/TLS_Handshake.d.ts +65 -0
  356. package/dist/headers/TLS_Handshake.js +860 -0
  357. package/dist/headers/TLS_Heartbeat.d.ts +27 -0
  358. package/dist/headers/TLS_Heartbeat.js +247 -0
  359. package/dist/headers/TPKT.d.ts +26 -0
  360. package/dist/headers/TPKT.js +99 -0
  361. package/dist/headers/TacacsPlus.d.ts +27 -0
  362. package/dist/headers/TacacsPlus.js +133 -0
  363. package/dist/headers/Telnet.d.ts +40 -0
  364. package/dist/headers/Telnet.js +193 -0
  365. package/dist/headers/Teredo.d.ts +40 -0
  366. package/dist/headers/Teredo.js +251 -0
  367. package/dist/headers/TimeProtocol.d.ts +25 -0
  368. package/dist/headers/TimeProtocol.js +53 -0
  369. package/dist/headers/UDP.d.ts +19 -0
  370. package/dist/headers/UDP.js +171 -0
  371. package/dist/headers/VLAN_802dot1Q.d.ts +24 -0
  372. package/dist/headers/VLAN_802dot1Q.js +96 -0
  373. package/dist/headers/VRRP.d.ts +26 -0
  374. package/dist/headers/VRRP.js +309 -0
  375. package/dist/headers/VXLAN.d.ts +24 -0
  376. package/dist/headers/VXLAN.js +75 -0
  377. package/dist/headers/WCCP.d.ts +29 -0
  378. package/dist/headers/WCCP.js +117 -0
  379. package/dist/headers/WHOIS.d.ts +37 -0
  380. package/dist/headers/WHOIS.js +126 -0
  381. package/dist/headers/WSDiscovery.d.ts +29 -0
  382. package/dist/headers/WSDiscovery.js +118 -0
  383. package/dist/headers/WakeOnLAN.d.ts +30 -0
  384. package/dist/headers/WakeOnLAN.js +126 -0
  385. package/dist/headers/WebSocket.d.ts +26 -0
  386. package/dist/headers/WebSocket.js +173 -0
  387. package/dist/headers/WireGuard.d.ts +38 -0
  388. package/dist/headers/WireGuard.js +216 -0
  389. package/dist/headers/XMPP.d.ts +37 -0
  390. package/dist/headers/XMPP.js +149 -0
  391. package/dist/headers/Zabbix.d.ts +35 -0
  392. package/dist/headers/Zabbix.js +153 -0
  393. package/dist/headers/cms/AcsiPdu.d.ts +45 -0
  394. package/dist/headers/cms/AcsiPdu.js +112 -0
  395. package/dist/headers/cms/PerDecoder.d.ts +68 -0
  396. package/dist/headers/cms/PerDecoder.js +211 -0
  397. package/dist/headers/cms/PerReader.d.ts +64 -0
  398. package/dist/headers/cms/PerReader.js +155 -0
  399. package/dist/helper/BufferToHex.d.ts +5 -0
  400. package/dist/helper/BufferToHex.js +10 -0
  401. package/dist/helper/BufferToIP.d.ts +12 -0
  402. package/dist/helper/BufferToIP.js +23 -0
  403. package/dist/helper/BufferToNumber.d.ts +18 -0
  404. package/dist/helper/BufferToNumber.js +47 -0
  405. package/dist/helper/HexToBuffer.d.ts +7 -0
  406. package/dist/helper/HexToBuffer.js +27 -0
  407. package/dist/helper/HexToNumber.d.ts +18 -0
  408. package/dist/helper/HexToNumber.js +48 -0
  409. package/dist/helper/IPToBuffer.d.ts +12 -0
  410. package/dist/helper/IPToBuffer.js +34 -0
  411. package/dist/helper/NumberToBERBuffer.d.ts +18 -0
  412. package/dist/helper/NumberToBERBuffer.js +31 -0
  413. package/dist/helper/NumberToBERHex.d.ts +18 -0
  414. package/dist/helper/NumberToBERHex.js +52 -0
  415. package/dist/helper/NumberToBuffer.d.ts +18 -0
  416. package/dist/helper/NumberToBuffer.js +38 -0
  417. package/dist/helper/NumberToHex.d.ts +18 -0
  418. package/dist/helper/NumberToHex.js +35 -0
  419. package/dist/index.d.ts +52 -0
  420. package/dist/index.js +113 -0
  421. package/dist/lib/FlexibleObject.d.ts +27 -0
  422. package/dist/lib/FlexibleObject.js +113 -0
  423. package/dist/lib/GetBERIntegerLengthFromBuffer.d.ts +6 -0
  424. package/dist/lib/GetBERIntegerLengthFromBuffer.js +16 -0
  425. package/dist/lib/ProcessPacketPostHandlers.d.ts +13 -0
  426. package/dist/lib/ProcessPacketPostHandlers.js +53 -0
  427. package/dist/lib/SortPostHandlers.d.ts +7 -0
  428. package/dist/lib/SortPostHandlers.js +11 -0
  429. package/dist/lib/StringContentEncodingEnum.d.ts +10 -0
  430. package/dist/lib/StringContentEncodingEnum.js +14 -0
  431. package/dist/schema/ProtocolFieldJSONSchema.d.ts +35 -0
  432. package/dist/schema/ProtocolFieldJSONSchema.js +2 -0
  433. package/dist/schema/ProtocolFieldJSONSchemaDefinition.d.ts +2 -0
  434. package/dist/schema/ProtocolFieldJSONSchemaDefinition.js +2 -0
  435. package/dist/schema/ProtocolJSONSchema.d.ts +32 -0
  436. package/dist/schema/ProtocolJSONSchema.js +2 -0
  437. package/dist/types/CodecData.d.ts +7 -0
  438. package/dist/types/CodecData.js +2 -0
  439. package/dist/types/CodecDecodeResult.d.ts +10 -0
  440. package/dist/types/CodecDecodeResult.js +2 -0
  441. package/dist/types/CodecEncodeInput.d.ts +2 -0
  442. package/dist/types/CodecEncodeInput.js +2 -0
  443. package/dist/types/CodecEncodeResult.d.ts +5 -0
  444. package/dist/types/CodecEncodeResult.js +2 -0
  445. package/dist/types/CodecErrorInfo.d.ts +5 -0
  446. package/dist/types/CodecErrorInfo.js +2 -0
  447. package/dist/types/CodecModule.d.ts +2 -0
  448. package/dist/types/CodecModule.js +2 -0
  449. package/dist/types/CodecModuleConstructor.d.ts +2 -0
  450. package/dist/types/CodecModuleConstructor.js +2 -0
  451. package/dist/types/CodecSchema.d.ts +6 -0
  452. package/dist/types/CodecSchema.js +2 -0
  453. package/dist/types/DemuxProducer.d.ts +23 -0
  454. package/dist/types/DemuxProducer.js +2 -0
  455. package/dist/types/Dissection.d.ts +23 -0
  456. package/dist/types/Dissection.js +2 -0
  457. package/dist/types/HeaderTreeNode.d.ts +4 -0
  458. package/dist/types/HeaderTreeNode.js +2 -0
  459. package/dist/types/LayerGraph.d.ts +32 -0
  460. package/dist/types/LayerGraph.js +2 -0
  461. package/dist/types/PostHandlerItem.d.ts +4 -0
  462. package/dist/types/PostHandlerItem.js +2 -0
  463. package/package.json +141 -0
@@ -0,0 +1,28 @@
1
+ import { BaseHeader } from '../abstracts/BaseHeader';
2
+ import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
3
+ import { DemuxProducer } from '../types/DemuxProducer';
4
+ /**
5
+ * SNMP — Simple Network Management Protocol v1 / v2c (RFC 1157 / RFC 3416). The message is a single
6
+ * ASN.1 BER structure: SEQUENCE { version INTEGER, community OCTET STRING, PDU }, where the PDU is a
7
+ * context tag ([0]=get-request … [2]=get-response/response, [3]=set-request, [5]=get-bulk-request,
8
+ * [7]=snmpV2-trap …) wrapping SEQUENCE { request-id, error-status, error-index, variable-bindings }.
9
+ * Rides UDP ports 161 (agent) and 162 (trap).
10
+ *
11
+ * Byte-perfect strategy: the four INTEGER fields are decoded as signed integers and re-emitted with
12
+ * minimal two's-complement BER; the object identifier is decoded to a dotted string and re-emitted via
13
+ * base-128 sub-identifiers; community is kept as a latin1 string; and each binding's VALUE is kept as
14
+ * its BER tag + verbatim hex content (so any value type — OctetString, TimeTicks, Counter, IpAddress,
15
+ * Null … — round-trips exactly without needing a per-type encoder). Definite lengths are re-derived in
16
+ * minimal form, matching the standard DER-style encoding SNMP agents emit. SNMPv3 (which adds security
17
+ * parameters and optional encryption) is a later, separate concern.
18
+ */
19
+ export declare class SNMP extends BaseHeader {
20
+ #private;
21
+ get SCHEMA(): ProtocolJSONSchema;
22
+ readonly id: string;
23
+ readonly name: string;
24
+ readonly nickname: string;
25
+ readonly matchKeys: string[];
26
+ match(): boolean;
27
+ readonly demuxProducers: DemuxProducer[];
28
+ }
@@ -0,0 +1,302 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SNMP = void 0;
4
+ const BaseHeader_1 = require("../abstracts/BaseHeader");
5
+ const StringContentEncodingEnum_1 = require("../lib/StringContentEncodingEnum");
6
+ /**
7
+ * SNMP — Simple Network Management Protocol v1 / v2c (RFC 1157 / RFC 3416). The message is a single
8
+ * ASN.1 BER structure: SEQUENCE { version INTEGER, community OCTET STRING, PDU }, where the PDU is a
9
+ * context tag ([0]=get-request … [2]=get-response/response, [3]=set-request, [5]=get-bulk-request,
10
+ * [7]=snmpV2-trap …) wrapping SEQUENCE { request-id, error-status, error-index, variable-bindings }.
11
+ * Rides UDP ports 161 (agent) and 162 (trap).
12
+ *
13
+ * Byte-perfect strategy: the four INTEGER fields are decoded as signed integers and re-emitted with
14
+ * minimal two's-complement BER; the object identifier is decoded to a dotted string and re-emitted via
15
+ * base-128 sub-identifiers; community is kept as a latin1 string; and each binding's VALUE is kept as
16
+ * its BER tag + verbatim hex content (so any value type — OctetString, TimeTicks, Counter, IpAddress,
17
+ * Null … — round-trips exactly without needing a per-type encoder). Definite lengths are re-derived in
18
+ * minimal form, matching the standard DER-style encoding SNMP agents emit. SNMPv3 (which adds security
19
+ * parameters and optional encryption) is a later, separate concern.
20
+ */
21
+ class SNMP extends BaseHeader_1.BaseHeader {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.id = 'snmp';
25
+ this.name = 'Simple Network Management Protocol';
26
+ this.nickname = 'SNMP';
27
+ //Agent port 161, trap/notification port 162 (both UDP). BER SEQUENCE has no reliable content
28
+ //signature, so this is port-defined (no heuristicFallback).
29
+ this.matchKeys = ['udpport:161', 'udpport:162'];
30
+ //A leaf header — nothing demuxes above SNMP.
31
+ this.demuxProducers = [];
32
+ }
33
+ static #schemaCache;
34
+ //The PDU tags that share the RFC 3416 body shape {request-id, error-status, error-index, varbinds}:
35
+ //get-request(0xa0), get-next(0xa1), get-response(0xa2), set-request(0xa3), get-bulk(0xa5),
36
+ //inform(0xa6), snmpV2-trap(0xa7), report(0xa8). The SNMPv1 Trap-PDU (0xa4) has a DIFFERENT body
37
+ //(enterprise/agent-addr/generic/specific/timestamp/varbinds), so it — and any unknown tag — is kept
38
+ //verbatim (pduRaw) rather than misparsed, preserving a byte-perfect round-trip.
39
+ static #RFC3416_PDU_TAGS = new Set([0xa0, 0xa1, 0xa2, 0xa3, 0xa5, 0xa6, 0xa7, 0xa8]);
40
+ get SCHEMA() {
41
+ return (SNMP.#schemaCache ??= SNMP.#buildSchema());
42
+ }
43
+ // ===== Minimal BER/DER codec (definite length only) =====
44
+ /** Read one TLV at `pos`; defensive against truncation (always advances, clamps to buffer). */
45
+ static #readTLV(buf, pos) {
46
+ if (pos >= buf.length)
47
+ return { tag: 0, contentStart: pos, contentLen: 0, next: pos + 1 };
48
+ const tag = buf[pos];
49
+ let p = pos + 1;
50
+ let len = p < buf.length ? buf[p] : 0;
51
+ p += 1;
52
+ if (len & 0x80) {
53
+ const lengthBytes = len & 0x7f;
54
+ len = 0;
55
+ for (let i = 0; i < lengthBytes; i++) {
56
+ len = len * 256 + (p < buf.length ? buf[p] : 0);
57
+ p += 1;
58
+ }
59
+ }
60
+ const contentStart = p;
61
+ //Clamp the content to what is actually present so a lying length cannot read out of bounds.
62
+ const contentLen = Math.min(len, Math.max(0, buf.length - contentStart));
63
+ return { tag: tag, contentStart: contentStart, contentLen: contentLen, next: contentStart + contentLen };
64
+ }
65
+ /** Decode a BER INTEGER content (big-endian two's-complement, signed). */
66
+ static #berInt(buf) {
67
+ if (buf.length === 0)
68
+ return 0;
69
+ let value = 0;
70
+ for (const byte of buf)
71
+ value = value * 256 + byte;
72
+ if (buf[0] & 0x80)
73
+ value -= Math.pow(2, 8 * buf.length);
74
+ return value;
75
+ }
76
+ /** Encode a signed integer as minimal BER INTEGER content bytes. */
77
+ static #intToBer(value) {
78
+ const bytes = [];
79
+ let v = Math.trunc(value);
80
+ if (v >= 0) {
81
+ do {
82
+ bytes.unshift(v & 0xff);
83
+ v = Math.floor(v / 256);
84
+ } while (v > 0);
85
+ if (bytes[0] & 0x80)
86
+ bytes.unshift(0);
87
+ }
88
+ else {
89
+ do {
90
+ bytes.unshift(v & 0xff);
91
+ v = Math.floor(v / 256);
92
+ } while (v < -1);
93
+ if (!(bytes[0] & 0x80))
94
+ bytes.unshift(0xff);
95
+ }
96
+ return Buffer.from(bytes);
97
+ }
98
+ /** Decode a BER OBJECT IDENTIFIER content into a dotted string. */
99
+ static #oidToStr(buf) {
100
+ const subs = [];
101
+ let value = 0;
102
+ for (let i = 0; i < buf.length; i++) {
103
+ value = value * 128 + (buf[i] & 0x7f);
104
+ if (!(buf[i] & 0x80)) {
105
+ subs.push(value);
106
+ value = 0;
107
+ }
108
+ }
109
+ if (subs.length === 0)
110
+ return '';
111
+ const first = subs[0];
112
+ const arc0 = first < 80 ? Math.floor(first / 40) : 2;
113
+ const arc1 = first - arc0 * 40;
114
+ return [arc0, arc1, ...subs.slice(1)].join('.');
115
+ }
116
+ /** Encode a dotted OID string into BER OBJECT IDENTIFIER content bytes (base-128 sub-identifiers). */
117
+ static #strToOid(oid) {
118
+ const arcs = oid.split('.').map((arc) => Number(arc) || 0);
119
+ const subs = [];
120
+ if (arcs.length >= 2)
121
+ subs.push(arcs[0] * 40 + arcs[1]);
122
+ else if (arcs.length === 1)
123
+ subs.push(arcs[0] * 40);
124
+ for (let i = 2; i < arcs.length; i++)
125
+ subs.push(arcs[i]);
126
+ const bytes = [];
127
+ for (const sub of subs) {
128
+ const group = [];
129
+ let v = sub;
130
+ do {
131
+ group.unshift(v & 0x7f);
132
+ v = Math.floor(v / 128);
133
+ } while (v > 0);
134
+ for (let i = 0; i < group.length - 1; i++)
135
+ group[i] |= 0x80;
136
+ bytes.push(...group);
137
+ }
138
+ return Buffer.from(bytes);
139
+ }
140
+ /** Encode a definite length in minimal form (short form < 128, else long form). */
141
+ static #encodeLength(length) {
142
+ if (length < 0x80)
143
+ return Buffer.from([length]);
144
+ const bytes = [];
145
+ let v = length;
146
+ while (v > 0) {
147
+ bytes.unshift(v & 0xff);
148
+ v = Math.floor(v / 256);
149
+ }
150
+ return Buffer.from([0x80 | bytes.length, ...bytes]);
151
+ }
152
+ /** Build a complete TLV: tag + minimal length + content. */
153
+ static #tlv(tag, content) {
154
+ return Buffer.concat([Buffer.from([tag]), this.#encodeLength(content.length), content]);
155
+ }
156
+ static #buildSchema() {
157
+ return {
158
+ type: 'object',
159
+ summary: 'SNMP ${community} req=${requestId}',
160
+ properties: {
161
+ //SNMP is one nested BER blob, so the whole message is parsed here (and emitted in the
162
+ //matching encode) rather than field-by-field at fixed offsets. The remaining properties
163
+ //below carry only schema/label/validation metadata; they have no closures of their own.
164
+ version: {
165
+ type: 'integer',
166
+ label: 'Version',
167
+ minimum: 0,
168
+ maximum: 3,
169
+ decode: function () {
170
+ const available = this.packet.length - this.startPos;
171
+ if (available <= 0)
172
+ return;
173
+ //Peek the outer SEQUENCE header to learn the whole-message length (the length
174
+ //field is read UNCLAMPED here — the peek is only long enough for the header, so
175
+ //#readTLV's content clamp would wrongly cap the total), then read the whole
176
+ //message (non-dry-run) so headerLength/endPos cover exactly the BER message.
177
+ const peek = this.readBytes(0, available < 8 ? available : 8, true);
178
+ let hp = 1;
179
+ let declaredLength = hp < peek.length ? peek[hp] : 0;
180
+ hp += 1;
181
+ if (declaredLength & 0x80) {
182
+ const lengthBytes = declaredLength & 0x7f;
183
+ declaredLength = 0;
184
+ for (let i = 0; i < lengthBytes; i++) {
185
+ declaredLength = declaredLength * 256 + (hp < peek.length ? peek[hp] : 0);
186
+ hp += 1;
187
+ }
188
+ }
189
+ const total = Math.min(hp + declaredLength, available);
190
+ const buf = this.readBytes(0, total > 0 ? total : 0);
191
+ const message = SNMP.#readTLV(buf, 0);
192
+ let p = message.contentStart;
193
+ const versionTLV = SNMP.#readTLV(buf, p);
194
+ this.instance.version.setValue(SNMP.#berInt(buf.subarray(versionTLV.contentStart, versionTLV.next)));
195
+ p = versionTLV.next;
196
+ const communityTLV = SNMP.#readTLV(buf, p);
197
+ this.instance.community.setValue(buf.subarray(communityTLV.contentStart, communityTLV.next).toString('latin1'));
198
+ p = communityTLV.next;
199
+ const pduTLV = SNMP.#readTLV(buf, p);
200
+ this.instance.pduType.setValue(pduTLV.tag);
201
+ if (!SNMP.#RFC3416_PDU_TAGS.has(pduTLV.tag)) {
202
+ //Non-RFC-3416 PDU (SNMPv1 Trap 0xa4, or an unknown tag): keep the body bytes
203
+ //verbatim so it round-trips exactly. Structured fields are left unset;
204
+ //semantic decoding of the v1 trap body is a later enrichment.
205
+ this.instance.pduRaw.setValue(buf.subarray(pduTLV.contentStart, pduTLV.next).toString('hex'));
206
+ return;
207
+ }
208
+ let pp = pduTLV.contentStart;
209
+ const requestIdTLV = SNMP.#readTLV(buf, pp);
210
+ this.instance.requestId.setValue(SNMP.#berInt(buf.subarray(requestIdTLV.contentStart, requestIdTLV.next)));
211
+ pp = requestIdTLV.next;
212
+ const errorStatusTLV = SNMP.#readTLV(buf, pp);
213
+ this.instance.errorStatus.setValue(SNMP.#berInt(buf.subarray(errorStatusTLV.contentStart, errorStatusTLV.next)));
214
+ pp = errorStatusTLV.next;
215
+ const errorIndexTLV = SNMP.#readTLV(buf, pp);
216
+ this.instance.errorIndex.setValue(SNMP.#berInt(buf.subarray(errorIndexTLV.contentStart, errorIndexTLV.next)));
217
+ pp = errorIndexTLV.next;
218
+ const bindingsTLV = SNMP.#readTLV(buf, pp);
219
+ const varbinds = [];
220
+ let vp = bindingsTLV.contentStart;
221
+ while (vp < bindingsTLV.next && vp < buf.length) {
222
+ const bindTLV = SNMP.#readTLV(buf, vp);
223
+ let ip = bindTLV.contentStart;
224
+ const oidTLV = SNMP.#readTLV(buf, ip);
225
+ const oid = SNMP.#oidToStr(buf.subarray(oidTLV.contentStart, oidTLV.next));
226
+ ip = oidTLV.next;
227
+ const valueTLV = SNMP.#readTLV(buf, ip);
228
+ varbinds.push({
229
+ oid: oid,
230
+ valueType: valueTLV.tag,
231
+ value: buf.subarray(valueTLV.contentStart, valueTLV.next).toString('hex')
232
+ });
233
+ vp = bindTLV.next;
234
+ }
235
+ this.instance.variableBindings.setValue(varbinds);
236
+ },
237
+ encode: function () {
238
+ const version = this.instance.version.getValue(0);
239
+ const community = this.instance.community.getValue('');
240
+ const pduType = this.instance.pduType.getValue(0xa0);
241
+ const requestId = this.instance.requestId.getValue(0);
242
+ const errorStatus = this.instance.errorStatus.getValue(0);
243
+ const errorIndex = this.instance.errorIndex.getValue(0);
244
+ const pduRaw = this.instance.pduRaw.getValue('');
245
+ let pduContent;
246
+ if (pduRaw) {
247
+ //A non-RFC-3416 PDU kept verbatim (e.g. SNMPv1 trap): re-emit its body as-is.
248
+ pduContent = Buffer.from(pduRaw, 'hex');
249
+ }
250
+ else {
251
+ const varbinds = this.instance.variableBindings.getValue([]);
252
+ const bindBuffers = (varbinds ? varbinds : []).map((varbind) => {
253
+ const oidBuffer = SNMP.#tlv(0x06, SNMP.#strToOid(varbind.oid ? varbind.oid : ''));
254
+ const valueBuffer = SNMP.#tlv(varbind.valueType ? varbind.valueType : 0x05, Buffer.from(varbind.value ? varbind.value : '', 'hex'));
255
+ return SNMP.#tlv(0x30, Buffer.concat([oidBuffer, valueBuffer]));
256
+ });
257
+ pduContent = Buffer.concat([
258
+ SNMP.#tlv(0x02, SNMP.#intToBer(requestId)),
259
+ SNMP.#tlv(0x02, SNMP.#intToBer(errorStatus)),
260
+ SNMP.#tlv(0x02, SNMP.#intToBer(errorIndex)),
261
+ SNMP.#tlv(0x30, Buffer.concat(bindBuffers))
262
+ ]);
263
+ }
264
+ const message = SNMP.#tlv(0x30, Buffer.concat([
265
+ SNMP.#tlv(0x02, SNMP.#intToBer(version)),
266
+ SNMP.#tlv(0x04, Buffer.from(community, 'latin1')),
267
+ SNMP.#tlv(pduType, pduContent)
268
+ ]));
269
+ this.writeBytes(0, message);
270
+ }
271
+ },
272
+ community: { type: 'string', label: 'Community' },
273
+ //The PDU context tag: 0xa0 get-request, 0xa1 get-next-request, 0xa2 get-response,
274
+ //0xa3 set-request, 0xa5 get-bulk-request, 0xa6 inform-request, 0xa7 snmpV2-trap, 0xa8 report.
275
+ pduType: { type: 'integer', label: 'PDU Type', minimum: 0, maximum: 255 },
276
+ //Verbatim PDU body for non-RFC-3416 PDUs (SNMPv1 Trap 0xa4 / unknown tags). Hidden and
277
+ //empty for the common request/response PDUs, which use the structured fields below.
278
+ pduRaw: { type: 'string', label: 'PDU Body', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX, hidden: true },
279
+ requestId: { type: 'integer', label: 'Request ID' },
280
+ errorStatus: { type: 'integer', label: 'Error Status', minimum: 0 },
281
+ errorIndex: { type: 'integer', label: 'Error Index', minimum: 0 },
282
+ variableBindings: {
283
+ type: 'array',
284
+ label: 'Variable Bindings',
285
+ items: {
286
+ type: 'object',
287
+ label: 'Variable Binding',
288
+ properties: {
289
+ oid: { type: 'string', label: 'Object Identifier' },
290
+ valueType: { type: 'integer', label: 'Value Type', minimum: 0, maximum: 255 },
291
+ value: { type: 'string', label: 'Value', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ };
297
+ }
298
+ match() {
299
+ return !!this.prevCodecModule && this.prevCodecModule.id === 'udp';
300
+ }
301
+ }
302
+ exports.SNMP = SNMP;
@@ -0,0 +1,42 @@
1
+ import { BaseHeader } from '../abstracts/BaseHeader';
2
+ import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
3
+ import { DemuxProducer } from '../types/DemuxProducer';
4
+ /**
5
+ * SOCKS4 — the SOCKS Protocol Version 4 (and the SOCKS4a extension), carried over TCP well-known
6
+ * port 1080. Only two message shapes travel on the wire, discriminated by their leading octet:
7
+ *
8
+ * 1. Client request : version(1,=4) · command(1: 1 CONNECT / 2 BIND) · dstPort(2, BE) ·
9
+ * dstIp(4, IPv4) · userId(null-terminated ASCII) [· domain(null-terminated)]
10
+ * 2. Server reply : null(1,=0) · status(1: 0x5A granted, 0x5B/0x5C/0x5D rejected) ·
11
+ * dstPort(2, BE) · dstIp(4, IPv4) — always exactly 8 octets
12
+ *
13
+ * The two shapes share their tail exactly — dstPort at offset 2 and dstIp at offset 4 — so those
14
+ * fields are common to both; only the leading octet (version 4 vs null 0), the second octet
15
+ * (command vs status), and the request's trailing user-id are shape-specific. A `messageType`
16
+ * display field ('request' | 'reply') is the discriminator, decoded from the leading octet
17
+ * (4 → request, 0 → reply) and driving every field below.
18
+ *
19
+ * SOCKS4a: when the request's dstIp is 0.0.0.x (first three octets zero, last non-zero) the client
20
+ * could not resolve the host and appends a second null-terminated string — the destination domain —
21
+ * after the user-id. The codec structures that trailing string as `domain` whenever bytes remain
22
+ * after the user-id's terminator, so both plain SOCKS4 and SOCKS4a requests round-trip byte-for-byte.
23
+ * (A request whose user-id lacks its RFC-mandated null terminator is malformed: it decodes
24
+ * best-effort but re-emits with the terminator, so the byte-perfect guarantee is for conformant
25
+ * SOCKS4 only.)
26
+ *
27
+ * Matching rationale (NO heuristicFallback): SOCKS4 is claimed ONLY on the tcp:1080 bucket. Its only
28
+ * content signature is a single leading octet of 0x04 (request) or 0x00 (reply) — a signature that
29
+ * matches enormous amounts of arbitrary binary TCP data; recognition therefore depends entirely on
30
+ * the well-known port. Joining the global content-heuristic chain would mislabel unrelated binary
31
+ * traffic on any port, so SOCKS4 is confined to tcp:1080 and alt-port SOCKS4 falls losslessly to raw.
32
+ */
33
+ export declare class SOCKS4 extends BaseHeader {
34
+ #private;
35
+ get SCHEMA(): ProtocolJSONSchema;
36
+ readonly id: string;
37
+ readonly name: string;
38
+ readonly nickname: string;
39
+ readonly matchKeys: string[];
40
+ match(): boolean;
41
+ readonly demuxProducers: DemuxProducer[];
42
+ }