netkitty 0.0.21 → 0.0.22
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/PcapExports.d.ts +13 -0
- package/dist/PcapExports.d.ts.map +1 -1
- package/dist/PcapExports.js +16 -1
- package/dist/lib/pcap/PCAPGenerator.d.ts +2 -2
- package/dist/lib/pcap/PCAPGenerator.d.ts.map +1 -1
- package/dist/lib/pcap/PCAPGenerator.js +7 -1
- package/package.json +1 -1
- package/src/PcapExports.ts +16 -0
- package/src/lib/pcap/PCAPGenerator.ts +8 -3
- package/dist/NetKitty.d.ts +0 -1
- package/dist/NetKitty.d.ts.map +0 -1
- package/dist/NetKitty.js +0 -90
- package/src/NetKitty.ts +0 -91
package/dist/PcapExports.d.ts
CHANGED
|
@@ -14,4 +14,17 @@ export { PcapParser } from './lib/pcap/PcapParser';
|
|
|
14
14
|
* Types
|
|
15
15
|
*/
|
|
16
16
|
export { type IPcapPacketInfo } from './lib/pcap/interfaces/IPcapPacketInfo';
|
|
17
|
+
export type { GeneratePCAPInputPacket, GeneratePCAPPacket } from './lib/pcap/PCAPGenerator';
|
|
18
|
+
/**
|
|
19
|
+
* Generate PCAP header
|
|
20
|
+
*/
|
|
21
|
+
export { GeneratePCAPHeader } from './lib/pcap/PCAPGenerator';
|
|
22
|
+
/**
|
|
23
|
+
* Generate PCAP Data
|
|
24
|
+
*/
|
|
25
|
+
export { GeneratePCAPData } from './lib/pcap/PCAPGenerator';
|
|
26
|
+
/**
|
|
27
|
+
* Generate PCAP file with full data
|
|
28
|
+
*/
|
|
29
|
+
export { GeneratePCAP } from './lib/pcap/PCAPGenerator';
|
|
17
30
|
//# sourceMappingURL=PcapExports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PcapExports.d.ts","sourceRoot":"","sources":["../src/PcapExports.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD;;GAEG;AACH,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,uCAAuC,CAAA"}
|
|
1
|
+
{"version":3,"file":"PcapExports.d.ts","sourceRoot":"","sources":["../src/PcapExports.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD;;GAEG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD;;GAEG;AACH,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,uCAAuC,CAAA;AAC1E,YAAY,EAAC,uBAAuB,EAAE,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAEzF;;GAEG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAE3D;;GAEG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AAEzD;;GAEG;AACH,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAA"}
|
package/dist/PcapExports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PcapParser = exports.PcapWriter = exports.PcapReader = void 0;
|
|
3
|
+
exports.GeneratePCAP = exports.GeneratePCAPData = exports.GeneratePCAPHeader = exports.PcapParser = exports.PcapWriter = exports.PcapReader = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* PCAP reader
|
|
6
6
|
*/
|
|
@@ -16,3 +16,18 @@ Object.defineProperty(exports, "PcapWriter", { enumerable: true, get: function (
|
|
|
16
16
|
*/
|
|
17
17
|
var PcapParser_1 = require("./lib/pcap/PcapParser");
|
|
18
18
|
Object.defineProperty(exports, "PcapParser", { enumerable: true, get: function () { return PcapParser_1.PcapParser; } });
|
|
19
|
+
/**
|
|
20
|
+
* Generate PCAP header
|
|
21
|
+
*/
|
|
22
|
+
var PCAPGenerator_1 = require("./lib/pcap/PCAPGenerator");
|
|
23
|
+
Object.defineProperty(exports, "GeneratePCAPHeader", { enumerable: true, get: function () { return PCAPGenerator_1.GeneratePCAPHeader; } });
|
|
24
|
+
/**
|
|
25
|
+
* Generate PCAP Data
|
|
26
|
+
*/
|
|
27
|
+
var PCAPGenerator_2 = require("./lib/pcap/PCAPGenerator");
|
|
28
|
+
Object.defineProperty(exports, "GeneratePCAPData", { enumerable: true, get: function () { return PCAPGenerator_2.GeneratePCAPData; } });
|
|
29
|
+
/**
|
|
30
|
+
* Generate PCAP file with full data
|
|
31
|
+
*/
|
|
32
|
+
var PCAPGenerator_3 = require("./lib/pcap/PCAPGenerator");
|
|
33
|
+
Object.defineProperty(exports, "GeneratePCAP", { enumerable: true, get: function () { return PCAPGenerator_3.GeneratePCAP; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type GeneratePCAPInputPacket = {
|
|
2
|
-
timestamp: number;
|
|
3
2
|
frameBase64Data: string;
|
|
3
|
+
timestamp?: number;
|
|
4
4
|
microsecond?: {
|
|
5
5
|
seconds: number;
|
|
6
6
|
microseconds: number;
|
|
@@ -8,7 +8,7 @@ export type GeneratePCAPInputPacket = {
|
|
|
8
8
|
};
|
|
9
9
|
export type GeneratePCAPPacket = {
|
|
10
10
|
buffer: Buffer;
|
|
11
|
-
timestamp
|
|
11
|
+
timestamp?: number;
|
|
12
12
|
microsecond?: {
|
|
13
13
|
seconds: number;
|
|
14
14
|
microseconds: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PCAPGenerator.d.ts","sourceRoot":"","sources":["../../../src/lib/pcap/PCAPGenerator.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,uBAAuB,GAAG;IAClC,
|
|
1
|
+
{"version":3,"file":"PCAPGenerator.d.ts","sourceRoot":"","sources":["../../../src/lib/pcap/PCAPGenerator.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,uBAAuB,GAAG;IAClC,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE;QACV,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,MAAM,CAAA;KACvB,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE;QACV,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,MAAM,CAAA;KACvB,CAAA;CACJ,CAAA;AAyCD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAU3C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAyBnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,uBAAuB,EAAO,GAAG,MAAM,CAM5E"}
|
|
@@ -68,7 +68,13 @@ function GeneratePCAPData(packet) {
|
|
|
68
68
|
microseconds = packet.microsecond.microseconds;
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
-
|
|
71
|
+
if (packet.timestamp) {
|
|
72
|
+
[seconds, microseconds] = convertMillisecond2Microsecond(packet.timestamp);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
seconds = 0;
|
|
76
|
+
microseconds = 0;
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
79
|
packetHeader.writeUInt32BE(seconds, 0); // 4
|
|
74
80
|
if (packet.microsecond) {
|
package/package.json
CHANGED
package/src/PcapExports.ts
CHANGED
|
@@ -14,3 +14,19 @@ export {PcapParser} from './lib/pcap/PcapParser'
|
|
|
14
14
|
* Types
|
|
15
15
|
*/
|
|
16
16
|
export {type IPcapPacketInfo} from './lib/pcap/interfaces/IPcapPacketInfo'
|
|
17
|
+
export type {GeneratePCAPInputPacket, GeneratePCAPPacket} from './lib/pcap/PCAPGenerator'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Generate PCAP header
|
|
21
|
+
*/
|
|
22
|
+
export {GeneratePCAPHeader} from './lib/pcap/PCAPGenerator'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Generate PCAP Data
|
|
26
|
+
*/
|
|
27
|
+
export {GeneratePCAPData} from './lib/pcap/PCAPGenerator'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Generate PCAP file with full data
|
|
31
|
+
*/
|
|
32
|
+
export {GeneratePCAP} from './lib/pcap/PCAPGenerator'
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import BigNumber from 'bignumber.js'
|
|
6
6
|
|
|
7
7
|
export type GeneratePCAPInputPacket = {
|
|
8
|
-
timestamp: number
|
|
9
8
|
frameBase64Data: string
|
|
9
|
+
timestamp?: number
|
|
10
10
|
microsecond?: {
|
|
11
11
|
seconds: number
|
|
12
12
|
microseconds: number
|
|
@@ -15,7 +15,7 @@ export type GeneratePCAPInputPacket = {
|
|
|
15
15
|
|
|
16
16
|
export type GeneratePCAPPacket = {
|
|
17
17
|
buffer: Buffer,
|
|
18
|
-
timestamp
|
|
18
|
+
timestamp?: number,
|
|
19
19
|
microsecond?: {
|
|
20
20
|
seconds: number
|
|
21
21
|
microseconds: number
|
|
@@ -90,7 +90,12 @@ export function GeneratePCAPData(packet: GeneratePCAPPacket): Buffer {
|
|
|
90
90
|
seconds = packet.microsecond.seconds
|
|
91
91
|
microseconds = packet.microsecond.microseconds
|
|
92
92
|
} else {
|
|
93
|
-
|
|
93
|
+
if (packet.timestamp) {
|
|
94
|
+
[seconds, microseconds] = convertMillisecond2Microsecond(packet.timestamp)
|
|
95
|
+
} else {
|
|
96
|
+
seconds = 0
|
|
97
|
+
microseconds = 0
|
|
98
|
+
}
|
|
94
99
|
}
|
|
95
100
|
packetHeader.writeUInt32BE(seconds, 0) // 4
|
|
96
101
|
if (packet.microsecond) {
|
package/dist/NetKitty.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=NetKitty.d.ts.map
|
package/dist/NetKitty.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NetKitty.d.ts","sourceRoot":"","sources":["../src/NetKitty.ts"],"names":[],"mappings":""}
|
package/dist/NetKitty.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// export {BufferToHex} from './lib/helper/BufferToHex'
|
|
3
|
-
// export {BufferToIPv4, BufferToIPv6} from './lib/helper/BufferToIP'
|
|
4
|
-
// export {
|
|
5
|
-
// BufferToFloat32,
|
|
6
|
-
// BufferToInt16,
|
|
7
|
-
// BufferToInt32,
|
|
8
|
-
// BufferToInt64,
|
|
9
|
-
// BufferToInt8,
|
|
10
|
-
// BufferToUInt16, BufferToUInt32, BufferToUInt64,
|
|
11
|
-
// BufferToUInt8
|
|
12
|
-
// } from './lib/helper/BufferToNumber'
|
|
13
|
-
// export {FlexibleObject} from './lib/codec/lib/FlexibleObject'
|
|
14
|
-
// export {
|
|
15
|
-
// HexToFloat32,
|
|
16
|
-
// HexToInt16,
|
|
17
|
-
// HexToInt32,
|
|
18
|
-
// HexToInt64,
|
|
19
|
-
// HexToInt8,
|
|
20
|
-
// HexToUInt16,
|
|
21
|
-
// HexToUInt32, HexToUInt64,
|
|
22
|
-
// HexToUInt8
|
|
23
|
-
// } from './lib/helper/HexToNumber'
|
|
24
|
-
// export {IPv4ToBuffer, IPv6ToBuffer} from './lib/helper/IPToBuffer'
|
|
25
|
-
// export {
|
|
26
|
-
// Int16ToBERBuffer,
|
|
27
|
-
// Int32ToBERBuffer,
|
|
28
|
-
// Int64ToBERBuffer,
|
|
29
|
-
// Int8ToBERBuffer, UInt16ToBERBuffer, UInt32ToBERBuffer, UInt64ToBERBuffer,
|
|
30
|
-
// UInt8ToBERBuffer
|
|
31
|
-
// } from './lib/helper/NumberToBERBuffer'
|
|
32
|
-
// export {
|
|
33
|
-
// Int16ToBERHex,
|
|
34
|
-
// Int32ToBERHex,
|
|
35
|
-
// Int64ToBERHex,
|
|
36
|
-
// Int8ToBERHex,
|
|
37
|
-
// UInt16ToBERHex, UInt32ToBERHex, UInt64ToBERHex,
|
|
38
|
-
// UInt8ToBERHex
|
|
39
|
-
// } from './lib/helper/NumberToBERHex'
|
|
40
|
-
// export {
|
|
41
|
-
// Float32ToBuffer,
|
|
42
|
-
// Int16ToBuffer,
|
|
43
|
-
// Int32ToBuffer,
|
|
44
|
-
// Int64ToBuffer,
|
|
45
|
-
// Int8ToBuffer,
|
|
46
|
-
// UInt16ToBuffer, UInt32ToBuffer, UInt64ToBuffer,
|
|
47
|
-
// UInt8ToBuffer
|
|
48
|
-
// } from './lib/helper/NumberToBuffer'
|
|
49
|
-
// export {
|
|
50
|
-
// Float32ToHex,
|
|
51
|
-
// Int16ToHex,
|
|
52
|
-
// Int32ToHex,
|
|
53
|
-
// Int64ToHex,
|
|
54
|
-
// Int8ToHex,
|
|
55
|
-
// UInt16ToHex,
|
|
56
|
-
// UInt32ToHex, UInt64ToHex,
|
|
57
|
-
// UInt8ToHex
|
|
58
|
-
// } from './lib/helper/NumberToHex'
|
|
59
|
-
// export {StringContentEncodingEnum} from './lib/codec/lib/StringContentEncodingEnum'
|
|
60
|
-
// export {type INetworkInterface} from './lib/nodepcap/interfaces/INetworkInterface'
|
|
61
|
-
// export {type CodecEncodeResult} from './lib/codec/types/CodecEncodeResult'
|
|
62
|
-
// export {type CodecEncodeInput} from './lib/codec/types/CodecEncodeInput'
|
|
63
|
-
// export {type CodecDecodeResult} from './lib/codec/types/CodecDecodeResult'
|
|
64
|
-
// export {type CodecSchema} from './lib/codec/types/CodecSchema'
|
|
65
|
-
// export {type HeaderTreeNode} from './lib/codec/types/HeaderTreeNode'
|
|
66
|
-
// export {type IPcapPacketInfo} from './lib/pcap/interfaces/IPcapPacketInfo'
|
|
67
|
-
// /**
|
|
68
|
-
// * PCAP reader
|
|
69
|
-
// */
|
|
70
|
-
// export {PcapReader} from './lib/pcap/PcapReader'
|
|
71
|
-
// /**
|
|
72
|
-
// * PCAP writer
|
|
73
|
-
// */
|
|
74
|
-
// export {PcapWriter} from './lib/pcap/PcapWriter'
|
|
75
|
-
// /**
|
|
76
|
-
// * PCAP parser
|
|
77
|
-
// */
|
|
78
|
-
// export {PcapParser} from './lib/pcap/PcapParser'
|
|
79
|
-
// /**
|
|
80
|
-
// * Fetch network interface
|
|
81
|
-
// */
|
|
82
|
-
// export {GetNetworkInterfaces} from './lib/nodepcap/GetNetworkInterfaces'
|
|
83
|
-
// /**
|
|
84
|
-
// * Network packet capture
|
|
85
|
-
// */
|
|
86
|
-
// export {Capture} from './lib/nodepcap/Capture'
|
|
87
|
-
// /**
|
|
88
|
-
// * Network packet codec
|
|
89
|
-
// */
|
|
90
|
-
// export {Codec, Headers} from './lib/codec/Codec'
|
package/src/NetKitty.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// export {BufferToHex} from './lib/helper/BufferToHex'
|
|
2
|
-
// export {BufferToIPv4, BufferToIPv6} from './lib/helper/BufferToIP'
|
|
3
|
-
// export {
|
|
4
|
-
// BufferToFloat32,
|
|
5
|
-
// BufferToInt16,
|
|
6
|
-
// BufferToInt32,
|
|
7
|
-
// BufferToInt64,
|
|
8
|
-
// BufferToInt8,
|
|
9
|
-
// BufferToUInt16, BufferToUInt32, BufferToUInt64,
|
|
10
|
-
// BufferToUInt8
|
|
11
|
-
// } from './lib/helper/BufferToNumber'
|
|
12
|
-
// export {FlexibleObject} from './lib/codec/lib/FlexibleObject'
|
|
13
|
-
// export {
|
|
14
|
-
// HexToFloat32,
|
|
15
|
-
// HexToInt16,
|
|
16
|
-
// HexToInt32,
|
|
17
|
-
// HexToInt64,
|
|
18
|
-
// HexToInt8,
|
|
19
|
-
// HexToUInt16,
|
|
20
|
-
// HexToUInt32, HexToUInt64,
|
|
21
|
-
// HexToUInt8
|
|
22
|
-
// } from './lib/helper/HexToNumber'
|
|
23
|
-
// export {IPv4ToBuffer, IPv6ToBuffer} from './lib/helper/IPToBuffer'
|
|
24
|
-
// export {
|
|
25
|
-
// Int16ToBERBuffer,
|
|
26
|
-
// Int32ToBERBuffer,
|
|
27
|
-
// Int64ToBERBuffer,
|
|
28
|
-
// Int8ToBERBuffer, UInt16ToBERBuffer, UInt32ToBERBuffer, UInt64ToBERBuffer,
|
|
29
|
-
// UInt8ToBERBuffer
|
|
30
|
-
// } from './lib/helper/NumberToBERBuffer'
|
|
31
|
-
// export {
|
|
32
|
-
// Int16ToBERHex,
|
|
33
|
-
// Int32ToBERHex,
|
|
34
|
-
// Int64ToBERHex,
|
|
35
|
-
// Int8ToBERHex,
|
|
36
|
-
// UInt16ToBERHex, UInt32ToBERHex, UInt64ToBERHex,
|
|
37
|
-
// UInt8ToBERHex
|
|
38
|
-
// } from './lib/helper/NumberToBERHex'
|
|
39
|
-
// export {
|
|
40
|
-
// Float32ToBuffer,
|
|
41
|
-
// Int16ToBuffer,
|
|
42
|
-
// Int32ToBuffer,
|
|
43
|
-
// Int64ToBuffer,
|
|
44
|
-
// Int8ToBuffer,
|
|
45
|
-
// UInt16ToBuffer, UInt32ToBuffer, UInt64ToBuffer,
|
|
46
|
-
// UInt8ToBuffer
|
|
47
|
-
// } from './lib/helper/NumberToBuffer'
|
|
48
|
-
// export {
|
|
49
|
-
// Float32ToHex,
|
|
50
|
-
// Int16ToHex,
|
|
51
|
-
// Int32ToHex,
|
|
52
|
-
// Int64ToHex,
|
|
53
|
-
// Int8ToHex,
|
|
54
|
-
// UInt16ToHex,
|
|
55
|
-
// UInt32ToHex, UInt64ToHex,
|
|
56
|
-
// UInt8ToHex
|
|
57
|
-
// } from './lib/helper/NumberToHex'
|
|
58
|
-
// export {StringContentEncodingEnum} from './lib/codec/lib/StringContentEncodingEnum'
|
|
59
|
-
|
|
60
|
-
// export {type INetworkInterface} from './lib/nodepcap/interfaces/INetworkInterface'
|
|
61
|
-
// export {type CodecEncodeResult} from './lib/codec/types/CodecEncodeResult'
|
|
62
|
-
// export {type CodecEncodeInput} from './lib/codec/types/CodecEncodeInput'
|
|
63
|
-
// export {type CodecDecodeResult} from './lib/codec/types/CodecDecodeResult'
|
|
64
|
-
// export {type CodecSchema} from './lib/codec/types/CodecSchema'
|
|
65
|
-
// export {type HeaderTreeNode} from './lib/codec/types/HeaderTreeNode'
|
|
66
|
-
// export {type IPcapPacketInfo} from './lib/pcap/interfaces/IPcapPacketInfo'
|
|
67
|
-
// /**
|
|
68
|
-
// * PCAP reader
|
|
69
|
-
// */
|
|
70
|
-
// export {PcapReader} from './lib/pcap/PcapReader'
|
|
71
|
-
// /**
|
|
72
|
-
// * PCAP writer
|
|
73
|
-
// */
|
|
74
|
-
// export {PcapWriter} from './lib/pcap/PcapWriter'
|
|
75
|
-
// /**
|
|
76
|
-
// * PCAP parser
|
|
77
|
-
// */
|
|
78
|
-
// export {PcapParser} from './lib/pcap/PcapParser'
|
|
79
|
-
// /**
|
|
80
|
-
// * Fetch network interface
|
|
81
|
-
// */
|
|
82
|
-
// export {GetNetworkInterfaces} from './lib/nodepcap/GetNetworkInterfaces'
|
|
83
|
-
// /**
|
|
84
|
-
// * Network packet capture
|
|
85
|
-
// */
|
|
86
|
-
// export {Capture} from './lib/nodepcap/Capture'
|
|
87
|
-
// /**
|
|
88
|
-
// * Network packet codec
|
|
89
|
-
// */
|
|
90
|
-
// export {Codec, Headers} from './lib/codec/Codec'
|
|
91
|
-
|