@netkitty/codec 1.2.1 → 2.1.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 +295 -0
- package/README.md +62 -10
- package/README.zh-CN.md +55 -9
- package/dist/Codec.d.ts +3 -2
- package/dist/Codec.js +109 -10
- package/dist/abstracts/BaseHeader.d.ts +54 -2
- package/dist/abstracts/BaseHeader.js +185 -43
- package/dist/errors/CodecSchemaValidateError.d.ts +34 -1
- package/dist/errors/CodecSchemaValidateError.js +26 -3
- package/dist/headers/ADSAMS.js +2 -0
- package/dist/headers/AH.js +4 -2
- package/dist/headers/AMQP.js +2 -1
- package/dist/headers/ARP.js +16 -10
- package/dist/headers/BACnetIP.js +1 -0
- package/dist/headers/BFD.d.ts +2 -1
- package/dist/headers/BFD.js +30 -4
- package/dist/headers/BGP.js +6 -1
- package/dist/headers/Babel.js +2 -1
- package/dist/headers/BitTorrent.d.ts +2 -0
- package/dist/headers/BitTorrent.js +4 -2
- package/dist/headers/C37118.d.ts +3 -2
- package/dist/headers/C37118.js +35 -15
- package/dist/headers/CAPWAP.js +1 -0
- package/dist/headers/CDP.d.ts +3 -3
- package/dist/headers/CDP.js +47 -11
- package/dist/headers/CMS.js +27 -12
- package/dist/headers/COTP.d.ts +2 -0
- package/dist/headers/COTP.js +8 -4
- package/dist/headers/CassandraCQL.js +1 -0
- package/dist/headers/CoAP.js +20 -2
- package/dist/headers/Codesys.js +1 -0
- package/dist/headers/Collectd.js +1 -1
- package/dist/headers/DCCP.d.ts +3 -2
- package/dist/headers/DCCP.js +61 -8
- package/dist/headers/DHCPFailover.js +1 -0
- package/dist/headers/DNP3.d.ts +5 -3
- package/dist/headers/DNP3.js +62 -7
- package/dist/headers/DNS.js +3 -3
- package/dist/headers/DTLS.js +1 -0
- package/dist/headers/Diameter.js +3 -2
- package/dist/headers/EAPOL.js +1 -1
- package/dist/headers/EIGRP.d.ts +3 -2
- package/dist/headers/EIGRP.js +32 -6
- package/dist/headers/ENIP.js +1 -0
- package/dist/headers/Elasticsearch.js +1 -0
- package/dist/headers/EtherCAT.js +1 -0
- package/dist/headers/EthernetII.js +7 -0
- package/dist/headers/FTP.js +6 -6
- package/dist/headers/Finger.js +3 -3
- package/dist/headers/FoundationFieldbusHSE.js +1 -0
- package/dist/headers/GELF.js +8 -1
- package/dist/headers/GENEVE.js +2 -1
- package/dist/headers/GLBP.js +1 -1
- package/dist/headers/GRE.js +1 -0
- package/dist/headers/GTPU.js +1 -0
- package/dist/headers/GTPv2C.js +2 -0
- package/dist/headers/GitProtocol.js +2 -2
- package/dist/headers/Goose.js +24 -12
- package/dist/headers/Gopher.js +6 -6
- package/dist/headers/HARTIP.js +1 -0
- package/dist/headers/HSR.js +3 -0
- package/dist/headers/HTTP.js +6 -6
- package/dist/headers/HTTP2.js +2 -0
- package/dist/headers/ICMP.js +3 -1
- package/dist/headers/ICMPv6.js +11 -16
- package/dist/headers/IEC104_I_Frame.js +215 -163
- package/dist/headers/IEC104_S_Frame.js +26 -3
- package/dist/headers/IEC104_U_Frame.js +33 -4
- package/dist/headers/IEC61850SampledValues.js +6 -5
- package/dist/headers/IGMP.d.ts +8 -7
- package/dist/headers/IGMP.js +58 -19
- package/dist/headers/IMAP.js +5 -5
- package/dist/headers/IPFIX.js +3 -2
- package/dist/headers/IPv4.js +41 -21
- package/dist/headers/IPv6.js +5 -1
- package/dist/headers/IPv6HopByHopOptions.js +15 -12
- package/dist/headers/IRC.js +4 -4
- package/dist/headers/ISAKMP.js +3 -1
- package/dist/headers/ISCSI.js +2 -0
- package/dist/headers/ISIS.js +2 -1
- package/dist/headers/ISOSession.d.ts +2 -0
- package/dist/headers/ISOSession.js +14 -10
- package/dist/headers/Ident.js +8 -8
- package/dist/headers/KNXnetIP.js +1 -0
- package/dist/headers/Kafka.js +1 -0
- package/dist/headers/Kerberos.js +2 -0
- package/dist/headers/L2TP.js +3 -2
- package/dist/headers/LACP.js +1 -1
- package/dist/headers/LDAP.js +3 -4
- package/dist/headers/LDP.js +1 -0
- package/dist/headers/LLC.d.ts +2 -0
- package/dist/headers/LLC.js +3 -0
- package/dist/headers/LPD.js +3 -3
- package/dist/headers/MGCP.js +7 -7
- package/dist/headers/MMS.d.ts +2 -0
- package/dist/headers/MMS.js +10 -6
- package/dist/headers/MQTT.js +1 -0
- package/dist/headers/MQTTSN.js +1 -0
- package/dist/headers/MarkerProtocol.js +1 -1
- package/dist/headers/Megaco.js +3 -3
- package/dist/headers/Memcached.js +3 -2
- package/dist/headers/ModbusTCP.js +1 -0
- package/dist/headers/ModbusUDP.js +1 -0
- package/dist/headers/MongoDB.js +1 -0
- package/dist/headers/MySQL.js +1 -0
- package/dist/headers/NATS.js +2 -2
- package/dist/headers/NBDS.js +1 -0
- package/dist/headers/NBSS.js +1 -0
- package/dist/headers/NFS.js +1 -0
- package/dist/headers/NHRP.d.ts +1 -1
- package/dist/headers/NHRP.js +30 -4
- package/dist/headers/NNTP.js +6 -6
- package/dist/headers/NetFlowV5.js +1 -0
- package/dist/headers/OLSR.js +2 -1
- package/dist/headers/OPCUA.js +1 -0
- package/dist/headers/OSPF.d.ts +3 -3
- package/dist/headers/OSPF.js +72 -7
- package/dist/headers/OpenFlow.js +1 -0
- package/dist/headers/OpenVPN.js +1 -0
- package/dist/headers/PCWorx.js +1 -0
- package/dist/headers/PIM.d.ts +3 -3
- package/dist/headers/PIM.js +55 -6
- package/dist/headers/POP3.js +5 -5
- package/dist/headers/PPPoEDiscovery.js +4 -1
- package/dist/headers/PPPoESession.js +1 -0
- package/dist/headers/PPTP.js +1 -0
- package/dist/headers/PTP.js +6 -1
- package/dist/headers/PostgreSQL.js +2 -0
- package/dist/headers/QUIC.js +2 -0
- package/dist/headers/RADIUS.js +1 -0
- package/dist/headers/RDP.d.ts +2 -0
- package/dist/headers/RDP.js +6 -1
- package/dist/headers/RFB.js +4 -4
- package/dist/headers/RGoose.js +8 -1
- package/dist/headers/RSVP.d.ts +3 -3
- package/dist/headers/RSVP.js +59 -44
- package/dist/headers/RTCP.js +2 -0
- package/dist/headers/RTP.js +2 -1
- package/dist/headers/RTPS.d.ts +2 -0
- package/dist/headers/RTPS.js +4 -1
- package/dist/headers/RTSP.js +7 -7
- package/dist/headers/RawData.js +1 -1
- package/dist/headers/Redis.js +4 -4
- package/dist/headers/Rlogin.js +5 -5
- package/dist/headers/Rsync.js +2 -2
- package/dist/headers/S7comm.d.ts +2 -0
- package/dist/headers/S7comm.js +5 -1
- package/dist/headers/SCTP.d.ts +2 -2
- package/dist/headers/SCTP.js +31 -7
- package/dist/headers/SFlow.js +2 -1
- package/dist/headers/SIP.js +6 -6
- package/dist/headers/SLMP.js +1 -0
- package/dist/headers/SLP.js +2 -0
- package/dist/headers/SLPv1.js +1 -0
- package/dist/headers/SMB1.js +1 -0
- package/dist/headers/SMB2.js +1 -0
- package/dist/headers/SMPP.js +1 -0
- package/dist/headers/SMTP.js +6 -6
- package/dist/headers/SNAP.js +18 -5
- package/dist/headers/SNMP.js +6 -6
- package/dist/headers/SOCKS4.js +11 -5
- package/dist/headers/SSDP.js +7 -7
- package/dist/headers/SSH.js +5 -4
- package/dist/headers/STOMP.js +5 -5
- package/dist/headers/STUN.js +3 -1
- package/dist/headers/SercosIII.d.ts +3 -2
- package/dist/headers/SercosIII.js +41 -5
- package/dist/headers/Skinny.js +1 -0
- package/dist/headers/StatsD.js +4 -4
- package/dist/headers/SunRPC.js +1 -0
- package/dist/headers/Syslog.js +2 -2
- package/dist/headers/TCP.js +31 -64
- package/dist/headers/TLS_Alert.js +42 -12
- package/dist/headers/TLS_ApplicationData.d.ts +3 -3
- package/dist/headers/TLS_ApplicationData.js +32 -8
- package/dist/headers/TLS_ChangeCipherSpec.d.ts +2 -2
- package/dist/headers/TLS_ChangeCipherSpec.js +33 -8
- package/dist/headers/TLS_Handshake.js +78 -30
- package/dist/headers/TLS_Heartbeat.d.ts +4 -3
- package/dist/headers/TLS_Heartbeat.js +50 -8
- package/dist/headers/TPKT.js +4 -2
- package/dist/headers/TacacsPlus.js +1 -0
- package/dist/headers/Telnet.js +2 -1
- package/dist/headers/Teredo.js +2 -2
- package/dist/headers/UDP.js +20 -56
- package/dist/headers/VLAN_802dot1Q.js +8 -0
- package/dist/headers/VRRP.d.ts +2 -1
- package/dist/headers/VRRP.js +45 -9
- package/dist/headers/WCCP.js +1 -0
- package/dist/headers/WHOIS.js +3 -3
- package/dist/headers/WSDiscovery.js +2 -2
- package/dist/headers/XMPP.js +3 -3
- package/dist/headers/Zabbix.js +1 -0
- package/dist/helper/Checksum.d.ts +15 -0
- package/dist/helper/Checksum.js +56 -0
- package/dist/helper/Crc.d.ts +18 -0
- package/dist/helper/Crc.js +58 -0
- package/dist/index.d.ts +3 -3
- package/dist/lib/SchemaValidator.d.ts +31 -0
- package/dist/lib/SchemaValidator.js +137 -0
- package/dist/schema/ProtocolFieldJSONSchema.d.ts +4 -1
- package/dist/schema/ProtocolJSONSchema.d.ts +1 -1
- package/dist/types/CodecErrorInfo.d.ts +11 -0
- package/dist/types/LayerGraph.d.ts +14 -1
- package/package.json +2 -2
package/dist/headers/RGoose.js
CHANGED
|
@@ -108,6 +108,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
108
108
|
properties: {
|
|
109
109
|
si: this.fieldUInt('si', 0, 1, 'Session Identifier'),
|
|
110
110
|
li: {
|
|
111
|
+
autoCalculated: true,
|
|
111
112
|
type: 'integer', label: 'Session Header Length', minimum: 0, maximum: 255,
|
|
112
113
|
decode: function () { this.instance.li.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(1, 1))); },
|
|
113
114
|
encode: function () {
|
|
@@ -120,6 +121,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
120
121
|
}
|
|
121
122
|
},
|
|
122
123
|
commonHeaderId: {
|
|
124
|
+
default: 0x80,
|
|
123
125
|
type: 'integer', label: 'Common Session Header Id', minimum: 0, maximum: 255,
|
|
124
126
|
decode: function () { this.instance.commonHeaderId.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(2, 1))); },
|
|
125
127
|
encode: function () {
|
|
@@ -130,6 +132,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
130
132
|
}
|
|
131
133
|
},
|
|
132
134
|
headerLength: {
|
|
135
|
+
autoCalculated: true,
|
|
133
136
|
type: 'integer', label: 'Header Length', minimum: 0, maximum: 255,
|
|
134
137
|
decode: function () { this.instance.headerLength.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(3, 1))); },
|
|
135
138
|
encode: function () {
|
|
@@ -142,6 +145,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
142
145
|
}
|
|
143
146
|
},
|
|
144
147
|
spduLength: {
|
|
148
|
+
autoCalculated: true,
|
|
145
149
|
type: 'integer', label: 'SPDU Length', minimum: 0, maximum: 4294967295,
|
|
146
150
|
decode: function () { this.instance.spduLength.setValue((0, BufferToNumber_1.BufferToUInt32)(this.readBytes(4, 4))); },
|
|
147
151
|
encode: function () {
|
|
@@ -163,6 +167,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
163
167
|
},
|
|
164
168
|
spduNumber: this.fieldUInt('spduNumber', 8, 4, 'SPDU Number'),
|
|
165
169
|
version: {
|
|
170
|
+
default: 1,
|
|
166
171
|
type: 'integer', label: 'Version', minimum: 0, maximum: 65535,
|
|
167
172
|
decode: function () { this.instance.version.setValue((0, BufferToNumber_1.BufferToUInt16)(this.readBytes(12, 2))); },
|
|
168
173
|
encode: function () {
|
|
@@ -192,6 +197,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
192
197
|
encode: function () { this.writeBytes(20, (0, NumberToBuffer_1.UInt32ToBuffer)(this.instance.security.keyId.getValue(0))); }
|
|
193
198
|
},
|
|
194
199
|
initVecLength: {
|
|
200
|
+
autoCalculated: true,
|
|
195
201
|
type: 'integer', label: 'Init Vector Length', minimum: 0, maximum: 255,
|
|
196
202
|
decode: function () { this.instance.security.initVecLength.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(24, 1))); },
|
|
197
203
|
encode: function () {
|
|
@@ -218,6 +224,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
218
224
|
}
|
|
219
225
|
},
|
|
220
226
|
payloadLength: {
|
|
227
|
+
autoCalculated: true,
|
|
221
228
|
type: 'integer', label: 'Payload Length', minimum: 0, maximum: 4294967295,
|
|
222
229
|
decode: function () {
|
|
223
230
|
this.instance.payloadLength.setValue((0, BufferToNumber_1.BufferToUInt32)(this.readBytes(this.#payloadLengthOffset(), 4)));
|
|
@@ -247,7 +254,7 @@ class RGoose extends BaseHeader_1.BaseHeader {
|
|
|
247
254
|
payloadType: { type: 'integer', label: 'Payload Type', minimum: 0, maximum: 255 },
|
|
248
255
|
simulation: { type: 'integer', label: 'Simulation', minimum: 0, maximum: 255 },
|
|
249
256
|
appid: { type: 'integer', label: 'APPID', minimum: 0, maximum: 65535 },
|
|
250
|
-
apduLength: { type: 'integer', label: 'APDU Length', minimum: 0, maximum: 65535 },
|
|
257
|
+
apduLength: { type: 'integer', label: 'APDU Length', autoCalculated: true, minimum: 0, maximum: 65535 },
|
|
251
258
|
apdu: { type: 'string', label: 'APDU', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
|
|
252
259
|
}
|
|
253
260
|
},
|
package/dist/headers/RSVP.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ import { DemuxProducer } from '../types/DemuxProducer';
|
|
|
12
12
|
*
|
|
13
13
|
* The object contents are class/C-Type specific and several (SESSION, SENDER_TSPEC, FLOWSPEC, …) need
|
|
14
14
|
* cross-object and policy context, so this codec keeps each object's contents verbatim as `data` hex
|
|
15
|
-
* (byte-perfect) and does not sub-decode them. The RSVP Length
|
|
16
|
-
* encode
|
|
17
|
-
*
|
|
15
|
+
* (byte-perfect) and does not sub-decode them. The RSVP Length, each object's Length and the Checksum
|
|
16
|
+
* are computed on encode when left out (the Length and Checksum over the bytes actually written), and
|
|
17
|
+
* written as given otherwise, 0 included (a crafted message may lie). Object walking is
|
|
18
18
|
* doubly bounded — by the RSVP Length field and by the bytes the IP layer actually made available — so a
|
|
19
19
|
* lying length can't read past the datagram, and trailing / pipelined bytes are left to the codec's
|
|
20
20
|
* recursion / RawData. A well-formed message round-trips byte-for-byte.
|
package/dist/headers/RSVP.js
CHANGED
|
@@ -6,6 +6,7 @@ const BufferToHex_1 = require("../helper/BufferToHex");
|
|
|
6
6
|
const HexToBuffer_1 = require("../helper/HexToBuffer");
|
|
7
7
|
const BufferToNumber_1 = require("../helper/BufferToNumber");
|
|
8
8
|
const NumberToBuffer_1 = require("../helper/NumberToBuffer");
|
|
9
|
+
const Checksum_1 = require("../helper/Checksum");
|
|
9
10
|
const StringContentEncodingEnum_1 = require("../lib/StringContentEncodingEnum");
|
|
10
11
|
/**
|
|
11
12
|
* RSVP — Resource ReSerVation Protocol (RFC 2205), carried directly over IP as protocol 46. Every RSVP
|
|
@@ -18,9 +19,9 @@ const StringContentEncodingEnum_1 = require("../lib/StringContentEncodingEnum");
|
|
|
18
19
|
*
|
|
19
20
|
* The object contents are class/C-Type specific and several (SESSION, SENDER_TSPEC, FLOWSPEC, …) need
|
|
20
21
|
* cross-object and policy context, so this codec keeps each object's contents verbatim as `data` hex
|
|
21
|
-
* (byte-perfect) and does not sub-decode them. The RSVP Length
|
|
22
|
-
* encode
|
|
23
|
-
*
|
|
22
|
+
* (byte-perfect) and does not sub-decode them. The RSVP Length, each object's Length and the Checksum
|
|
23
|
+
* are computed on encode when left out (the Length and Checksum over the bytes actually written), and
|
|
24
|
+
* written as given otherwise, 0 included (a crafted message may lie). Object walking is
|
|
24
25
|
* doubly bounded — by the RSVP Length field and by the bytes the IP layer actually made available — so a
|
|
25
26
|
* lying length can't read past the datagram, and trailing / pipelined bytes are left to the codec's
|
|
26
27
|
* recursion / RawData. A well-formed message round-trips byte-for-byte.
|
|
@@ -80,14 +81,6 @@ class RSVP extends BaseHeader_1.BaseHeader {
|
|
|
80
81
|
end = available;
|
|
81
82
|
return end;
|
|
82
83
|
}
|
|
83
|
-
/** Effective on-wire byte length of one object: its Length field when supplied, else 4 + its data. */
|
|
84
|
-
static #objectLength(object) {
|
|
85
|
-
const provided = Number(object && object.length);
|
|
86
|
-
if (Number.isFinite(provided) && provided > 0)
|
|
87
|
-
return provided;
|
|
88
|
-
const data = object && object.data ? String(object.data) : '';
|
|
89
|
-
return 4 + (0, HexToBuffer_1.HexToBuffer)(data).length;
|
|
90
|
-
}
|
|
91
84
|
static #buildSchema() {
|
|
92
85
|
return {
|
|
93
86
|
type: 'object',
|
|
@@ -101,6 +94,7 @@ class RSVP extends BaseHeader_1.BaseHeader {
|
|
|
101
94
|
label: 'Version',
|
|
102
95
|
minimum: 0,
|
|
103
96
|
maximum: 15,
|
|
97
|
+
default: 1,
|
|
104
98
|
decode: function () {
|
|
105
99
|
this.instance.version.setValue(this.readBits(0, 1, 0, 4));
|
|
106
100
|
},
|
|
@@ -127,46 +121,68 @@ class RSVP extends BaseHeader_1.BaseHeader {
|
|
|
127
121
|
}
|
|
128
122
|
},
|
|
129
123
|
msgType: this.fieldUInt('msgType', 1, 1, 'Message Type'),
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
//checksum was transmitted
|
|
133
|
-
checksum:
|
|
124
|
+
//Internet checksum over the whole RSVP message (RFC 2205 §3.1.1), computed after the Length
|
|
125
|
+
//once every object is written when left out. A given value is written as given; 0 means no
|
|
126
|
+
//checksum was transmitted.
|
|
127
|
+
checksum: {
|
|
128
|
+
type: 'integer',
|
|
129
|
+
autoCalculated: true,
|
|
130
|
+
label: 'Checksum',
|
|
131
|
+
minimum: 0,
|
|
132
|
+
maximum: 65535,
|
|
133
|
+
decode: function () {
|
|
134
|
+
this.instance.checksum.setValue((0, BufferToNumber_1.BufferToUInt16)(this.readBytes(2, 2)));
|
|
135
|
+
},
|
|
136
|
+
encode: function () {
|
|
137
|
+
if (!this.isLeftOut(this.instance.checksum)) {
|
|
138
|
+
const checksum = this.instance.checksum.getValue(0);
|
|
139
|
+
this.instance.checksum.setValue(checksum);
|
|
140
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt16ToBuffer)(checksum));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.instance.checksum.setValue(0);
|
|
144
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt16ToBuffer)(0));
|
|
145
|
+
this.addPostSelfEncodeHandler(() => {
|
|
146
|
+
const checksum = (0, Checksum_1.InternetChecksum)(this.packet.subarray(this.startPos, this.endPos));
|
|
147
|
+
this.instance.checksum.setValue(checksum);
|
|
148
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt16ToBuffer)(checksum));
|
|
149
|
+
}, 2);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
134
152
|
sendTTL: this.fieldUInt('sendTTL', 4, 1, 'Send TTL'),
|
|
135
153
|
//Reserved byte — kept verbatim and re-emitted for byte-perfect.
|
|
136
154
|
reserved: this.fieldUInt('reserved', 5, 1, 'Reserved'),
|
|
137
155
|
length: {
|
|
138
156
|
type: 'integer',
|
|
157
|
+
autoCalculated: true,
|
|
139
158
|
label: 'Length',
|
|
140
|
-
minimum:
|
|
159
|
+
minimum: 0,
|
|
141
160
|
maximum: 65535,
|
|
142
161
|
decode: function () {
|
|
143
162
|
this.instance.length.setValue((0, BufferToNumber_1.BufferToUInt16)(this.readBytes(6, 2)));
|
|
144
163
|
},
|
|
145
164
|
encode: function () {
|
|
146
|
-
//RSVP Length counts the whole message = 8-byte common header + all objects.
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
else {
|
|
154
|
-
const objects = this.instance.objects.getValue();
|
|
155
|
-
let total = 8;
|
|
156
|
-
if (Array.isArray(objects)) {
|
|
157
|
-
for (const object of objects)
|
|
158
|
-
total += RSVP.#objectLength(object);
|
|
165
|
+
//RSVP Length counts the whole message = 8-byte common header + all objects. A given
|
|
166
|
+
//value is written as given (a crafted message may lie; flagged below the header).
|
|
167
|
+
if (!this.isLeftOut(this.instance.length)) {
|
|
168
|
+
let value = this.instance.length.getValue(0);
|
|
169
|
+
if (value > 65535) {
|
|
170
|
+
this.recordError(this.instance.length.getPath(), 'Maximum value is 65535');
|
|
171
|
+
value = 65535;
|
|
159
172
|
}
|
|
160
|
-
value
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.
|
|
164
|
-
|
|
173
|
+
if (value < 8)
|
|
174
|
+
this.recordError(this.instance.length.getPath(), 'Length should be at least 8');
|
|
175
|
+
this.instance.length.setValue(value);
|
|
176
|
+
this.writeBytes(6, (0, NumberToBuffer_1.UInt16ToBuffer)(value));
|
|
177
|
+
return;
|
|
165
178
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
179
|
+
//Left out: the bytes actually written, known once every object is encoded.
|
|
180
|
+
this.instance.length.setValue(0);
|
|
181
|
+
this.writeBytes(6, (0, NumberToBuffer_1.UInt16ToBuffer)(0));
|
|
182
|
+
this.addPostSelfEncodeHandler(() => {
|
|
183
|
+
this.instance.length.setValue(this.length);
|
|
184
|
+
this.writeBytes(6, (0, NumberToBuffer_1.UInt16ToBuffer)(this.length));
|
|
185
|
+
}, 1);
|
|
170
186
|
}
|
|
171
187
|
},
|
|
172
188
|
//==== Objects (RFC 2205 §3.1.2) ====
|
|
@@ -180,7 +196,7 @@ class RSVP extends BaseHeader_1.BaseHeader {
|
|
|
180
196
|
items: {
|
|
181
197
|
type: 'object',
|
|
182
198
|
properties: {
|
|
183
|
-
length: { type: 'integer', label: 'Length', minimum: 0, maximum: 65535 },
|
|
199
|
+
length: { type: 'integer', label: 'Length', autoCalculated: true, minimum: 0, maximum: 65535 },
|
|
184
200
|
classNum: { type: 'integer', label: 'Class-Num', minimum: 0, maximum: 255 },
|
|
185
201
|
cType: { type: 'integer', label: 'C-Type', minimum: 0, maximum: 255 },
|
|
186
202
|
data: { type: 'string', label: 'Data', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
|
|
@@ -227,11 +243,10 @@ class RSVP extends BaseHeader_1.BaseHeader {
|
|
|
227
243
|
let offset = 8;
|
|
228
244
|
for (const object of objects) {
|
|
229
245
|
const dataBuffer = (0, HexToBuffer_1.HexToBuffer)(object && object.data ? String(object.data) : '');
|
|
230
|
-
//Object Length
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
: 4 + dataBuffer.length;
|
|
246
|
+
//Object Length written as given, 0 included (may lie); left out, derived from
|
|
247
|
+
//the 4-byte header + contents.
|
|
248
|
+
const lengthLeftOut = !object || object.length === undefined || object.length === null;
|
|
249
|
+
const lengthValue = lengthLeftOut ? 4 + dataBuffer.length : (Number(object.length) || 0);
|
|
235
250
|
const classNum = Number(object && object.classNum) || 0;
|
|
236
251
|
const cType = Number(object && object.cType) || 0;
|
|
237
252
|
this.writeBytes(offset, (0, NumberToBuffer_1.UInt16ToBuffer)(lengthValue > 65535 ? 65535 : lengthValue));
|
package/dist/headers/RTCP.js
CHANGED
|
@@ -56,6 +56,7 @@ class RTCP extends BaseHeader_1.BaseHeader {
|
|
|
56
56
|
//separate field over the same octet window; writeBits read-modify-writes so sequential
|
|
57
57
|
//encode of the three composes byte 0 correctly.
|
|
58
58
|
version: {
|
|
59
|
+
default: 2,
|
|
59
60
|
type: 'integer',
|
|
60
61
|
label: 'Version',
|
|
61
62
|
minimum: 0,
|
|
@@ -121,6 +122,7 @@ class RTCP extends BaseHeader_1.BaseHeader {
|
|
|
121
122
|
packetType: this.fieldUInt('packetType', 1, 1, 'Packet Type'),
|
|
122
123
|
length: {
|
|
123
124
|
type: 'integer',
|
|
125
|
+
autoCalculated: true,
|
|
124
126
|
label: 'Length',
|
|
125
127
|
minimum: 0,
|
|
126
128
|
maximum: 65535,
|
package/dist/headers/RTP.js
CHANGED
|
@@ -113,6 +113,7 @@ class RTP extends BaseHeader_1.BaseHeader {
|
|
|
113
113
|
//packet may lie), else derived from the CSRC list length; written into byte 0 bits 4-7.
|
|
114
114
|
csrcCount: {
|
|
115
115
|
type: 'integer',
|
|
116
|
+
autoCalculated: true,
|
|
116
117
|
label: 'CSRC Count',
|
|
117
118
|
minimum: 0,
|
|
118
119
|
maximum: 15,
|
|
@@ -160,7 +161,7 @@ class RTP extends BaseHeader_1.BaseHeader {
|
|
|
160
161
|
label: 'Header Extension',
|
|
161
162
|
properties: {
|
|
162
163
|
profile: { type: 'integer', label: 'Profile', minimum: 0, maximum: 65535 },
|
|
163
|
-
length: { type: 'integer', label: 'Length (32-bit words)', minimum: 0, maximum: 65535 },
|
|
164
|
+
length: { type: 'integer', label: 'Length (32-bit words)', autoCalculated: true, minimum: 0, maximum: 65535 },
|
|
164
165
|
data: { type: 'string', label: 'Data', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
|
|
165
166
|
}
|
|
166
167
|
},
|
package/dist/headers/RTPS.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
2
|
+
import { HeuristicParent } from '../types/LayerGraph';
|
|
2
3
|
import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
|
|
3
4
|
import { DemuxProducer } from '../types/DemuxProducer';
|
|
4
5
|
/**
|
|
@@ -27,6 +28,7 @@ export declare class RTPS extends BaseHeader {
|
|
|
27
28
|
readonly name: string;
|
|
28
29
|
readonly nickname: string;
|
|
29
30
|
readonly matchKeys: string[];
|
|
31
|
+
readonly heuristicParents: HeuristicParent[];
|
|
30
32
|
readonly heuristicFallback: boolean;
|
|
31
33
|
match(): boolean;
|
|
32
34
|
readonly demuxProducers: DemuxProducer[];
|
package/dist/headers/RTPS.js
CHANGED
|
@@ -33,6 +33,8 @@ class RTPS extends BaseHeader_1.BaseHeader {
|
|
|
33
33
|
//No demux keys: RTPS uses dynamically negotiated UDP ports, so it is a content-heuristic child
|
|
34
34
|
//recognized by its 'RTPS' magic rather than a well-known port.
|
|
35
35
|
this.matchKeys = [];
|
|
36
|
+
//Editor graph: matched by content, so list it under these parents in allowedNextLayers().
|
|
37
|
+
this.heuristicParents = ['udp'];
|
|
36
38
|
this.heuristicFallback = true;
|
|
37
39
|
//A leaf header — submessage bodies are QoS/type-dependent and kept verbatim, decoded later.
|
|
38
40
|
this.demuxProducers = [];
|
|
@@ -52,7 +54,7 @@ class RTPS extends BaseHeader_1.BaseHeader {
|
|
|
52
54
|
properties: {
|
|
53
55
|
//The 4-byte magic 'RTPS' (0x52545053). Kept verbatim so any variant round-trips; it is
|
|
54
56
|
//also the content signature match() gates on.
|
|
55
|
-
magic: this.fieldHex('magic', 0, 4, 'Magic'),
|
|
57
|
+
magic: { ...this.fieldHex('magic', 0, 4, 'Magic'), default: '52545053' },
|
|
56
58
|
//Protocol version (major.minor), e.g. 0x0201 = RTPS 2.1. Two opaque octets.
|
|
57
59
|
protocolVersion: this.fieldHex('protocolVersion', 4, 2, 'Protocol Version'),
|
|
58
60
|
//Vendor ID (OMG-assigned), e.g. 0x0101 = RTI Connext. Two opaque octets.
|
|
@@ -84,6 +86,7 @@ class RTPS extends BaseHeader_1.BaseHeader {
|
|
|
84
86
|
},
|
|
85
87
|
submessageLength: {
|
|
86
88
|
type: 'integer',
|
|
89
|
+
autoCalculated: true,
|
|
87
90
|
label: 'Submessage Length',
|
|
88
91
|
minimum: 0,
|
|
89
92
|
maximum: 65535
|
package/dist/headers/RTSP.js
CHANGED
|
@@ -138,13 +138,13 @@ class RTSP extends BaseHeader_1.BaseHeader {
|
|
|
138
138
|
//message field above, never read back). isRequest distinguishes a Request-Line from a
|
|
139
139
|
//Status-Line; method/requestUri are for requests, statusCode/reasonPhrase for responses;
|
|
140
140
|
//cseq is RTSP's request/response sequence number (one per message).
|
|
141
|
-
isRequest: { type: 'boolean', label: 'Is Request' },
|
|
142
|
-
method: { type: 'string', label: 'Method' },
|
|
143
|
-
requestUri: { type: 'string', label: 'Request URI' },
|
|
144
|
-
version: { type: 'string', label: 'Version' },
|
|
145
|
-
statusCode: { type: 'integer', label: 'Status Code', minimum: 0, maximum: 999 },
|
|
146
|
-
reasonPhrase: { type: 'string', label: 'Reason Phrase' },
|
|
147
|
-
cseq: { type: 'integer', label: 'CSeq', minimum: 0 }
|
|
141
|
+
isRequest: { type: 'boolean', label: 'Is Request', readOnly: true },
|
|
142
|
+
method: { type: 'string', label: 'Method', readOnly: true },
|
|
143
|
+
requestUri: { type: 'string', label: 'Request URI', readOnly: true },
|
|
144
|
+
version: { type: 'string', label: 'Version', readOnly: true },
|
|
145
|
+
statusCode: { type: 'integer', label: 'Status Code', readOnly: true, minimum: 0, maximum: 999 },
|
|
146
|
+
reasonPhrase: { type: 'string', label: 'Reason Phrase', readOnly: true },
|
|
147
|
+
cseq: { type: 'integer', label: 'CSeq', readOnly: true, minimum: 0 }
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
}
|
package/dist/headers/RawData.js
CHANGED
|
@@ -26,7 +26,7 @@ class RawData extends BaseHeader_1.BaseHeader {
|
|
|
26
26
|
this.instance.data.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(0, dataLength)));
|
|
27
27
|
},
|
|
28
28
|
encode: () => {
|
|
29
|
-
this.writeBytes(0, Buffer.from(this.instance.data.getValue().toString(), 'hex'));
|
|
29
|
+
this.writeBytes(0, Buffer.from(this.instance.data.getValue('').toString(), 'hex'));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
package/dist/headers/Redis.js
CHANGED
|
@@ -162,10 +162,10 @@ class Redis extends BaseHeader_1.BaseHeader {
|
|
|
162
162
|
//never read back). respType names the leading type byte; isRequest flags the `*` array shape
|
|
163
163
|
//that client commands use; command is the array's first bulk string (the verb); preview is the
|
|
164
164
|
//first line as latin1 text.
|
|
165
|
-
respType: { type: 'string', label: 'RESP Type' },
|
|
166
|
-
isRequest: { type: 'boolean', label: 'Is Request' },
|
|
167
|
-
command: { type: 'string', label: 'Command' },
|
|
168
|
-
preview: { type: 'string', label: 'Preview' }
|
|
165
|
+
respType: { type: 'string', label: 'RESP Type', readOnly: true },
|
|
166
|
+
isRequest: { type: 'boolean', label: 'Is Request', readOnly: true },
|
|
167
|
+
command: { type: 'string', label: 'Command', readOnly: true },
|
|
168
|
+
preview: { type: 'string', label: 'Preview', readOnly: true }
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
}
|
package/dist/headers/Rlogin.js
CHANGED
|
@@ -92,12 +92,12 @@ class Rlogin extends BaseHeader_1.BaseHeader {
|
|
|
92
92
|
//Display-only metadata parsed from the startup message on decode (no encode — populated by
|
|
93
93
|
//the `message` field below, never read back). isStartup flags a payload that opens with a
|
|
94
94
|
//0x00 byte; clientUser/serverUser/terminalType are the leading null-separated fields.
|
|
95
|
-
isStartup: { type: 'boolean', label: 'Is Startup', default: false },
|
|
96
|
-
clientUser: { type: 'string', label: 'Client User', default: '' },
|
|
97
|
-
serverUser: { type: 'string', label: 'Server User', default: '' },
|
|
98
|
-
terminalType: { type: 'string', label: 'Terminal Type', default: '' },
|
|
95
|
+
isStartup: { type: 'boolean', label: 'Is Startup', readOnly: true, default: false },
|
|
96
|
+
clientUser: { type: 'string', label: 'Client User', readOnly: true, default: '' },
|
|
97
|
+
serverUser: { type: 'string', label: 'Server User', readOnly: true, default: '' },
|
|
98
|
+
terminalType: { type: 'string', label: 'Terminal Type', readOnly: true, default: '' },
|
|
99
99
|
//Drives the one-line summary: "clientUser/serverUser" for a startup, else 'data'.
|
|
100
|
-
summaryInfo: { type: 'string', label: 'Summary', hidden: true, default: '' },
|
|
100
|
+
summaryInfo: { type: 'string', label: 'Summary', readOnly: true, hidden: true, default: '' },
|
|
101
101
|
//The whole raw payload is the single source of truth: decoded verbatim to hex and re-emitted
|
|
102
102
|
//untouched (byte-perfect for any Rlogin payload). The startup fields are parsed into the
|
|
103
103
|
//display-only metadata above, which carry no codec of their own.
|
package/dist/headers/Rsync.js
CHANGED
|
@@ -99,8 +99,8 @@ class Rsync extends BaseHeader_1.BaseHeader {
|
|
|
99
99
|
//Display-only metadata parsed from the first line on decode (no encode — populated by the
|
|
100
100
|
//message field above, never read back). isGreeting is true only for a `@RSYNCD:` line;
|
|
101
101
|
//version is the token after `@RSYNCD:` (empty for a binary/non-greeting segment).
|
|
102
|
-
isGreeting: { type: 'boolean', label: 'Is Greeting' },
|
|
103
|
-
version: { type: 'string', label: 'Version' }
|
|
102
|
+
isGreeting: { type: 'boolean', label: 'Is Greeting', readOnly: true },
|
|
103
|
+
version: { type: 'string', label: 'Version', readOnly: true }
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
}
|
package/dist/headers/S7comm.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
2
|
+
import { HeuristicParent } from '../types/LayerGraph';
|
|
2
3
|
import { ProtocolJSONSchema } from '../schema/ProtocolJSONSchema';
|
|
3
4
|
import { DemuxProducer } from '../types/DemuxProducer';
|
|
4
5
|
/**
|
|
@@ -30,6 +31,7 @@ export declare class S7comm extends BaseHeader {
|
|
|
30
31
|
readonly name: string;
|
|
31
32
|
readonly nickname: string;
|
|
32
33
|
readonly matchKeys: string[];
|
|
34
|
+
readonly heuristicParents: HeuristicParent[];
|
|
33
35
|
readonly heuristicFallback: boolean;
|
|
34
36
|
match(): boolean;
|
|
35
37
|
readonly demuxProducers: DemuxProducer[];
|
package/dist/headers/S7comm.js
CHANGED
|
@@ -39,6 +39,8 @@ class S7comm extends BaseHeader_1.BaseHeader {
|
|
|
39
39
|
//with no matchKeys), selection is by content: heuristicFallback lists it in the heuristic chain and
|
|
40
40
|
//match() gates on the COTP parent plus the 0x32 signature.
|
|
41
41
|
this.matchKeys = [];
|
|
42
|
+
//Editor graph: matched by content, so list it under these parents in allowedNextLayers().
|
|
43
|
+
this.heuristicParents = [{ parent: 'cotp', discriminator: { field: 'pduType', value: 0xf0 } }];
|
|
42
44
|
this.heuristicFallback = true;
|
|
43
45
|
//A leaf for now — the Parameter/Data sections require per-function, cross-PDU parsing.
|
|
44
46
|
this.demuxProducers = [];
|
|
@@ -79,6 +81,7 @@ class S7comm extends BaseHeader_1.BaseHeader {
|
|
|
79
81
|
static #lengthField(name, offset, sectionName, label) {
|
|
80
82
|
return {
|
|
81
83
|
type: 'integer',
|
|
84
|
+
autoCalculated: true,
|
|
82
85
|
label: label,
|
|
83
86
|
minimum: 0,
|
|
84
87
|
maximum: 65535,
|
|
@@ -111,7 +114,8 @@ class S7comm extends BaseHeader_1.BaseHeader {
|
|
|
111
114
|
properties: {
|
|
112
115
|
//Protocol Id: always 0x32 for S7comm. A plain uint (no enum) so a crafted/off-spec value
|
|
113
116
|
//still round-trips; the 0x32 signature gates selection in match(), not the schema.
|
|
114
|
-
|
|
117
|
+
//Default 0x32: the S7comm Protocol Id, and the signature match() requires.
|
|
118
|
+
protocolId: { ...this.fieldUInt('protocolId', 0, 1, 'Protocol Id'), default: 0x32 },
|
|
115
119
|
//ROSCTR (message class): 1 Job, 2 Ack, 3 Ack_Data, 7 Userdata. Kept as a plain uint —
|
|
116
120
|
//an unknown class must still decode and re-encode, so no enum constraint is applied.
|
|
117
121
|
rosctr: this.fieldUInt('rosctr', 1, 1, 'ROSCTR'),
|
package/dist/headers/SCTP.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { DemuxProducer } from '../types/DemuxProducer';
|
|
|
5
5
|
* SCTP — Stream Control Transmission Protocol (RFC 9260), carried directly over IP as protocol 132
|
|
6
6
|
* (both IPv4 `protocol` and IPv6 `nxt`). The 12-byte common header is all big-endian: Source Port (2) +
|
|
7
7
|
* Destination Port (2) + Verification Tag (4) + Checksum (4). The Checksum is a CRC32c over the whole
|
|
8
|
-
* SCTP packet (with the field zeroed) stored little-endian on the wire
|
|
9
|
-
*
|
|
8
|
+
* SCTP packet (with the field zeroed) stored little-endian on the wire, surfaced as the 4-byte hex of
|
|
9
|
+
* the wire bytes; encode computes it when left out and writes a given value as given.
|
|
10
10
|
*
|
|
11
11
|
* After the common header comes a chain of chunks until the enclosing IP payload is consumed. Each chunk
|
|
12
12
|
* is Type(1) + Flags(1) + Length(2) + Value, where Length counts the 4-byte chunk header plus the value
|
package/dist/headers/SCTP.js
CHANGED
|
@@ -6,13 +6,14 @@ const BufferToHex_1 = require("../helper/BufferToHex");
|
|
|
6
6
|
const HexToBuffer_1 = require("../helper/HexToBuffer");
|
|
7
7
|
const BufferToNumber_1 = require("../helper/BufferToNumber");
|
|
8
8
|
const NumberToBuffer_1 = require("../helper/NumberToBuffer");
|
|
9
|
+
const Checksum_1 = require("../helper/Checksum");
|
|
9
10
|
const StringContentEncodingEnum_1 = require("../lib/StringContentEncodingEnum");
|
|
10
11
|
/**
|
|
11
12
|
* SCTP — Stream Control Transmission Protocol (RFC 9260), carried directly over IP as protocol 132
|
|
12
13
|
* (both IPv4 `protocol` and IPv6 `nxt`). The 12-byte common header is all big-endian: Source Port (2) +
|
|
13
14
|
* Destination Port (2) + Verification Tag (4) + Checksum (4). The Checksum is a CRC32c over the whole
|
|
14
|
-
* SCTP packet (with the field zeroed) stored little-endian on the wire
|
|
15
|
-
*
|
|
15
|
+
* SCTP packet (with the field zeroed) stored little-endian on the wire, surfaced as the 4-byte hex of
|
|
16
|
+
* the wire bytes; encode computes it when left out and writes a given value as given.
|
|
16
17
|
*
|
|
17
18
|
* After the common header comes a chain of chunks until the enclosing IP payload is consumed. Each chunk
|
|
18
19
|
* is Type(1) + Flags(1) + Length(2) + Value, where Length counts the 4-byte chunk header plus the value
|
|
@@ -72,9 +73,32 @@ class SCTP extends BaseHeader_1.BaseHeader {
|
|
|
72
73
|
dstPort: this.fieldUInt('dstPort', 2, 2, 'Destination Port'),
|
|
73
74
|
//32-bit association selector; opaque on the wire, kept verbatim as hex.
|
|
74
75
|
verificationTag: this.fieldHex('verificationTag', 4, 4, 'Verification Tag'),
|
|
75
|
-
//CRC32c over the whole packet
|
|
76
|
-
//
|
|
77
|
-
|
|
76
|
+
//CRC32c over the whole packet with this field zeroed (RFC 9260 §6.8), least significant byte
|
|
77
|
+
//first on the wire, kept as the hex of the wire bytes. Left out, computed once every chunk
|
|
78
|
+
//is written; a given value is written as given, so a crafted/wrong one round-trips.
|
|
79
|
+
checksum: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
autoCalculated: true,
|
|
82
|
+
label: 'Checksum',
|
|
83
|
+
contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX,
|
|
84
|
+
decode: function () {
|
|
85
|
+
this.instance.checksum.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(8, 4)));
|
|
86
|
+
},
|
|
87
|
+
encode: function () {
|
|
88
|
+
if (!this.isLeftOut(this.instance.checksum)) {
|
|
89
|
+
this.writeBytes(8, (0, HexToBuffer_1.HexToBuffer)(this.instance.checksum.getValue('00000000')));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.instance.checksum.setValue('00000000');
|
|
93
|
+
this.writeBytes(8, Buffer.alloc(4, 0));
|
|
94
|
+
this.addPostSelfEncodeHandler(() => {
|
|
95
|
+
const checksum = Buffer.alloc(4);
|
|
96
|
+
checksum.writeUInt32LE((0, Checksum_1.CRC32c)(this.packet.subarray(this.startPos, this.endPos)));
|
|
97
|
+
this.instance.checksum.setValue((0, BufferToHex_1.BufferToHex)(checksum));
|
|
98
|
+
this.writeBytes(8, checksum);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
},
|
|
78
102
|
chunks: {
|
|
79
103
|
type: 'array',
|
|
80
104
|
label: 'Chunks',
|
|
@@ -84,9 +108,9 @@ class SCTP extends BaseHeader_1.BaseHeader {
|
|
|
84
108
|
properties: {
|
|
85
109
|
type: { type: 'integer', label: 'Chunk Type', minimum: 0, maximum: 255 },
|
|
86
110
|
flags: { type: 'integer', label: 'Chunk Flags', minimum: 0, maximum: 255 },
|
|
87
|
-
length: { type: 'integer', label: 'Chunk Length', minimum: 0, maximum: 65535 },
|
|
111
|
+
length: { type: 'integer', label: 'Chunk Length', autoCalculated: true, minimum: 0, maximum: 65535 },
|
|
88
112
|
value: { type: 'string', label: 'Value', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX },
|
|
89
|
-
padding: { type: 'string', label: 'Padding', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
|
|
113
|
+
padding: { type: 'string', label: 'Padding', autoCalculated: true, contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
|
|
90
114
|
}
|
|
91
115
|
},
|
|
92
116
|
decode: function () {
|
package/dist/headers/SFlow.js
CHANGED
|
@@ -143,6 +143,7 @@ class SFlow extends BaseHeader_1.BaseHeader {
|
|
|
143
143
|
}, 'System Uptime'),
|
|
144
144
|
numSamples: {
|
|
145
145
|
type: 'integer',
|
|
146
|
+
autoCalculated: true,
|
|
146
147
|
label: 'Number of Samples',
|
|
147
148
|
minimum: 0,
|
|
148
149
|
maximum: 4294967295,
|
|
@@ -177,7 +178,7 @@ class SFlow extends BaseHeader_1.BaseHeader {
|
|
|
177
178
|
label: 'Sample',
|
|
178
179
|
properties: {
|
|
179
180
|
sampleType: { type: 'integer', label: 'Sample Type', minimum: 0, maximum: 4294967295 },
|
|
180
|
-
sampleLength: { type: 'integer', label: 'Sample Length', minimum: 0, maximum: 4294967295 },
|
|
181
|
+
sampleLength: { type: 'integer', label: 'Sample Length', autoCalculated: true, minimum: 0, maximum: 4294967295 },
|
|
181
182
|
sampleData: { type: 'string', label: 'Sample Data', contentEncoding: StringContentEncodingEnum_1.StringContentEncodingEnum.HEX }
|
|
182
183
|
}
|
|
183
184
|
},
|
package/dist/headers/SIP.js
CHANGED
|
@@ -113,12 +113,12 @@ class SIP extends BaseHeader_1.BaseHeader {
|
|
|
113
113
|
//Display-only metadata parsed from the start-line on decode (no encode — populated by the
|
|
114
114
|
//message field above, never read back). isRequest distinguishes a Request-Line from a
|
|
115
115
|
//Status-Line; method/requestUri are for requests, statusCode/reasonPhrase for responses.
|
|
116
|
-
isRequest: { type: 'boolean', label: 'Is Request' },
|
|
117
|
-
method: { type: 'string', label: 'Method' },
|
|
118
|
-
requestUri: { type: 'string', label: 'Request URI' },
|
|
119
|
-
version: { type: 'string', label: 'Version' },
|
|
120
|
-
statusCode: { type: 'integer', label: 'Status Code', minimum: 0, maximum: 999 },
|
|
121
|
-
reasonPhrase: { type: 'string', label: 'Reason Phrase' }
|
|
116
|
+
isRequest: { type: 'boolean', label: 'Is Request', readOnly: true },
|
|
117
|
+
method: { type: 'string', label: 'Method', readOnly: true },
|
|
118
|
+
requestUri: { type: 'string', label: 'Request URI', readOnly: true },
|
|
119
|
+
version: { type: 'string', label: 'Version', readOnly: true },
|
|
120
|
+
statusCode: { type: 'integer', label: 'Status Code', readOnly: true, minimum: 0, maximum: 999 },
|
|
121
|
+
reasonPhrase: { type: 'string', label: 'Reason Phrase', readOnly: true }
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
}
|
package/dist/headers/SLMP.js
CHANGED
package/dist/headers/SLP.js
CHANGED
|
@@ -92,6 +92,7 @@ class SLP extends BaseHeader_1.BaseHeader {
|
|
|
92
92
|
functionId: this.fieldUInt('functionId', 1, 1, 'Function-ID'),
|
|
93
93
|
length: {
|
|
94
94
|
type: 'integer',
|
|
95
|
+
autoCalculated: true,
|
|
95
96
|
label: 'Length',
|
|
96
97
|
minimum: 0,
|
|
97
98
|
maximum: 16777215,
|
|
@@ -124,6 +125,7 @@ class SLP extends BaseHeader_1.BaseHeader {
|
|
|
124
125
|
xid: this.fieldUInt('xid', 10, 2, 'XID'),
|
|
125
126
|
langTagLen: {
|
|
126
127
|
type: 'integer',
|
|
128
|
+
autoCalculated: true,
|
|
127
129
|
label: 'Language Tag Length',
|
|
128
130
|
minimum: 0,
|
|
129
131
|
maximum: 65535,
|
package/dist/headers/SLPv1.js
CHANGED
package/dist/headers/SMB1.js
CHANGED
package/dist/headers/SMB2.js
CHANGED