netkitty 0.0.29 → 0.0.31
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/dist/lib/codec/PacketHeaders.d.ts +3 -0
- package/dist/lib/codec/PacketHeaders.d.ts.map +1 -1
- package/dist/lib/codec/PacketHeaders.js +7 -1
- package/dist/lib/codec/headers/Goose.d.ts.map +1 -1
- package/dist/lib/codec/headers/Goose.js +14 -0
- package/dist/lib/codec/headers/IEC104_I_Frame.d.ts +10 -0
- package/dist/lib/codec/headers/IEC104_I_Frame.d.ts.map +1 -0
- package/dist/lib/codec/headers/IEC104_I_Frame.js +6411 -0
- package/dist/lib/codec/headers/IEC104_S_Frame.d.ts +10 -0
- package/dist/lib/codec/headers/IEC104_S_Frame.d.ts.map +1 -0
- package/dist/lib/codec/headers/IEC104_S_Frame.js +105 -0
- package/dist/lib/codec/headers/IEC104_U_Frame.d.ts +10 -0
- package/dist/lib/codec/headers/IEC104_U_Frame.d.ts.map +1 -0
- package/dist/lib/codec/headers/IEC104_U_Frame.js +155 -0
- package/dist/tests/units/Codec.spec.js +13 -6
- package/package.json +1 -1
- package/src/lib/codec/PacketHeaders.ts +3 -0
- package/src/lib/codec/headers/Goose.ts +14 -0
- package/src/lib/codec/headers/IEC104_I_Frame.ts +7373 -0
- package/src/lib/codec/headers/IEC104_S_Frame.ts +97 -0
- package/src/lib/codec/headers/IEC104_U_Frame.ts +139 -0
- package/src/lib/codec/headers/VLAN_802dot1Q.ts +4 -0
- package/src/tests/units/Codec.spec.ts +14 -7
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProtocolJSONSchema } from '../../schema/ProtocolJSONSchema';
|
|
2
|
+
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
3
|
+
export declare class IEC104_S_Frame extends BaseHeader {
|
|
4
|
+
SCHEMA: ProtocolJSONSchema;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
nickname: string;
|
|
8
|
+
match(): boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IEC104_S_Frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEC104_S_Frame.d.ts","sourceRoot":"","sources":["../../../../src/lib/codec/headers/IEC104_S_Frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAA;AAIlE,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAA;AAIlD,qBAAa,cAAe,SAAQ,UAAU;IACnC,MAAM,EAAE,kBAAkB,CAqEhC;IACM,EAAE,EAAE,MAAM,CAAmB;IAC7B,IAAI,EAAE,MAAM,CAAoB;IAChC,QAAQ,EAAE,MAAM,CAAiB;IAEjC,KAAK,IAAI,OAAO;CAa1B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IEC104_S_Frame = void 0;
|
|
4
|
+
const BufferToNumber_1 = require("../../helper/BufferToNumber");
|
|
5
|
+
const BufferToHex_1 = require("../../helper/BufferToHex");
|
|
6
|
+
const HexToBuffer_1 = require("../../helper/HexToBuffer");
|
|
7
|
+
const BaseHeader_1 = require("../abstracts/BaseHeader");
|
|
8
|
+
const NumberToBuffer_1 = require("../../helper/NumberToBuffer");
|
|
9
|
+
class IEC104_S_Frame extends BaseHeader_1.BaseHeader {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.SCHEMA = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
startByte: {
|
|
16
|
+
type: 'integer',
|
|
17
|
+
label: 'Start Byte',
|
|
18
|
+
minimum: 0,
|
|
19
|
+
maximum: 255,
|
|
20
|
+
decode: () => {
|
|
21
|
+
this.instance.startByte.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(0, 1)));
|
|
22
|
+
},
|
|
23
|
+
encode: () => {
|
|
24
|
+
this.writeBytes(0, (0, NumberToBuffer_1.UInt8ToBuffer)(this.instance.startByte.getValue(0, (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
apduLength: {
|
|
28
|
+
type: 'integer',
|
|
29
|
+
label: 'APDU Length',
|
|
30
|
+
minimum: 0,
|
|
31
|
+
maximum: 255,
|
|
32
|
+
decode: () => {
|
|
33
|
+
this.instance.apduLength.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(1, 1)));
|
|
34
|
+
},
|
|
35
|
+
encode: () => {
|
|
36
|
+
this.writeBytes(1, (0, NumberToBuffer_1.UInt8ToBuffer)(this.instance.apduLength.getValue(0, (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
controlField: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
label: 'Control Field',
|
|
42
|
+
decode: () => {
|
|
43
|
+
this.instance.controlField.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(2, 4)));
|
|
44
|
+
},
|
|
45
|
+
encode: () => {
|
|
46
|
+
this.writeBytes(2, (0, HexToBuffer_1.HexToBuffer)(this.instance.controlField.getValue('0', (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
apciType: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
label: 'APCI Type',
|
|
52
|
+
minimum: 0,
|
|
53
|
+
maximum: 3,
|
|
54
|
+
decode: () => {
|
|
55
|
+
const controlType = this.readBits(2, 1, 7, 1);
|
|
56
|
+
switch (controlType) {
|
|
57
|
+
case 1:
|
|
58
|
+
{
|
|
59
|
+
this.instance.apciType.setValue('S-Format');
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
default: {
|
|
63
|
+
this.recordError(this.instance.apciType.getPath(), 'Illegal acpiType!');
|
|
64
|
+
this.instance.apciType.setValue(controlType);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
encode: () => {
|
|
69
|
+
const controlType = this.instance.apciType.getValue('0', (nodePath) => this.recordError(nodePath, 'Not Found'));
|
|
70
|
+
switch (controlType) {
|
|
71
|
+
case 'S-Format':
|
|
72
|
+
{
|
|
73
|
+
this.writeBits(2, 1, 7, 1, 1);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
default: {
|
|
77
|
+
this.writeBits(2, 1, 7, 1, this.instance.apciType.getValue(0, (nodePath) => this.recordError(nodePath, 'Not Found')));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
this.id = 'IEC104_S_Frame';
|
|
85
|
+
this.name = 'IEC 60870-5-104';
|
|
86
|
+
this.nickname = 'iec60870_104';
|
|
87
|
+
}
|
|
88
|
+
match() {
|
|
89
|
+
if (!this.prevCodecModules)
|
|
90
|
+
return false;
|
|
91
|
+
if ((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(0, 1)) != 104)
|
|
92
|
+
return false;
|
|
93
|
+
const type = this.readBits(2, 1, 6, 2);
|
|
94
|
+
switch (type) {
|
|
95
|
+
case 1: {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
default: {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
;
|
|
104
|
+
}
|
|
105
|
+
exports.IEC104_S_Frame = IEC104_S_Frame;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProtocolJSONSchema } from '../../schema/ProtocolJSONSchema';
|
|
2
|
+
import { BaseHeader } from '../abstracts/BaseHeader';
|
|
3
|
+
export declare class IEC104_U_Frame extends BaseHeader {
|
|
4
|
+
SCHEMA: ProtocolJSONSchema;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
nickname: string;
|
|
8
|
+
match(): boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IEC104_U_Frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEC104_U_Frame.d.ts","sourceRoot":"","sources":["../../../../src/lib/codec/headers/IEC104_U_Frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAA;AAIlE,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAA;AAIlD,qBAAa,cAAe,SAAQ,UAAU;IACnC,MAAM,EAAE,kBAAkB,CA+GhC;IACM,EAAE,EAAE,MAAM,CAAmB;IAC7B,IAAI,EAAE,MAAM,CAAoB;IAChC,QAAQ,EAAE,MAAM,CAAiB;IAEjC,KAAK,IAAI,OAAO;CAa1B"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IEC104_U_Frame = void 0;
|
|
4
|
+
const BufferToNumber_1 = require("../../helper/BufferToNumber");
|
|
5
|
+
const BufferToHex_1 = require("../../helper/BufferToHex");
|
|
6
|
+
const HexToBuffer_1 = require("../../helper/HexToBuffer");
|
|
7
|
+
const BaseHeader_1 = require("../abstracts/BaseHeader");
|
|
8
|
+
const NumberToBuffer_1 = require("../../helper/NumberToBuffer");
|
|
9
|
+
class IEC104_U_Frame extends BaseHeader_1.BaseHeader {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.SCHEMA = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
startByte: {
|
|
16
|
+
type: 'integer',
|
|
17
|
+
label: 'Start Byte',
|
|
18
|
+
minimum: 0,
|
|
19
|
+
maximum: 255,
|
|
20
|
+
decode: () => {
|
|
21
|
+
this.instance.startByte.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(0, 1)));
|
|
22
|
+
},
|
|
23
|
+
encode: () => {
|
|
24
|
+
this.writeBytes(0, (0, NumberToBuffer_1.UInt8ToBuffer)(this.instance.startByte.getValue(0, (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
apduLength: {
|
|
28
|
+
type: 'integer',
|
|
29
|
+
label: 'APDU Length',
|
|
30
|
+
minimum: 0,
|
|
31
|
+
maximum: 255,
|
|
32
|
+
decode: () => {
|
|
33
|
+
this.instance.apduLength.setValue((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(1, 1)));
|
|
34
|
+
},
|
|
35
|
+
encode: () => {
|
|
36
|
+
this.writeBytes(1, (0, NumberToBuffer_1.UInt8ToBuffer)(this.instance.apduLength.getValue(0, (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
controlField: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
label: 'Control Field',
|
|
42
|
+
decode: () => {
|
|
43
|
+
this.instance.controlField.setValue((0, BufferToHex_1.BufferToHex)(this.readBytes(2, 4)));
|
|
44
|
+
},
|
|
45
|
+
encode: () => {
|
|
46
|
+
this.writeBytes(2, (0, HexToBuffer_1.HexToBuffer)(this.instance.controlField.getValue('0', (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
apciType: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
label: 'APCI Type',
|
|
52
|
+
minimum: 0,
|
|
53
|
+
maximum: 3,
|
|
54
|
+
decode: () => {
|
|
55
|
+
const uframeType = (0, BufferToHex_1.BufferToHex)(this.readBytes(2, 4));
|
|
56
|
+
switch (uframeType) {
|
|
57
|
+
case '43000000':
|
|
58
|
+
{
|
|
59
|
+
this.instance.apciType.setValue('U-Format Type:Test Frame Activation');
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case '83000000':
|
|
63
|
+
{
|
|
64
|
+
this.instance.apciType.setValue('U-Format Type:Test Frame Confirmation');
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case '13000000':
|
|
68
|
+
{
|
|
69
|
+
this.instance.apciType.setValue('U-Format Type:Stop Data Transfer Activation');
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
case '23000000':
|
|
73
|
+
{
|
|
74
|
+
this.instance.apciType.setValue('U-Format Type:Stop Data Transfer Confirmation');
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
case '07000000':
|
|
78
|
+
{
|
|
79
|
+
this.instance.apciType.setValue('U-Format Type:Start Data Transfer Activation');
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
case '0B000000':
|
|
83
|
+
{
|
|
84
|
+
this.instance.apciType.setValue('U-Format Type:Start Data Transfer Confirmation');
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
default: {
|
|
88
|
+
this.recordError(this.instance.apciType.getPath(), 'Illegal acpiType!');
|
|
89
|
+
this.instance.apciType.setValue(uframeType);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
encode: () => {
|
|
94
|
+
const controlType = this.instance.apciType.getValue('0', (nodePath) => this.recordError(nodePath, 'Not Found'));
|
|
95
|
+
switch (controlType) {
|
|
96
|
+
case 'U-Format Type:Test Frame Activation':
|
|
97
|
+
{
|
|
98
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt32ToBuffer)(1124073472));
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case 'U-Format Type:Test Frame Confirmation':
|
|
102
|
+
{
|
|
103
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt32ToBuffer)(2197815296));
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
case 'U-Format Type:Stop Data Transfer Activation':
|
|
107
|
+
{
|
|
108
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt32ToBuffer)(318767104));
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
case 'U-Format Type:Stop Data Transfer Confirmation':
|
|
112
|
+
{
|
|
113
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt32ToBuffer)(587202560));
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
case 'U-Format Type:Start Data Transfer Activation':
|
|
117
|
+
{
|
|
118
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt32ToBuffer)(117440512));
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
case 'U-Format Type:Start Data Transfer Confirmation':
|
|
122
|
+
{
|
|
123
|
+
this.writeBytes(2, (0, NumberToBuffer_1.UInt32ToBuffer)(184549376));
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
default: {
|
|
127
|
+
this.writeBytes(2, (0, HexToBuffer_1.HexToBuffer)(this.instance.apciType.getValue('0', (nodePath) => this.recordError(nodePath, 'Not Found'))));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
this.id = 'IEC104_U_Frame';
|
|
135
|
+
this.name = 'IEC 60870-5-104';
|
|
136
|
+
this.nickname = 'iec60870_104';
|
|
137
|
+
}
|
|
138
|
+
match() {
|
|
139
|
+
if (!this.prevCodecModules)
|
|
140
|
+
return false;
|
|
141
|
+
if ((0, BufferToNumber_1.BufferToUInt8)(this.readBytes(0, 1)) != 104)
|
|
142
|
+
return false;
|
|
143
|
+
const type = this.readBits(2, 1, 6, 2);
|
|
144
|
+
switch (type) {
|
|
145
|
+
case 3: {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
default: {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
;
|
|
154
|
+
}
|
|
155
|
+
exports.IEC104_U_Frame = IEC104_U_Frame;
|
|
@@ -7,9 +7,9 @@ async function DecodeAndEncode(packet) {
|
|
|
7
7
|
const codec = new Codec_1.Codec();
|
|
8
8
|
const decodeResult = await codec.decode(packetBuffer);
|
|
9
9
|
// console.log(JSON.stringify(decodeResult, null, 2))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
for (let i = 0; i < 100000; i++) {
|
|
11
|
+
const encodeResult = await codec.encode(decodeResult);
|
|
12
|
+
}
|
|
13
13
|
const encodeResult = await codec.encode(decodeResult);
|
|
14
14
|
// const pw=new PcapWriter({filename:`/Users/alex/Desktop/genPcap${Date.now()}.pcap`})
|
|
15
15
|
// pw.write(Buffer.from(packet,'base64'),0,0)
|
|
@@ -41,13 +41,16 @@ async function TCP_Codec(packet) {
|
|
|
41
41
|
async function UDP_Codec(packet) {
|
|
42
42
|
await DecodeAndEncode(packet);
|
|
43
43
|
}
|
|
44
|
+
async function IEC104(packet) {
|
|
45
|
+
await DecodeAndEncode(packet);
|
|
46
|
+
}
|
|
44
47
|
(async () => {
|
|
45
|
-
console.time('GOOSE')
|
|
48
|
+
// console.time('GOOSE')
|
|
46
49
|
// await GOOSE_Codec('AaD0CC93AKD0CC93iLgAAQCRAAAAAGGBhoAaR0VEZXZpY2VGNjUwL0xMTjAkR08kZ2NiMDGBAwCcQIIYR0VEZXZpY2VGNjUwL0xMTjAkR09PU0UxgwtGNjUwX0dPT1NFMYQIOG6780IXKAqFAQGGAQuHAQCIAQGJAQCKAQirIIMBAIQDAwAAgwEAhAMDAACDAQCEAwMAAIMBAIQDAwAA')
|
|
47
50
|
// await GOOSE_Codec('AQzNAQNVABAAAANVgQAABoi4A1UAlgAAAABhgYuAGlBMMTEwMVBJR08wMS9MTE4wJEdPJGdvY2IwgQInEIIZUEwxMTAxUElHTzAxL0xMTjAkZHNHT09TRYMXUEwxMTAxUElHTzAxL0xMTjAuZ28AA1AAAA///wAApdAQcA==')
|
|
48
51
|
// await GOOSE_Codec('AQzNARACABQ7WwNyiLgQAgDXAAAAAGGBzIAYUENTMDAyUElHTy9MTE4wJEdPJGdvY2IxgQIBkIIYUENTMDAyUElHTy9MTE4wJGRzR09PU0UxgxhQQ1MwMDJQSUdPL0xMTjAkR08kZ29jYjGECGf88cRG/rQAhQMOWIGGAQCHAQCIAQGJAQCKAQ6rWocFCEScQACHBQg+0OVhhQEChwUIAAAAAIcFCEKSmZqHBQhEu4AAhwUIRLuAAIcFCEScQACHBQg+1P30hQEChwUIAAAAAIcFCEJlmZqHBQhEu4AAhwUIRLuAAA==')
|
|
49
|
-
await GOOSE_Codec('AQzNAQH/ABEiM0RVgQCgzIi4EjQAcwAAAABhaYASRGV2MS9MTE4wJEdPJGdjYjAxgQEUghFEZXYxL0xMTjAkRGF0U2V0MYMIR1NfZ2NiMDGECAAAAAAAAAAAhQEAhgEAhwEAiAEBiQEAigEDqxeFAQuiC4MBAYkGESIzRFVmhwUIwEhfww==')
|
|
50
|
-
console.timeEnd('GOOSE')
|
|
52
|
+
// await GOOSE_Codec('AQzNAQH/ABEiM0RVgQCgzIi4EjQAcwAAAABhaYASRGV2MS9MTE4wJEdPJGdjYjAxgQEUghFEZXYxL0xMTjAkRGF0U2V0MYMIR1NfZ2NiMDGECAAAAAAAAAAAhQEAhgEAhwEAiAEBiQEAigEDqxeFAQuiC4MBAYkGESIzRFVmhwUIwEhfww==')
|
|
53
|
+
// console.timeEnd('GOOSE')
|
|
51
54
|
//
|
|
52
55
|
// console.time('IEC61850SampleValues')
|
|
53
56
|
// await IEC61850SampleValues_Codec('AQzNBAAByv7A/+5piLpAAQBmAAAAAGBcgAEBolcwVYAENDAwMYICCDaDBAAAAAGFAQKHQAADpBwAAAAAAAAgrAAAAAD//DyAAAAAAAAAAUgAACAAAPOi+AAAAAAAC1wyAAAAAP8BRogAAAAAAABFsgAAIAA=')
|
|
@@ -76,4 +79,8 @@ async function UDP_Codec(packet) {
|
|
|
76
79
|
// await IPv6_Codec('xAI6RAAAxAA6RAAAht1gAAAAADw6QP6AAAAAAAAAxgA6//5EAAD+gAAAAAAAAMYCOv/+RAAAgQDIrxOKAAEBAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0')
|
|
77
80
|
// await IPv6_Codec('MzMAAAAWxAI6RAAAht1uAAAAACQAAf6AAAAAAAAAxgI6//5EAAD/AgAAAAAAAAAAAAAAAAAWOgAFAgAAAQCPAHDCAAAAAQQAAAD/AgAAAAAAAAAAAAAAAAAC')
|
|
78
81
|
// console.timeEnd('IPv6')
|
|
82
|
+
console.time('IEC104');
|
|
83
|
+
// await IEC104('ACIVVgtUABbRAAkFCABFAAHcOlYAAP8GoTAKFGRsChRmAQlktU0AnlnKzdq0t1AYCDQZSAAAaB4IAAQABQQUAAoAAQAAAAACAAAAAAMAAAAABAAAAABoKgoABAAHBBQACgABAAAAAAAAAAIAAAAAAAAAAwAAAAAAAAAEAAAAAAAAAGgiDAAEAAkEFAAKAAEAAAAAAAIAAAAAAAMAAAAAAAQAAAAAAGgiDgAEAAsEFAAKAAEAAAAAAAIAAAAAAAMAAAAAAAQAAAAAAGgqEAAEAA0EFAAKAAEAAAAAAAAAAgAAAAAAAAADAAAAAAAAAAQAAAAAAAAAaDYSAAQAHgQUAAoACwAAADEQFwiEBw0MAAAAMRAXCIQHDQ0AAAAxEBcIhAcNDgAAADEQFwiEBw1oNhQABAAfBBQACgALAAAAMRAXCIQHDQwAAAAxEBcIhAcNDQAAADEQFwiEBw0OAAAAMRAXCIQHDWg6FgAEACAEFAAKAAsAAAAAMRAXCIQHDQwAAAAAMRAXCIQHDQ0AAAAAMRAXCIQHDQ4AAAAAMRAXCIQHDWhGGAAEACEEFAAKAAsAAAAAAAAAMRAXCIQHDQwAAAAAAAAAMRAXCIQHDQ0AAAAAAAAAMRAXCIQHDQ4AAAAAAAAAMRAXCIQHDQ==')
|
|
84
|
+
await IEC104('ACIVVgtUABbRAAkFCABFAABwOlUAAP8Gop0KFGRsChRmAQlktU0AnlmCzdq0t1AYCDQZ9gAAaA4CAAIAZAEHAAoAAAAAFGgaBAACAAEEFAAKAAEAAAACAAAAAwAAAAQAAABoGgYAAgADBBQACgABAAAAAgAAAAMAAAAEAAAA');
|
|
85
|
+
console.timeEnd('IEC104');
|
|
79
86
|
})();
|
package/package.json
CHANGED
|
@@ -17,4 +17,7 @@ export {TLS_ApplicationData} from './headers/TLS_ApplicationData'
|
|
|
17
17
|
export {TLS_ChangeCipherSpec} from './headers/TLS_ChangeCipherSpec'
|
|
18
18
|
export {TLS_Handshake} from './headers/TLS_Handshake'
|
|
19
19
|
export {TLS_Heartbeat} from './headers/TLS_Heartbeat'
|
|
20
|
+
export {IEC104_I_Frame} from './headers/IEC104_I_Frame'
|
|
21
|
+
export {IEC104_S_Frame} from './headers/IEC104_S_Frame'
|
|
22
|
+
export {IEC104_U_Frame} from './headers/IEC104_U_Frame'
|
|
20
23
|
//阿才写的代码
|
|
@@ -473,6 +473,7 @@ export class Goose extends BaseHeader {
|
|
|
473
473
|
anyOf: [
|
|
474
474
|
{
|
|
475
475
|
type: 'object',
|
|
476
|
+
label: ItemDataType.Boolean,
|
|
476
477
|
properties: {
|
|
477
478
|
dataType: {type: 'string', enum: [ItemDataType.Boolean]},
|
|
478
479
|
value: {type: 'boolean'}
|
|
@@ -480,6 +481,7 @@ export class Goose extends BaseHeader {
|
|
|
480
481
|
},
|
|
481
482
|
{
|
|
482
483
|
type: 'object',
|
|
484
|
+
label: ItemDataType.INT8,
|
|
483
485
|
properties: {
|
|
484
486
|
dataType: {type: 'string', enum: [ItemDataType.INT8]},
|
|
485
487
|
value: {type: 'integer'}
|
|
@@ -487,6 +489,7 @@ export class Goose extends BaseHeader {
|
|
|
487
489
|
},
|
|
488
490
|
{
|
|
489
491
|
type: 'object',
|
|
492
|
+
label: ItemDataType.INT16,
|
|
490
493
|
properties: {
|
|
491
494
|
dataType: {type: 'string', enum: [ItemDataType.INT16]},
|
|
492
495
|
value: {type: 'integer'}
|
|
@@ -494,6 +497,7 @@ export class Goose extends BaseHeader {
|
|
|
494
497
|
},
|
|
495
498
|
{
|
|
496
499
|
type: 'object',
|
|
500
|
+
label: ItemDataType.INT32,
|
|
497
501
|
properties: {
|
|
498
502
|
dataType: {type: 'string', enum: [ItemDataType.INT32]},
|
|
499
503
|
value: {type: 'integer'}
|
|
@@ -501,6 +505,7 @@ export class Goose extends BaseHeader {
|
|
|
501
505
|
},
|
|
502
506
|
{
|
|
503
507
|
type: 'object',
|
|
508
|
+
label: ItemDataType.INT64,
|
|
504
509
|
properties: {
|
|
505
510
|
dataType: {type: 'string', enum: [ItemDataType.INT64]},
|
|
506
511
|
value: {type: 'string', contentEncoding: StringContentEncodingEnum.BIGINT}
|
|
@@ -508,6 +513,7 @@ export class Goose extends BaseHeader {
|
|
|
508
513
|
},
|
|
509
514
|
{
|
|
510
515
|
type: 'object',
|
|
516
|
+
label: ItemDataType.INT8U,
|
|
511
517
|
properties: {
|
|
512
518
|
dataType: {type: 'string', enum: [ItemDataType.INT8U]},
|
|
513
519
|
value: {type: 'integer'}
|
|
@@ -515,6 +521,7 @@ export class Goose extends BaseHeader {
|
|
|
515
521
|
},
|
|
516
522
|
{
|
|
517
523
|
type: 'object',
|
|
524
|
+
label: ItemDataType.INT16U,
|
|
518
525
|
properties: {
|
|
519
526
|
dataType: {type: 'string', enum: [ItemDataType.INT16U]},
|
|
520
527
|
value: {type: 'integer'}
|
|
@@ -522,6 +529,7 @@ export class Goose extends BaseHeader {
|
|
|
522
529
|
},
|
|
523
530
|
{
|
|
524
531
|
type: 'object',
|
|
532
|
+
label: ItemDataType.INT32U,
|
|
525
533
|
properties: {
|
|
526
534
|
dataType: {type: 'string', enum: [ItemDataType.INT32U]},
|
|
527
535
|
value: {type: 'integer'}
|
|
@@ -529,6 +537,7 @@ export class Goose extends BaseHeader {
|
|
|
529
537
|
},
|
|
530
538
|
{
|
|
531
539
|
type: 'object',
|
|
540
|
+
label: ItemDataType.FLOAT32,
|
|
532
541
|
properties: {
|
|
533
542
|
dataType: {type: 'string', enum: [ItemDataType.FLOAT32]},
|
|
534
543
|
value: {type: 'number'}
|
|
@@ -536,6 +545,7 @@ export class Goose extends BaseHeader {
|
|
|
536
545
|
},
|
|
537
546
|
{
|
|
538
547
|
type: 'object',
|
|
548
|
+
label: ItemDataType.CODEDENUM,
|
|
539
549
|
properties: {
|
|
540
550
|
dataType: {type: 'string', enum: [ItemDataType.CODEDENUM]},
|
|
541
551
|
value: {type: 'integer'}
|
|
@@ -543,6 +553,7 @@ export class Goose extends BaseHeader {
|
|
|
543
553
|
},
|
|
544
554
|
{
|
|
545
555
|
type: 'object',
|
|
556
|
+
label: ItemDataType.OCTETSTRING,
|
|
546
557
|
properties: {
|
|
547
558
|
dataType: {type: 'string', enum: [ItemDataType.OCTETSTRING]},
|
|
548
559
|
value: {type: 'string', contentEncoding: StringContentEncodingEnum.HEX}
|
|
@@ -550,6 +561,7 @@ export class Goose extends BaseHeader {
|
|
|
550
561
|
},
|
|
551
562
|
{
|
|
552
563
|
type: 'object',
|
|
564
|
+
label: ItemDataType.VISIBLESTRING,
|
|
553
565
|
properties: {
|
|
554
566
|
dataType: {type: 'string', enum: [ItemDataType.VISIBLESTRING]},
|
|
555
567
|
value: {type: 'string', contentEncoding: StringContentEncodingEnum.ASCII}
|
|
@@ -564,6 +576,7 @@ export class Goose extends BaseHeader {
|
|
|
564
576
|
},
|
|
565
577
|
{
|
|
566
578
|
type: 'object',
|
|
579
|
+
label: ItemDataType.Quality,
|
|
567
580
|
properties: {
|
|
568
581
|
dataType: {type: 'string', enum: [ItemDataType.Quality]},
|
|
569
582
|
value: {type: 'string', contentEncoding: StringContentEncodingEnum.BINARY}
|
|
@@ -571,6 +584,7 @@ export class Goose extends BaseHeader {
|
|
|
571
584
|
},
|
|
572
585
|
{
|
|
573
586
|
type: 'object',
|
|
587
|
+
label: ItemDataType.Structure,
|
|
574
588
|
properties: {
|
|
575
589
|
dataType: {type: 'string', enum: [ItemDataType.Structure]},
|
|
576
590
|
value: {
|