@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,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TLS_ApplicationData = void 0;
|
|
4
|
+
const BaseHeader_1 = require("../abstracts/BaseHeader");
|
|
5
|
+
const BufferToNumber_1 = require("../helper/BufferToNumber");
|
|
6
|
+
const BufferToHex_1 = require("../helper/BufferToHex");
|
|
7
|
+
const NumberToBuffer_1 = require("../helper/NumberToBuffer");
|
|
8
|
+
const HexToBuffer_1 = require("../helper/HexToBuffer");
|
|
9
|
+
var TLSver;
|
|
10
|
+
(function (TLSver) {
|
|
11
|
+
TLSver["SSL_3_0"] = "SSL3.0";
|
|
12
|
+
TLSver["TLS_1_0"] = "TLS1.0";
|
|
13
|
+
TLSver["TLS_1_1"] = "TLS1.1";
|
|
14
|
+
TLSver["TLS_1_2"] = "TLS1.2";
|
|
15
|
+
TLSver["TLS_1_3"] = "TLS1.3";
|
|
16
|
+
})(TLSver || (TLSver = {}));
|
|
17
|
+
/**
|
|
18
|
+
* TLS Application Data protocol — a TLS/SSL record carrying encrypted application payload, over TCP
|
|
19
|
+
* (heuristically, port 443). This codec decodes the 5-octet TLS record header plus its body: an 8-bit
|
|
20
|
+
* Content Type (`contentType`, offset 0, = 23 / 0x17 for Application Data), a 16-bit legacy Version
|
|
21
|
+
* (`version`, offset 1, mapped to the labels SSL3.0 / TLS1.0 / TLS1.1 / TLS1.2 / TLS1.3 for 0x0300-0x0304,
|
|
22
|
+
* else "0"), a 16-bit record Length (`length`, offset 3), and the ciphertext body (`appData`, offset 5,
|
|
23
|
+
* `length` octets).
|
|
24
|
+
*
|
|
25
|
+
* The body is encrypted and opaque, so it is kept verbatim as `appData` hex (byte-perfect) and never
|
|
26
|
+
* sub-decoded; the Length is honored as given. A well-formed record round-trips byte-for-byte. In the
|
|
27
|
+
* heuristic chain (`heuristicFallback`), match() requires a Content Type of 0x17 and a recognized legacy
|
|
28
|
+
* Version (0x0300-0x0304).
|
|
29
|
+
*/
|
|
30
|
+
class TLS_ApplicationData extends BaseHeader_1.BaseHeader {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.SCHEMA = {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
contentType: {
|
|
37
|
+
type: 'integer',
|
|
38
|
+
label: 'Content Type',
|
|
39
|
+
minimum: 0,
|
|
40
|
+
maximum: 255,
|
|
41
|
+
decode: () => {
|
|
42
|
+
this.instance.contentType.setValue((0, BufferToNumber_1.BufferToInt8)(this.readBytes(0, 1)));
|
|
43
|
+
},
|
|
44
|
+
encode: () => {
|
|
45
|
+
const contentType = (0, NumberToBuffer_1.UInt8ToBuffer)(this.instance.contentType.getValue(0, (nodePath) => this.recordError(nodePath, 'Not found')));
|
|
46
|
+
this.writeBytes(0, contentType);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
version: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
label: 'Legacy Version',
|
|
52
|
+
minimum: 0,
|
|
53
|
+
maximum: 65535,
|
|
54
|
+
decode: () => {
|
|
55
|
+
const version = (0, BufferToNumber_1.BufferToUInt16)(this.readBytes(1, 2));
|
|
56
|
+
switch (version) {
|
|
57
|
+
case 768:
|
|
58
|
+
{
|
|
59
|
+
this.instance.version.setValue(TLSver.SSL_3_0);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case 769:
|
|
63
|
+
{
|
|
64
|
+
this.instance.version.setValue(TLSver.TLS_1_0);
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case 770:
|
|
68
|
+
{
|
|
69
|
+
this.instance.version.setValue(TLSver.TLS_1_1);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
case 771:
|
|
73
|
+
{
|
|
74
|
+
this.instance.version.setValue(TLSver.TLS_1_2);
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
case 772:
|
|
78
|
+
{
|
|
79
|
+
this.instance.version.setValue(TLSver.TLS_1_3);
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
default: {
|
|
83
|
+
this.instance.version.setValue('0');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
encode: () => {
|
|
88
|
+
const version = this.instance.version.getValue('0', (nodePath) => this.recordError(nodePath, 'Not found'));
|
|
89
|
+
switch (version) {
|
|
90
|
+
case TLSver.SSL_3_0:
|
|
91
|
+
{
|
|
92
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(768);
|
|
93
|
+
this.writeBytes(1, version);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
case TLSver.TLS_1_0:
|
|
97
|
+
{
|
|
98
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(769);
|
|
99
|
+
this.writeBytes(1, version);
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case TLSver.TLS_1_1:
|
|
103
|
+
{
|
|
104
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(770);
|
|
105
|
+
this.writeBytes(1, version);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case TLSver.TLS_1_2:
|
|
109
|
+
{
|
|
110
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(771);
|
|
111
|
+
this.writeBytes(1, version);
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case TLSver.TLS_1_3:
|
|
115
|
+
{
|
|
116
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(772);
|
|
117
|
+
this.writeBytes(1, version);
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
default: {
|
|
121
|
+
this.writeBytes(1, (0, NumberToBuffer_1.UInt16ToBuffer)(0));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
length: {
|
|
127
|
+
type: 'integer',
|
|
128
|
+
label: 'Length',
|
|
129
|
+
minimum: 0,
|
|
130
|
+
maximum: 65535,
|
|
131
|
+
decode: () => {
|
|
132
|
+
this.instance.length.setValue((0, BufferToNumber_1.BufferToUInt16)(this.readBytes(3, 2)));
|
|
133
|
+
},
|
|
134
|
+
encode: () => {
|
|
135
|
+
const length = (0, NumberToBuffer_1.UInt16ToBuffer)(this.instance.length.getValue(0, (nodePath) => this.recordError(nodePath, 'Not found')));
|
|
136
|
+
this.writeBytes(3, length);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
appData: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
label: 'Encrypted Application Data',
|
|
142
|
+
minimum: 0,
|
|
143
|
+
maximum: 65535,
|
|
144
|
+
decode: () => {
|
|
145
|
+
this.instance.appData.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(5, this.instance.length.getValue())));
|
|
146
|
+
},
|
|
147
|
+
encode: () => {
|
|
148
|
+
const appData = (0, HexToBuffer_1.HexToBuffer)(this.instance.appData.getValue('0', (nodePath) => this.recordError(nodePath, 'Not found')));
|
|
149
|
+
this.writeBytes(5, appData);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
this.id = 'tls-appdata';
|
|
155
|
+
this.matchKeys = ['tcpport:443'];
|
|
156
|
+
this.heuristicFallback = true;
|
|
157
|
+
this.name = 'Transport Layer Security(Application Data Protocol)';
|
|
158
|
+
this.nickname = 'TLS-AppData';
|
|
159
|
+
}
|
|
160
|
+
match() {
|
|
161
|
+
if (!this.prevCodecModule)
|
|
162
|
+
return false;
|
|
163
|
+
if ((0, BufferToHex_1.BufferToHex)(this.readBytes(0, 1)) != '17')
|
|
164
|
+
return false;
|
|
165
|
+
const version = (0, BufferToNumber_1.BufferToUInt16)(this.readBytes(1, 2));
|
|
166
|
+
const validVersions = [768, 769, 770, 771, 772];
|
|
167
|
+
return validVersions.includes(version);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.TLS_ApplicationData = TLS_ApplicationData;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
|
|
2
|
+
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
3
|
+
/**
|
|
4
|
+
* TLS ChangeCipherSpec protocol — a TLS/SSL record signaling the switch to the negotiated cipher, over TCP
|
|
5
|
+
* (heuristically, port 443). This codec decodes the 5-octet TLS record header plus its body: an 8-bit
|
|
6
|
+
* Content Type (`contentType`, offset 0, = 20 / 0x14 for ChangeCipherSpec), a 16-bit legacy Version
|
|
7
|
+
* (`version`, offset 1, mapped to the labels SSL3.0 / TLS1.0 / TLS1.1 / TLS1.2 / TLS1.3 for 0x0300-0x0304,
|
|
8
|
+
* else "0"), a 16-bit record Length (`length`, offset 3), and the message body
|
|
9
|
+
* (`change_cipher_spec_message`, offset 5, `length` octets — canonically the single byte 0x01).
|
|
10
|
+
*
|
|
11
|
+
* The body is kept verbatim as hex (byte-perfect) and the Length is honored as given, so a well-formed
|
|
12
|
+
* record round-trips byte-for-byte. In the heuristic chain (`heuristicFallback`), match() requires a
|
|
13
|
+
* Content Type of 0x14 and a recognized legacy Version (0x0300-0x0304).
|
|
14
|
+
*/
|
|
15
|
+
export declare class TLS_ChangeCipherSpec extends BaseHeader {
|
|
16
|
+
SCHEMA: ProtocolJSONSchema;
|
|
17
|
+
id: string;
|
|
18
|
+
readonly matchKeys: string[];
|
|
19
|
+
readonly heuristicFallback: boolean;
|
|
20
|
+
name: string;
|
|
21
|
+
nickname: string;
|
|
22
|
+
match(): boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TLS_ChangeCipherSpec = void 0;
|
|
4
|
+
const BaseHeader_1 = require("../abstracts/BaseHeader");
|
|
5
|
+
const BufferToNumber_1 = require("../helper/BufferToNumber");
|
|
6
|
+
const BufferToHex_1 = require("../helper/BufferToHex");
|
|
7
|
+
const NumberToBuffer_1 = require("../helper/NumberToBuffer");
|
|
8
|
+
const HexToBuffer_1 = require("../helper/HexToBuffer");
|
|
9
|
+
var TLSver;
|
|
10
|
+
(function (TLSver) {
|
|
11
|
+
TLSver["SSL_3_0"] = "SSL3.0";
|
|
12
|
+
TLSver["TLS_1_0"] = "TLS1.0";
|
|
13
|
+
TLSver["TLS_1_1"] = "TLS1.1";
|
|
14
|
+
TLSver["TLS_1_2"] = "TLS1.2";
|
|
15
|
+
TLSver["TLS_1_3"] = "TLS1.3";
|
|
16
|
+
})(TLSver || (TLSver = {}));
|
|
17
|
+
/**
|
|
18
|
+
* TLS ChangeCipherSpec protocol — a TLS/SSL record signaling the switch to the negotiated cipher, over TCP
|
|
19
|
+
* (heuristically, port 443). This codec decodes the 5-octet TLS record header plus its body: an 8-bit
|
|
20
|
+
* Content Type (`contentType`, offset 0, = 20 / 0x14 for ChangeCipherSpec), a 16-bit legacy Version
|
|
21
|
+
* (`version`, offset 1, mapped to the labels SSL3.0 / TLS1.0 / TLS1.1 / TLS1.2 / TLS1.3 for 0x0300-0x0304,
|
|
22
|
+
* else "0"), a 16-bit record Length (`length`, offset 3), and the message body
|
|
23
|
+
* (`change_cipher_spec_message`, offset 5, `length` octets — canonically the single byte 0x01).
|
|
24
|
+
*
|
|
25
|
+
* The body is kept verbatim as hex (byte-perfect) and the Length is honored as given, so a well-formed
|
|
26
|
+
* record round-trips byte-for-byte. In the heuristic chain (`heuristicFallback`), match() requires a
|
|
27
|
+
* Content Type of 0x14 and a recognized legacy Version (0x0300-0x0304).
|
|
28
|
+
*/
|
|
29
|
+
class TLS_ChangeCipherSpec extends BaseHeader_1.BaseHeader {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.SCHEMA = {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
contentType: {
|
|
36
|
+
type: 'integer',
|
|
37
|
+
label: 'Content Type',
|
|
38
|
+
minimum: 0,
|
|
39
|
+
maximum: 255,
|
|
40
|
+
decode: () => {
|
|
41
|
+
this.instance.contentType.setValue((0, BufferToNumber_1.BufferToInt8)(this.readBytes(0, 1)));
|
|
42
|
+
},
|
|
43
|
+
encode: () => {
|
|
44
|
+
const contentType = (0, NumberToBuffer_1.UInt8ToBuffer)(this.instance.contentType.getValue(0, (nodePath) => this.recordError(nodePath, 'Not found')));
|
|
45
|
+
this.writeBytes(0, contentType);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
version: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
label: 'Legacy Version',
|
|
51
|
+
minimum: 0,
|
|
52
|
+
maximum: 65535,
|
|
53
|
+
decode: () => {
|
|
54
|
+
const version = (0, BufferToNumber_1.BufferToUInt16)(this.readBytes(1, 2));
|
|
55
|
+
switch (version) {
|
|
56
|
+
case 768:
|
|
57
|
+
{
|
|
58
|
+
this.instance.version.setValue(TLSver.SSL_3_0);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case 769:
|
|
62
|
+
{
|
|
63
|
+
this.instance.version.setValue(TLSver.TLS_1_0);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case 770:
|
|
67
|
+
{
|
|
68
|
+
this.instance.version.setValue(TLSver.TLS_1_1);
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
case 771:
|
|
72
|
+
{
|
|
73
|
+
this.instance.version.setValue(TLSver.TLS_1_2);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case 772:
|
|
77
|
+
{
|
|
78
|
+
this.instance.version.setValue(TLSver.TLS_1_3);
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
default: {
|
|
82
|
+
this.instance.version.setValue('0');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
encode: () => {
|
|
87
|
+
const version = this.instance.version.getValue('0', (nodePath) => this.recordError(nodePath, 'Not found'));
|
|
88
|
+
switch (version) {
|
|
89
|
+
case TLSver.SSL_3_0:
|
|
90
|
+
{
|
|
91
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(768);
|
|
92
|
+
this.writeBytes(1, version);
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
case TLSver.TLS_1_0:
|
|
96
|
+
{
|
|
97
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(769);
|
|
98
|
+
this.writeBytes(1, version);
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case TLSver.TLS_1_1:
|
|
102
|
+
{
|
|
103
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(770);
|
|
104
|
+
this.writeBytes(1, version);
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case TLSver.TLS_1_2:
|
|
108
|
+
{
|
|
109
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(771);
|
|
110
|
+
this.writeBytes(1, version);
|
|
111
|
+
}
|
|
112
|
+
break;
|
|
113
|
+
case TLSver.TLS_1_3:
|
|
114
|
+
{
|
|
115
|
+
const version = (0, NumberToBuffer_1.UInt16ToBuffer)(772);
|
|
116
|
+
this.writeBytes(1, version);
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
default: {
|
|
120
|
+
this.writeBytes(1, (0, NumberToBuffer_1.UInt16ToBuffer)(0));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
length: {
|
|
126
|
+
type: 'integer',
|
|
127
|
+
label: 'Length',
|
|
128
|
+
minimum: 0,
|
|
129
|
+
maximum: 65535,
|
|
130
|
+
decode: () => {
|
|
131
|
+
this.instance.length.setValue((0, BufferToNumber_1.BufferToUInt16)(this.readBytes(3, 2)));
|
|
132
|
+
},
|
|
133
|
+
encode: () => {
|
|
134
|
+
const length = (0, NumberToBuffer_1.UInt16ToBuffer)(this.instance.length.getValue(0, (nodePath) => this.recordError(nodePath, 'Not found')));
|
|
135
|
+
this.writeBytes(3, length);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
change_cipher_spec_message: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
label: 'Change Cipher Spec Message',
|
|
141
|
+
decode: () => {
|
|
142
|
+
const length = this.instance.length.getValue(0, (nodePath) => this.recordError(nodePath, 'Not found'));
|
|
143
|
+
this.instance.change_cipher_spec_message.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(5, length)));
|
|
144
|
+
},
|
|
145
|
+
encode: () => {
|
|
146
|
+
const message = (0, HexToBuffer_1.HexToBuffer)(this.instance.change_cipher_spec_message.getValue('0', (nodePath) => this.recordError(nodePath, 'Not found')));
|
|
147
|
+
this.writeBytes(5, message);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
this.id = 'tls-ccsp';
|
|
153
|
+
this.matchKeys = ['tcpport:443'];
|
|
154
|
+
this.heuristicFallback = true;
|
|
155
|
+
this.name = 'Transport Layer Security(ChangeCipherSpec Protocol)';
|
|
156
|
+
this.nickname = 'TLS-ChangeCipherSpec';
|
|
157
|
+
}
|
|
158
|
+
match() {
|
|
159
|
+
if (!this.prevCodecModule)
|
|
160
|
+
return false;
|
|
161
|
+
if ((0, BufferToHex_1.BufferToHex)(this.readBytes(0, 1)) != '14')
|
|
162
|
+
return false;
|
|
163
|
+
const version = (0, BufferToNumber_1.BufferToUInt16)(this.readBytes(1, 2));
|
|
164
|
+
const validVersions = [768, 769, 770, 771, 772];
|
|
165
|
+
return validVersions.includes(version);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.TLS_ChangeCipherSpec = TLS_ChangeCipherSpec;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
|
|
2
|
+
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
3
|
+
export declare class TLS_Handshake extends BaseHeader {
|
|
4
|
+
/**
|
|
5
|
+
* Map a 2-byte TLS version to a friendly string, or its 4-hex form when unknown.
|
|
6
|
+
*/
|
|
7
|
+
protected tlsVersionToString(version: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* Inverse of tlsVersionToString: a friendly string or 4-hex back to 2 bytes.
|
|
10
|
+
*/
|
|
11
|
+
protected tlsVersionStringToBuffer(version: string): Buffer;
|
|
12
|
+
/**
|
|
13
|
+
* True when the handshake body could not be structured (unsupported message type or a
|
|
14
|
+
* parse failure) and was preserved as messagedata.raw. Encode then re-emits those bytes
|
|
15
|
+
* verbatim; a structured Hello (messagedata.version set) turns this false.
|
|
16
|
+
*/
|
|
17
|
+
protected messagedataRawFallbackActive(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Structurally decode a ClientHello (handshake type 1) body starting at record offset 9.
|
|
20
|
+
* Throws on any bound overrun / trailing bytes so the caller can fall back to raw.
|
|
21
|
+
*/
|
|
22
|
+
protected decodeClientHello(bodyLength: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* Structurally decode a ServerHello (handshake type 2) body starting at record offset 9.
|
|
25
|
+
* Throws on any bound overrun / trailing bytes so the caller can fall back to raw.
|
|
26
|
+
*/
|
|
27
|
+
protected decodeServerHello(bodyLength: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Friendly name for a 2-byte TLS extension type (IANA registry), or its 4-hex form.
|
|
30
|
+
*/
|
|
31
|
+
protected tlsExtensionName(type: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Split a TLS extensions block into its individual extensions. Each extension is a
|
|
34
|
+
* type(2) + length(2) + data(length) triple; data is kept as hex (authoritative for
|
|
35
|
+
* re-encode). Throws on any overrun so the caller can fall back to raw.
|
|
36
|
+
*/
|
|
37
|
+
protected parseTLSExtensions(buffer: Buffer): any[];
|
|
38
|
+
/**
|
|
39
|
+
* Decode a single extension's inner structure by type. Returns the structured fields, or
|
|
40
|
+
* null when the type has no (implemented) structure so the caller keeps it as hex. Throws
|
|
41
|
+
* on any bound violation so the caller falls back to hex for that one extension.
|
|
42
|
+
*/
|
|
43
|
+
protected decodeExtensionData(type: string, buffer: Buffer, handshakeType: string): any | null;
|
|
44
|
+
/**
|
|
45
|
+
* Decode a 2-byte-length-prefixed list of 2-byte codes into hex strings (used by
|
|
46
|
+
* supported_groups and signature_algorithms).
|
|
47
|
+
*/
|
|
48
|
+
protected decodeCodeList16(buffer: Buffer): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Rebuild a single extension's data buffer from its structured fields (inverse of
|
|
51
|
+
* decodeExtensionData). Only called for extensions decoded structurally (no `data` hex).
|
|
52
|
+
*/
|
|
53
|
+
protected encodeExtensionData(extension: any, handshakeType: string): Buffer;
|
|
54
|
+
/**
|
|
55
|
+
* Rebuild a 2-byte-length-prefixed list of 2-byte codes (inverse of decodeCodeList16).
|
|
56
|
+
*/
|
|
57
|
+
protected encodeCodeList16(codes: string[]): Buffer;
|
|
58
|
+
SCHEMA: ProtocolJSONSchema;
|
|
59
|
+
id: string;
|
|
60
|
+
readonly matchKeys: string[];
|
|
61
|
+
readonly heuristicFallback: boolean;
|
|
62
|
+
name: string;
|
|
63
|
+
nickname: string;
|
|
64
|
+
match(): boolean;
|
|
65
|
+
}
|