node-ikev2 0.1.3 → 0.2.1

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.
@@ -0,0 +1,302 @@
1
+ /**
2
+ * Configuration Attribute Types
3
+ *
4
+ * See: https://datatracker.ietf.org/doc/html/rfc7296#section-3.15.1
5
+ *
6
+ * Attribute Type Value Multi-Valued Length
7
+ * ------------------------------------------------------------
8
+ * INTERNAL_IP4_ADDRESS 1 YES* 0 or 4 octets
9
+ * INTERNAL_IP4_NETMASK 2 NO 0 or 4 octets
10
+ * INTERNAL_IP4_DNS 3 YES 0 or 4 octets
11
+ * INTERNAL_IP4_NBNS 4 YES 0 or 4 octets
12
+ * INTERNAL_IP4_DHCP 6 YES 0 or 4 octets
13
+ * APPLICATION_VERSION 7 NO 0 or more
14
+ * INTERNAL_IP6_ADDRESS 8 YES* 0 or 17 octets
15
+ * INTERNAL_IP6_DNS 10 YES 0 or 16 octets
16
+ * INTERNAL_IP6_DHCP 12 YES 0 or 16 octets
17
+ * INTERNAL_IP4_SUBNET 13 YES 0 or 8 octets
18
+ * SUPPORTED_ATTRIBUTES 14 NO Multiple of 2
19
+ * INTERNAL_IP6_SUBNET 15 YES 17 octets
20
+ *
21
+ * See: https://www.iana.org/assignments/ikev2-parameters/ikev2-parameters.xhtml#ikev2-parameters-20
22
+ *
23
+ * Value Attribute Type Multi-Valued Length Reference
24
+ * 0 Reserved [RFC7296]
25
+ * 1 INTERNAL_IP4_ADDRESS YES* 0 or 4 octets [RFC7296]
26
+ * 2 INTERNAL_IP4_NETMASK NO 0 or 4 octets [RFC7296]
27
+ * 3 INTERNAL_IP4_DNS YES 0 or 4 octets [RFC7296]
28
+ * 4 INTERNAL_IP4_NBNS YES 0 or 4 octets [RFC7296]
29
+ * 5 Reserved [RFC7296]
30
+ * 6 INTERNAL_IP4_DHCP YES 0 or 4 octets [RFC7296]
31
+ * 7 APPLICATION_VERSION NO 0 or more [RFC7296]
32
+ * 8 INTERNAL_IP6_ADDRESS YES* 0 or 17 octets [RFC7296]
33
+ * 9 Reserved [RFC7296]
34
+ * 10 INTERNAL_IP6_DNS YES 0 or 16 octets [RFC7296]
35
+ * 11 Reserved [RFC7296]
36
+ * 12 INTERNAL_IP6_DHCP YES 0 or 16 octets [RFC7296]
37
+ * 13 INTERNAL_IP4_SUBNET YES 0 or 8 octets [RFC7296]
38
+ * 14 SUPPORTED_ATTRIBUTES NO Multiple of 2 [RFC7296]
39
+ * 15 INTERNAL_IP6_SUBNET YES 17 octets [RFC7296]
40
+ * 16 MIP6_HOME_PREFIX YES 0 or 21 octets [RFC5026]
41
+ * 17 INTERNAL_IP6_LINK NO 8 or more [RFC5739]
42
+ * 18 INTERNAL_IP6_PREFIX YES 17 octets [RFC5739]
43
+ * 19 HOME_AGENT_ADDRESS NO 16 or 20 [http://www.3gpp.org/ftp/Specs/html-info/24302.htm][John_Meredith]
44
+ * 20 P_CSCF_IP4_ADDRESS YES 0 or 4 octets [RFC7651]
45
+ * 21 P_CSCF_IP6_ADDRESS YES 0 or 16 octets [RFC7651]
46
+ * 22 FTT_KAT NO 2 octets [TS 24.302 12.6.0]
47
+ * 23 EXTERNAL_SOURCE_IP4_NAT_INFO NO 0 or 6 [TS 29.139][Kimmo_Kymalainen]
48
+ * 24 TIMEOUT_PERIOD_FOR_LIVENESS_CHECK NO 0 or 4 octets [TS 24.302 13.4.0][Frederic_Firmin]
49
+ * 25 INTERNAL_DNS_DOMAIN YES 0 or more [RFC8598]
50
+ * 26 INTERNAL_DNSSEC_TA YES 0 or more [RFC8598]
51
+ * 27 ENCDNS_IP4 YES 0 or more [RFC9464]
52
+ * 28 ENCDNS_IP6 YES 0 or more [RFC9464]
53
+ * 29 ENCDNS_DIGEST_INFO YES 0 or more [RFC9464]
54
+ * 30-16383 Unassigned
55
+ * 16384-32767 Reserved for Private Use [RFC7296]
56
+ */
57
+ export declare enum configurationAttributeType {
58
+ INTERNAL_IP4_ADDRESS = 1,
59
+ INTERNAL_IP4_NETMASK = 2,
60
+ INTERNAL_IP4_DNS = 3,
61
+ INTERNAL_IP4_NBNS = 4,
62
+ INTERNAL_IP4_DHCP = 6,
63
+ APPLICATION_VERSION = 7,
64
+ INTERNAL_IP6_ADDRESS = 8,
65
+ INTERNAL_IP6_DNS = 10,
66
+ INTERNAL_IP6_DHCP = 12,
67
+ INTERNAL_IP4_SUBNET = 13,
68
+ SUPPORTED_ATTRIBUTES = 14,
69
+ INTERNAL_IP6_SUBNET = 15,
70
+ MIP6_HOME_PREFIX = 16,
71
+ INTERNAL_IP6_LINK = 17,
72
+ INTERNAL_IP6_PREFIX = 18,
73
+ HOME_AGENT_ADDRESS = 19,
74
+ P_CSCF_IP4_ADDRESS = 20,
75
+ P_CSCF_IP6_ADDRESS = 21,
76
+ FTT_KAT = 22,
77
+ EXTERNAL_SOURCE_IP4_NAT_INFO = 23,
78
+ TIMEOUT_PERIOD_FOR_LIVENESS_CHECK = 24,
79
+ INTERNAL_DNS_DOMAIN = 25,
80
+ INTERNAL_DNSSEC_TA = 26,
81
+ ENCDNS_IP4 = 27,
82
+ ENCDNS_IP6 = 28,
83
+ ENCDNS_DIGEST_INFO = 29
84
+ }
85
+ /**
86
+ * Configuration Attributes
87
+ *
88
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
89
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
90
+ * |R| Attribute Type | Length |
91
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
92
+ * | |
93
+ * ~ Value ~
94
+ * | |
95
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
96
+ *
97
+ * Figure 23: Configuration Attribute Format
98
+ *
99
+ * See: https://datatracker.ietf.org/doc/html/rfc7296#section-3.15.1
100
+ *
101
+ * As used in the PayloadCP
102
+ *
103
+ */
104
+ export declare class ConfigurationAttribute {
105
+ type: configurationAttributeType;
106
+ value: Buffer;
107
+ constructor(type: configurationAttributeType, value: Buffer);
108
+ /**
109
+ * Parses a ConfigurationAttribute from a Buffer
110
+ * @param {Buffer} buffer
111
+ * @static
112
+ * @public
113
+ * @returns {ConfigurationAttribute}
114
+ */
115
+ static parse(buffer: Buffer): ConfigurationAttribute;
116
+ /**
117
+ * Serializes a Configuration Attribute from a JSON object
118
+ * @param {any} json
119
+ * @static
120
+ * @public
121
+ * @returns {Buffer}
122
+ */
123
+ static serializeJSON(json: Record<string, any>): Buffer;
124
+ /**
125
+ * Serializes a Configuration Attribute to a Buffer
126
+ * @public
127
+ * @returns {Buffer}
128
+ */
129
+ serialize(): Buffer;
130
+ /**
131
+ * Parses Configuration Attributes from a Buffer
132
+ * @param {Buffer} buffer
133
+ * @static
134
+ * @public
135
+ * @returns {ConfigurationAttribute[]}
136
+ */
137
+ static parseConfigurationAttributes(buffer: Buffer): ConfigurationAttribute[];
138
+ /**
139
+ * Converts Configuration Attribute to JSON
140
+ * @public
141
+ * @returns {Record<string, any>} JSON object
142
+ */
143
+ toJSON(): Record<string, any>;
144
+ /**
145
+ * Returns a string representation of the configuration attribute
146
+ * @public
147
+ * @returns {string}
148
+ */
149
+ toString(): string;
150
+ }
151
+ export declare class INTERNAL_IP4_ADDRESS extends ConfigurationAttribute {
152
+ address: Buffer;
153
+ constructor(address: Buffer);
154
+ static parse(buffer: Buffer): INTERNAL_IP4_ADDRESS;
155
+ static serializeJSON(json: Record<string, any>): Buffer;
156
+ toJSON(): Record<string, any>;
157
+ toString(): string;
158
+ }
159
+ export declare class INTERNAL_IP4_NETMASK extends ConfigurationAttribute {
160
+ netmask: Buffer;
161
+ constructor(netmask: Buffer);
162
+ static parse(buffer: Buffer): INTERNAL_IP4_NETMASK;
163
+ static serializeJSON(json: Record<string, any>): Buffer;
164
+ toJSON(): Record<string, any>;
165
+ toString(): string;
166
+ }
167
+ export declare class INTERNAL_IP4_DNS extends ConfigurationAttribute {
168
+ dns: Buffer;
169
+ constructor(dns: Buffer);
170
+ static parse(buffer: Buffer): INTERNAL_IP4_DNS;
171
+ static serializeJSON(json: Record<string, any>): Buffer;
172
+ toJSON(): Record<string, any>;
173
+ toString(): string;
174
+ }
175
+ export declare class INTERNAL_IP4_NBNS extends ConfigurationAttribute {
176
+ nbns: Buffer;
177
+ constructor(nbns: Buffer);
178
+ static parse(buffer: Buffer): INTERNAL_IP4_NBNS;
179
+ static serializeJSON(json: Record<string, any>): Buffer;
180
+ toJSON(): Record<string, any>;
181
+ toString(): string;
182
+ }
183
+ export declare class INTERNAL_IP4_DHCP extends ConfigurationAttribute {
184
+ dhcp: Buffer;
185
+ constructor(dhcp: Buffer);
186
+ static parse(buffer: Buffer): INTERNAL_IP4_DHCP;
187
+ static serializeJSON(json: Record<string, any>): Buffer;
188
+ toJSON(): Record<string, any>;
189
+ toString(): string;
190
+ }
191
+ export declare class APPLICATION_VERSION extends ConfigurationAttribute {
192
+ versionString: string;
193
+ constructor(versionString: string);
194
+ static parse(buffer: Buffer): APPLICATION_VERSION;
195
+ static serializeJSON(json: Record<string, any>): Buffer;
196
+ toJSON(): Record<string, any>;
197
+ toString(): string;
198
+ }
199
+ export declare class INTERNAL_IP6_ADDRESS extends ConfigurationAttribute {
200
+ address: Buffer;
201
+ prefixLength: number;
202
+ constructor(address: Buffer, prefixLength: number);
203
+ static parse(buffer: Buffer): INTERNAL_IP6_ADDRESS;
204
+ static serializeJSON(json: Record<string, any>): Buffer;
205
+ toJSON(): Record<string, any>;
206
+ toString(): string;
207
+ }
208
+ export declare class INTERNAL_IP6_DNS extends ConfigurationAttribute {
209
+ dns: Buffer;
210
+ constructor(dns: Buffer);
211
+ static parse(buffer: Buffer): INTERNAL_IP6_DNS;
212
+ static serializeJSON(json: Record<string, any>): Buffer;
213
+ toJSON(): Record<string, any>;
214
+ toString(): string;
215
+ }
216
+ export declare class INTERNAL_IP6_DHCP extends ConfigurationAttribute {
217
+ dhcp: Buffer;
218
+ constructor(dhcp: Buffer);
219
+ static parse(buffer: Buffer): INTERNAL_IP6_DHCP;
220
+ static serializeJSON(json: Record<string, any>): Buffer;
221
+ toJSON(): Record<string, any>;
222
+ toString(): string;
223
+ }
224
+ export declare class INTERNAL_IP4_SUBNET extends ConfigurationAttribute {
225
+ address: Buffer;
226
+ netmask: Buffer;
227
+ constructor(address: Buffer, netmask: Buffer);
228
+ static parse(buffer: Buffer): INTERNAL_IP4_SUBNET;
229
+ static serializeJSON(json: Record<string, any>): Buffer;
230
+ toJSON(): Record<string, any>;
231
+ toString(): string;
232
+ }
233
+ export declare class SUPPORTED_ATTRIBUTES extends ConfigurationAttribute {
234
+ values: configurationAttributeType[];
235
+ constructor(values: configurationAttributeType[]);
236
+ static parse(buffer: Buffer): SUPPORTED_ATTRIBUTES;
237
+ static serializeJSON(json: Record<string, any>): Buffer;
238
+ toJSON(): Record<string, any>;
239
+ toString(): string;
240
+ }
241
+ export declare class INTERNAL_IP6_SUBNET extends ConfigurationAttribute {
242
+ address: Buffer;
243
+ prefixLength: number;
244
+ constructor(address: Buffer, prefixLength: number);
245
+ static parse(buffer: Buffer): INTERNAL_IP6_SUBNET;
246
+ static serializeJSON(json: Record<string, any>): Buffer;
247
+ toJSON(): Record<string, any>;
248
+ toString(): string;
249
+ }
250
+ export declare class P_CSCF_IP4_ADDRESS extends ConfigurationAttribute {
251
+ address: Buffer;
252
+ constructor(address: Buffer);
253
+ static parse(buffer: Buffer): P_CSCF_IP4_ADDRESS;
254
+ static serializeJSON(json: Record<string, any>): Buffer;
255
+ toJSON(): Record<string, any>;
256
+ toString(): string;
257
+ }
258
+ export declare class P_CSCF_IP6_ADDRESS extends ConfigurationAttribute {
259
+ address: Buffer;
260
+ constructor(address: Buffer);
261
+ static parse(buffer: Buffer): P_CSCF_IP6_ADDRESS;
262
+ static serializeJSON(json: Record<string, any>): Buffer;
263
+ toJSON(): Record<string, any>;
264
+ toString(): string;
265
+ }
266
+ export declare class CPAttributes {
267
+ INTERNAL_IP4_ADDRESS: INTERNAL_IP4_ADDRESS[];
268
+ INTERNAL_IP4_NETMASK: INTERNAL_IP4_NETMASK | undefined;
269
+ INTERNAL_IP4_DNS: INTERNAL_IP4_DNS[];
270
+ INTERNAL_IP4_NBNS: INTERNAL_IP4_NBNS[];
271
+ INTERNAL_IP4_DHCP: INTERNAL_IP4_DHCP[];
272
+ APPLICATION_VERSION: APPLICATION_VERSION | undefined;
273
+ INTERNAL_IP6_ADDRESS: INTERNAL_IP6_ADDRESS[];
274
+ INTERNAL_IP6_DNS: INTERNAL_IP6_DNS[];
275
+ INTERNAL_IP6_DHCP: INTERNAL_IP6_DHCP[];
276
+ INTERNAL_IP4_SUBNET: INTERNAL_IP4_SUBNET[];
277
+ SUPPORTED_ATTRIBUTES: SUPPORTED_ATTRIBUTES | undefined;
278
+ INTERNAL_IP6_SUBNET: INTERNAL_IP6_SUBNET[];
279
+ P_CSCF_IP4_ADDRESS: P_CSCF_IP4_ADDRESS[];
280
+ P_CSCF_IP6_ADDRESS: P_CSCF_IP6_ADDRESS[];
281
+ OtherAttributes: ConfigurationAttribute[];
282
+ constructor();
283
+ static parse(buffer: Buffer): CPAttributes;
284
+ /**
285
+ * Serializes the configuration attributes to a buffer
286
+ * @public
287
+ * @returns {Buffer}
288
+ */
289
+ serialize(): Buffer;
290
+ /**
291
+ * Converts Configuration Attribute to JSON
292
+ * @public
293
+ * @returns {Record<string, any>}
294
+ */
295
+ toJSON(): Record<string, any>;
296
+ /**
297
+ * Returns a string representation of the configuration attributes
298
+ * @public
299
+ * @returns {string}
300
+ */
301
+ toString(): string;
302
+ }