node-opcua-transport 2.76.0 → 2.76.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/source/AcknowledgeMessage.d.ts +27 -27
  2. package/dist/source/AcknowledgeMessage.js +78 -78
  3. package/dist/source/HelloMessage.d.ts +27 -27
  4. package/dist/source/HelloMessage.js +94 -94
  5. package/dist/source/TCPErrorMessage.d.ts +18 -18
  6. package/dist/source/TCPErrorMessage.js +46 -46
  7. package/dist/source/client_tcp_transport.d.ts +86 -86
  8. package/dist/source/client_tcp_transport.js +331 -331
  9. package/dist/source/index.d.ts +13 -13
  10. package/dist/source/index.js +29 -29
  11. package/dist/source/message_builder_base.d.ts +112 -112
  12. package/dist/source/message_builder_base.js +244 -244
  13. package/dist/source/server_tcp_transport.d.ts +44 -44
  14. package/dist/source/server_tcp_transport.js +228 -228
  15. package/dist/source/status_codes.d.ts +100 -100
  16. package/dist/source/status_codes.js +110 -110
  17. package/dist/source/tcp_transport.d.ts +136 -136
  18. package/dist/source/tcp_transport.js +376 -376
  19. package/dist/source/tools.d.ts +14 -14
  20. package/dist/source/tools.js +103 -103
  21. package/dist/source/utils.d.ts +3 -3
  22. package/dist/source/utils.js +9 -9
  23. package/dist/test-fixtures/fixture_full_tcp_packets.d.ts +21 -21
  24. package/dist/test-fixtures/fixture_full_tcp_packets.js +41 -41
  25. package/dist/test-fixtures/index.d.ts +1 -1
  26. package/dist/test-fixtures/index.js +17 -17
  27. package/dist/test_helpers/direct_transport.d.ts +18 -18
  28. package/dist/test_helpers/direct_transport.js +62 -62
  29. package/dist/test_helpers/fake_server.d.ts +19 -19
  30. package/dist/test_helpers/fake_server.js +54 -54
  31. package/dist/test_helpers/half_com_channel.d.ts +17 -17
  32. package/dist/test_helpers/half_com_channel.js +31 -31
  33. package/dist/test_helpers/index.d.ts +4 -4
  34. package/dist/test_helpers/index.js +20 -20
  35. package/dist/test_helpers/socket_transport.d.ts +10 -10
  36. package/dist/test_helpers/socket_transport.js +30 -30
  37. package/package.json +11 -11
