-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathenumerations.js
643 lines (640 loc) · 20.1 KB
/
enumerations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
module.exports = {
'NM_STATE': function (code) {
var result = {
code: code,
name: 'UNKNOWN',
description: 'Networking state is unknown.'
};
switch(code) {
case 10:
result.name = 'ASLEEP';
result.description = 'Networking is inactive and all devices are disabled.';
break;
case 20:
result.name = 'DISCONNECTED';
result.description = 'There is no active network connection.';
break;
case 30:
result.name = 'DISCONNECTING';
result.description = 'Network connections are being cleaned up.';
break;
case 40:
result.name = 'CONNECTING';
result.description = 'A network device is connecting to a network and there is no other available network connection.';
break;
case 50:
result.name = 'CONNECTED_LOCAL';
result.description = 'A network device is connected, but there is only link-local connectivity.';
break;
case 60:
result.name = 'CONNECTED_SITE';
result.description = 'A network device is connected, but there is only site-local connectivity.';
break;
case 70:
result.name = 'CONNECTED_GLOBAL';
result.description = 'A network device is connected, with global network connectivity.';
break;
}
return result;
},
'NM_ACTIVE_CONNECTION_STATE': function (code) {
var result = {
code: code,
name: 'UNKNOWN',
description: 'The active connection is in an unknown state.'
};
switch(code) {
case 1:
result.name = 'ACTIVATING';
result.description = 'The connection is activating.';
break;
case 2:
result.name = 'ACTIVATED';
result.description = 'The connection is activated.';
break;
case 3:
result.name = 'DEACTIVATING';
result.description = 'The connection is being torn down and cleaned up.';
break;
case 4:
result.name = 'DEACTIVATED';
result.description = 'The connection is no longer active.';
break;
}
return result;
},
'NM_DEVICE_STATE': function (code) {
var result = {
code: code,
name: 'UNKNOWN',
description: 'The device is in an unknown state.'
};
switch(code) {
case 10:
result.name = 'UNMANAGED';
result.description = 'The device is recognized but not managed by NetworkManager.';
break;
case 20:
result.name = 'UNAVAILABLE';
result.description = 'The device cannot be used (carrier off, rfkill, etc).';
break;
case 30:
result.name = 'DISCONNECTED';
result.description = 'The device is not connected.';
break;
case 40:
result.name = 'PREPARE';
result.description = 'The device is preparing to connect.';
break;
case 50:
result.name = 'CONFIG';
result.description = 'The device is being configured.';
break;
case 60:
result.name = 'NEED_AUTH';
result.description = 'The device is awaiting secrets necessary to continue connection.';
break;
case 70:
result.name = 'IP_CONFIG';
result.description = 'The IP settings of the device are being requested and configured.';
break;
case 80:
result.name = 'IP_CHECK';
result.description = "The device's IP connectivity ability is being determined.";
break;
case 90:
result.name = 'SECONDARIES';
result.description = 'The device is waiting for secondary connections to be activated.';
break;
case 100:
result.name = 'ACTIVATED';
result.description = 'The device is active.';
break;
case 110:
result.name = 'DEACTIVATING';
result.description = "The device's network connection is being torn down.";
break;
case 120:
result.name = 'FAILED';
result.description = 'The device is in a failure state following an attempt to activate it.';
break;
}
return result;
},
'NM_DEVICE_STATE_REASON': function (code) {
var result = {
code: code,
name: 'UNKNOWN',
description: 'The reason for the device state change is unknown.'
};
switch(code) {
case 1:
result.name = 'NONE';
result.description = 'The state change is normal.';
break;
case 2:
result.name = 'NOW_MANAGED';
result.description = 'The device is now managed.';
break;
case 3:
result.name = 'UNMANAGED';
result.description = 'The device is no longer managed.';
break;
case 4:
result.name = 'CONFIG_FAILED';
result.description = 'The device could not be readied for configuration.';
break;
case 5:
result.name = 'CONFIG_UNAVAILABLE';
result.description = 'IP configuration could not be reserved (no available address, timeout, etc).';
break;
case 6:
result.name = 'CONFIG_EXPIRED';
result.description = 'The IP configuration is no longer valid.';
break;
case 7:
result.name = 'NO_SECRETS';
result.description = 'Secrets were required, but not provided.';
break;
case 8:
result.name = 'SUPPLICANT_DISCONNECT';
result.description = "The 802.1X supplicant disconnected from the access point or authentication server.";
break;
case 9:
result.name = 'SUPPLICANT_CONFIG_FAILED';
result.description = 'Configuration of the 802.1X supplicant failed.';
break;
case 10:
result.name = 'SUPPLICANT_FAILED';
result.description = 'The 802.1X supplicant quit or failed unexpectedly.';
break;
case 11:
result.name = 'SUPPLICANT_TIMEOUT';
result.description = "The 802.1X supplicant took too long to authenticate.";
break;
case 12:
result.name = 'PPP_START_FAILED';
result.description = 'The PPP service failed to start within the allowed time.';
break;
case 13:
result.name = 'PPP_DISCONNECT';
result.description = 'The PPP service disconnected unexpectedly.';
break;
case 14:
result.name = 'PPP_FAILED';
result.description = 'The PPP service quit or failed unexpectedly.';
break;
case 15:
result.name = 'DHCP_START_FAILED';
result.description = 'The DHCP service failed to start within the allowed time.';
break;
case 16:
result.name = 'DHCP_ERROR';
result.description = 'The DHCP service reported an unexpected error.';
break;
case 17:
result.name = 'DHCP_FAILED';
result.description = 'The DHCP service quit or failed unexpectedly.';
break;
case 18:
result.name = 'SHARED_START_FAILED';
result.description = 'The shared connection service failed to start.';
break;
case 19:
result.name = 'SHARED_FAILED';
result.description = 'The shared connection service quit or failed unexpectedly.';
break;
case 20:
result.name = 'AUTOIP_START_FAILED';
result.description = 'The AutoIP service failed to start.';
break;
case 21:
result.name = 'AUTOIP_ERROR';
result.description = 'The AutoIP service reported an unexpected error.';
break;
case 22:
result.name = 'AUTOIP_FAILED';
result.description = 'The AutoIP service quit or failed unexpectedly.';
break;
case 23:
result.name = 'MODEM_BUSY';
result.description = 'Dialing failed because the line was busy.';
break;
case 24:
result.name = 'MODEM_NO_DIAL_TONE';
result.description = 'Dialing failed because there was no dial tone.';
break;
case 25:
result.name = 'MODEM_NO_CARRIER';
result.description = 'Dialing failed because there was carrier.';
break;
case 26:
result.name = 'MODEM_DIAL_TIMEOUT';
result.description = 'Dialing timed out.';
break;
case 27:
result.name = 'MODEM_DIAL_FAILED';
result.description = 'Dialing failed.';
break;
case 28:
result.name = 'MODEM_INIT_FAILED';
result.description = 'Modem initialization failed.';
break;
case 29:
result.name = 'GSM_APN_FAILED';
result.description = 'Failed to select the specified GSM APN.';
break;
case 30:
result.name = 'GSM_REGISTRATION_NOT_SEARCHING';
result.description = 'Not searching for networks.';
break;
case 31:
result.name = 'GSM_REGISTRATION_DENIED';
result.description = 'Network registration was denied.';
break;
case 32:
result.name = 'GSM_REGISTRATION_TIMEOUT';
result.description = 'Network registration timed out.';
break;
case 33:
result.name = 'GSM_REGISTRATION_FAILED';
result.description = 'Failed to register with the requested GSM network.';
break;
case 34:
result.name = 'GSM_PIN_CHECK_FAILED';
result.description = 'PIN check failed.';
break;
case 35:
result.name = 'FIRMWARE_MISSING';
result.description = 'Necessary firmware for the device may be missing.';
break;
case 36:
result.name = 'REMOVED';
result.description = 'The device was removed.';
break;
case 37:
result.name = 'SLEEPING';
result.description = 'NetworkManager went to sleep.';
break;
case 38:
result.name = 'CONNECTION_REMOVED';
result.description = "The device's active connection was removed or disappeared.";
break;
case 39:
result.name = 'USER_REQUESTED';
result.description = 'A user or client requested the disconnection.';
break;
case 40:
result.name = 'CARRIER';
result.description = "The device's carrier/link changed.";
break;
case 41:
result.name = 'CONNECTION_ASSUMED';
result.description = "The device's existing connection was assumed.";
break;
case 42:
result.name = 'SUPPLICANT_AVAILABLE';
result.description = 'The 802.1x supplicant is now available.';
break;
case 43:
result.name = 'MODEM_NOT_FOUND';
result.description = 'The modem could not be found.';
break;
case 44:
result.name = 'BT_FAILED';
result.description = 'The Bluetooth connection timed out or failed.';
break;
case 45:
result.name = 'GSM_SIM_NOT_INSERTED';
result.description = "GSM Modem's SIM Card not inserted.";
break;
case 46:
result.name = 'GSM_SIM_PIN_REQUIRED';
result.description = "GSM Modem's SIM Pin required.";
break;
case 47:
result.name = 'GSM_SIM_PUK_REQUIRED';
result.description = "GSM Modem's SIM Puk required.";
break;
case 48:
result.name = 'GSM_SIM_WRONG';
result.description = "GSM Modem's SIM wrong";
break;
case 49:
result.name = 'INFINIBAND_MODE';
result.description = 'InfiniBand device does not support connected mode.';
break;
case 50:
result.name = 'DEPENDENCY_FAILED';
result.description = 'A dependency of the connection failed.';
break;
case 51:
result.name = 'BR2684_FAILED';
result.description = 'Problem with the RFC 2684 Ethernet over ADSL bridge.';
break;
case 52:
result.name = 'MODEM_MANAGER_UNAVAILABLE';
result.description = 'ModemManager was not running or quit unexpectedly.';
break;
case 53:
result.name = 'SSID_NOT_FOUND';
result.description = 'The 802.11 Wi-Fi network could not be found.';
break;
case 54:
result.name = 'SECONDARY_CONNECTION_FAILED';
result.description = 'A secondary connection of the base connection failed.';
break;
}
return result;
},
'NM_DEVICE_TYPE': function (code) {
var result = {
code: code,
name: 'UNKNOWN',
description: 'The device type is unknown.'
};
switch(code) {
case 1:
result.name = 'ETHERNET';
result.description = 'The device is wired Ethernet device.';
break;
case 2:
result.name = 'WIFI';
result.description = 'The device is an 802.11 WiFi device.';
break;
case 3:
result.name = 'UNUSED1';
result.description = 'Unused';
break;
case 4:
result.name = 'UNUSED2';
result.description = 'Unused';
break;
case 5:
result.name = 'BT';
result.description = 'The device is Bluetooth device that provides PAN or DUN capabilities.';
break;
case 6:
result.name = 'OLPC_MESH';
result.description = 'The device is an OLPC mesh networking device.';
break;
case 7:
result.name = 'WIMAX';
result.description = 'The device is an 802.16e Mobile WiMAX device.';
break;
case 8:
result.name = 'MODEM';
result.description = 'The device is a modem supporting one or more of analog telephone, CDMA/EVDO, GSM/UMTS/HSPA, or LTE standards to access a cellular or wireline data network.';
break;
case 9:
result.name = 'INFINIBAND';
result.description = 'The device is an IP-capable InfiniBand interface.';
break;
case 10:
result.name = 'BOND';
result.description = 'The device is a bond master interface.';
break;
case 11:
result.name = 'VLAN';
result.description = 'The device is a VLAN interface.';
break;
case 12:
result.name = 'ADSL';
result.description = 'The device is an ADSL device supporting PPPoE and PPPoATM protocols.';
break;
case 13:
result.name = 'BRIDGE';
result.description = 'The device is a bridge interface.';
break;
}
return result;
},
// device = "wireless device" || "access point"
'NM_802_11_MODE': function (code, device) {
var result = {
code: code,
name: 'UNKNOWN',
description: 'Mode is unknown.'
};
switch(code) {
case 1:
result.name = 'ADHOC';
if(!device) result.description = 'For both devices and access point objects, indicates the object is part of an Ad-Hoc 802.11 network without a central coordinating access point.';
else if(device == "wireless device") result.description = 'The wireless device is part of an Ad-Hoc 802.11 network without a central coordinating access point.';
else result.description = 'The access point is part of an Ad-Hoc 802.11 network without a central coordinating access point.';
break;
case 2:
result.name = 'INFRA';
if(!device) result.description = 'The wireless device or access point is in infrastructure mode. For devices, this indicates the device is an 802.11 client/station. For access point objects, this indicates the object is an access point that provides connectivity to clients.';
else if(device == "wireless device") result.description = 'The wireless device is in infrastructure mode, this indicates the device is an 802.11 client/station.';
else result.description = 'The access point is in infrastructure mode, this indicates the object is an access point that provides connectivity to clients.';
break;
case 3:
result.name = 'AP';
if(!device) result.description = 'The device is an access point/hotspot. Not valid for access point objects themselves.';
else if(device == "wireless device") result.description = 'The device is an access point/hotspot.';
else result.description = 'This mode is not valid for access points.';
break;
}
return result;
},
'NM_DEVICE_CAP': function (code) {
var result = {
code: code,
name: 'NONE',
description: 'Null capability.'
};
switch(code) {
case 1:
result.name = 'NM_SUPPORTED';
result.description = 'The device is supported by NetworkManager.';
break;
case 2:
result.name = 'CARRIER_DETECT';
result.description = 'The device supports carrier detection.';
break;
}
return result;
},
'NM_802_11_AP_FLAGS': function (code) {
var result = {
code: code,
name: 'NONE',
description: 'Null capability - says nothing about the access point.'
};
switch(code) {
case 1:
result.name = 'PRIVACY';
result.description = 'Access point supports privacy measures.';
break;
}
return result;
},
'NM_802_11_AP_SEC': function (code) {
var values = [];
// 0x0
if(code == 0) {
values = [{
code: 0,
name: 'NONE',
description: 'Null flag.'
}];
}
// 0x1
if(code & 1) {
values.push({
code: 1,
name: 'PAIR_WEP40',
description: 'Access point supports pairwise 40-bit WEP encryption.'
});
}
// 0x2
if(code & 2) {
values.push({
code: 2,
name: 'PAIR_WEP104',
description: 'Access point supports pairwise 104-bit WEP encryption.'
});
}
// 0x4
if(code & 4) {
values.push({
code: 4,
name: 'PAIR_TKIP',
description: 'Access point supports pairwise TKIP encryption.'
});
}
// 0x8
if(code & 8) {
values.push({
code: 8,
name: 'PAIR_CCMP',
description: 'Access point supports pairwise CCMP encryption.'
});
}
// 0x10
if(code & 16) {
values.push({
code: 16,
name: 'GROUP_WEP40',
description: 'Access point supports a group 40-bit WEP cipher.'
});
}
// 0x20
if(code & 32) {
values.push({
code: 32,
name: 'GROUP_WEP104',
description: 'Access point supports a group 104-bit WEP cipher.'
});
}
// 0x40"
if(code & 64) {
values.push({
code: 64,
name: 'GROUP_TKIP',
description: 'Access point supports a group TKIP cipher.'
});
}
// 0x80
if(code & 128) {
values.push({
code: 128,
name: 'GROUP_CCMP',
description: 'Access point supports a group CCMP cipher.'
});
}
// 0x100
if(code & 256) {
values.push({
code: 256,
name: 'KEY_MGMT_PSK',
description: 'Access point supports PSK key management.'
});
}
// 0x200
if(code & 512) {
values.push({
code: 512,
name: 'KEY_MGMT_802_1X',
description: 'Access point supports 802.1x key management.'
});
}
return {flags:code, values:values};
},
'NM_802_11_DEVICE_CAP': function (code) {
var values = [];
if(code == 0) {
values = [{
code: 0,
name: 'NONE',
description: 'Null flag.'
}];
}
// 0x1
if(code & 1) {
values.push({
code: 1,
name: 'CIPHER_WEP40',
description: 'The device supports the 40-bit WEP cipher.'
});
}
// 0x2
if(code & 2) {
values.push({
code: 2,
name: 'CIPHER_WEP104',
description: 'The device supports the 104-bit WEP cipher.'
});
}
// 0x4
if(code & 4) {
values.push({
code: 4,
name: 'CIPHER_TKIP',
description: 'The device supports the TKIP cipher.'
});
}
// 0x8
if(code & 8) {
values.push({
code: 8,
name: 'CIPHER_CCMP',
description: 'The device supports the CCMP cipher.'
});
}
// 0x10
if(code & 16) {
values.push({
code: 16,
name: 'WPA',
description: 'The device supports the WPA encryption/authentication protocol.'
});
}
// 0x20
if(code & 32) {
values.push({
code: 32,
name: 'RSN',
description: 'The device supports the RSN encryption/authentication protocol.'
});
}
// 0x40"
if(code & 64) {
values.push({
code: 64,
name: 'AP',
description: 'The device supports Access Point mode.'
});
}
// 0x80
if(code & 128) {
values.push({
code: 128,
name: 'ADHOC',
description: 'The device supports Ad-Hoc mode.'
});
}
return {flags:code, values:values};
},
};