File: icmp6.py

package info (click to toggle)
python-libtrace 1.6-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 2,160 kB
  • sloc: ansic: 6,886; python: 3,187; sh: 79; makefile: 70
file content (23 lines) | stat: -rwxr-xr-x 403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

# Thu, 13 Mar 14 (PDT)
# icmp6.py: Demonstrate ICMP6 (v6) header decodes
# Copyright (C) 2015, Nevil Brownlee, U Auckland | WAND

from plt_testing import *

t = get_example_trace('icmp6-sample.pcap')

n = 0;  offset = 12

for pkt in t:
    icmp6 = pkt.icmp6
    if not icmp6:
        continue
    n += 1

    print "%5d: " % (n),
    print_icmp6(icmp6, offset)
    print

t.close