@@ -1,14 +1,14 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /**
4
- * @module node-opcua-transport
5
- */
6
- import * as url from "url";
7
- import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
8
- import { BaseUAObject } from "node-opcua-factory";
9
- export declare type ConstructorFunc = new (...args: any[]) => BaseUAObject;
10
- export declare function decodeMessage(stream: BinaryStream, classNameConstructor: ConstructorFunc): BaseUAObject;
11
- export declare function packTcpMessage(msgType: string, encodeableObject: BaseUAObject): Buffer;
12
- export declare function parseEndpointUrl(endpointUrl: string): url.Url;
13
- export declare function is_valid_endpointUrl(endpointUrl: string): boolean;
14
- export declare function writeTCPMessageHeader(msgType: string, chunkType: string, totalLength: number, stream: OutputBinaryStream | Buffer): void;
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /**
4
+ * @module node-opcua-transport
5
+ */
6
+ import * as url from "url";
7
+ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
8
+ import { BaseUAObject } from "node-opcua-factory";
9
+ export declare type ConstructorFunc = new (...args: any[]) => BaseUAObject;
10
+ export declare function decodeMessage(stream: BinaryStream, classNameConstructor: ConstructorFunc): BaseUAObject;
11
+ export declare function packTcpMessage(msgType: string, encodeableObject: BaseUAObject): Buffer;
12
+ export declare function parseEndpointUrl(endpointUrl: string): url.Url;
13
+ export declare function is_valid_endpointUrl(endpointUrl: string): boolean;
14
+ export declare function writeTCPMessageHeader(msgType: string, chunkType: string, totalLength: number, stream: OutputBinaryStream | Buffer): void;
@@ -1,104 +1,104 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeTCPMessageHeader = exports.is_valid_endpointUrl = exports.parseEndpointUrl = exports.packTcpMessage = exports.decodeMessage = void 0;
4
- /**
5
- * @module node-opcua-transport
6
- */
7
- const url = require("url");
8
- const node_opcua_assert_1 = require("node-opcua-assert");
9
- const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
10
- const node_opcua_buffer_utils_1 = require("node-opcua-buffer-utils");
11
- const node_opcua_chunkmanager_1 = require("node-opcua-chunkmanager");
12
- const TCPErrorMessage_1 = require("./TCPErrorMessage");
13
- function is_valid_msg_type(msgType) {
14
- (0, node_opcua_assert_1.assert)([
15
- "HEL",
16
- "ACK",
17
- "ERR",
18
- "OPN",
19
- "MSG",
20
- "CLO" // OPC Unified Architecture, Part 6 page 36
21
- ].indexOf(msgType) >= 0, "invalid message type " + msgType);
22
- return true;
23
- }
24
- function decodeMessage(stream, classNameConstructor) {
25
- (0, node_opcua_assert_1.assert)(stream instanceof node_opcua_binary_stream_1.BinaryStream);
26
- (0, node_opcua_assert_1.assert)(classNameConstructor instanceof Function, " expecting a function for " + classNameConstructor);
27
- const header = (0, node_opcua_chunkmanager_1.readMessageHeader)(stream);
28
- (0, node_opcua_assert_1.assert)(stream.length === 8);
29
- let obj;
30
- if (header.msgType === "ERR") {
31
- obj = new TCPErrorMessage_1.TCPErrorMessage();
32
- obj.decode(stream);
33
- return obj;
34
- }
35
- else {
36
- obj = new classNameConstructor();
37
- obj.decode(stream);
38
- return obj;
39
- }
40
- }
41
- exports.decodeMessage = decodeMessage;
42
- function packTcpMessage(msgType, encodeableObject) {
43
- (0, node_opcua_assert_1.assert)(is_valid_msg_type(msgType));
44
- const messageChunk = (0, node_opcua_buffer_utils_1.createFastUninitializedBuffer)(encodeableObject.binaryStoreSize() + 8);
45
- // encode encodeableObject in a packet
46
- const stream = new node_opcua_binary_stream_1.BinaryStream(messageChunk);
47
- encodeMessage(msgType, encodeableObject, stream);
48
- return messageChunk;
49
- }
50
- exports.packTcpMessage = packTcpMessage;
51
- // opc.tcp://hostname:51210/UA/SampleServer
52
- function parseEndpointUrl(endpointUrl) {
53
- const _url = url.parse(endpointUrl);
54
- if (!_url.protocol || !_url.hostname) {
55
- throw new Error("Invalid endpoint url " + endpointUrl);
56
- }
57
- return _url;
58
- /*
59
- const r = /^([a-z.]*):\/\/([a-zA-Z_\-.\-0-9]*):([0-9]*)(\/.*){0,1}/;
60
-
61
- const matches = r.exec(endpointUrl);
62
-
63
- if (!matches) {
64
- throw new Error("Invalid endpoint url " + endpointUrl);
65
- }
66
- return {
67
- protocol: matches[1],
68
-
69
- hostname: matches[2],
70
-
71
- port: parseInt(matches[3], 10),
72
-
73
- address: matches[4] || ""
74
- };
75
- */
76
- }
77
- exports.parseEndpointUrl = parseEndpointUrl;
78
- function is_valid_endpointUrl(endpointUrl) {
79
- const e = parseEndpointUrl(endpointUrl);
80
- return Object.prototype.hasOwnProperty.call(e, "hostname");
81
- }
82
- exports.is_valid_endpointUrl = is_valid_endpointUrl;
83
- function writeTCPMessageHeader(msgType, chunkType, totalLength, stream) {
84
- if (stream instanceof Buffer) {
85
- stream = new node_opcua_binary_stream_1.BinaryStream(stream);
86
- }
87
- (0, node_opcua_assert_1.assert)(is_valid_msg_type(msgType));
88
- (0, node_opcua_assert_1.assert)(["A", "F", "C"].indexOf(chunkType) !== -1);
89
- stream.writeUInt8(msgType.charCodeAt(0));
90
- stream.writeUInt8(msgType.charCodeAt(1));
91
- stream.writeUInt8(msgType.charCodeAt(2));
92
- // Chunk type
93
- stream.writeUInt8(chunkType.charCodeAt(0)); // reserved
94
- stream.writeUInt32(totalLength);
95
- }
96
- exports.writeTCPMessageHeader = writeTCPMessageHeader;
97
- function encodeMessage(msgType, messageContent, stream) {
98
- // the length of the message, in bytes. (includes the 8 bytes of the message header)
99
- const totalLength = messageContent.binaryStoreSize() + 8;
100
- writeTCPMessageHeader(msgType, "F", totalLength, stream);
101
- messageContent.encode(stream);
102
- (0, node_opcua_assert_1.assert)(totalLength === stream.length, "invalid message size");
103
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeTCPMessageHeader = exports.is_valid_endpointUrl = exports.parseEndpointUrl = exports.packTcpMessage = exports.decodeMessage = void 0;
4
+ /**
5
+ * @module node-opcua-transport
6
+ */
7
+ const url = require("url");
8
+ const node_opcua_assert_1 = require("node-opcua-assert");
9
+ const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
10
+ const node_opcua_buffer_utils_1 = require("node-opcua-buffer-utils");
11
+ const node_opcua_chunkmanager_1 = require("node-opcua-chunkmanager");
12
+ const TCPErrorMessage_1 = require("./TCPErrorMessage");
13
+ function is_valid_msg_type(msgType) {
14
+ (0, node_opcua_assert_1.assert)([
15
+ "HEL",
16
+ "ACK",
17
+ "ERR",
18
+ "OPN",
19
+ "MSG",
20
+ "CLO" // OPC Unified Architecture, Part 6 page 36
21
+ ].indexOf(msgType) >= 0, "invalid message type " + msgType);
22
+ return true;
23
+ }
24
+ function decodeMessage(stream, classNameConstructor) {
25
+ (0, node_opcua_assert_1.assert)(stream instanceof node_opcua_binary_stream_1.BinaryStream);
26
+ (0, node_opcua_assert_1.assert)(classNameConstructor instanceof Function, " expecting a function for " + classNameConstructor);
27
+ const header = (0, node_opcua_chunkmanager_1.readMessageHeader)(stream);
28
+ (0, node_opcua_assert_1.assert)(stream.length === 8);
29
+ let obj;
30
+ if (header.msgType === "ERR") {
31
+ obj = new TCPErrorMessage_1.TCPErrorMessage();
32
+ obj.decode(stream);
33
+ return obj;
34
+ }
35
+ else {
36
+ obj = new classNameConstructor();
37
+ obj.decode(stream);
38
+ return obj;
39
+ }
40
+ }
41
+ exports.decodeMessage = decodeMessage;
42
+ function packTcpMessage(msgType, encodeableObject) {
43
+ (0, node_opcua_assert_1.assert)(is_valid_msg_type(msgType));
44
+ const messageChunk = (0, node_opcua_buffer_utils_1.createFastUninitializedBuffer)(encodeableObject.binaryStoreSize() + 8);
45
+ // encode encodeableObject in a packet
46
+ const stream = new node_opcua_binary_stream_1.BinaryStream(messageChunk);
47
+ encodeMessage(msgType, encodeableObject, stream);
48
+ return messageChunk;
49
+ }
50
+ exports.packTcpMessage = packTcpMessage;
51
+ // opc.tcp://hostname:51210/UA/SampleServer
52
+ function parseEndpointUrl(endpointUrl) {
53
+ const _url = url.parse(endpointUrl);
54
+ if (!_url.protocol || !_url.hostname) {
55
+ throw new Error("Invalid endpoint url " + endpointUrl);
56
+ }
57
+ return _url;
58
+ /*
59
+ const r = /^([a-z.]*):\/\/([a-zA-Z_\-.\-0-9]*):([0-9]*)(\/.*){0,1}/;
60
+
61
+ const matches = r.exec(endpointUrl);
62
+
63
+ if (!matches) {
64
+ throw new Error("Invalid endpoint url " + endpointUrl);
65
+ }
66
+ return {
67
+ protocol: matches[1],
68
+
69
+ hostname: matches[2],
70
+
71
+ port: parseInt(matches[3], 10),
72
+
73
+ address: matches[4] || ""
74
+ };
75
+ */
76
+ }
77
+ exports.parseEndpointUrl = parseEndpointUrl;
78
+ function is_valid_endpointUrl(endpointUrl) {
79
+ const e = parseEndpointUrl(endpointUrl);
80
+ return Object.prototype.hasOwnProperty.call(e, "hostname");
81
+ }
82
+ exports.is_valid_endpointUrl = is_valid_endpointUrl;
83
+ function writeTCPMessageHeader(msgType, chunkType, totalLength, stream) {
84
+ if (stream instanceof Buffer) {
85
+ stream = new node_opcua_binary_stream_1.BinaryStream(stream);
86
+ }
87
+ (0, node_opcua_assert_1.assert)(is_valid_msg_type(msgType));
88
+ (0, node_opcua_assert_1.assert)(["A", "F", "C"].indexOf(chunkType) !== -1);
89
+ stream.writeUInt8(msgType.charCodeAt(0));
90
+ stream.writeUInt8(msgType.charCodeAt(1));
91
+ stream.writeUInt8(msgType.charCodeAt(2));
92
+ // Chunk type
93
+ stream.writeUInt8(chunkType.charCodeAt(0)); // reserved
94
+ stream.writeUInt32(totalLength);
95
+ }
96
+ exports.writeTCPMessageHeader = writeTCPMessageHeader;
97
+ function encodeMessage(msgType, messageContent, stream) {
98
+ // the length of the message, in bytes. (includes the 8 bytes of the message header)
99
+ const totalLength = messageContent.binaryStoreSize() + 8;
100
+ writeTCPMessageHeader(msgType, "F", totalLength, stream);
101
+ messageContent.encode(stream);
102
+ (0, node_opcua_assert_1.assert)(totalLength === stream.length, "invalid message size");
103
+ }
104
104
  //# sourceMappingURL=tools.js.map
@@ -1,3 +1,3 @@
1
- export declare const doTraceHelloAck: boolean;
2
- export declare const doTraceChunk: boolean;
3
- export declare const doTraceIncomingChunk: boolean;
1
+ export declare const doTraceHelloAck: boolean;
2
+ export declare const doTraceChunk: boolean;
3
+ export declare const doTraceIncomingChunk: boolean;
@@ -1,10 +1,10 @@
1
- "use strict";
2
- var _a, _b;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.doTraceIncomingChunk = exports.doTraceChunk = exports.doTraceHelloAck = void 0;
5
- //
6
- const transportFlag = (((_b = (_a = process.env) === null || _a === void 0 ? void 0 : _a.NODEOPCUADEBUG) === null || _b === void 0 ? void 0 : _b.match(/TRANSPORT{([^}]*)}/)) || [])[1] || "";
7
- exports.doTraceHelloAck = !!transportFlag.match(/HELACK/);
8
- exports.doTraceChunk = !!transportFlag.match(/CHUNK/);
9
- exports.doTraceIncomingChunk = !!transportFlag.match(/FLOW/);
1
+ "use strict";
2
+ var _a, _b;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.doTraceIncomingChunk = exports.doTraceChunk = exports.doTraceHelloAck = void 0;
5
+ //
6
+ const transportFlag = (((_b = (_a = process.env) === null || _a === void 0 ? void 0 : _a.NODEOPCUADEBUG) === null || _b === void 0 ? void 0 : _b.match(/TRANSPORT{([^}]*)}/)) || [])[1] || "";
7
+ exports.doTraceHelloAck = !!transportFlag.match(/HELACK/);
8
+ exports.doTraceChunk = !!transportFlag.match(/CHUNK/);
9
+ exports.doTraceIncomingChunk = !!transportFlag.match(/FLOW/);
10
10
  //# sourceMappingURL=utils.js.map
