lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
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
#! /usr/bin/env python
 
# This file is part of Scapy
# Scapy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# any later version.
#
# Scapy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Scapy. If not, see <http://www.gnu.org/licenses/>.
 
# scapy.contrib.description = AVS WLAN Monitor Header
# scapy.contrib.status = loads
 
from scapy.packet import *
from scapy.fields import *
from scapy.layers.dot11 import *
 
AVSWLANPhyType =  { 0 : "Unknown",
                    1 : "FHSS 802.11 '97",
                    2 : "DSSS 802.11 '97", 
                    3 : "IR Baseband",
                    4 : "DSSS 802.11b",
                    5 : "PBCC 802.11b", 
                    6 : "OFDM 802.11g",
                    7 : "PBCC 802.11g",
                    8 : "OFDM 802.11a" }
 
AVSWLANEncodingType =  { 0 : "Unknown",
                         1 : "CCK",
                         2 : "PBCC",
                         3 : "OFDM"}
 
AVSWLANSSIType = { 0 : "None",
                   1 : "Normalized RSSI",
                   2 : "dBm",
                   3 : "Raw RSSI"}
 
AVSWLANPreambleType = { 0 : "Unknown",
                        1 : "Short",
                        2 : "Long" }
 
 
class AVSWLANHeader(Packet):
        """ iwpriv eth1 set_prismhdr 1 """
        name = "AVS WLAN Monitor Header"
        fields_desc = [   IntField("version",1),
                          IntField("len",64),
                         LongField("mactime",0),
                         LongField("hosttime",0),
                      IntEnumField("phytype",0, AVSWLANPhyType),
                          IntField("channel",0),
                          IntField("datarate",0),
                          IntField("antenna",0),
                          IntField("priority",0),
                      IntEnumField("ssi_type",0, AVSWLANSSIType),
                    SignedIntField("ssi_signal",0),
                    SignedIntField("ssi_noise",0),
                      IntEnumField("preamble",0, AVSWLANPreambleType),
                      IntEnumField("encoding",0, AVSWLANEncodingType),
                        ]
 
bind_layers(AVSWLANHeader, Dot11)