-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconf.help
630 lines (487 loc) · 18.9 KB
/
conf.help
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
This is help file for the pgen configuration file. It gives a minimal
information about all possible options. pgen expects the user to give options
in the same order that appears in a packet. Also some sample conf files have
been given in sample_confs directory.
***** Common *****
1. BUFF_SIZE
Size of the packet buffer. Any decimal/hex number in the range of an 32-bit
interger. Memory will be allocated for the given size and data will be written
in that.
pgen doesn't do any validity check whether the packet buffer is sufficient
to write the data. So the user has to be more clever while choosing size. And
if extra non-used bytes are there in the packet buffer after writing data, pgen
will cut them before sending the packet in wire.
2. IF_NAME
Name of the network interface through which the packet will be sent. pgen
will verify whether the interface is present and UP. If the interface is not
connected to outside network, pgen will show success but the packet will not
be sent.
3. PK_DST_MAC
The mac address of the destination node. Should be given regular ':'
seperated form
***** Ethernet Header *****
1. ETHER_HEADER
Start of ether header. pgen will start processing the options following
this as part of ether-header options.
2. DST_MAC
The mac address that will be filled at the ether-header's Destination mac
field. Mac address should be in regular ':' seperated form.
3. SRC_MAC
The mac address that will be filled at the ether-header's Source mac field.
Mac address should be in ':' seperated form.
4. ETHR_TYPE
The type of the packet that follows ether-header. Any decimal/hex integer
value.
ARP 2054
IPV6 34525
***** ARP Header *****
1. ARP
Starting of ARP packet.
2. ARP_HW_TYPE
Type of the network interface hardware.
ETHERNET 1
3. ARP_HW_LEN
Hardware address length. For ethernet interface, the hardware address is
mac address of the interface. It is 6 bytes long
ETHERNET 6
4. ARP_PROTO_TYPE
L3 protocol type. Mostly IPv4.
IPv4 2048
5. ARP_PROTO_LEN
Length of L3 protocol address. For IPv4 address is 4 bytes.
IPv4 4
6. ARP_OPCODE
ARP operation code.
REQUEST 1
REPLY 2
RARP_REQUEST 3
RARP_REPLY 4
IN_ARP_REQUEST 8
IN_ARP_REPLY 9
ARP_NAK 10
7. ARP_SRC_MAC
Mac address that will be filled at Source Hardware Address field of the
ARP packet.
8. ARP_SRC_IP
IP protocol address that will be filled at Source Protocol Address field
of the ARP packet.
9. ARP_DST_MAC
Mac address that will be filled at Destination Hardware Address field of
the ARP packet.
10. ARP_DST_IP
IP address that will be filled at Destination Protocol Address field of
the ARP packet.
***** IPv6 *****
1. IPV6
IPv6 packet information starts here.
2. IPV6_VERSION
Version of the IP protocol. A 4-bit entity. Of course the value is 6 for
IPv6 protocol.
IPv6 6
3. IPV6_TRAFFIC_CLASS
The traffic class for the packet. An 8-bit entity. The value ranges from
0 to 255
4. IPV5_FLOW_LABEL
Flow label for the IPv6 packet. A 20-bit entity.
5. IPV6_PAYLOAD_LENGTH
The payload length in bytes of the IPv6 packet. Receiver must process only
till this length of any received IPv6 packet. The bits after this length must
be ignored. So the user must be careful while entering payload length. It is a
16-bit long.
6. IPV6_NEXT_HEADER
The next header value that follows the IPv6 header.
Hop-by-Hop 0
Destination-option 60
Routing 43
Fragment 44
ICMPv6 58
7. IPV6_HOP_LIMIT
The hop limit value of the IPv6 packet. 8-bit long entity accepts any
decimal/hex value in range
8. IPV6_SRC_ADDR
IPv6 source address that will be placed in the IPv6 packet's Source Address
field. IPv6 address short forms are accepted.
9. IPV6_DST_ADDR
IPv6 Destination address. As source address, it also accepts short form of
IPv6 address.
10. IPV6_EXT_HDRS
Number of IPv6 extension headers that follows the IPv6 header. This is for
control of pgen. It won't placed in the packet. pgen will expect exactly that
many IPv6 extension headers.
***** IPv6 Extension Headers *****
Hop-by-Hop option header-------------------------------------------------------
1. HOP_BY_HOP
Start of Hop-by-Hop option header
2. HBH_NXT_HDR
The next header that follows this Hop-by-Hop option header. Read
IPV6_NEXT_HEADER for supported next header values.
3. HBH_HDR_EXT_LEN
Header extension length of IPv6 Hop-by-Hop option header. 1-bit entity.
This must be the length of HBH extension header devide by 8 minus 1.
ext_len = (len(hbh_hdr) * 8) - 1
4. HBH_OPTION_NUM
Number of options to be included.
5. HBH_OPTION
The Hop-by-Hop option. pgen supports following options
* PAD1
* PADN
- PADN_N should follow PADN to specify number of bytes to be padded.
* RAW
- RAW_DATA should follow RAW indicating the hex stream of RAW data.
-------------------------------------------------------------------------------
Destination Option Header------------------------------------------------------
1. DESTINATION_HEADER
Start of the Destination Option Header
2. DH_NXT_HDR
Next header value that follows this Destination Option Header. Read
IPV6_NEXT_HEADER for supported next header values.
3. DH_HDR_EXT_LEN
Length of the Destination Option Header.
ext_len = (len(dh_hdr) * 8) - 1
4. DH_OPTION_NUM
Number of options to be included in Destination Header.
5. DH_OPTION
The Destination option. pgen supports following options.
* PAD1
* PADN
- PADN_N should follow PADN to specify number of bytes to be padded.
* RAW
- RAW_DATA should follow RAW indicating the hex stream of RAW data.
-------------------------------------------------------------------------------
Routing Header-----------------------------------------------------------------
1. ROUTING_HEADER
The Routing Header starts here
2. RH_NXT_HDR
The next header value that follows this Routing Header. Read
IPV6_NEXT_HEADER for supported next header values.
3. RH_EXT_LEN
Lenth of Routing Extension Header. Calculate with following formula
ext_len = ((len(rh) * 8) - 1
4. RH_TYPE
Routing Header Type. An 8-bit entity. As of now only type-0 routing header
is supported by pgen. But unfortunately type-0 routing header is deprecated.
5. RH_SEG_LEFT
Number of Routing Header segments left. It is an 8-bit long field.
6. RH_DATA
Start of Routing Header data implies the segments.
7. RH_ADDR
Routing header segments. One for each line. Use as many of this option as
as you gave in RH_SEG_LEFT.
--- For Type-3 Routing Header ---
8. RH_CMPRI
Number of compression bytes that will be elided from IPv6 address prefix.
Not for last segment. [0 - 16]
9. RH_CMPRI
Number of compression bytes that will be elided from last IPv6 address
prefix. [0 - 16]
10. RH_PAD
Number of padding bytes after last segment. As IPv6 address compression is
enabled, Segments left need not to be the half of the length. So total length
may not be in multiple of 8 octets. In such cases padding bytes will be used.
Use -1 for pgen to calculate padding bytes to nearest 8 octet multiple.
11. RH_OP_NUM
Number of IPv6 address or in other words number of segments. Used for
pgen control purpose. This data will not be added to packet. Receiver could
able to calculate number of segments from Length, CMPR-I, CMPR-E, pad data.
No. Of Items = 1 + ((Length - pad - (16 - CMPR-E)) / CMPR-I)
12. RH_ADDR
Refer 7.RH_ADDR
-------------------------------------------------------------------------------
IPv6 Fragment Header-----------------------------------------------------------
1. FRAGMENT_HEADER
Start of IPv6 Fragment Header
2. FH_NXT_HDR
The next header value that follows this Fragment Header. Read
IPV6_NEXT_HDEADER for supported next header values.
3. FH_OFFSET
Offset of the current fragment. A 13-bit field.
4. FH_M_FLAG
The M-flag of IPv6 fragment header. 1-bit entity. If set it means that
fragments follows. Otherwise no more fragments after this fragment.
5. FH_IDENTIFICATION
Packet identification value. Generated by source node used for packet
re-assembly.
-------------------------------------------------------------------------------
***** ICMPv6 *****
This first four options specifies the ICMPv6 packet header. Whatever the
packet type is, this header format will remain same. So pgen seperates the
ICMPv6 header and packet.
1. ICMP6
Start of ICMPv6 packet.
2. ICMP6_TYPE
Type of ICMPv6 message. pgen supported types are,
ECHO6_REQUEST 128
ECHO6_REPLY 129
ROUTER_SOLICITATION 133
ROUTER_ADVERTISEMENT 134
NEIGHBOR_SOLICITATION 135
NEIGHBOR_ADVERTISEMENT 136
3. ICMP6_CODE
ICMP6 message code. Provides additional level of message granularity.
4. ICMP6_CHECKSUM
Checksum value of the ICMPv6 message. pgen provides an option to user to
give his own checksum. Or if user provides -1, pgen will calculate checksum
by itself for the ICMPv6 pcaket.
Router Advertisement-----------------------------------------------------------
1. NDISC_RA
Start of the Router Advertisement packet
2. NDISC_RA_CUR_HOP_LIMIT
Cur-Hop-Limit that will be filled in the RA packet.
3. NDISC_RA_M_FLAG
The M-flag of RA. 1 for set and 0 for reset.
4. NDISC_RA_O_FLAG
The O-flag of RA. 1 for set and 0 for reset.
5. NDISC_RA_ROUTER_LIFETIME
Router Lifetime
6. NDISC_RA_REACHABLE_TIME
Reachable Time
7. NDISC_RA_RETRANS_TIMER
Retrans timer
8. NDISC_RA_OPTION_NUM
Number of RA options that included in this RA packet
9. NDISC_RA_OPTION
Here the RA option starts. pgen expects that the option fields should be in
order. pgen will through erro if the order changes. pgen supported RA options
are,
NDISC_RA_PREFIX_INFO
NDISC_RA_SRC_LINK_ADDR
NDISC_RA_MTU
NDISC_RA_RDNSS
NDISC_RA_DNSSL
RAW
Raw hex data that will be dumped. Should be followed by RAW_DATA
--- Common RA option fields ---
10. NDISC_RA_OP_TYPE
Type of RA option. pgen supports following types,
NDISC_RA_PREFIX_INFO 3
NDISC_RA_SRC_LINK_ADDR 1
NDISC_RA_TAR_LINK_ADDR 1
NDISC_RA_MTU 5
NDISC_RA_RDNSS 25
NDISC_RA_RDNSL 31
11. NDISC_RA_OP_LEN
Length of the RA option in 8-octets unit.
--- For RA Prefix option ---
12. NDISC_RA_PREFIX_LEN
Prefix Length
13. NDISC_RA_L_FLAG
L flag. 1 for set and 0 for reset
14. NDISC_RA_A_FLAG
A flag. 1 for set and 0 for reset
15. NDISC_RA_PREFIX_VALID_LIFETIME
Valid lifetime for the prefix
16. NDISC_RA_PREFIX_PREFERRED_LIFETIME
Preferred lifetime for the prefix
17. NDISC_RA_PREFIX
The prefix itself. As of now, pgen not accepts short for of prefix. The
user has to give full prefix value.
--- For Source Link Layer Address option ---
18. NDISC_RA_OP_SRC_LINK_ADDR
The Source Link Layer Address. As of now the MAC address of the underlying
hardware. For Target Link Layer Address option, use NDISC_RA_TYPE value 2.
--- For MTU option ---
19. NDISC_RA_MTU
The MTU value.
--- For RDNSS option ---
20. NDISC_RA_OP_LIFETIME
Lifetime of supplied Recursive DNS Servers in seconds.
21. NDISC_RA_OP_DNS_ADDR
The Recursive DNS Server address. Number of RDNSS address is based on
option length given in NDISC_RA_OP_LEN.
No. of RDNSS address = (option_length - 1) / 2
--- For DNSSL option ---
22. NDISC_RA_OP_LIFETIME
Lifetime in seconds for the DNS Server List supplied.
23. NDISC_RA_OP_NUM
Number of DNS Servers that will be supplied by this option. Unlike RDNSS,
number of DNSSL couldn't be calculated from the option length. Because all
DNSSL are not same length. So user has to be clever while filling length.
24. NDISC_RA_OP_NAME
DNSSL server name. Each DNSSL in seperate option.
-------------------------------------------------------------------------------
Router Solicitation------------------------------------------------------------
1. NDISC_RS
Starting of Router Solicitation message
2. NDISC_RS_OPTION
The Router Solicitaion option. pgen supports followint RS options
NDISC_RS_SRC_LINK_ADDR
RAW
Raw hex data that will be dumped. Should be followed by RAW_DATA
3. NDISC_RS_OP_TYPE
Option type for the RS option. For Target Source Link Layer address option
use NDISC_RS_OP_TYPE as 2
4. NDISC_RS_OP_LEN
Option length in 8-bit octet unit.
5. NDISC_RS_SRC_LINK_ADDR
The Link Layer Address. As of now the Hardware mac address Source/Target
-------------------------------------------------------------------------------
Neighbor Advertisement---------------------------------------------------------
1. NDISC_NA
NA data starts here
2. NDISC_NA_R
NA R flag. 1 for set and 0 for reset
3. NDISC_NA_S
NA S flag. 1 for set and 0 for reset
4. NDISC_NA_O
NA O flag. 1 for set and 0 for reset
5. NDISC_NA_TARGET_ADDR
The target address from which this advertisement is being sent
6. NDISC_NA_OPTION
The NA option. pgen supports
NDISC_NA_SRC_LINK_ADDR
RAW
Raw hex data that will be dumped. Should be followed by RAW_DATA
7. NDISC_NA_OP_TYPE
Type of NA option. For Target Link Layer Address, type will be 2
8. NDISC_NA_OP_LEN
Length of NA option in 8-octets unit
9. NDISC_NA_OP_TAR_LINK_ADDR
The Target Link Layer Address. The Hardware MAC address.
-------------------------------------------------------------------------------
Neighbor Solicitation----------------------------------------------------------
1. NDISC_NS
Neighbor Solicitaion starts here
2. NDISC_NS_TARGET_ADDR
Target Address of NS
3. NDISC_NS_OPTION
Neighbor Soliciation option. The only supported option is
NDISC_NS_SRC_LINK_ADDR
RAW
Raw hex data that will be dumped. Should be followed by RAW_DATA
3. NDISC_NS_OP_TYPE
Type of NS option. 1 for Source Link Layer Address option and 2 for Target
Link Layer Address option.
4. NDISC_NS_OP_LEN
Length of NS option in 8-octets unit
5. NDISC_NS_OP_SRC_LINK_ADDR
Source Link Layer Address. The hardware MAC address of the sender.
-------------------------------------------------------------------------------
ICMPv6 Echo--------------------------------------------------------------------
1. ECHO6
The ICMPv6 Echo packet starts here
2. ECHO6_IDENTIFIER
Identifier of the Echo6 packet
3. ECHO6_SEQ
Sequence of Echo6 packet
4. ECHO6_DATA
Data for Echo6 packet.
NO_DATA For no data
Or the user has to give the data he wants in hex.
-------------------------------------------------------------------------------
***** UDP *****
1. UPD
UDP packet starts here
2. UDP_SRC_PORT
Source port of UDP datagram
3. UDP_DST_PORT
Destination port of UDP datagram
4. UDP_LEN
Actual length of UDP packet
5. UDP_CHECKSUM
Checksum of the UDP datagram. User can enter his desired checksum manually
or could use -1 for pgen to calculate the checksum.
6. UDP_DATA
The data that is encapsulted in an UDP datagram. Actually the type. As of
now pgen supports following types.
* NO_DATA For no data actually after UDP header
* DHCPV6 For DHCPv6 packet
***** DHCPv6 *****
1. DHCP6_MSG_TYPE
Type of the dhcp6 message.
2. DHCP6_TRANS_ID
Transaction ID of the dhcp6 transaction
3. DHCP6_OP_NUM
Number options that dhcp6 packet has
DHCPV6_OPTION------------------------------------------------------------------
4. DHCP6_OP_CODE
Dhcp6 option code
5. DHCP6_OP_LEN
Length of dhcp6 option
6. DHCP6_OPTION
The dhcp6 option. Supported options are
* DHCP6_CLIENT_ID Client identifier option
* DHCP6_SERVER_ID Server identifier option
* DHCP6_ORO Option Request option
* DHCP6_OP_PREF Preference option
* DHCP6_OP_ELAPSED_TIME Elapsed Time option
* DHCP6_OP_SERVER_UNICAST Server Unicast Option
* DHCP6_OPTION_IANA IANA Option
* DHCP6_OPTION_IATA IATA Option
* DHCP6_STATUS_CODE Status Code Option
* DHCP6_RAPID_COMMIT Rapid Commit option
* DHCP6_USER_CLASS User Class option
* DHCP6_VENDER_CLASS Vender Class option
-------------------------------------------------------------------------------
Client Identifier Option-------------------------------------------------------
7. DHCP6_CLIENT_ID
DUID of Client Identifier Option
Server Identifier Option-------------------------------------------------------
8. DHCP6_SERVER_ID
DUID Of Server. Given hex value will be dumped in packet
-------------------------------------------------------------------------------
Option Request Option----------------------------------------------------------
8. DHCP6_ORC
Option Request Code. The code of the option, which is being requested.
Number of requested optinos will be obtained from length of the option. So user
has to give len/2 entries of this options
-------------------------------------------------------------------------------
Preference Option--------------------------------------------------------------
9. DHCP6_OP_PREF
Preference value for the server.
-------------------------------------------------------------------------------
Elapsed Time Option------------------------------------------------------------
10. DHCP6_OP_ELAPSED_TIME
The amount of time since the client began its current DHCP transaction.
This time is expressed in hundredths of a second (10^-2 seconds).
-------------------------------------------------------------------------------
Server Unicast Option----------------------------------------------------------
11. DHCP6_OP_SER_UNICAST_ADDR
The IP address to which the client should send messages delivered using
unicast.
-------------------------------------------------------------------------------
IANA Option--------------------------------------------------------------------
12. DHCP6_IANA_IAID
The unique identifier for the IA_NA.
13. DHCP6_IANA_T1
T1 in seconds
14. DHCP6_IANA_T2
T2 in sedonds
15. DHCP6_IANA_OP_NUM
Number of options the IANA option have. As of now now options identified.
-------------------------------------------------------------------------------
IATA Option--------------------------------------------------------------------
16. DHCP6_IATA_IAID
The unique identifier for the IA_TA
-------------------------------------------------------------------------------
Status Code Option-------------------------------------------------------------
18. DHCP6_OP_STATUS_CODE
Status code of the message. Possible options
SUCCESS 0
UNSPECFAIL 1
NOADDRAVAIL 2
NOBINDING 3
NOTONLINK 4
USEMULTICAST 5
[Any decimal/hex number]
19. DHCP6_OP_STATUS_MSG
Hex code of the status message.
-------------------------------------------------------------------------------
Rapid Commit Option------------------------------------------------------------
No specific options as of now
-------------------------------------------------------------------------------
User Class Option--------------------------------------------------------------
20. DHCP6_OP_USR_CLS_NUM
Number of user class data in the option
21. DHCP6_OP_USR_CLS_LEN
Length of the user class option data.
22. DHCP6_OP_USR_CLS_DATA
The opaque user class data itself.
-------------------------------------------------------------------------------
Vender Class Option------------------------------------------------------------
23. DHCP6_OP_VND_ENT_NO
Vender enterprise number as registered with IANA
24. DHCP6_OP_VND_CLS_LEN
Length of the vender class option data followed
25. DHCP6_OP_VND_CLS_DATA
The opaque vender class data.
-------------------------------------------------------------------------------