@@ -1,21 +1,21 @@
1
- /// <reference types="node" />
2
- export declare const helloMessage1: Buffer;
3
- export declare const altered_helloMessage1: Buffer;
4
- export declare const altered_helloMessage2: Buffer;
5
- export declare const altered_helloMessage3: Buffer;
6
- export declare const ackResponse1: Buffer;
7
- export declare const openChannelRequest1: Buffer;
8
- export declare const altered_openChannelRequest1: Buffer;
9
- export declare const altered_openChannelRequest2: Buffer;
10
- export declare const openSecureChannelResponse1: Buffer;
11
- export declare const getEndpointsRequest1: Buffer;
12
- export declare const altered_getEndpointsRequest1: Buffer;
13
- export declare const getEndpointsRequest2_chunk1: Buffer;
14
- export declare const getEndpointsRequest2_chunk2: Buffer;
15
- export declare const closeSecureChannelRequest1: Buffer;
16
- export declare const closeSecureChannelResponse: Buffer;
17
- export declare const packet_cs_6: Buffer;
18
- export declare const activateSesionRequest: Buffer;
19
- export declare const activateSesionResponse: Buffer;
20
- export declare const packect_outtec: Buffer;
21
- export declare const random_packet: Buffer;
1
+ /// <reference types="node" />
2
+ export declare const helloMessage1: Buffer;
3
+ export declare const altered_helloMessage1: Buffer;
4
+ export declare const altered_helloMessage2: Buffer;
5
+ export declare const altered_helloMessage3: Buffer;
6
+ export declare const ackResponse1: Buffer;
7
+ export declare const openChannelRequest1: Buffer;
8
+ export declare const altered_openChannelRequest1: Buffer;
9
+ export declare const altered_openChannelRequest2: Buffer;
10
+ export declare const openSecureChannelResponse1: Buffer;
11
+ export declare const getEndpointsRequest1: Buffer;
12
+ export declare const altered_getEndpointsRequest1: Buffer;
13
+ export declare const getEndpointsRequest2_chunk1: Buffer;
14
+ export declare const getEndpointsRequest2_chunk2: Buffer;
15
+ export declare const closeSecureChannelRequest1: Buffer;
16
+ export declare const closeSecureChannelResponse: Buffer;
17
+ export declare const packet_cs_6: Buffer;
18
+ export declare const activateSesionRequest: Buffer;
19
+ export declare const activateSesionResponse: Buffer;
20
+ export declare const packect_outtec: Buffer;
21
+ export declare const random_packet: Buffer;
@@ -1,74 +1,74 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.random_packet = exports.packect_outtec = exports.activateSesionResponse = exports.activateSesionRequest = exports.packet_cs_6 = exports.closeSecureChannelResponse = exports.closeSecureChannelRequest1 = exports.getEndpointsRequest2_chunk2 = exports.getEndpointsRequest2_chunk1 = exports.altered_getEndpointsRequest1 = exports.getEndpointsRequest1 = exports.openSecureChannelResponse1 = exports.altered_openChannelRequest2 = exports.altered_openChannelRequest1 = exports.openChannelRequest1 = exports.ackResponse1 = exports.altered_helloMessage3 = exports.altered_helloMessage2 = exports.altered_helloMessage1 = exports.helloMessage1 = void 0;
4
- // tslint:disable:variable-name
5
- // tslint:disable:max-line-length
6
- const node_opcua_debug_1 = require("node-opcua-debug");
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.random_packet = exports.packect_outtec = exports.activateSesionResponse = exports.activateSesionRequest = exports.packet_cs_6 = exports.closeSecureChannelResponse = exports.closeSecureChannelRequest1 = exports.getEndpointsRequest2_chunk2 = exports.getEndpointsRequest2_chunk1 = exports.altered_getEndpointsRequest1 = exports.getEndpointsRequest1 = exports.openSecureChannelResponse1 = exports.altered_openChannelRequest2 = exports.altered_openChannelRequest1 = exports.openChannelRequest1 = exports.ackResponse1 = exports.altered_helloMessage3 = exports.altered_helloMessage2 = exports.altered_helloMessage1 = exports.helloMessage1 = void 0;
4
+ // tslint:disable:variable-name
5
+ // tslint:disable:max-line-length
6
+ const node_opcua_debug_1 = require("node-opcua-debug");
7
7
  exports.helloMessage1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
