Skip to content

Commit e67088c

Browse files
committed
added pcapng samples
1 parent 428c60c commit e67088c

File tree

4 files changed

+306
-1
lines changed

4 files changed

+306
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ sample/*
77
!sample/out.plist
88
!sample/out.txt
99
!sample/in.pcap
10+
!sample/dhcp.pcapng
11+
!sample/pcapng.txt
1012

1113
src
1214
!requirements.txt

sample/dhcp.pcapng

1.47 KB
Binary file not shown.

sample/pcapng.txt

Lines changed: 303 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,303 @@
1+
Section Header 1
2+
|-- type
3+
| |--> BlockType::Section_Header_Block
4+
| [168627466]
5+
|-- length -> 28
6+
|-- byteorder -> little
7+
|-- version
8+
| |-- type -> VersionInfo
9+
| |-- value
10+
| |--> 1
11+
| |--> 0
12+
|-- section_length -> 18446744073709551615
13+
|-- options -> NIL
14+
15+
Interface Description 1
16+
|-- type
17+
| |--> BlockType::Interface_Description_Block
18+
| [1]
19+
|-- length -> 32
20+
|-- linktype -> LinkType::ETHERNET [1]
21+
|-- snaplen -> 65535
22+
|-- options
23+
|-- OptionType::if_tsresol [9_if_tsresol]
24+
| |--> --
25+
| |-- type
26+
| | |-- enum -> OptionType::if_tsresol [9_if_tsresol]
27+
| | |-- opt_name -> if_tsresol
28+
| | |-- opt_value -> 9
29+
| |-- length -> 1
30+
| |-- resolution -> 1000000
31+
|-- OptionType::opt_endofopt [0_opt_endofopt]
32+
|--> --
33+
|-- type
34+
| |-- enum
35+
| | |--> OptionType::opt_endofopt
36+
| | [0_opt_endofopt]
37+
| |-- opt_name -> opt_endofopt
38+
| |-- opt_value -> 0
39+
|-- length -> 0
40+
41+
Frame 1
42+
|-- type -> BlockType::Enhanced_Packet_Block [6]
43+
|-- length -> 348
44+
|-- section_number -> 1
45+
|-- number -> 1
46+
|-- interface_id -> 0
47+
|-- timestamp -> 2004-12-06T03:16:24.317453+08:00
48+
|-- timestamp_epoch -> 1102302984.317453
49+
|-- captured_len -> 314
50+
|-- original_len -> 314
51+
|-- options -> NIL
52+
|-- ethernet
53+
| |-- dst -> ff:ff:ff:ff:ff:ff
54+
| |-- src -> 00:0b:82:01:fc:42
55+
| |-- type
56+
| | |--> EtherType::Internet_Protocol_version_4
57+
| | [2048]
58+
| |-- ipv4
59+
| |-- version -> 4
60+
| |-- hdr_len -> 20
61+
| |-- tos
62+
| | |-- pre -> ToSPrecedence::Routine [0]
63+
| | |-- del -> ToSDelay::NORMAL [0]
64+
| | |-- thr -> ToSThroughput::NORMAL [0]
65+
| | |-- rel -> ToSReliability::NORMAL [0]
66+
| | |-- ecn -> ToSECN::Not_ECT [0]
67+
| |-- len -> 300
68+
| |-- id -> 43062
69+
| |-- flags
70+
| | |-- df -> False
71+
| | |-- mf -> False
72+
| |-- offset -> 0
73+
| |-- ttl -> 250.0
74+
| |-- protocol -> TransType::UDP [17]
75+
| |-- checksum -> 17 8b
76+
| |-- src -> 0.0.0.0
77+
| |-- dst -> 255.255.255.255
78+
| |-- udp
79+
| |-- srcport -> 68
80+
| |-- dstport -> 67
81+
| |-- len -> 280
82+
| |-- checksum -> 59 1f
83+
| |-- raw
84+
| |-- protocol -> NIL
85+
| |-- packet
86+
| | |--> 01 01 06 00 00 00 3d 1d 00 00 00 00 00 00 00 00
87+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 0b 82 01
88+
| | fc 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00
89+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
91+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
92+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
93+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
94+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
95+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
96+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
97+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
98+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
99+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
100+
| | 00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63
101+
| | 35 01 01 3d 07 01 00 0b 82 01 fc 42 32 04 00 00
102+
| | 00 00 37 04 01 03 06 2a ff 00 00 00 00 00 00 00
103+
| |-- error -> NIL
104+
|-- protocols -> Ethernet:IPv4:UDP:Raw
105+
106+
Frame 2
107+
|-- type -> BlockType::Enhanced_Packet_Block [6]
108+
|-- length -> 376
109+
|-- section_number -> 1
110+
|-- number -> 2
111+
|-- interface_id -> 0
112+
|-- timestamp -> 2004-12-06T03:16:24.317748+08:00
113+
|-- timestamp_epoch -> 1102302984.317748
114+
|-- captured_len -> 342
115+
|-- original_len -> 342
116+
|-- options -> NIL
117+
|-- ethernet
118+
| |-- dst -> 00:0b:82:01:fc:42
119+
| |-- src -> 00:08:74:ad:f1:9b
120+
| |-- type
121+
| | |--> EtherType::Internet_Protocol_version_4
122+
| | [2048]
123+
| |-- ipv4
124+
| |-- version -> 4
125+
| |-- hdr_len -> 20
126+
| |-- tos
127+
| | |-- pre -> ToSPrecedence::Routine [0]
128+
| | |-- del -> ToSDelay::NORMAL [0]
129+
| | |-- thr -> ToSThroughput::NORMAL [0]
130+
| | |-- rel -> ToSReliability::NORMAL [0]
131+
| | |-- ecn -> ToSECN::Not_ECT [0]
132+
| |-- len -> 328
133+
| |-- id -> 1093
134+
| |-- flags
135+
| | |-- df -> False
136+
| | |-- mf -> False
137+
| |-- offset -> 0
138+
| |-- ttl -> 128.0
139+
| |-- protocol -> TransType::UDP [17]
140+
| |-- checksum -> 00 00
141+
| |-- src -> 192.168.0.1
142+
| |-- dst -> 192.168.0.10
143+
| |-- udp
144+
| |-- srcport -> 67
145+
| |-- dstport -> 68
146+
| |-- len -> 308
147+
| |-- checksum -> 22 33
148+
| |-- raw
149+
| |-- protocol -> NIL
150+
| |-- packet
151+
| | |--> 02 01 06 00 00 00 3d 1d 00 00 00 00 00 00 00 00
152+
| | c0 a8 00 0a c0 a8 00 01 00 00 00 00 00 0b 82 01
153+
| | fc 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00
154+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
155+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
156+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
157+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
158+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
159+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
160+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
161+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
162+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
163+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
164+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
165+
| | 00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63
166+
| | 35 01 02 01 04 ff ff ff 00 3a 04 00 00 07 08 3b
167+
| | 04 00 00 0c 4e 33 04 00 00 0e 10 36 04 c0 a8 00
168+
| | 01 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
169+
| | 00 00 00 00 00 00 00 00 00 00 00 00
170+
| |-- error -> NIL
171+
|-- protocols -> Ethernet:IPv4:UDP:Raw
172+
173+
Frame 3
174+
|-- type -> BlockType::Enhanced_Packet_Block [6]
175+
|-- length -> 348
176+
|-- section_number -> 1
177+
|-- number -> 3
178+
|-- interface_id -> 0
179+
|-- timestamp -> 2004-12-06T03:16:24.387484+08:00
180+
|-- timestamp_epoch -> 1102302984.387484
181+
|-- captured_len -> 314
182+
|-- original_len -> 314
183+
|-- options -> NIL
184+
|-- ethernet
185+
| |-- dst -> ff:ff:ff:ff:ff:ff
186+
| |-- src -> 00:0b:82:01:fc:42
187+
| |-- type
188+
| | |--> EtherType::Internet_Protocol_version_4
189+
| | [2048]
190+
| |-- ipv4
191+
| |-- version -> 4
192+
| |-- hdr_len -> 20
193+
| |-- tos
194+
| | |-- pre -> ToSPrecedence::Routine [0]
195+
| | |-- del -> ToSDelay::NORMAL [0]
196+
| | |-- thr -> ToSThroughput::NORMAL [0]
197+
| | |-- rel -> ToSReliability::NORMAL [0]
198+
| | |-- ecn -> ToSECN::Not_ECT [0]
199+
| |-- len -> 300
200+
| |-- id -> 43063
201+
| |-- flags
202+
| | |-- df -> False
203+
| | |-- mf -> False
204+
| |-- offset -> 0
205+
| |-- ttl -> 250.0
206+
| |-- protocol -> TransType::UDP [17]
207+
| |-- checksum -> 17 8a
208+
| |-- src -> 0.0.0.0
209+
| |-- dst -> 255.255.255.255
210+
| |-- udp
211+
| |-- srcport -> 68
212+
| |-- dstport -> 67
213+
| |-- len -> 280
214+
| |-- checksum -> 9f bd
215+
| |-- raw
216+
| |-- protocol -> NIL
217+
| |-- packet
218+
| | |--> 01 01 06 00 00 00 3d 1e 00 00 00 00 00 00 00 00
219+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 0b 82 01
220+
| | fc 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00
221+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
222+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
223+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
224+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
225+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
226+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
227+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
228+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
229+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
230+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
231+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
232+
| | 00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63
233+
| | 35 01 03 3d 07 01 00 0b 82 01 fc 42 32 04 c0 a8
234+
| | 00 0a 36 04 c0 a8 00 01 37 04 01 03 06 2a ff 00
235+
| |-- error -> NIL
236+
|-- protocols -> Ethernet:IPv4:UDP:Raw
237+
238+
Frame 4
239+
|-- type -> BlockType::Enhanced_Packet_Block [6]
240+
|-- length -> 376
241+
|-- section_number -> 1
242+
|-- number -> 4
243+
|-- interface_id -> 0
244+
|-- timestamp -> 2004-12-06T03:16:24.387798+08:00
245+
|-- timestamp_epoch -> 1102302984.387798
246+
|-- captured_len -> 342
247+
|-- original_len -> 342
248+
|-- options -> NIL
249+
|-- ethernet
250+
| |-- dst -> 00:0b:82:01:fc:42
251+
| |-- src -> 00:08:74:ad:f1:9b
252+
| |-- type
253+
| | |--> EtherType::Internet_Protocol_version_4
254+
| | [2048]
255+
| |-- ipv4
256+
| |-- version -> 4
257+
| |-- hdr_len -> 20
258+
| |-- tos
259+
| | |-- pre -> ToSPrecedence::Routine [0]
260+
| | |-- del -> ToSDelay::NORMAL [0]
261+
| | |-- thr -> ToSThroughput::NORMAL [0]
262+
| | |-- rel -> ToSReliability::NORMAL [0]
263+
| | |-- ecn -> ToSECN::Not_ECT [0]
264+
| |-- len -> 328
265+
| |-- id -> 1094
266+
| |-- flags
267+
| | |-- df -> False
268+
| | |-- mf -> False
269+
| |-- offset -> 0
270+
| |-- ttl -> 128.0
271+
| |-- protocol -> TransType::UDP [17]
272+
| |-- checksum -> 00 00
273+
| |-- src -> 192.168.0.1
274+
| |-- dst -> 192.168.0.10
275+
| |-- udp
276+
| |-- srcport -> 67
277+
| |-- dstport -> 68
278+
| |-- len -> 308
279+
| |-- checksum -> df db
280+
| |-- raw
281+
| |-- protocol -> NIL
282+
| |-- packet
283+
| | |--> 02 01 06 00 00 00 3d 1e 00 00 00 00 00 00 00 00
284+
| | c0 a8 00 0a 00 00 00 00 00 00 00 00 00 0b 82 01
285+
| | fc 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00
286+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
287+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
288+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
289+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
290+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
291+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
292+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
293+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
294+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
295+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
296+
| | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
297+
| | 00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63
298+
| | 35 01 05 3a 04 00 00 07 08 3b 04 00 00 0c 4e 33
299+
| | 04 00 00 0e 10 36 04 c0 a8 00 01 01 04 ff ff ff
300+
| | 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
301+
| | 00 00 00 00 00 00 00 00 00 00 00 00
302+
| |-- error -> NIL
303+
|-- protocols -> Ethernet:IPv4:UDP:Raw

test/test_pcapng.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
import pcapkit
44

5-
plist = pcapkit.extract(fin='../sample/test.pcapng',
5+
plist = pcapkit.extract(fin='../sample/dhcp.pcapng',
66
fout='../sample/pcapng.txt', format='tree', verbose=True)

0 commit comments

Comments
 (0)