netkitty 0.0.3 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netkitty",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Network tools kit",
5
5
  "main": "dist/NetKitty.js",
6
6
  "types": "dist/NetKitty.d.ts",
@@ -70,6 +70,11 @@ export abstract class BaseHeader {
70
70
  */
71
71
  public readonly abstract name: string
72
72
 
73
+ /**
74
+ * Human-readable header nickname
75
+ */
76
+ public readonly abstract nickname: string
77
+
73
78
  /**
74
79
  * Encode/Decode error info objects
75
80
  */
@@ -206,9 +206,11 @@ export class ARP extends BaseHeader {
206
206
  }
207
207
  }
208
208
 
209
- public id: string = 'arp'
209
+ public readonly id: string = 'arp'
210
210
 
211
- public name: string = 'Address Resolution Protocol'
211
+ public readonly name: string = 'Address Resolution Protocol'
212
+
213
+ public readonly nickname: string = 'ARP'
212
214
 
213
215
  public match(): boolean {
214
216
  if (!this.prevCodecModule) return false
@@ -5,10 +5,6 @@ import {StringContentEncodingEnum} from '../lib/StringContentEncodingEnum'
5
5
 
6
6
  export class EthernetII extends BaseHeader {
7
7
 
8
- public readonly id: string = 'eth'
9
-
10
- public readonly name: string = 'Ethernet II'
11
-
12
8
  public readonly SCHEMA: ProtocolJSONSchema = {
13
9
  type: 'object',
14
10
  properties: {
@@ -69,6 +65,12 @@ export class EthernetII extends BaseHeader {
69
65
  }
70
66
  }
71
67
 
68
+ public readonly id: string = 'eth'
69
+
70
+ public readonly name: string = 'Ethernet II'
71
+
72
+ public readonly nickname: string = 'ETH'
73
+
72
74
  public match(): boolean {
73
75
  const specialScenes: string[] = ['trill', 'vxlan', 'nvgre', 'mpls', 'qinq', 'gre', 'geneve']
74
76
  if (this.prevCodecModule && !specialScenes.includes(this.prevCodecModule.id)) return false
@@ -647,9 +647,11 @@ export class Goose extends BaseHeader {
647
647
  }
648
648
  }
649
649
 
650
- public id: string = 'goose'
650
+ public readonly id: string = 'goose'
651
651
 
652
- public name: string = 'GOOSE'
652
+ public readonly name: string = 'GOOSE'
653
+
654
+ public readonly nickname: string = 'IEC 61850/GOOSE'
653
655
 
654
656
  public match(): boolean {
655
657
  if (!this.prevCodecModule) return false
@@ -348,9 +348,11 @@ export class IEC61850SampledValues extends BaseHeader {
348
348
  }
349
349
  }
350
350
 
351
- public id: string = 'sv'
351
+ public readonly id: string = 'sv'
352
352
 
353
- public name: string = 'IEC61850 Sampled Values'
353
+ public readonly name: string = 'IEC61850 Sampled Values'
354
+
355
+ public readonly nickname: string = 'IEC 61850/SV'
354
356
 
355
357
  public match(): boolean {
356
358
  if (!this.prevCodecModule) return false
@@ -318,9 +318,11 @@ export class IPv4 extends BaseHeader {
318
318
  }
319
319
  }
320
320
 
321
- public id: string = 'ipv4'
321
+ public readonly id: string = 'ipv4'
322
322
 
323
- public name: string = 'Internet Protocol Version 4'
323
+ public readonly name: string = 'Internet Protocol Version 4'
324
+
325
+ public readonly nickname: string = ''
324
326
 
325
327
  public match(): boolean {
326
328
  if (!this.prevCodecModule) return false
@@ -27,6 +27,8 @@ export class RawData extends BaseHeader {
27
27
 
28
28
  public readonly name: string = 'Raw Data'
29
29
 
30
+ public readonly nickname: string = 'Raw'
31
+
30
32
  public match(): boolean {
31
33
  return !!this.prevCodecModule
32
34
  }
@@ -918,9 +918,11 @@ export class TCP extends BaseHeader {
918
918
  }
919
919
  }
920
920
 
921
- public id: string = 'tcp'
921
+ public readonly id: string = 'tcp'
922
922
 
923
- public name: string = 'Transmission Control Protocol'
923
+ public readonly name: string = 'Transmission Control Protocol'
924
+
925
+ public readonly nickname: string = 'TCP'
924
926
 
925
927
  public match(): boolean {
926
928
  if (!this.prevCodecModule) return false
@@ -167,9 +167,11 @@ export class UDP extends BaseHeader {
167
167
  }
168
168
  }
169
169
 
170
- public id: string = 'udp'
170
+ public readonly id: string = 'udp'
171
171
 
172
- public name: string = 'User Datagram Protocol'
172
+ public readonly name: string = 'User Datagram Protocol'
173
+
174
+ public readonly nickname: string = 'UDP'
173
175
 
174
176
  public match(): boolean {
175
177
  if (!this.prevCodecModule) return false
@@ -63,9 +63,11 @@ export class VLAN_802dot1Q extends BaseHeader {
63
63
  }
64
64
  }
65
65
 
66
- public id: string = 'vlan'
66
+ public readonly id: string = 'vlan'
67
67
 
68
- public name: string = '802.1Q Virtual LAN'
68
+ public readonly name: string = '802.1Q Virtual LAN'
69
+
70
+ public readonly nickname: string = 'VLAN'
69
71
 
70
72
  public match(): boolean {
71
73
  if (!this.prevCodecModule) return false
package/tsconfig.json CHANGED
@@ -36,6 +36,7 @@
36
36
  "exclude": [
37
37
  "node_modules",
38
38
  "build",
39
+ "dist",
39
40
  "data"
40
41
  ]
41
42
  }