8
8
  00000000: 48 45 4c 46 4f 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 40 00 00 00 00 00 2f 00 00 00 HELFO.................@...../...
9
9
  00000020: 6f 70 63 2e 74 63 70 3a 2f 2f 74 61 74 74 61 74 61 3a 36 32 35 34 33 2f 41 41 41 41 41 2f 41 67 opc.tcp://tattata:62543/AAAAA/Ag
10
10
  00000040: 67 72 65 67 61 74 69 6f 6e 53 65 72 76 65 72 gregationServer
11
- `);
12
- // same as helloMessage1 but with a altered endpointUri Length = 0 ---ff added here-----------------+
13
- // |
14
- // v
11
+ `);
12
+ // same as helloMessage1 but with a altered endpointUri Length = 0 ---ff added here-----------------+
13
+ // |
14
+ // v
15
15
  exports.altered_helloMessage1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
16
16
  00000000: 48 45 4c 46 4f 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 40 00 00 00 00 00 2f ff 00 00 HELFO.................@...../...
17
17
  00000020: 6f 70 63 2e 74 63 70 3a 2f 2f 74 61 74 74 61 74 61 3a 36 32 35 34 33 2f 41 41 41 41 41 2f 41 67 opc.tcp://tattata:62543/AAAAA/Ag
