| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
from scapy import * |
|---|
| 4 |
|
|---|
| 5 |
AVSWLANPhyType = { 0 : "Unknown", |
|---|
| 6 |
1 : "FHSS 802.11 '97", |
|---|
| 7 |
2 : "DSSS 802.11 '97", |
|---|
| 8 |
3 : "IR Baseband", |
|---|
| 9 |
4 : "DSSS 802.11b", |
|---|
| 10 |
5 : "PBCC 802.11b", |
|---|
| 11 |
6 : "OFDM 802.11g", |
|---|
| 12 |
7 : "PBCC 802.11g", |
|---|
| 13 |
8 : "OFDM 802.11a" } |
|---|
| 14 |
|
|---|
| 15 |
AVSWLANEncodingType = { 0 : "Unknown", |
|---|
| 16 |
1 : "CCK", |
|---|
| 17 |
2 : "PBCC", |
|---|
| 18 |
3 : "OFDM"} |
|---|
| 19 |
|
|---|
| 20 |
AVSWLANSSIType = { 0 : "None", |
|---|
| 21 |
1 : "Normalized RSSI", |
|---|
| 22 |
2 : "dBm", |
|---|
| 23 |
3 : "Raw RSSI"} |
|---|
| 24 |
|
|---|
| 25 |
AVSWLANPreambleType = { 0 : "Unknown", |
|---|
| 26 |
1 : "Short", |
|---|
| 27 |
2 : "Long" } |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
class AVSWLANHeader(Packet): |
|---|
| 31 |
""" iwpriv eth1 set_prismhdr 1 """ |
|---|
| 32 |
name = "AVS WLAN Monitor Header" |
|---|
| 33 |
fields_desc = [ IntField("version",1), |
|---|
| 34 |
IntField("len",64), |
|---|
| 35 |
LongField("mactime",0), |
|---|
| 36 |
LongField("hosttime",0), |
|---|
| 37 |
IntEnumField("phytype",0, AVSWLANPhyType), |
|---|
| 38 |
IntField("channel",0), |
|---|
| 39 |
IntField("datarate",0), |
|---|
| 40 |
IntField("antenna",0), |
|---|
| 41 |
IntField("priority",0), |
|---|
| 42 |
IntEnumField("ssi_type",0, AVSWLANSSIType), |
|---|
| 43 |
SignedIntField("ssi_signal",0), |
|---|
| 44 |
SignedIntField("ssi_noise",0), |
|---|
| 45 |
IntEnumField("preamble",0, AVSWLANPreambleType), |
|---|
| 46 |
IntEnumField("encoding",0, AVSWLANEncodingType), |
|---|
| 47 |
] |
|---|
| 48 |
|
|---|
| 49 |
bind_layers(AVSWLANHeader, Dot11, { }) |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
cap=rdpcap("avswlan.cap") |
|---|
| 56 |
p=cap[0] |
|---|
| 57 |
print p.summary() |
|---|
| 58 |
p=AVSWLANHeader(str(p)) |
|---|
| 59 |
print p.summary() |
|---|
| 60 |
p.show() |
|---|