@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.
- package/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/README.zh-CN.md +342 -0
- package/dist/Codec.d.ts +133 -0
- package/dist/Codec.js +632 -0
- package/dist/PacketHeaders.d.ts +189 -0
- package/dist/PacketHeaders.js +384 -0
- package/dist/abstracts/BaseHeader.d.ts +325 -0
- package/dist/abstracts/BaseHeader.js +734 -0
- package/dist/errors/CodecSchemaValidateError.d.ts +4 -0
- package/dist/errors/CodecSchemaValidateError.js +11 -0
- package/dist/headers/ADSAMS.d.ts +33 -0
- package/dist/headers/ADSAMS.js +208 -0
- package/dist/headers/AH.d.ts +28 -0
- package/dist/headers/AH.js +137 -0
- package/dist/headers/AMQP.d.ts +31 -0
- package/dist/headers/AMQP.js +316 -0
- package/dist/headers/ARP.d.ts +26 -0
- package/dist/headers/ARP.js +243 -0
- package/dist/headers/BACnetIP.d.ts +27 -0
- package/dist/headers/BACnetIP.js +97 -0
- package/dist/headers/BFD.d.ts +28 -0
- package/dist/headers/BFD.js +155 -0
- package/dist/headers/BGP.d.ts +27 -0
- package/dist/headers/BGP.js +111 -0
- package/dist/headers/BSAPIP.d.ts +33 -0
- package/dist/headers/BSAPIP.js +78 -0
- package/dist/headers/Babel.d.ts +32 -0
- package/dist/headers/Babel.js +224 -0
- package/dist/headers/BitTorrent.d.ts +28 -0
- package/dist/headers/BitTorrent.js +72 -0
- package/dist/headers/C37118.d.ts +26 -0
- package/dist/headers/C37118.js +147 -0
- package/dist/headers/CAPWAP.d.ts +38 -0
- package/dist/headers/CAPWAP.js +275 -0
- package/dist/headers/CDP.d.ts +25 -0
- package/dist/headers/CDP.js +117 -0
- package/dist/headers/CMS.d.ts +33 -0
- package/dist/headers/CMS.js +238 -0
- package/dist/headers/COTP.d.ts +30 -0
- package/dist/headers/COTP.js +193 -0
- package/dist/headers/CassandraCQL.d.ts +28 -0
- package/dist/headers/CassandraCQL.js +117 -0
- package/dist/headers/CoAP.d.ts +29 -0
- package/dist/headers/CoAP.js +140 -0
- package/dist/headers/Codesys.d.ts +32 -0
- package/dist/headers/Codesys.js +119 -0
- package/dist/headers/Collectd.d.ts +29 -0
- package/dist/headers/Collectd.js +154 -0
- package/dist/headers/DCCP.d.ts +30 -0
- package/dist/headers/DCCP.js +204 -0
- package/dist/headers/DHCP.d.ts +26 -0
- package/dist/headers/DHCP.js +148 -0
- package/dist/headers/DHCPFailover.d.ts +30 -0
- package/dist/headers/DHCPFailover.js +104 -0
- package/dist/headers/DHCPv6.d.ts +25 -0
- package/dist/headers/DHCPv6.js +145 -0
- package/dist/headers/DNP3.d.ts +27 -0
- package/dist/headers/DNP3.js +150 -0
- package/dist/headers/DNS.d.ts +55 -0
- package/dist/headers/DNS.js +309 -0
- package/dist/headers/DTLS.d.ts +33 -0
- package/dist/headers/DTLS.js +142 -0
- package/dist/headers/Diameter.d.ts +34 -0
- package/dist/headers/Diameter.js +229 -0
- package/dist/headers/EAPOL.d.ts +32 -0
- package/dist/headers/EAPOL.js +135 -0
- package/dist/headers/EIGRP.d.ts +28 -0
- package/dist/headers/EIGRP.js +165 -0
- package/dist/headers/ENIP.d.ts +31 -0
- package/dist/headers/ENIP.js +164 -0
- package/dist/headers/ESP.d.ts +27 -0
- package/dist/headers/ESP.js +140 -0
- package/dist/headers/Elasticsearch.d.ts +30 -0
- package/dist/headers/Elasticsearch.js +125 -0
- package/dist/headers/EtherCAT.d.ts +35 -0
- package/dist/headers/EtherCAT.js +150 -0
- package/dist/headers/EthernetII.d.ts +28 -0
- package/dist/headers/EthernetII.js +117 -0
- package/dist/headers/FCoE.d.ts +38 -0
- package/dist/headers/FCoE.js +210 -0
- package/dist/headers/FTP.d.ts +34 -0
- package/dist/headers/FTP.js +158 -0
- package/dist/headers/Finger.d.ts +41 -0
- package/dist/headers/Finger.js +135 -0
- package/dist/headers/FoundationFieldbusHSE.d.ts +43 -0
- package/dist/headers/FoundationFieldbusHSE.js +163 -0
- package/dist/headers/GELF.d.ts +35 -0
- package/dist/headers/GELF.js +261 -0
- package/dist/headers/GENEVE.d.ts +26 -0
- package/dist/headers/GENEVE.js +209 -0
- package/dist/headers/GESRTP.d.ts +32 -0
- package/dist/headers/GESRTP.js +141 -0
- package/dist/headers/GLBP.d.ts +29 -0
- package/dist/headers/GLBP.js +159 -0
- package/dist/headers/GRE.d.ts +27 -0
- package/dist/headers/GRE.js +181 -0
- package/dist/headers/GTPU.d.ts +25 -0
- package/dist/headers/GTPU.js +203 -0
- package/dist/headers/GTPv2C.d.ts +30 -0
- package/dist/headers/GTPv2C.js +281 -0
- package/dist/headers/GitProtocol.d.ts +34 -0
- package/dist/headers/GitProtocol.js +141 -0
- package/dist/headers/Goose.d.ts +115 -0
- package/dist/headers/Goose.js +1067 -0
- package/dist/headers/Gopher.d.ts +43 -0
- package/dist/headers/Gopher.js +182 -0
- package/dist/headers/HARTIP.d.ts +30 -0
- package/dist/headers/HARTIP.js +145 -0
- package/dist/headers/HSR.d.ts +27 -0
- package/dist/headers/HSR.js +105 -0
- package/dist/headers/HSRP.d.ts +26 -0
- package/dist/headers/HSRP.js +173 -0
- package/dist/headers/HTTP.d.ts +32 -0
- package/dist/headers/HTTP.js +153 -0
- package/dist/headers/HTTP2.d.ts +34 -0
- package/dist/headers/HTTP2.js +190 -0
- package/dist/headers/IAX2.d.ts +33 -0
- package/dist/headers/IAX2.js +274 -0
- package/dist/headers/ICMP.d.ts +15 -0
- package/dist/headers/ICMP.js +148 -0
- package/dist/headers/ICMPv6.d.ts +15 -0
- package/dist/headers/ICMPv6.js +129 -0
- package/dist/headers/IEC104_I_Frame.d.ts +23 -0
- package/dist/headers/IEC104_I_Frame.js +6489 -0
- package/dist/headers/IEC104_S_Frame.d.ts +26 -0
- package/dist/headers/IEC104_S_Frame.js +135 -0
- package/dist/headers/IEC104_U_Frame.d.ts +27 -0
- package/dist/headers/IEC104_U_Frame.js +176 -0
- package/dist/headers/IEC61850SampledValues.d.ts +20 -0
- package/dist/headers/IEC61850SampledValues.js +420 -0
- package/dist/headers/IGMP.d.ts +31 -0
- package/dist/headers/IGMP.js +274 -0
- package/dist/headers/IMAP.d.ts +32 -0
- package/dist/headers/IMAP.js +185 -0
- package/dist/headers/IPFIX.d.ts +29 -0
- package/dist/headers/IPFIX.js +156 -0
- package/dist/headers/IPv4.d.ts +20 -0
- package/dist/headers/IPv4.js +370 -0
- package/dist/headers/IPv6.d.ts +29 -0
- package/dist/headers/IPv6.js +209 -0
- package/dist/headers/IPv6HopByHopOptions.d.ts +81 -0
- package/dist/headers/IPv6HopByHopOptions.js +495 -0
- package/dist/headers/IRC.d.ts +34 -0
- package/dist/headers/IRC.js +175 -0
- package/dist/headers/ISAKMP.d.ts +29 -0
- package/dist/headers/ISAKMP.js +197 -0
- package/dist/headers/ISCSI.d.ts +39 -0
- package/dist/headers/ISCSI.js +289 -0
- package/dist/headers/ISIS.d.ts +25 -0
- package/dist/headers/ISIS.js +79 -0
- package/dist/headers/ISOSession.d.ts +27 -0
- package/dist/headers/ISOSession.js +343 -0
- package/dist/headers/Ident.d.ts +42 -0
- package/dist/headers/Ident.js +184 -0
- package/dist/headers/KNXnetIP.d.ts +30 -0
- package/dist/headers/KNXnetIP.js +135 -0
- package/dist/headers/Kafka.d.ts +35 -0
- package/dist/headers/Kafka.js +128 -0
- package/dist/headers/Kerberos.d.ts +30 -0
- package/dist/headers/Kerberos.js +217 -0
- package/dist/headers/L2TP.d.ts +26 -0
- package/dist/headers/L2TP.js +297 -0
- package/dist/headers/LACP.d.ts +31 -0
- package/dist/headers/LACP.js +151 -0
- package/dist/headers/LDAP.d.ts +31 -0
- package/dist/headers/LDAP.js +226 -0
- package/dist/headers/LDP.d.ts +31 -0
- package/dist/headers/LDP.js +138 -0
- package/dist/headers/LISP.d.ts +30 -0
- package/dist/headers/LISP.js +103 -0
- package/dist/headers/LLC.d.ts +27 -0
- package/dist/headers/LLC.js +81 -0
- package/dist/headers/LLDP.d.ts +26 -0
- package/dist/headers/LLDP.js +126 -0
- package/dist/headers/LLMNR.d.ts +23 -0
- package/dist/headers/LLMNR.js +40 -0
- package/dist/headers/LPD.d.ts +31 -0
- package/dist/headers/LPD.js +159 -0
- package/dist/headers/MACsec.d.ts +34 -0
- package/dist/headers/MACsec.js +178 -0
- package/dist/headers/MDNS.d.ts +26 -0
- package/dist/headers/MDNS.js +45 -0
- package/dist/headers/MGCP.d.ts +30 -0
- package/dist/headers/MGCP.js +155 -0
- package/dist/headers/MMS.d.ts +29 -0
- package/dist/headers/MMS.js +243 -0
- package/dist/headers/MPLS.d.ts +31 -0
- package/dist/headers/MPLS.js +145 -0
- package/dist/headers/MQTT.d.ts +30 -0
- package/dist/headers/MQTT.js +173 -0
- package/dist/headers/MQTTSN.d.ts +34 -0
- package/dist/headers/MQTTSN.js +177 -0
- package/dist/headers/MarkerProtocol.d.ts +32 -0
- package/dist/headers/MarkerProtocol.js +153 -0
- package/dist/headers/Megaco.d.ts +32 -0
- package/dist/headers/Megaco.js +144 -0
- package/dist/headers/Memcached.d.ts +44 -0
- package/dist/headers/Memcached.js +285 -0
- package/dist/headers/ModbusTCP.d.ts +25 -0
- package/dist/headers/ModbusTCP.js +99 -0
- package/dist/headers/ModbusUDP.d.ts +26 -0
- package/dist/headers/ModbusUDP.js +100 -0
- package/dist/headers/MongoDB.d.ts +33 -0
- package/dist/headers/MongoDB.js +143 -0
- package/dist/headers/MySQL.d.ts +30 -0
- package/dist/headers/MySQL.js +114 -0
- package/dist/headers/NATS.d.ts +29 -0
- package/dist/headers/NATS.js +135 -0
- package/dist/headers/NBDS.d.ts +34 -0
- package/dist/headers/NBDS.js +176 -0
- package/dist/headers/NBNS.d.ts +34 -0
- package/dist/headers/NBNS.js +78 -0
- package/dist/headers/NBSS.d.ts +36 -0
- package/dist/headers/NBSS.js +137 -0
- package/dist/headers/NFS.d.ts +36 -0
- package/dist/headers/NFS.js +273 -0
- package/dist/headers/NHRP.d.ts +32 -0
- package/dist/headers/NHRP.js +154 -0
- package/dist/headers/NNTP.d.ts +35 -0
- package/dist/headers/NNTP.js +162 -0
- package/dist/headers/NTP.d.ts +18 -0
- package/dist/headers/NTP.js +73 -0
- package/dist/headers/NetFlowV5.d.ts +28 -0
- package/dist/headers/NetFlowV5.js +205 -0
- package/dist/headers/OLSR.d.ts +31 -0
- package/dist/headers/OLSR.js +213 -0
- package/dist/headers/OPCUA.d.ts +33 -0
- package/dist/headers/OPCUA.js +165 -0
- package/dist/headers/OPCUAPubSub.d.ts +33 -0
- package/dist/headers/OPCUAPubSub.js +144 -0
- package/dist/headers/OSPF.d.ts +31 -0
- package/dist/headers/OSPF.js +365 -0
- package/dist/headers/OmronFINS.d.ts +31 -0
- package/dist/headers/OmronFINS.js +90 -0
- package/dist/headers/OpenFlow.d.ts +30 -0
- package/dist/headers/OpenFlow.js +113 -0
- package/dist/headers/OpenVPN.d.ts +35 -0
- package/dist/headers/OpenVPN.js +214 -0
- package/dist/headers/PCWorx.d.ts +35 -0
- package/dist/headers/PCWorx.js +115 -0
- package/dist/headers/PIM.d.ts +27 -0
- package/dist/headers/PIM.js +129 -0
- package/dist/headers/POP3.d.ts +31 -0
- package/dist/headers/POP3.js +152 -0
- package/dist/headers/POWERLINK.d.ts +28 -0
- package/dist/headers/POWERLINK.js +116 -0
- package/dist/headers/PPPoEDiscovery.d.ts +29 -0
- package/dist/headers/PPPoEDiscovery.js +198 -0
- package/dist/headers/PPPoESession.d.ts +28 -0
- package/dist/headers/PPPoESession.js +125 -0
- package/dist/headers/PPTP.d.ts +30 -0
- package/dist/headers/PPTP.js +122 -0
- package/dist/headers/PROFINETRT.d.ts +28 -0
- package/dist/headers/PROFINETRT.js +74 -0
- package/dist/headers/PTP.d.ts +34 -0
- package/dist/headers/PTP.js +213 -0
- package/dist/headers/PostgreSQL.d.ts +40 -0
- package/dist/headers/PostgreSQL.js +236 -0
- package/dist/headers/QUIC.d.ts +34 -0
- package/dist/headers/QUIC.js +308 -0
- package/dist/headers/RADIUS.d.ts +24 -0
- package/dist/headers/RADIUS.js +138 -0
- package/dist/headers/RDP.d.ts +27 -0
- package/dist/headers/RDP.js +93 -0
- package/dist/headers/RFB.d.ts +39 -0
- package/dist/headers/RFB.js +151 -0
- package/dist/headers/RGoose.d.ts +72 -0
- package/dist/headers/RGoose.js +340 -0
- package/dist/headers/RIP.d.ts +29 -0
- package/dist/headers/RIP.js +133 -0
- package/dist/headers/RIPng.d.ts +26 -0
- package/dist/headers/RIPng.js +140 -0
- package/dist/headers/RMCP.d.ts +26 -0
- package/dist/headers/RMCP.js +155 -0
- package/dist/headers/RSVP.d.ts +31 -0
- package/dist/headers/RSVP.js +263 -0
- package/dist/headers/RTCP.d.ts +34 -0
- package/dist/headers/RTCP.js +217 -0
- package/dist/headers/RTP.d.ts +33 -0
- package/dist/headers/RTP.js +291 -0
- package/dist/headers/RTPS.d.ts +33 -0
- package/dist/headers/RTPS.js +182 -0
- package/dist/headers/RTSP.d.ts +36 -0
- package/dist/headers/RTSP.js +184 -0
- package/dist/headers/RawData.d.ts +17 -0
- package/dist/headers/RawData.js +43 -0
- package/dist/headers/Redis.d.ts +32 -0
- package/dist/headers/Redis.js +202 -0
- package/dist/headers/Rlogin.d.ts +42 -0
- package/dist/headers/Rlogin.js +139 -0
- package/dist/headers/Rsync.d.ts +28 -0
- package/dist/headers/Rsync.js +117 -0
- package/dist/headers/S7comm.d.ts +36 -0
- package/dist/headers/S7comm.js +244 -0
- package/dist/headers/SCTP.d.ts +35 -0
- package/dist/headers/SCTP.js +174 -0
- package/dist/headers/SFlow.d.ts +29 -0
- package/dist/headers/SFlow.js +242 -0
- package/dist/headers/SIP.d.ts +27 -0
- package/dist/headers/SIP.js +146 -0
- package/dist/headers/SLMP.d.ts +36 -0
- package/dist/headers/SLMP.js +154 -0
- package/dist/headers/SLP.d.ts +30 -0
- package/dist/headers/SLP.js +207 -0
- package/dist/headers/SLPv1.d.ts +32 -0
- package/dist/headers/SLPv1.js +138 -0
- package/dist/headers/SMB1.d.ts +37 -0
- package/dist/headers/SMB1.js +200 -0
- package/dist/headers/SMB2.d.ts +36 -0
- package/dist/headers/SMB2.js +203 -0
- package/dist/headers/SMPP.d.ts +33 -0
- package/dist/headers/SMPP.js +119 -0
- package/dist/headers/SMTP.d.ts +33 -0
- package/dist/headers/SMTP.js +157 -0
- package/dist/headers/SNAP.d.ts +22 -0
- package/dist/headers/SNAP.js +68 -0
- package/dist/headers/SNMP.d.ts +28 -0
- package/dist/headers/SNMP.js +302 -0
- package/dist/headers/SOCKS4.d.ts +42 -0
- package/dist/headers/SOCKS4.js +302 -0
- package/dist/headers/SOCKS5.d.ts +45 -0
- package/dist/headers/SOCKS5.js +223 -0
- package/dist/headers/SSDP.d.ts +27 -0
- package/dist/headers/SSDP.js +161 -0
- package/dist/headers/SSH.d.ts +44 -0
- package/dist/headers/SSH.js +274 -0
- package/dist/headers/STOMP.d.ts +48 -0
- package/dist/headers/STOMP.js +177 -0
- package/dist/headers/STP.d.ts +26 -0
- package/dist/headers/STP.js +150 -0
- package/dist/headers/STUN.d.ts +25 -0
- package/dist/headers/STUN.js +183 -0
- package/dist/headers/SercosIII.d.ts +43 -0
- package/dist/headers/SercosIII.js +199 -0
- package/dist/headers/Skinny.d.ts +32 -0
- package/dist/headers/Skinny.js +139 -0
- package/dist/headers/StatsD.d.ts +27 -0
- package/dist/headers/StatsD.js +134 -0
- package/dist/headers/SunRPC.d.ts +34 -0
- package/dist/headers/SunRPC.js +268 -0
- package/dist/headers/Syslog.d.ts +21 -0
- package/dist/headers/Syslog.js +91 -0
- package/dist/headers/TCP.d.ts +19 -0
- package/dist/headers/TCP.js +905 -0
- package/dist/headers/TFTP.d.ts +28 -0
- package/dist/headers/TFTP.js +224 -0
- package/dist/headers/TLS_Alert.d.ts +24 -0
- package/dist/headers/TLS_Alert.js +639 -0
- package/dist/headers/TLS_ApplicationData.d.ts +24 -0
- package/dist/headers/TLS_ApplicationData.js +170 -0
- package/dist/headers/TLS_ChangeCipherSpec.d.ts +23 -0
- package/dist/headers/TLS_ChangeCipherSpec.js +168 -0
- package/dist/headers/TLS_Handshake.d.ts +65 -0
- package/dist/headers/TLS_Handshake.js +860 -0
- package/dist/headers/TLS_Heartbeat.d.ts +27 -0
- package/dist/headers/TLS_Heartbeat.js +247 -0
- package/dist/headers/TPKT.d.ts +26 -0
- package/dist/headers/TPKT.js +99 -0
- package/dist/headers/TacacsPlus.d.ts +27 -0
- package/dist/headers/TacacsPlus.js +133 -0
- package/dist/headers/Telnet.d.ts +40 -0
- package/dist/headers/Telnet.js +193 -0
- package/dist/headers/Teredo.d.ts +40 -0
- package/dist/headers/Teredo.js +251 -0
- package/dist/headers/TimeProtocol.d.ts +25 -0
- package/dist/headers/TimeProtocol.js +53 -0
- package/dist/headers/UDP.d.ts +19 -0
- package/dist/headers/UDP.js +171 -0
- package/dist/headers/VLAN_802dot1Q.d.ts +24 -0
- package/dist/headers/VLAN_802dot1Q.js +96 -0
- package/dist/headers/VRRP.d.ts +26 -0
- package/dist/headers/VRRP.js +309 -0
- package/dist/headers/VXLAN.d.ts +24 -0
- package/dist/headers/VXLAN.js +75 -0
- package/dist/headers/WCCP.d.ts +29 -0
- package/dist/headers/WCCP.js +117 -0
- package/dist/headers/WHOIS.d.ts +37 -0
- package/dist/headers/WHOIS.js +126 -0
- package/dist/headers/WSDiscovery.d.ts +29 -0
- package/dist/headers/WSDiscovery.js +118 -0
- package/dist/headers/WakeOnLAN.d.ts +30 -0
- package/dist/headers/WakeOnLAN.js +126 -0
- package/dist/headers/WebSocket.d.ts +26 -0
- package/dist/headers/WebSocket.js +173 -0
- package/dist/headers/WireGuard.d.ts +38 -0
- package/dist/headers/WireGuard.js +216 -0
- package/dist/headers/XMPP.d.ts +37 -0
- package/dist/headers/XMPP.js +149 -0
- package/dist/headers/Zabbix.d.ts +35 -0
- package/dist/headers/Zabbix.js +153 -0
- package/dist/headers/cms/AcsiPdu.d.ts +45 -0
- package/dist/headers/cms/AcsiPdu.js +112 -0
- package/dist/headers/cms/PerDecoder.d.ts +68 -0
- package/dist/headers/cms/PerDecoder.js +211 -0
- package/dist/headers/cms/PerReader.d.ts +64 -0
- package/dist/headers/cms/PerReader.js +155 -0
- package/dist/helper/BufferToHex.d.ts +5 -0
- package/dist/helper/BufferToHex.js +10 -0
- package/dist/helper/BufferToIP.d.ts +12 -0
- package/dist/helper/BufferToIP.js +23 -0
- package/dist/helper/BufferToNumber.d.ts +18 -0
- package/dist/helper/BufferToNumber.js +47 -0
- package/dist/helper/HexToBuffer.d.ts +7 -0
- package/dist/helper/HexToBuffer.js +27 -0
- package/dist/helper/HexToNumber.d.ts +18 -0
- package/dist/helper/HexToNumber.js +48 -0
- package/dist/helper/IPToBuffer.d.ts +12 -0
- package/dist/helper/IPToBuffer.js +34 -0
- package/dist/helper/NumberToBERBuffer.d.ts +18 -0
- package/dist/helper/NumberToBERBuffer.js +31 -0
- package/dist/helper/NumberToBERHex.d.ts +18 -0
- package/dist/helper/NumberToBERHex.js +52 -0
- package/dist/helper/NumberToBuffer.d.ts +18 -0
- package/dist/helper/NumberToBuffer.js +38 -0
- package/dist/helper/NumberToHex.d.ts +18 -0
- package/dist/helper/NumberToHex.js +35 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +113 -0
- package/dist/lib/FlexibleObject.d.ts +27 -0
- package/dist/lib/FlexibleObject.js +113 -0
- package/dist/lib/GetBERIntegerLengthFromBuffer.d.ts +6 -0
- package/dist/lib/GetBERIntegerLengthFromBuffer.js +16 -0
- package/dist/lib/ProcessPacketPostHandlers.d.ts +13 -0
- package/dist/lib/ProcessPacketPostHandlers.js +53 -0
- package/dist/lib/SortPostHandlers.d.ts +7 -0
- package/dist/lib/SortPostHandlers.js +11 -0
- package/dist/lib/StringContentEncodingEnum.d.ts +10 -0
- package/dist/lib/StringContentEncodingEnum.js +14 -0
- package/dist/schema/ProtocolFieldJSONSchema.d.ts +35 -0
- package/dist/schema/ProtocolFieldJSONSchema.js +2 -0
- package/dist/schema/ProtocolFieldJSONSchemaDefinition.d.ts +2 -0
- package/dist/schema/ProtocolFieldJSONSchemaDefinition.js +2 -0
- package/dist/schema/ProtocolJSONSchema.d.ts +32 -0
- package/dist/schema/ProtocolJSONSchema.js +2 -0
- package/dist/types/CodecData.d.ts +7 -0
- package/dist/types/CodecData.js +2 -0
- package/dist/types/CodecDecodeResult.d.ts +10 -0
- package/dist/types/CodecDecodeResult.js +2 -0
- package/dist/types/CodecEncodeInput.d.ts +2 -0
- package/dist/types/CodecEncodeInput.js +2 -0
- package/dist/types/CodecEncodeResult.d.ts +5 -0
- package/dist/types/CodecEncodeResult.js +2 -0
- package/dist/types/CodecErrorInfo.d.ts +5 -0
- package/dist/types/CodecErrorInfo.js +2 -0
- package/dist/types/CodecModule.d.ts +2 -0
- package/dist/types/CodecModule.js +2 -0
- package/dist/types/CodecModuleConstructor.d.ts +2 -0
- package/dist/types/CodecModuleConstructor.js +2 -0
- package/dist/types/CodecSchema.d.ts +6 -0
- package/dist/types/CodecSchema.js +2 -0
- package/dist/types/DemuxProducer.d.ts +23 -0
- package/dist/types/DemuxProducer.js +2 -0
- package/dist/types/Dissection.d.ts +23 -0
- package/dist/types/Dissection.js +2 -0
- package/dist/types/HeaderTreeNode.d.ts +4 -0
- package/dist/types/HeaderTreeNode.js +2 -0
- package/dist/types/LayerGraph.d.ts +32 -0
- package/dist/types/LayerGraph.js +2 -0
- package/dist/types/PostHandlerItem.d.ts +4 -0
- package/dist/types/PostHandlerItem.js +2 -0
- package/package.json +141 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ISCSI = void 0;
|
|
4
|
+
const BaseHeader_1 = require("../abstracts/BaseHeader");
|
|
5
|
+
const BufferToHex_1 = require("../helper/BufferToHex");
|
|
6
|
+
const HexToBuffer_1 = require("../helper/HexToBuffer");
|
|
7
|
+
const StringContentEncodingEnum_1 = require("../lib/StringContentEncodingEnum");
|
|
8
|
+
/**
|
|
9
|
+
* iSCSI — Internet Small Computer Systems Interface (RFC 7143), TCP port 3260. Every iSCSI PDU begins
|
|
10
|
+
* with a fixed 48-byte Basic Header Segment (BHS):
|
|
11
|
+
* byte 0 : reserved bit (0x80) | Immediate bit I (0x40) | 6-bit Opcode (0x3f)
|
|
12
|
+
* byte 1 : Final/Transit bit F (0x80) | 7 opcode-specific flag bits
|
|
13
|
+
* bytes 2-3 : opcode-specific
|
|
14
|
+
* byte 4 : TotalAHSLength (count of 4-byte AHS words)
|
|
15
|
+
* bytes 5-7 : DataSegmentLength (24-bit)
|
|
16
|
+
* bytes 8-15 : LUN or opcode-specific
|
|
17
|
+
* bytes 16-19 : Initiator Task Tag
|
|
18
|
+
* bytes 20-47 : opcode-specific
|
|
19
|
+
* Opcodes include 0x00 NOP-Out, 0x01 SCSI Command, 0x03 Login Request, 0x21 SCSI Response, 0x23 Login
|
|
20
|
+
* Response. The BHS is followed by any AHS (TotalAHSLength*4 bytes), an optional header digest, the data
|
|
21
|
+
* segment (DataSegmentLength bytes padded to a 4-byte boundary), and an optional data digest.
|
|
22
|
+
*
|
|
23
|
+
* Byte-perfect strategy (minimal slice): the semantically useful values are structured — opcode /
|
|
24
|
+
* immediate / final / totalAHSLength / dataSegmentLength / initiatorTaskTag — and every other BHS byte is
|
|
25
|
+
* kept verbatim as bounded opcode-specific hex, together covering all 48 bytes exactly once (no field
|
|
26
|
+
* overlaps another, so reserved bits and opcode-specific fields round-trip untouched). DataSegmentLength
|
|
27
|
+
* is honored when supplied (a crafted PDU may lie), else derived from the actual data segment. The AHS and
|
|
28
|
+
* the (4-byte-padded) data segment follow, each bounded by the on-wire TCP payload (derived from the IP
|
|
29
|
+
* length) so a lying length never reads past the datagram; the data segment's alignment padding is
|
|
30
|
+
* consumed on decode and re-emitted as zeros on encode. This layer consumes exactly one PDU (BHS + AHS +
|
|
31
|
+
* data + pad); trailing bytes — a header/data digest (negotiated, so not modelled) or a pipelined PDU —
|
|
32
|
+
* are left to the codec's recursion / RawData. A well-formed PDU round-trips byte-for-byte.
|
|
33
|
+
*/
|
|
34
|
+
class ISCSI extends BaseHeader_1.BaseHeader {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
this.id = 'iscsi';
|
|
38
|
+
this.name = 'Internet Small Computer Systems Interface';
|
|
39
|
+
this.nickname = 'iSCSI';
|
|
40
|
+
this.matchKeys = ['tcpport:3260'];
|
|
41
|
+
//A leaf header — AHS / data-segment sub-structure (SCSI CDBs, login key=value pairs) is kept verbatim.
|
|
42
|
+
this.demuxProducers = [];
|
|
43
|
+
}
|
|
44
|
+
static #schemaCache;
|
|
45
|
+
get SCHEMA() {
|
|
46
|
+
return (ISCSI.#schemaCache ??= ISCSI.#buildSchema());
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Bytes of TCP payload available to this iSCSI PDU from its start, clamped to the captured buffer.
|
|
50
|
+
* The transport (TCP) carries no payload length, so the bound comes from the IP layer two hops back:
|
|
51
|
+
* IPv4's total length or IPv6's payload length gives the absolute end of the L4 payload. Mirrors the
|
|
52
|
+
* OSPF/GRE #available pattern so the AHS and data segment can be bounded by the real on-wire length
|
|
53
|
+
* rather than trusting the length fields alone. Falls back to the captured bytes when no IP is found.
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
#available() {
|
|
57
|
+
const capped = this.packet.length - this.startPos;
|
|
58
|
+
const mods = this.prevCodecModules;
|
|
59
|
+
const ip = mods && mods.length >= 2 ? mods[mods.length - 2] : undefined;
|
|
60
|
+
if (!ip || !ip.instance)
|
|
61
|
+
return capped;
|
|
62
|
+
const ipv4TotalLength = ip.instance.length.getValue(0);
|
|
63
|
+
const ipv6PayloadLength = ip.instance.plen.getValue(0);
|
|
64
|
+
let payloadEndAbs = 0;
|
|
65
|
+
if (ipv4TotalLength)
|
|
66
|
+
payloadEndAbs = ip.startPos + ipv4TotalLength;
|
|
67
|
+
else if (ipv6PayloadLength)
|
|
68
|
+
payloadEndAbs = ip.startPos + ip.length + ipv6PayloadLength;
|
|
69
|
+
if (payloadEndAbs > 0) {
|
|
70
|
+
const available = payloadEndAbs - this.startPos;
|
|
71
|
+
if (available >= 0 && available < capped)
|
|
72
|
+
return available;
|
|
73
|
+
}
|
|
74
|
+
return capped;
|
|
75
|
+
}
|
|
76
|
+
/** Length in bytes of the Additional Header Segments (TotalAHSLength is a 4-byte word count). */
|
|
77
|
+
#ahsLength() {
|
|
78
|
+
return this.instance.totalAHSLength.getValue(0) * 4;
|
|
79
|
+
}
|
|
80
|
+
/** Header-relative offset where the data segment begins: after the 48-byte BHS and any AHS. */
|
|
81
|
+
#dataStart() {
|
|
82
|
+
return 48 + this.#ahsLength();
|
|
83
|
+
}
|
|
84
|
+
static #buildSchema() {
|
|
85
|
+
return {
|
|
86
|
+
type: 'object',
|
|
87
|
+
summary: 'iSCSI opcode=${opcode} itt=${initiatorTaskTag}',
|
|
88
|
+
properties: {
|
|
89
|
+
//==== Basic Header Segment (48 bytes, RFC 7143 §11.1) ====
|
|
90
|
+
//Byte 0: opcode (low 6 bits), Immediate bit (0x40), reserved bit (0x80). The three fields
|
|
91
|
+
//cover byte 0 exactly, so every bit — including the reserved one — round-trips.
|
|
92
|
+
opcode: {
|
|
93
|
+
type: 'integer',
|
|
94
|
+
label: 'Opcode',
|
|
95
|
+
minimum: 0,
|
|
96
|
+
maximum: 63,
|
|
97
|
+
decode: function () {
|
|
98
|
+
this.instance.opcode.setValue(this.readBits(0, 1, 2, 6));
|
|
99
|
+
},
|
|
100
|
+
encode: function () {
|
|
101
|
+
let value = this.instance.opcode.getValue(0);
|
|
102
|
+
if (value > 63) {
|
|
103
|
+
this.recordError(this.instance.opcode.getPath(), 'Maximum value is 63');
|
|
104
|
+
value = 63;
|
|
105
|
+
}
|
|
106
|
+
if (value < 0) {
|
|
107
|
+
this.recordError(this.instance.opcode.getPath(), 'Minimum value is 0');
|
|
108
|
+
value = 0;
|
|
109
|
+
}
|
|
110
|
+
this.instance.opcode.setValue(value);
|
|
111
|
+
this.writeBits(0, 1, 2, 6, value);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
immediate: {
|
|
115
|
+
type: 'boolean',
|
|
116
|
+
label: 'Immediate',
|
|
117
|
+
decode: function () {
|
|
118
|
+
this.instance.immediate.setValue(!!this.readBits(0, 1, 1, 1));
|
|
119
|
+
},
|
|
120
|
+
encode: function () {
|
|
121
|
+
const value = !!this.instance.immediate.getValue(false);
|
|
122
|
+
this.instance.immediate.setValue(value);
|
|
123
|
+
this.writeBits(0, 1, 1, 1, value ? 1 : 0);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
//The single reserved bit of byte 0 (0x80), preserved verbatim.
|
|
127
|
+
reserved: {
|
|
128
|
+
type: 'integer',
|
|
129
|
+
label: 'Reserved',
|
|
130
|
+
minimum: 0,
|
|
131
|
+
maximum: 1,
|
|
132
|
+
decode: function () {
|
|
133
|
+
this.instance.reserved.setValue(this.readBits(0, 1, 0, 1));
|
|
134
|
+
},
|
|
135
|
+
encode: function () {
|
|
136
|
+
this.writeBits(0, 1, 0, 1, this.instance.reserved.getValue(0) ? 1 : 0);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
//Byte 1: Final/Transit bit (0x80) + 7 opcode-specific flag bits — together they cover byte 1.
|
|
140
|
+
final: {
|
|
141
|
+
type: 'boolean',
|
|
142
|
+
label: 'Final',
|
|
143
|
+
decode: function () {
|
|
144
|
+
this.instance.final.setValue(!!this.readBits(1, 1, 0, 1));
|
|
145
|
+
},
|
|
146
|
+
encode: function () {
|
|
147
|
+
const value = !!this.instance.final.getValue(false);
|
|
148
|
+
this.instance.final.setValue(value);
|
|
149
|
+
this.writeBits(1, 1, 0, 1, value ? 1 : 0);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
//The opcode-specific flag bits of byte 1 (0x7f), kept verbatim (e.g. Login's C/CSG/NSG,
|
|
153
|
+
//SCSI Command's R/W/ATTR).
|
|
154
|
+
opcodeSpecificFlags: {
|
|
155
|
+
type: 'integer',
|
|
156
|
+
label: 'Opcode-Specific Flags',
|
|
157
|
+
minimum: 0,
|
|
158
|
+
maximum: 127,
|
|
159
|
+
decode: function () {
|
|
160
|
+
this.instance.opcodeSpecificFlags.setValue(this.readBits(1, 1, 1, 7));
|
|
161
|
+
},
|
|
162
|
+
encode: function () {
|
|
163
|
+
let value = this.instance.opcodeSpecificFlags.getValue(0);
|
|
164
|
+
if (value > 127) {
|
|
165
|
+
this.recordError(this.instance.opcodeSpecificFlags.getPath(), 'Maximum value is 127');
|
|
166
|
+
value = 127;
|
|
167
|
+
}
|
|
168
|
+
if (value < 0) {
|
|
169
|
+
this.recordError(this.instance.opcodeSpecificFlags.getPath(), 'Minimum value is 0');
|
|
170
|
+
value = 0;
|
|
171
|
+
}
|
|
172
|
+
this.instance.opcodeSpecificFlags.setValue(value);
|
|
173
|
+
this.writeBits(1, 1, 1, 7, value);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
//Bytes 2-3, opcode-specific (e.g. Login Version-max / Version-min), kept verbatim.
|
|
177
|
+
opcodeSpecific1: this.fieldHex('opcodeSpecific1', 2, 2, 'Opcode-Specific (bytes 2-3)'),
|
|
178
|
+
//Byte 4: TotalAHSLength, a count of 4-byte AHS words; bounds where the data segment begins.
|
|
179
|
+
totalAHSLength: this.fieldUInt('totalAHSLength', 4, 1, 'Total AHS Length'),
|
|
180
|
+
//Bytes 5-7: DataSegmentLength (24-bit). Honored when supplied (a crafted PDU may lie), else
|
|
181
|
+
//derived from the actual data segment length.
|
|
182
|
+
dataSegmentLength: {
|
|
183
|
+
type: 'integer',
|
|
184
|
+
label: 'Data Segment Length',
|
|
185
|
+
minimum: 0,
|
|
186
|
+
maximum: 16777215,
|
|
187
|
+
decode: function () {
|
|
188
|
+
this.instance.dataSegmentLength.setValue(this.readBits(5, 3, 0, 24));
|
|
189
|
+
},
|
|
190
|
+
encode: function () {
|
|
191
|
+
const provided = this.instance.dataSegmentLength.getValue();
|
|
192
|
+
let value = (provided !== undefined && provided !== null)
|
|
193
|
+
? provided
|
|
194
|
+
: (0, HexToBuffer_1.HexToBuffer)(this.instance.dataSegment.getValue('')).length;
|
|
195
|
+
if (value > 16777215) {
|
|
196
|
+
this.recordError(this.instance.dataSegmentLength.getPath(), 'Maximum value is 16777215');
|
|
197
|
+
value = 16777215;
|
|
198
|
+
}
|
|
199
|
+
if (value < 0) {
|
|
200
|
+
this.recordError(this.instance.dataSegmentLength.getPath(), 'Minimum value is 0');
|
|
201
|
+
value = 0;
|
|
202
|
+
}
|
|
203
|
+
this.instance.dataSegmentLength.setValue(value);
|
|
204
|
+
this.writeBits(5, 3, 0, 24, value);
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
//Bytes 8-15: LUN or opcode-specific fields (e.g. Login's ISID + TSIH), kept verbatim.
|
|
208
|
+
lun: this.fieldHex('lun', 8, 8, 'LUN / Opcode-Specific (bytes 8-15)'),
|
|
209
|
+
//Bytes 16-19: Initiator Task Tag, an opaque tag matching a response to its request.
|
|
210
|
+
initiatorTaskTag: this.fieldHex('initiatorTaskTag', 16, 4, 'Initiator Task Tag'),
|
|
211
|
+
//Bytes 20-47: the rest of the opcode-specific header (e.g. Login's CID / CmdSN / ExpStatSN),
|
|
212
|
+
//kept verbatim.
|
|
213
|
+
opcodeSpecific2: this.fieldHex('opcodeSpecific2', 20, 28, 'Opcode-Specific (bytes 20-47)'),
|
|
214
|
+
//==== Additional Header Segments (RFC 7143 §11.2), kept verbatim ====
|
|
215
|
+
//Present only when TotalAHSLength > 0. Bounded by the TCP payload so a lying count can't
|
|
216
|
+
//read past the datagram.
|
|
217
|
+
ahs: {
|
|
218
|
+
type: 'string',
|
|
219
|
+
label: 'Additional Header Segments',
|
|
220
|
+
minLength: 0,
|
|
221
|
+
contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX,
|
|
222
|
+
decode: function () {
|
|
223
|
+
const ahsLength = this.#ahsLength();
|
|
224
|
+
if (ahsLength <= 0)
|
|
225
|
+
return;
|
|
226
|
+
const available = this.#available();
|
|
227
|
+
const length = Math.min(ahsLength, Math.max(0, available - 48));
|
|
228
|
+
if (length > 0)
|
|
229
|
+
this.instance.ahs.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(48, length)));
|
|
230
|
+
},
|
|
231
|
+
encode: function () {
|
|
232
|
+
if (this.instance.ahs.isUndefined())
|
|
233
|
+
return;
|
|
234
|
+
const ahs = this.instance.ahs.getValue('');
|
|
235
|
+
if (ahs)
|
|
236
|
+
this.writeBytes(48, (0, HexToBuffer_1.HexToBuffer)(ahs));
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
//==== Data segment (RFC 7143 §11.5), kept verbatim ====
|
|
240
|
+
//DataSegmentLength bytes after the BHS + AHS, padded to a 4-byte boundary with zeros. The
|
|
241
|
+
//data is stored unpadded; the padding is consumed on decode and re-emitted as zeros on
|
|
242
|
+
//encode (well-formed PDUs pad with zeros) so this layer consumes exactly one PDU's header +
|
|
243
|
+
//data + pad and leaves any digest / pipelined PDU to the codec's recursion. Bounded by the
|
|
244
|
+
//TCP payload so a lying DataSegmentLength can't read past the datagram.
|
|
245
|
+
dataSegment: {
|
|
246
|
+
type: 'string',
|
|
247
|
+
label: 'Data Segment',
|
|
248
|
+
minLength: 0,
|
|
249
|
+
contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX,
|
|
250
|
+
decode: function () {
|
|
251
|
+
const dataSegmentLength = this.instance.dataSegmentLength.getValue(0);
|
|
252
|
+
const start = this.#dataStart();
|
|
253
|
+
const available = this.#available();
|
|
254
|
+
const room = Math.max(0, available - start);
|
|
255
|
+
const realLength = Math.min(dataSegmentLength, room);
|
|
256
|
+
this.instance.dataSegment.setValue(realLength > 0 ? (0, BufferToHex_1.BufferToHex)(this.readBytes(start, realLength)) : '');
|
|
257
|
+
//Consume the 4-byte-alignment padding so headerLength spans the whole PDU and the
|
|
258
|
+
//next PDU / digest starts at the right offset. Reading (non-dry) extends the span.
|
|
259
|
+
const padded = dataSegmentLength + ((4 - (dataSegmentLength % 4)) % 4);
|
|
260
|
+
const consume = Math.min(padded, room);
|
|
261
|
+
if (consume > realLength)
|
|
262
|
+
this.readBytes(start, consume);
|
|
263
|
+
},
|
|
264
|
+
encode: function () {
|
|
265
|
+
const body = (0, HexToBuffer_1.HexToBuffer)(this.instance.dataSegment.getValue(''));
|
|
266
|
+
const start = this.#dataStart();
|
|
267
|
+
if (body.length)
|
|
268
|
+
this.writeBytes(start, body);
|
|
269
|
+
//Pad the data segment to a 4-byte boundary with zeros (RFC 7143 §11.5).
|
|
270
|
+
const pad = (4 - (body.length % 4)) % 4;
|
|
271
|
+
if (pad > 0)
|
|
272
|
+
this.writeBytes(start + body.length, Buffer.alloc(pad, 0));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
match() {
|
|
279
|
+
//iSCSI rides TCP port 3260 (selected via the tcpport:3260 bucket). This stays a port-bucket
|
|
280
|
+
//protocol: matchKeys only, NO heuristicFallback — the BHS has no magic signature, so non-iSCSI
|
|
281
|
+
//traffic on 3260 must fall through to raw. Require a full 48-byte BHS of TCP payload to be present
|
|
282
|
+
//(bounded by the real on-wire length, not the whole frame, so ethernet padding is not mistaken
|
|
283
|
+
//for a BHS).
|
|
284
|
+
if (!this.prevCodecModule || this.prevCodecModule.id !== 'tcp')
|
|
285
|
+
return false;
|
|
286
|
+
return this.#available() >= 48;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
exports.ISCSI = ISCSI;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
2
|
+
import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
|
|
3
|
+
import { DemuxProducer } from '../types/DemuxProducer';
|
|
4
|
+
/**
|
|
5
|
+
* IS-IS — Intermediate System to Intermediate System routing (ISO/IEC 10589), carried in an 802.3 frame
|
|
6
|
+
* over LLC with DSAP/SSAP 0xFE. Every PDU opens with an 8-byte common header: the Intradomain Routing
|
|
7
|
+
* Protocol Discriminator (0x83), a Length Indicator (the header length), a Version/Protocol Id Extension,
|
|
8
|
+
* an ID Length, a 1-byte PDU Type (its low 5 bits; upper 3 reserved), a Version, a reserved byte and the
|
|
9
|
+
* Maximum Area Addresses.
|
|
10
|
+
*
|
|
11
|
+
* The PDU-type-specific part (Hello / LSP / CSNP / PSNP fixed fields + TLVs) is kept verbatim as `body`
|
|
12
|
+
* hex — it is rich and type-dependent — bounded by the captured bytes. PDU types: 15 L1 LAN Hello, 16
|
|
13
|
+
* L2 LAN Hello, 17 Point-to-Point Hello, 18 L1 LSP, 20 L2 LSP, 24/25 L1/L2 CSNP, 26/27 L1/L2 PSNP. A
|
|
14
|
+
* well-formed PDU round-trips byte-for-byte.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ISIS extends BaseHeader {
|
|
17
|
+
#private;
|
|
18
|
+
get SCHEMA(): ProtocolJSONSchema;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly nickname: string;
|
|
22
|
+
readonly matchKeys: string[];
|
|
23
|
+
match(): boolean;
|
|
24
|
+
readonly demuxProducers: DemuxProducer[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ISIS = void 0;
|
|
4
|
+
const BaseHeader_1 = require("../abstracts/BaseHeader");
|
|
5
|
+
const BufferToHex_1 = require("../helper/BufferToHex");
|
|
6
|
+
const HexToBuffer_1 = require("../helper/HexToBuffer");
|
|
7
|
+
const StringContentEncodingEnum_1 = require("../lib/StringContentEncodingEnum");
|
|
8
|
+
/**
|
|
9
|
+
* IS-IS — Intermediate System to Intermediate System routing (ISO/IEC 10589), carried in an 802.3 frame
|
|
10
|
+
* over LLC with DSAP/SSAP 0xFE. Every PDU opens with an 8-byte common header: the Intradomain Routing
|
|
11
|
+
* Protocol Discriminator (0x83), a Length Indicator (the header length), a Version/Protocol Id Extension,
|
|
12
|
+
* an ID Length, a 1-byte PDU Type (its low 5 bits; upper 3 reserved), a Version, a reserved byte and the
|
|
13
|
+
* Maximum Area Addresses.
|
|
14
|
+
*
|
|
15
|
+
* The PDU-type-specific part (Hello / LSP / CSNP / PSNP fixed fields + TLVs) is kept verbatim as `body`
|
|
16
|
+
* hex — it is rich and type-dependent — bounded by the captured bytes. PDU types: 15 L1 LAN Hello, 16
|
|
17
|
+
* L2 LAN Hello, 17 Point-to-Point Hello, 18 L1 LSP, 20 L2 LSP, 24/25 L1/L2 CSNP, 26/27 L1/L2 PSNP. A
|
|
18
|
+
* well-formed PDU round-trips byte-for-byte.
|
|
19
|
+
*/
|
|
20
|
+
class ISIS extends BaseHeader_1.BaseHeader {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.id = 'isis';
|
|
24
|
+
this.name = 'Intermediate System to Intermediate System';
|
|
25
|
+
this.nickname = 'IS-IS';
|
|
26
|
+
this.matchKeys = ['llcsap:254'];
|
|
27
|
+
//A leaf for this slice — the type-specific fields and TLVs are kept verbatim.
|
|
28
|
+
this.demuxProducers = [];
|
|
29
|
+
}
|
|
30
|
+
static #schemaCache;
|
|
31
|
+
get SCHEMA() {
|
|
32
|
+
return (ISIS.#schemaCache ??= ISIS.#buildSchema());
|
|
33
|
+
}
|
|
34
|
+
static #buildSchema() {
|
|
35
|
+
return {
|
|
36
|
+
type: 'object',
|
|
37
|
+
summary: 'IS-IS type=${pduType}',
|
|
38
|
+
properties: {
|
|
39
|
+
irpDiscriminator: this.fieldHex('irpDiscriminator', 0, 1, 'IRP Discriminator'),
|
|
40
|
+
lengthIndicator: this.fieldUInt('lengthIndicator', 1, 1, 'Length Indicator'),
|
|
41
|
+
versionProtocolIdExtension: this.fieldUInt('versionProtocolIdExtension', 2, 1, 'Version/Protocol Id Extension'),
|
|
42
|
+
idLength: this.fieldUInt('idLength', 3, 1, 'ID Length'),
|
|
43
|
+
pduType: this.fieldUInt('pduType', 4, 1, 'PDU Type'),
|
|
44
|
+
version: this.fieldUInt('version', 5, 1, 'Version'),
|
|
45
|
+
reserved: this.fieldUInt('reserved', 6, 1, 'Reserved'),
|
|
46
|
+
maximumAreaAddresses: this.fieldUInt('maximumAreaAddresses', 7, 1, 'Maximum Area Addresses'),
|
|
47
|
+
//The PDU-type-specific fixed fields + TLVs, kept verbatim. Bounded by the captured bytes so
|
|
48
|
+
//trailing 802.3 padding is left to RawData.
|
|
49
|
+
body: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
label: 'Body',
|
|
52
|
+
contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX,
|
|
53
|
+
decode: function () {
|
|
54
|
+
const available = this.packet.length - this.startPos;
|
|
55
|
+
this.instance.body.setValue(available > 8 ? (0, BufferToHex_1.BufferToHex)(this.readBytes(8, available - 8)) : '');
|
|
56
|
+
},
|
|
57
|
+
encode: function () {
|
|
58
|
+
const body = this.instance.body.getValue('');
|
|
59
|
+
if (body)
|
|
60
|
+
this.writeBytes(8, (0, HexToBuffer_1.HexToBuffer)(body));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
match() {
|
|
67
|
+
//An LLC child selected by DSAP 0xFE (254). Confirm the parent is LLC with DSAP 0xFE, the 0x83
|
|
68
|
+
//discriminator, and the 8-byte common header.
|
|
69
|
+
const prev = this.prevCodecModule;
|
|
70
|
+
if (!prev || prev.id !== 'llc')
|
|
71
|
+
return false;
|
|
72
|
+
if (prev.instance.dsap.getValue(0) !== 0xfe)
|
|
73
|
+
return false;
|
|
74
|
+
if (this.packet.length - this.startPos < 8)
|
|
75
|
+
return false;
|
|
76
|
+
return this.readBytes(0, 1, true)[0] === 0x83;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.ISIS = ISIS;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
2
|
+
import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
|
|
3
|
+
import { DemuxProducer } from '../types/DemuxProducer';
|
|
4
|
+
/**
|
|
5
|
+
* ISO Session — the OSI Session layer (ISO 8327 / X.225) that sits above COTP in the MMS stack
|
|
6
|
+
* (TPKT → COTP → Session → Presentation → MMS). Each SPDU is a 1-byte SI (SPDU Identifier) + 1-byte LI
|
|
7
|
+
* (Length Indicator) + LI bytes of parameters. The MMS data phase is the fixed pair GIVE-TOKENS +
|
|
8
|
+
* DATA-TRANSFER (`01 00 01 00`); the connection phase is a CONNECT (SI 13) or ACCEPT (SI 14) SPDU with
|
|
9
|
+
* variable parameters.
|
|
10
|
+
*
|
|
11
|
+
* Session is decoded as a small chain of SPDUs (each SI/LI/params kept verbatim), then the user data —
|
|
12
|
+
* the Presentation/MMS PDU that follows — is handed to the codec's dispatch (like COTP hands its payload
|
|
13
|
+
* to Session). The single-frame completeness gate is already enforced upstream by COTP (it only exposes
|
|
14
|
+
* a child for a DT+EOT PDU fully contained in the packet), so a T2-fragmented MMS body never reaches
|
|
15
|
+
* here. The SPDU chain round-trips byte-for-byte; the presentation/MMS remainder is a child layer.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ISOSession extends BaseHeader {
|
|
18
|
+
#private;
|
|
19
|
+
get SCHEMA(): ProtocolJSONSchema;
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly nickname: string;
|
|
23
|
+
readonly matchKeys: string[];
|
|
24
|
+
readonly heuristicFallback: boolean;
|
|
25
|
+
match(): boolean;
|
|
26
|
+
readonly demuxProducers: DemuxProducer[];
|
|
27
|
+
}
|