18
18
  00000040: 67 72 65 67 61 74 69 6f 6e 53 65 72 76 65 72 gregationServer
19
- `);
20
- exports.altered_helloMessage2 = Buffer.from("48454c46390000000000000000000100000001000000000000000000595555556f70632e7463703a2f2f6c6f63616c686f73743a343834302f", "hex");
21
- exports.altered_helloMessage3 = Buffer.from("48454c46390000000000000000000100000001000000000000000000020000106f70632e7463703a2f2f6c6f63616c686f73743a343834302f", "hex");
19
+ `);
20
+ exports.altered_helloMessage2 = Buffer.from("48454c46390000000000000000000100000001000000000000000000595555556f70632e7463703a2f2f6c6f63616c686f73743a343834302f", "hex");
21
+ exports.altered_helloMessage3 = Buffer.from("48454c46390000000000000000000100000001000000000000000000020000106f70632e7463703a2f2f6c6f63616c686f73743a343834302f", "hex");
22
22
  exports.ackResponse1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
23
23
  00000000: 41 43 4b 46 1c 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 40 00 00 00 00 00 ACKF..................@.....
24
- `);
25
- // client -> server : packet length 132 => OpenSecureChannelRequest
24
+ `);
25
+ // client -> server : packet length 132 => OpenSecureChannelRequest
26
26
  exports.openChannelRequest1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
27
27
  00000000: 4f 50 4e 46 84 00 00 00 00 00 00 00 2f 00 00 00 68 74 74 70 3a 2f 2f 6f 70 63 66 6f 75 6e 64 61 OPNF......../...http://opcfounda
28
28
  00000020: 74 69 6f 6e 2e 6f 72 67 2f 55 41 2f 53 65 63 75 72 69 74 79 50 6f 6c 69 63 79 23 4e 6f 6e 65 ff tion.org/UA/SecurityPolicy#None.
29
29
  00000040: ff ff ff ff ff ff ff 01 00 00 00 02 00 00 00 01 00 be 01 00 00 43 b2 42 d9 d0 1d cf 01 00 00 00 .................>...C2BYP.O....
30
30
  00000060: 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................................
31
31
  00000080: 80 ee 36 00 .n6.
32
- `);
33
- // altered_openChannelRequest
34
- // 00000000: 50 50 instead of 00000000: 4f 50
32
+ `);
33
+ // altered_openChannelRequest
34
+ // 00000000: 50 50 instead of 00000000: 4f 50
35
35
  exports.altered_openChannelRequest1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
36
36
  00000000: 50 50 4e 46 84 00 00 00 00 00 00 00 2f 00 00 00 68 74 74 70 3a 2f 2f 6f 70 63 66 6f 75 6e 64 61 PPNF......../...http://opcfounda
37
37
  00000020: 74 69 6f 6e 2e 6f 72 67 2f 55 41 2f 53 65 63 75 72 69 74 79 50 6f 6c 69 63 79 23 4e 6f 6e 65 ff tion.org/UA/SecurityPolicy#None.
38
38
  00000040: ff ff ff ff ff ff ff 01 00 00 00 02 00 00 00 01 00 be 01 00 00 43 b2 42 d9 d0 1d cf 01 00 00 00 .................>...C2BYP.O....
39
39
  00000060: 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................................
40
40
  00000080: 80 ee 36 00 .n6.
41
- `);
42
- // 00000000: 4f 50 4e 46 84 00 00 00 00 00 00 00 2f FF FF instead of 2F 00 00
41
+ `);
42
+ // 00000000: 4f 50 4e 46 84 00 00 00 00 00 00 00 2f FF FF instead of 2F 00 00
43
43
  exports.altered_openChannelRequest2 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
44
44
  00000000: 4f 50 4e 46 84 00 00 00 00 00 00 00 2f FF FF 00 68 74 74 70 3a 2f 2f 6f 70 63 66 6f 75 6e 64 61 PPNF......../...http://opcfounda
45
45
  00000020: 74 69 6f 6e 2e 6f 72 67 2f 55 41 2f 53 65 63 75 72 69 74 79 50 6f 6c 69 63 79 23 4e 6f 6e 65 ff tion.org/UA/SecurityPolicy#None.
46
46
  00000040: ff ff ff ff ff ff ff 01 00 00 00 02 00 00 00 01 00 be 01 00 00 43 b2 42 d9 d0 1d cf 01 00 00 00 .................>...C2BYP.O....
47
47
  00000060: 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................................
48
48
  00000080: 80 ee 36 00 .n6.
49
- `);
50
- // server -> client : packet length 135 => OpenSecureChannelResponse
49
+ `);
50
+ // server -> client : packet length 135 => OpenSecureChannelResponse
51
51
  exports.openSecureChannelResponse1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
52
52
  00000000: 4f 50 4e 46 87 00 00 00 0a 00 00 00 2f 00 00 00 68 74 74 70 3a 2f 2f 6f 70 63 66 6f 75 6e 64 61 OPNF......../...http://opcfounda
53
53
  00000020: 74 69 6f 6e 2e 6f 72 67 2f 55 41 2f 53 65 63 75 72 69 74 79 50 6f 6c 69 63 79 23 4e 6f 6e 65 ff tion.org/UA/SecurityPolicy#None.
54
54
  00000040: ff ff ff ff ff ff ff 01 00 00 00 01 00 00 00 01 00 c1 01 4b 87 44 d9 d0 1d cf 01 01 00 00 00 00 .................A.K.DYP.O......
55
55
  00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00 01 00 00 00 ed c3 43 d9 d0 1d cf 01 80 .......................mCCYP.O..
56
56
  00000080: ee 36 00 00 00 00 00 n6.....
57
- `);
58
- // client -> server : packet length 116 => GetEndpointsRequest
57
+ `);
58
+ // client -> server : packet length 116 => GetEndpointsRequest
59
59
  exports.getEndpointsRequest1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
60
60
  00000000: 4d 53 47 46 74 00 00 00 0a 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 ac 01 00 00 b7 19 MSGFt.....................,...7.
61
61
  00000020: 40 d9 d0 1d cf 01 01 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 2f 00 00 00 6f 70 63 @YP.O..................../...opc
62
62
  00000040: 2e 74 63 70 3a 2f 2f 74 61 74 74 61 74 61 3a 36 32 35 34 33 2f 41 41 41 41 41 2f 41 67 67 72 65 .tcp://tattata:62543/AAAAA/Aggre
63
63
  00000060: 67 61 74 69 6f 6e 53 65 72 76 65 72 00 00 00 00 00 00 00 00 gationServer........
64
- `);
64
+ `);
65
65
  exports.altered_getEndpointsRequest1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
66
66
  00000000: 4d 53 47 46 74 00 00 00 0a 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 ac 01 00 00 b7 19 MSGFt.....................,...7.
67
67
  00000020: 40 d9 d0 1d cf 01 01 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 2f FF FF FF 6f 70 63 @YP.O..................../...opc
68
68
  00000040: 2e 74 63 70 3a 2f 2f 74 61 74 74 61 74 61 3a 36 32 35 34 33 2f 41 41 41 41 41 2f 41 67 67 72 65 .tcp://tattata:62543/AAAAA/Aggre
69
69
  00000060: 67 61 74 69 6f 6e 53 65 72 76 65 72 00 00 00 00 00 00 00 00 gationServer........
70
- `);
71
- // server -> client : packet length 4380 => GetEndpointsResponse 1/2
70
+ `);
71
+ // server -> client : packet length 4380 => GetEndpointsResponse 1/2
72
72
  exports.getEndpointsRequest2_chunk1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
73
73
  00000000: 4d 53 47 46 e0 1f 00 00 0a 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 af 01 ec 46 47 d9 MSGF....................../.lFGY
74
74
  00000020: d0 1d cf 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 2f 00 00 00 6f 70 63 2e P.O...................../...opc.
@@ -207,8 +207,8 @@ exports.getEndpointsRequest2_chunk1 = (0, node_opcua_debug_1.makeBufferFromTrace
207
207
  000010c0: 3a 36 32 35 34 31 2f 41 41 41 41 41 2f 41 67 67 72 65 67 61 74 69 6f 6e 53 65 72 76 65 72 2f 64 :62541/AAAAA/AggregationServer/d
208
208
  000010e0: 69 73 63 6f 76 65 72 79 2f 00 00 00 6f 70 63 2e 74 63 70 3a 2f 2f 74 61 74 74 61 74 61 3a 36 32 iscovery/...opc.tcp://tattata:62
209
209
  00001100: 35 34 32 2f 41 41 41 41 41 2f 41 67 67 72 65 67 61 74 69 6f 6e 53 65 72 76 65 72 24 542/AAAAA/AggregationServer$
210
- `);
211
- // server -> client : packet length 3780 => GetEndpointsResponse 2/2
210
+ `);
211
+ // server -> client : packet length 3780 => GetEndpointsResponse 2/2
212
212
  exports.getEndpointsRequest2_chunk2 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
213
213
  00000000: 03 00 00 30 82 03 20 30 82 02 89 a0 03 02 01 02 02 10 2e 1b cc fe 63 34 7b 47 9e d3 11 f9 fe a2 ...0...0............L~c4{G.S.y~"
214
214
  00000020: cd 64 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 3f 31 17 30 15 06 0a 09 92 26 89 93 f2 2c Md0...*.H.w......0?1.0.....&..r,
@@ -329,17 +329,17 @@ exports.getEndpointsRequest2_chunk2 = (0, node_opcua_debug_1.makeBufferFromTrace
329
329
  00000e80: 6f 70 63 66 6f 75 6e 64 61 74 69 6f 6e 2e 6f 72 67 2f 55 41 2d 50 72 6f 66 69 6c 65 2f 54 72 61 opcfoundation.org/UA-Profile/Tra
330
330
  00000ea0: 6e 73 70 6f 72 74 2f 73 6f 61 70 68 74 74 70 2d 77 73 73 63 2d 75 61 78 6d 6c 2d 75 61 62 69 6e nsport/soaphttp-wssc-uaxml-uabin
331
331
  00000ec0: 61 72 79 00 ary.
332
- `);
333
- // client -> server : packet length 57 => CloseSecureChannelRequest
332
+ `);
333
+ // client -> server : packet length 57 => CloseSecureChannelRequest
334
334
  exports.closeSecureChannelRequest1 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
335
335
  00000000: 43 4c 4f 46 39 00 00 00 0a 00 00 00 01 00 00 00 03 00 00 00 03 00 00 00 01 00 c4 01 00 00 95 78 CLOF9.....................D....x
336
336
  00000020: 65 d9 d0 1d cf 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 eYP.O....................
337
- `);
338
- // server -> client => CloseSecureChannelResponse
337
+ `);
338
+ // server -> client => CloseSecureChannelResponse
339
339
  exports.closeSecureChannelResponse = (0, node_opcua_debug_1.makeBufferFromTrace)(`
340
340
  00000000: 43 4c 4f 46 39 00 00 00 02 00 00 00 01 00 00 00 03 00 00 00 03 00 00 00 01 00 c4 01 00 00 cd e6 CLOF9.....................D...Mf
341
341
  00000020: 25 6b 8c 1f cf 01 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 %k..O....................
342
- `);
342
+ `);
343
343
  exports.packet_cs_6 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
344
344
  00000000: 4d 53 47 46 4c 04 00 00 02 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 cd 01 00 00 16 12 MSGFL.....................M.....
345
345
  00000020: a8 62 a2 1f cf 01 01 00 00 00 ff 03 00 00 ff ff ff ff 00 00 00 00 00 00 00 20 00 00 00 75 72 6e (b".O........................urn
@@ -376,8 +376,8 @@ exports.packet_cs_6 = (0, node_opcua_debug_1.makeBufferFromTrace)(`
376
376
  00000400: d8 75 1d 77 6a c1 9b d3 8c 39 4d 9e d9 30 cb d6 04 b3 13 d2 53 ad df 59 b6 82 41 20 94 e3 12 f1 Xu.wjA.S.9M.Y0KV.3.RS-_Y6.A..c.q
377
377
  00000420: 0d 3f 3e 92 be ce ba b4 16 dd 23 4a 15 2a 7e a9 27 d5 c6 78 0a 88 bf 21 29 00 ce 87 0c 91 42 b9 .?>.>N:4.]#J.*~)'UFx..?!).N...B9
378
378
  00000440: 00 00 00 00 80 4f 22 41 00 00 40 00 .....O"A..@.
379
- `);
380
- // ActivateSesionRequest
379
+ `);
380
+ // ActivateSesionRequest
381
381
  exports.activateSesionRequest = (0, node_opcua_debug_1.makeBufferFromTrace)(`
382
382
  0000 4d 53 47 46 8d 00 00 00 08 00 00 00 01 00 00 00 MSGF............
383
383
  0010 03 00 00 00 03 00 00 00 01 00 d3 01 05 00 00 20 ...............
@@ -388,8 +388,8 @@ exports.activateSesionRequest = (0, node_opcua_debug_1.makeBufferFromTrace)(`
388
388
  0060 ff ff ff ff ff ff 00 00 00 00 01 00 00 00 05 00 ................
389
389
  0070 00 00 66 72 2d 46 52 01 00 41 01 01 05 00 00 00 ..fr-FR..A......
390
390
  0080 01 00 00 00 30 ff ff ff ff ff ff ff ff ....0........
391
- `);
392
- // ActivateSesionResponse
391
+ `);
392
+ // ActivateSesionResponse
393
393
  exports.activateSesionResponse = (0, node_opcua_debug_1.makeBufferFromTrace)(`
394
394
  0000 4d 53 47 46 60 00 00 00 08 00 00 00 01 00 00 00 MSGF............
395
395
  0010 03 00 00 00 03 00 00 00 01 00 d6 01 17 ff 83 6d ...............m
@@ -397,10 +397,10 @@ exports.activateSesionResponse = (0, node_opcua_debug_1.makeBufferFromTrace)(`
397
397
  0030 00 00 00 00 20 00 00 00 14 19 e7 a6 e6 cf 4c e2 .... .........L.
398
398
  0040 05 91 2c 1f 67 59 b1 10 ba d6 d1 46 77 89 39 9c ..,.gY.....Fw.9.
399
399
  0050 20 bd 76 15 57 09 17 92 00 00 00 00 00 00 00 00 .v.W...........
400
- `);
400
+ `);
401
401
  exports.packect_outtec = (0, node_opcua_debug_1.makeBufferFromTrace)(`
402
402
  00000000: 43 4c 4f 46 18 00 00 00 0c 00 00 00 01 00 00 00 0f 00 00 00 0f 00 00 00
403
- `);
403
+ `);
404
404
  exports.random_packet = (0, node_opcua_debug_1.makeBufferFromTrace)(`
405
405
  0000 4d 53 47 46 70 00 00 00 23 00 00 00 bd 00 00 00 MSGFp...#.......
406
406
  0010 7a fc d2 8c 61 b3 16 e5 40 7d b4 63 d3 64 cd 2c z...a...@}.c.d.,
@@ -409,5 +409,5 @@ exports.random_packet = (0, node_opcua_debug_1.makeBufferFromTrace)(`
409
409
  0040 a9 33 d7 ee 38 7f 8a c2 45 d5 5a a9 be 86 c8 c2 .3..8...E.Z.....
410
410
  0050 4d 81 b7 4d 1c b4 69 b8 73 d9 b2 0c 9f a4 d0 18 M..M..i.s.......
411
411
  0060 3d ce bc 37 98 25 2c 0d f0 59 80 b2 b1 6f 95 03 =..7.%,..Y...o..
412
- `);
412
+ `);
413
413
  //# sourceMappingURL=fixture_full_tcp_packets.js.map
@@ -1 +1 @@
1
- export * from "./fixture_full_tcp_packets";
1
+ export * from "./fixture_full_tcp_packets";
@@ -1,18 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./fixture_full_tcp_packets"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./fixture_full_tcp_packets"), exports);
18
18
  //# sourceMappingURL=index.js.map
@@ -1,18 +1,18 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { EventEmitter } from "events";
4
- import { HalfComChannel } from "./half_com_channel";
5
- export interface DirectTransport {
6
- on(eventName: "end", eventHandler: () => void): this;
7
- }
8
- export declare class DirectTransport extends EventEmitter {
9
- client: HalfComChannel;
10
- server: HalfComChannel;
11
- url: string;
12
- private _responses?;
13
- constructor();
14
- initialize(done: () => void): void;
15
- shutdown(done: () => void): void;
16
- popResponse(): any;
17
- pushResponse(func: (socket: HalfComChannel, data: Buffer) => void): void;
18
- }
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { EventEmitter } from "events";
4
+ import { HalfComChannel } from "./half_com_channel";
5
+ export interface DirectTransport {
6
+ on(eventName: "end", eventHandler: () => void): this;
7
+ }
8
+ export declare class DirectTransport extends EventEmitter {
9
+ client: HalfComChannel;
10
+ server: HalfComChannel;
11
+ url: string;
12
+ private _responses?;
13
+ constructor();
14
+ initialize(done: () => void): void;
15
+ shutdown(done: () => void): void;
16
+ popResponse(): any;
17
+ pushResponse(func: (socket: HalfComChannel, data: Buffer) => void): void;
18
+ }