summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go')
-rw-r--r--src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go959
1 files changed, 901 insertions, 58 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go
index fdf949e101d..3843d70bd20 100644
--- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go
+++ b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/google/gopacket/layers/dot11.go
@@ -13,9 +13,10 @@ import (
"bytes"
"encoding/binary"
"fmt"
- "github.com/google/gopacket"
"hash/crc32"
"net"
+
+ "github.com/google/gopacket"
)
// Dot11Flags contains the set of 8 flags in the IEEE 802.11 frame control
@@ -239,24 +240,178 @@ func (a Dot11Algorithm) String() string {
type Dot11InformationElementID uint8
-// TODO: Verify these element ids, and append more ids if more.
-
const (
- Dot11InformationElementIDSSID Dot11InformationElementID = 0
- Dot11InformationElementIDRates Dot11InformationElementID = 1
- Dot11InformationElementIDFHSet Dot11InformationElementID = 2
- Dot11InformationElementIDDSSet Dot11InformationElementID = 3
- Dot11InformationElementIDCFSet Dot11InformationElementID = 4
- Dot11InformationElementIDTIM Dot11InformationElementID = 5
- Dot11InformationElementIDIBSSSet Dot11InformationElementID = 6
- Dot11InformationElementIDChallenge Dot11InformationElementID = 16
- Dot11InformationElementIDERPInfo Dot11InformationElementID = 42
- Dot11InformationElementIDQOSCapability Dot11InformationElementID = 46
- Dot11InformationElementIDERPInfo2 Dot11InformationElementID = 47
- Dot11InformationElementIDRSNInfo Dot11InformationElementID = 48
- Dot11InformationElementIDESRates Dot11InformationElementID = 50
- Dot11InformationElementIDVendor Dot11InformationElementID = 221
- Dot11InformationElementIDReserved Dot11InformationElementID = 68
+ Dot11InformationElementIDSSID Dot11InformationElementID = 0
+ Dot11InformationElementIDRates Dot11InformationElementID = 1
+ Dot11InformationElementIDFHSet Dot11InformationElementID = 2
+ Dot11InformationElementIDDSSet Dot11InformationElementID = 3
+ Dot11InformationElementIDCFSet Dot11InformationElementID = 4
+ Dot11InformationElementIDTIM Dot11InformationElementID = 5
+ Dot11InformationElementIDIBSSSet Dot11InformationElementID = 6
+ Dot11InformationElementIDCountryInfo Dot11InformationElementID = 7
+ Dot11InformationElementIDHoppingPatternParam Dot11InformationElementID = 8
+ Dot11InformationElementIDHoppingPatternTable Dot11InformationElementID = 9
+ Dot11InformationElementIDRequest Dot11InformationElementID = 10
+ Dot11InformationElementIDQBSSLoadElem Dot11InformationElementID = 11
+ Dot11InformationElementIDEDCAParamSet Dot11InformationElementID = 12
+ Dot11InformationElementIDTrafficSpec Dot11InformationElementID = 13
+ Dot11InformationElementIDTrafficClass Dot11InformationElementID = 14
+ Dot11InformationElementIDSchedule Dot11InformationElementID = 15
+ Dot11InformationElementIDChallenge Dot11InformationElementID = 16
+ Dot11InformationElementIDPowerConst Dot11InformationElementID = 32
+ Dot11InformationElementIDPowerCapability Dot11InformationElementID = 33
+ Dot11InformationElementIDTPCRequest Dot11InformationElementID = 34
+ Dot11InformationElementIDTPCReport Dot11InformationElementID = 35
+ Dot11InformationElementIDSupportedChannels Dot11InformationElementID = 36
+ Dot11InformationElementIDSwitchChannelAnnounce Dot11InformationElementID = 37
+ Dot11InformationElementIDMeasureRequest Dot11InformationElementID = 38
+ Dot11InformationElementIDMeasureReport Dot11InformationElementID = 39
+ Dot11InformationElementIDQuiet Dot11InformationElementID = 40
+ Dot11InformationElementIDIBSSDFS Dot11InformationElementID = 41
+ Dot11InformationElementIDERPInfo Dot11InformationElementID = 42
+ Dot11InformationElementIDTSDelay Dot11InformationElementID = 43
+ Dot11InformationElementIDTCLASProcessing Dot11InformationElementID = 44
+ Dot11InformationElementIDHTCapabilities Dot11InformationElementID = 45
+ Dot11InformationElementIDQOSCapability Dot11InformationElementID = 46
+ Dot11InformationElementIDERPInfo2 Dot11InformationElementID = 47
+ Dot11InformationElementIDRSNInfo Dot11InformationElementID = 48
+ Dot11InformationElementIDESRates Dot11InformationElementID = 50
+ Dot11InformationElementIDAPChannelReport Dot11InformationElementID = 51
+ Dot11InformationElementIDNeighborReport Dot11InformationElementID = 52
+ Dot11InformationElementIDRCPI Dot11InformationElementID = 53
+ Dot11InformationElementIDMobilityDomain Dot11InformationElementID = 54
+ Dot11InformationElementIDFastBSSTrans Dot11InformationElementID = 55
+ Dot11InformationElementIDTimeoutInt Dot11InformationElementID = 56
+ Dot11InformationElementIDRICData Dot11InformationElementID = 57
+ Dot11InformationElementIDDSERegisteredLoc Dot11InformationElementID = 58
+ Dot11InformationElementIDSuppOperatingClass Dot11InformationElementID = 59
+ Dot11InformationElementIDExtChanSwitchAnnounce Dot11InformationElementID = 60
+ Dot11InformationElementIDHTInfo Dot11InformationElementID = 61
+ Dot11InformationElementIDSecChanOffset Dot11InformationElementID = 62
+ Dot11InformationElementIDBSSAverageAccessDelay Dot11InformationElementID = 63
+ Dot11InformationElementIDAntenna Dot11InformationElementID = 64
+ Dot11InformationElementIDRSNI Dot11InformationElementID = 65
+ Dot11InformationElementIDMeasurePilotTrans Dot11InformationElementID = 66
+ Dot11InformationElementIDBSSAvailAdmCapacity Dot11InformationElementID = 67
+ Dot11InformationElementIDBSSACAccDelayWAPIParam Dot11InformationElementID = 68
+ Dot11InformationElementIDTimeAdvertisement Dot11InformationElementID = 69
+ Dot11InformationElementIDRMEnabledCapabilities Dot11InformationElementID = 70
+ Dot11InformationElementIDMultipleBSSID Dot11InformationElementID = 71
+ Dot11InformationElementID2040BSSCoExist Dot11InformationElementID = 72
+ Dot11InformationElementID2040BSSIntChanReport Dot11InformationElementID = 73
+ Dot11InformationElementIDOverlapBSSScanParam Dot11InformationElementID = 74
+ Dot11InformationElementIDRICDescriptor Dot11InformationElementID = 75
+ Dot11InformationElementIDManagementMIC Dot11InformationElementID = 76
+ Dot11InformationElementIDEventRequest Dot11InformationElementID = 78
+ Dot11InformationElementIDEventReport Dot11InformationElementID = 79
+ Dot11InformationElementIDDiagnosticRequest Dot11InformationElementID = 80
+ Dot11InformationElementIDDiagnosticReport Dot11InformationElementID = 81
+ Dot11InformationElementIDLocationParam Dot11InformationElementID = 82
+ Dot11InformationElementIDNonTransBSSIDCapability Dot11InformationElementID = 83
+ Dot11InformationElementIDSSIDList Dot11InformationElementID = 84
+ Dot11InformationElementIDMultipleBSSIDIndex Dot11InformationElementID = 85
+ Dot11InformationElementIDFMSDescriptor Dot11InformationElementID = 86
+ Dot11InformationElementIDFMSRequest Dot11InformationElementID = 87
+ Dot11InformationElementIDFMSResponse Dot11InformationElementID = 88
+ Dot11InformationElementIDQOSTrafficCapability Dot11InformationElementID = 89
+ Dot11InformationElementIDBSSMaxIdlePeriod Dot11InformationElementID = 90
+ Dot11InformationElementIDTFSRequest Dot11InformationElementID = 91
+ Dot11InformationElementIDTFSResponse Dot11InformationElementID = 92
+ Dot11InformationElementIDWNMSleepMode Dot11InformationElementID = 93
+ Dot11InformationElementIDTIMBroadcastRequest Dot11InformationElementID = 94
+ Dot11InformationElementIDTIMBroadcastResponse Dot11InformationElementID = 95
+ Dot11InformationElementIDCollInterferenceReport Dot11InformationElementID = 96
+ Dot11InformationElementIDChannelUsage Dot11InformationElementID = 97
+ Dot11InformationElementIDTimeZone Dot11InformationElementID = 98
+ Dot11InformationElementIDDMSRequest Dot11InformationElementID = 99
+ Dot11InformationElementIDDMSResponse Dot11InformationElementID = 100
+ Dot11InformationElementIDLinkIdentifier Dot11InformationElementID = 101
+ Dot11InformationElementIDWakeupSchedule Dot11InformationElementID = 102
+ Dot11InformationElementIDChannelSwitchTiming Dot11InformationElementID = 104
+ Dot11InformationElementIDPTIControl Dot11InformationElementID = 105
+ Dot11InformationElementIDPUBufferStatus Dot11InformationElementID = 106
+ Dot11InformationElementIDInterworking Dot11InformationElementID = 107
+ Dot11InformationElementIDAdvertisementProtocol Dot11InformationElementID = 108
+ Dot11InformationElementIDExpBWRequest Dot11InformationElementID = 109
+ Dot11InformationElementIDQOSMapSet Dot11InformationElementID = 110
+ Dot11InformationElementIDRoamingConsortium Dot11InformationElementID = 111
+ Dot11InformationElementIDEmergencyAlertIdentifier Dot11InformationElementID = 112
+ Dot11InformationElementIDMeshConfiguration Dot11InformationElementID = 113
+ Dot11InformationElementIDMeshID Dot11InformationElementID = 114
+ Dot11InformationElementIDMeshLinkMetricReport Dot11InformationElementID = 115
+ Dot11InformationElementIDCongestionNotification Dot11InformationElementID = 116
+ Dot11InformationElementIDMeshPeeringManagement Dot11InformationElementID = 117
+ Dot11InformationElementIDMeshChannelSwitchParam Dot11InformationElementID = 118
+ Dot11InformationElementIDMeshAwakeWindows Dot11InformationElementID = 119
+ Dot11InformationElementIDBeaconTiming Dot11InformationElementID = 120
+ Dot11InformationElementIDMCCAOPSetupRequest Dot11InformationElementID = 121
+ Dot11InformationElementIDMCCAOPSetupReply Dot11InformationElementID = 122
+ Dot11InformationElementIDMCCAOPAdvertisement Dot11InformationElementID = 123
+ Dot11InformationElementIDMCCAOPTeardown Dot11InformationElementID = 124
+ Dot11InformationElementIDGateAnnouncement Dot11InformationElementID = 125
+ Dot11InformationElementIDRootAnnouncement Dot11InformationElementID = 126
+ Dot11InformationElementIDExtCapability Dot11InformationElementID = 127
+ Dot11InformationElementIDAgereProprietary Dot11InformationElementID = 128
+ Dot11InformationElementIDPathRequest Dot11InformationElementID = 130
+ Dot11InformationElementIDPathReply Dot11InformationElementID = 131
+ Dot11InformationElementIDPathError Dot11InformationElementID = 132
+ Dot11InformationElementIDCiscoCCX1CKIPDeviceName Dot11InformationElementID = 133
+ Dot11InformationElementIDCiscoCCX2 Dot11InformationElementID = 136
+ Dot11InformationElementIDProxyUpdate Dot11InformationElementID = 137
+ Dot11InformationElementIDProxyUpdateConfirmation Dot11InformationElementID = 138
+ Dot11InformationElementIDAuthMeshPerringExch Dot11InformationElementID = 139
+ Dot11InformationElementIDMIC Dot11InformationElementID = 140
+ Dot11InformationElementIDDestinationURI Dot11InformationElementID = 141
+ Dot11InformationElementIDUAPSDCoexistence Dot11InformationElementID = 142
+ Dot11InformationElementIDWakeupSchedule80211ad Dot11InformationElementID = 143
+ Dot11InformationElementIDExtendedSchedule Dot11InformationElementID = 144
+ Dot11InformationElementIDSTAAvailability Dot11InformationElementID = 145
+ Dot11InformationElementIDDMGTSPEC Dot11InformationElementID = 146
+ Dot11InformationElementIDNextDMGATI Dot11InformationElementID = 147
+ Dot11InformationElementIDDMSCapabilities Dot11InformationElementID = 148
+ Dot11InformationElementIDCiscoUnknown95 Dot11InformationElementID = 149
+ Dot11InformationElementIDVendor2 Dot11InformationElementID = 150
+ Dot11InformationElementIDDMGOperating Dot11InformationElementID = 151
+ Dot11InformationElementIDDMGBSSParamChange Dot11InformationElementID = 152
+ Dot11InformationElementIDDMGBeamRefinement Dot11InformationElementID = 153
+ Dot11InformationElementIDChannelMeasFeedback Dot11InformationElementID = 154
+ Dot11InformationElementIDAwakeWindow Dot11InformationElementID = 157
+ Dot11InformationElementIDMultiBand Dot11InformationElementID = 158
+ Dot11InformationElementIDADDBAExtension Dot11InformationElementID = 159
+ Dot11InformationElementIDNEXTPCPList Dot11InformationElementID = 160
+ Dot11InformationElementIDPCPHandover Dot11InformationElementID = 161
+ Dot11InformationElementIDDMGLinkMargin Dot11InformationElementID = 162
+ Dot11InformationElementIDSwitchingStream Dot11InformationElementID = 163
+ Dot11InformationElementIDSessionTransmission Dot11InformationElementID = 164
+ Dot11InformationElementIDDynamicTonePairReport Dot11InformationElementID = 165
+ Dot11InformationElementIDClusterReport Dot11InformationElementID = 166
+ Dot11InformationElementIDRelayCapabilities Dot11InformationElementID = 167
+ Dot11InformationElementIDRelayTransferParameter Dot11InformationElementID = 168
+ Dot11InformationElementIDBeamlinkMaintenance Dot11InformationElementID = 169
+ Dot11InformationElementIDMultipleMacSublayers Dot11InformationElementID = 170
+ Dot11InformationElementIDUPID Dot11InformationElementID = 171
+ Dot11InformationElementIDDMGLinkAdaptionAck Dot11InformationElementID = 172
+ Dot11InformationElementIDSymbolProprietary Dot11InformationElementID = 173
+ Dot11InformationElementIDMCCAOPAdvertOverview Dot11InformationElementID = 174
+ Dot11InformationElementIDQuietPeriodRequest Dot11InformationElementID = 175
+ Dot11InformationElementIDQuietPeriodResponse Dot11InformationElementID = 177
+ Dot11InformationElementIDECPACPolicy Dot11InformationElementID = 182
+ Dot11InformationElementIDClusterTimeOffset Dot11InformationElementID = 183
+ Dot11InformationElementIDAntennaSectorID Dot11InformationElementID = 190
+ Dot11InformationElementIDVHTCapabilities Dot11InformationElementID = 191
+ Dot11InformationElementIDVHTOperation Dot11InformationElementID = 192
+ Dot11InformationElementIDExtendedBSSLoad Dot11InformationElementID = 193
+ Dot11InformationElementIDWideBWChannelSwitch Dot11InformationElementID = 194
+ Dot11InformationElementIDVHTTxPowerEnvelope Dot11InformationElementID = 195
+ Dot11InformationElementIDChannelSwitchWrapper Dot11InformationElementID = 196
+ Dot11InformationElementIDOperatingModeNotification Dot11InformationElementID = 199
+ Dot11InformationElementIDUPSIM Dot11InformationElementID = 200
+ Dot11InformationElementIDReducedNeighborReport Dot11InformationElementID = 201
+ Dot11InformationElementIDTVHTOperation Dot11InformationElementID = 202
+ Dot11InformationElementIDDeviceLocation Dot11InformationElementID = 204
+ Dot11InformationElementIDWhiteSpaceMap Dot11InformationElementID = 205
+ Dot11InformationElementIDFineTuningMeasureParams Dot11InformationElementID = 206
+ Dot11InformationElementIDVendor Dot11InformationElementID = 221
)
// String provides a human readable string for Dot11InformationElementID.
@@ -266,35 +421,347 @@ const (
func (a Dot11InformationElementID) String() string {
switch a {
case Dot11InformationElementIDSSID:
- return "SSID"
+ return "SSID parameter set"
case Dot11InformationElementIDRates:
- return "Rates"
+ return "Supported Rates"
case Dot11InformationElementIDFHSet:
- return "FHset"
+ return "FH Parameter set"
case Dot11InformationElementIDDSSet:
- return "DSset"
+ return "DS Parameter set"
case Dot11InformationElementIDCFSet:
- return "CFset"
+ return "CF Parameter set"
case Dot11InformationElementIDTIM:
- return "TIM"
+ return "Traffic Indication Map (TIM)"
case Dot11InformationElementIDIBSSSet:
- return "IBSSset"
+ return "IBSS Parameter set"
+ case Dot11InformationElementIDCountryInfo:
+ return "Country Information"
+ case Dot11InformationElementIDHoppingPatternParam:
+ return "Hopping Pattern Parameters"
+ case Dot11InformationElementIDHoppingPatternTable:
+ return "Hopping Pattern Table"
+ case Dot11InformationElementIDRequest:
+ return "Request"
+ case Dot11InformationElementIDQBSSLoadElem:
+ return "QBSS Load Element"
+ case Dot11InformationElementIDEDCAParamSet:
+ return "EDCA Parameter Set"
+ case Dot11InformationElementIDTrafficSpec:
+ return "Traffic Specification"
+ case Dot11InformationElementIDTrafficClass:
+ return "Traffic Classification"
+ case Dot11InformationElementIDSchedule:
+ return "Schedule"
case Dot11InformationElementIDChallenge:
- return "Challenge"
+ return "Challenge text"
+ case Dot11InformationElementIDPowerConst:
+ return "Power Constraint"
+ case Dot11InformationElementIDPowerCapability:
+ return "Power Capability"
+ case Dot11InformationElementIDTPCRequest:
+ return "TPC Request"
+ case Dot11InformationElementIDTPCReport:
+ return "TPC Report"
+ case Dot11InformationElementIDSupportedChannels:
+ return "Supported Channels"
+ case Dot11InformationElementIDSwitchChannelAnnounce:
+ return "Channel Switch Announcement"
+ case Dot11InformationElementIDMeasureRequest:
+ return "Measurement Request"
+ case Dot11InformationElementIDMeasureReport:
+ return "Measurement Report"
+ case Dot11InformationElementIDQuiet:
+ return "Quiet"
+ case Dot11InformationElementIDIBSSDFS:
+ return "IBSS DFS"
case Dot11InformationElementIDERPInfo:
- return "ERPinfo"
+ return "ERP Information"
+ case Dot11InformationElementIDTSDelay:
+ return "TS Delay"
+ case Dot11InformationElementIDTCLASProcessing:
+ return "TCLAS Processing"
+ case Dot11InformationElementIDHTCapabilities:
+ return "HT Capabilities (802.11n D1.10)"
case Dot11InformationElementIDQOSCapability:
- return "QOS capability"
+ return "QOS Capability"
case Dot11InformationElementIDERPInfo2:
- return "ERPinfo2"
+ return "ERP Information-2"
case Dot11InformationElementIDRSNInfo:
- return "RSNinfo"
+ return "RSN Information"
case Dot11InformationElementIDESRates:
- return "ESrates"
+ return "Extended Supported Rates"
+ case Dot11InformationElementIDAPChannelReport:
+ return "AP Channel Report"
+ case Dot11InformationElementIDNeighborReport:
+ return "Neighbor Report"
+ case Dot11InformationElementIDRCPI:
+ return "RCPI"
+ case Dot11InformationElementIDMobilityDomain:
+ return "Mobility Domain"
+ case Dot11InformationElementIDFastBSSTrans:
+ return "Fast BSS Transition"
+ case Dot11InformationElementIDTimeoutInt:
+ return "Timeout Interval"
+ case Dot11InformationElementIDRICData:
+ return "RIC Data"
+ case Dot11InformationElementIDDSERegisteredLoc:
+ return "DSE Registered Location"
+ case Dot11InformationElementIDSuppOperatingClass:
+ return "Supported Operating Classes"
+ case Dot11InformationElementIDExtChanSwitchAnnounce:
+ return "Extended Channel Switch Announcement"
+ case Dot11InformationElementIDHTInfo:
+ return "HT Information (802.11n D1.10)"
+ case Dot11InformationElementIDSecChanOffset:
+ return "Secondary Channel Offset (802.11n D1.10)"
+ case Dot11InformationElementIDBSSAverageAccessDelay:
+ return "BSS Average Access Delay"
+ case Dot11InformationElementIDAntenna:
+ return "Antenna"
+ case Dot11InformationElementIDRSNI:
+ return "RSNI"
+ case Dot11InformationElementIDMeasurePilotTrans:
+ return "Measurement Pilot Transmission"
+ case Dot11InformationElementIDBSSAvailAdmCapacity:
+ return "BSS Available Admission Capacity"
+ case Dot11InformationElementIDBSSACAccDelayWAPIParam:
+ return "BSS AC Access Delay/WAPI Parameter Set"
+ case Dot11InformationElementIDTimeAdvertisement:
+ return "Time Advertisement"
+ case Dot11InformationElementIDRMEnabledCapabilities:
+ return "RM Enabled Capabilities"
+ case Dot11InformationElementIDMultipleBSSID:
+ return "Multiple BSSID"
+ case Dot11InformationElementID2040BSSCoExist:
+ return "20/40 BSS Coexistence"
+ case Dot11InformationElementID2040BSSIntChanReport:
+ return "20/40 BSS Intolerant Channel Report"
+ case Dot11InformationElementIDOverlapBSSScanParam:
+ return "Overlapping BSS Scan Parameters"
+ case Dot11InformationElementIDRICDescriptor:
+ return "RIC Descriptor"
+ case Dot11InformationElementIDManagementMIC:
+ return "Management MIC"
+ case Dot11InformationElementIDEventRequest:
+ return "Event Request"
+ case Dot11InformationElementIDEventReport:
+ return "Event Report"
+ case Dot11InformationElementIDDiagnosticRequest:
+ return "Diagnostic Request"
+ case Dot11InformationElementIDDiagnosticReport:
+ return "Diagnostic Report"
+ case Dot11InformationElementIDLocationParam:
+ return "Location Parameters"
+ case Dot11InformationElementIDNonTransBSSIDCapability:
+ return "Non Transmitted BSSID Capability"
+ case Dot11InformationElementIDSSIDList:
+ return "SSID List"
+ case Dot11InformationElementIDMultipleBSSIDIndex:
+ return "Multiple BSSID Index"
+ case Dot11InformationElementIDFMSDescriptor:
+ return "FMS Descriptor"
+ case Dot11InformationElementIDFMSRequest:
+ return "FMS Request"
+ case Dot11InformationElementIDFMSResponse:
+ return "FMS Response"
+ case Dot11InformationElementIDQOSTrafficCapability:
+ return "QoS Traffic Capability"
+ case Dot11InformationElementIDBSSMaxIdlePeriod:
+ return "BSS Max Idle Period"
+ case Dot11InformationElementIDTFSRequest:
+ return "TFS Request"
+ case Dot11InformationElementIDTFSResponse:
+ return "TFS Response"
+ case Dot11InformationElementIDWNMSleepMode:
+ return "WNM-Sleep Mode"
+ case Dot11InformationElementIDTIMBroadcastRequest:
+ return "TIM Broadcast Request"
+ case Dot11InformationElementIDTIMBroadcastResponse:
+ return "TIM Broadcast Response"
+ case Dot11InformationElementIDCollInterferenceReport:
+ return "Collocated Interference Report"
+ case Dot11InformationElementIDChannelUsage:
+ return "Channel Usage"
+ case Dot11InformationElementIDTimeZone:
+ return "Time Zone"
+ case Dot11InformationElementIDDMSRequest:
+ return "DMS Request"
+ case Dot11InformationElementIDDMSResponse:
+ return "DMS Response"
+ case Dot11InformationElementIDLinkIdentifier:
+ return "Link Identifier"
+ case Dot11InformationElementIDWakeupSchedule:
+ return "Wakeup Schedule"
+ case Dot11InformationElementIDChannelSwitchTiming:
+ return "Channel Switch Timing"
+ case Dot11InformationElementIDPTIControl:
+ return "PTI Control"
+ case Dot11InformationElementIDPUBufferStatus:
+ return "PU Buffer Status"
+ case Dot11InformationElementIDInterworking:
+ return "Interworking"
+ case Dot11InformationElementIDAdvertisementProtocol:
+ return "Advertisement Protocol"
+ case Dot11InformationElementIDExpBWRequest:
+ return "Expedited Bandwidth Request"
+ case Dot11InformationElementIDQOSMapSet:
+ return "QoS Map Set"
+ case Dot11InformationElementIDRoamingConsortium:
+ return "Roaming Consortium"
+ case Dot11InformationElementIDEmergencyAlertIdentifier:
+ return "Emergency Alert Identifier"
+ case Dot11InformationElementIDMeshConfiguration:
+ return "Mesh Configuration"
+ case Dot11InformationElementIDMeshID:
+ return "Mesh ID"
+ case Dot11InformationElementIDMeshLinkMetricReport:
+ return "Mesh Link Metric Report"
+ case Dot11InformationElementIDCongestionNotification:
+ return "Congestion Notification"
+ case Dot11InformationElementIDMeshPeeringManagement:
+ return "Mesh Peering Management"
+ case Dot11InformationElementIDMeshChannelSwitchParam:
+ return "Mesh Channel Switch Parameters"
+ case Dot11InformationElementIDMeshAwakeWindows:
+ return "Mesh Awake Windows"
+ case Dot11InformationElementIDBeaconTiming:
+ return "Beacon Timing"
+ case Dot11InformationElementIDMCCAOPSetupRequest:
+ return "MCCAOP Setup Request"
+ case Dot11InformationElementIDMCCAOPSetupReply:
+ return "MCCAOP SETUP Reply"
+ case Dot11InformationElementIDMCCAOPAdvertisement:
+ return "MCCAOP Advertisement"
+ case Dot11InformationElementIDMCCAOPTeardown:
+ return "MCCAOP Teardown"
+ case Dot11InformationElementIDGateAnnouncement:
+ return "Gate Announcement"
+ case Dot11InformationElementIDRootAnnouncement:
+ return "Root Announcement"
+ case Dot11InformationElementIDExtCapability:
+ return "Extended Capabilities"
+ case Dot11InformationElementIDAgereProprietary:
+ return "Agere Proprietary"
+ case Dot11InformationElementIDPathRequest:
+ return "Path Request"
+ case Dot11InformationElementIDPathReply:
+ return "Path Reply"
+ case Dot11InformationElementIDPathError:
+ return "Path Error"
+ case Dot11InformationElementIDCiscoCCX1CKIPDeviceName:
+ return "Cisco CCX1 CKIP + Device Name"
+ case Dot11InformationElementIDCiscoCCX2:
+ return "Cisco CCX2"
+ case Dot11InformationElementIDProxyUpdate:
+ return "Proxy Update"
+ case Dot11InformationElementIDProxyUpdateConfirmation:
+ return "Proxy Update Confirmation"
+ case Dot11InformationElementIDAuthMeshPerringExch:
+ return "Auhenticated Mesh Perring Exchange"
+ case Dot11InformationElementIDMIC:
+ return "MIC (Message Integrity Code)"
+ case Dot11InformationElementIDDestinationURI:
+ return "Destination URI"
+ case Dot11InformationElementIDUAPSDCoexistence:
+ return "U-APSD Coexistence"
+ case Dot11InformationElementIDWakeupSchedule80211ad:
+ return "Wakeup Schedule 802.11ad"
+ case Dot11InformationElementIDExtendedSchedule:
+ return "Extended Schedule"
+ case Dot11InformationElementIDSTAAvailability:
+ return "STA Availability"
+ case Dot11InformationElementIDDMGTSPEC:
+ return "DMG TSPEC"
+ case Dot11InformationElementIDNextDMGATI:
+ return "Next DMG ATI"
+ case Dot11InformationElementIDDMSCapabilities:
+ return "DMG Capabilities"
+ case Dot11InformationElementIDCiscoUnknown95:
+ return "Cisco Unknown 95"
+ case Dot11InformationElementIDVendor2:
+ return "Vendor Specific"
+ case Dot11InformationElementIDDMGOperating:
+ return "DMG Operating"
+ case Dot11InformationElementIDDMGBSSParamChange:
+ return "DMG BSS Parameter Change"
+ case Dot11InformationElementIDDMGBeamRefinement:
+ return "DMG Beam Refinement"
+ case Dot11InformationElementIDChannelMeasFeedback:
+ return "Channel Measurement Feedback"
+ case Dot11InformationElementIDAwakeWindow:
+ return "Awake Window"
+ case Dot11InformationElementIDMultiBand:
+ return "Multi Band"
+ case Dot11InformationElementIDADDBAExtension:
+ return "ADDBA Extension"
+ case Dot11InformationElementIDNEXTPCPList:
+ return "NEXTPCP List"
+ case Dot11InformationElementIDPCPHandover:
+ return "PCP Handover"
+ case Dot11InformationElementIDDMGLinkMargin:
+ return "DMG Link Margin"
+ case Dot11InformationElementIDSwitchingStream:
+ return "Switching Stream"
+ case Dot11InformationElementIDSessionTransmission:
+ return "Session Transmission"
+ case Dot11InformationElementIDDynamicTonePairReport:
+ return "Dynamic Tone Pairing Report"
+ case Dot11InformationElementIDClusterReport:
+ return "Cluster Report"
+ case Dot11InformationElementIDRelayCapabilities:
+ return "Relay Capabilities"
+ case Dot11InformationElementIDRelayTransferParameter:
+ return "Relay Transfer Parameter"
+ case Dot11InformationElementIDBeamlinkMaintenance:
+ return "Beamlink Maintenance"
+ case Dot11InformationElementIDMultipleMacSublayers:
+ return "Multiple MAC Sublayers"
+ case Dot11InformationElementIDUPID:
+ return "U-PID"
+ case Dot11InformationElementIDDMGLinkAdaptionAck:
+ return "DMG Link Adaption Acknowledgment"
+ case Dot11InformationElementIDSymbolProprietary:
+ return "Symbol Proprietary"
+ case Dot11InformationElementIDMCCAOPAdvertOverview:
+ return "MCCAOP Advertisement Overview"
+ case Dot11InformationElementIDQuietPeriodRequest:
+ return "Quiet Period Request"
+ case Dot11InformationElementIDQuietPeriodResponse:
+ return "Quiet Period Response"
+ case Dot11InformationElementIDECPACPolicy:
+ return "ECPAC Policy"
+ case Dot11InformationElementIDClusterTimeOffset:
+ return "Cluster Time Offset"
+ case Dot11InformationElementIDAntennaSectorID:
+ return "Antenna Sector ID"
+ case Dot11InformationElementIDVHTCapabilities:
+ return "VHT Capabilities (IEEE Std 802.11ac/D3.1)"
+ case Dot11InformationElementIDVHTOperation:
+ return "VHT Operation (IEEE Std 802.11ac/D3.1)"
+ case Dot11InformationElementIDExtendedBSSLoad:
+ return "Extended BSS Load"
+ case Dot11InformationElementIDWideBWChannelSwitch:
+ return "Wide Bandwidth Channel Switch"
+ case Dot11InformationElementIDVHTTxPowerEnvelope:
+ return "VHT Tx Power Envelope (IEEE Std 802.11ac/D5.0)"
+ case Dot11InformationElementIDChannelSwitchWrapper:
+ return "Channel Switch Wrapper"
+ case Dot11InformationElementIDOperatingModeNotification:
+ return "Operating Mode Notification"
+ case Dot11InformationElementIDUPSIM:
+ return "UP SIM"
+ case Dot11InformationElementIDReducedNeighborReport:
+ return "Reduced Neighbor Report"
+ case Dot11InformationElementIDTVHTOperation:
+ return "TVHT Op"
+ case Dot11InformationElementIDDeviceLocation:
+ return "Device Location"
+ case Dot11InformationElementIDWhiteSpaceMap:
+ return "White Space Map"
+ case Dot11InformationElementIDFineTuningMeasureParams:
+ return "Fine Tuning Measure Parameters"
case Dot11InformationElementIDVendor:
return "Vendor"
- case Dot11InformationElementIDReserved:
- return "Reserved"
default:
return "Unknown information element id"
}
@@ -302,7 +769,7 @@ func (a Dot11InformationElementID) String() string {
// Dot11 provides an IEEE 802.11 base packet header.
// See http://standards.ieee.org/findstds/standard/802.11-2012.html
-// for excrutiating detail.
+// for excruciating detail.
type Dot11 struct {
BaseLayer
Type Dot11Type
@@ -316,23 +783,138 @@ type Dot11 struct {
SequenceNumber uint16
FragmentNumber uint16
Checksum uint32
+ QOS *Dot11QOS
+ HTControl *Dot11HTControl
+ DataLayer gopacket.Layer
+}
+
+type Dot11QOS struct {
+ TID uint8 /* Traffic IDentifier */
+ EOSP bool /* End of service period */
+ AckPolicy Dot11AckPolicy
+ TXOP uint8
+}
+
+type Dot11HTControl struct {
+ ACConstraint bool
+ RDGMorePPDU bool
+
+ VHT *Dot11HTControlVHT
+ HT *Dot11HTControlHT
+}
+
+type Dot11HTControlHT struct {
+ LinkAdapationControl *Dot11LinkAdapationControl
+ CalibrationPosition uint8
+ CalibrationSequence uint8
+ CSISteering uint8
+ NDPAnnouncement bool
+ DEI bool
+}
+
+type Dot11HTControlVHT struct {
+ MRQ bool
+ UnsolicitedMFB bool
+ MSI *uint8
+ MFB Dot11HTControlMFB
+ CompressedMSI *uint8
+ STBCIndication bool
+ MFSI *uint8
+ GID *uint8
+ CodingType *Dot11CodingType
+ FbTXBeamformed bool
+}
+
+type Dot11HTControlMFB struct {
+ NumSTS uint8
+ VHTMCS uint8
+ BW uint8
+ SNR int8
+}
+
+type Dot11LinkAdapationControl struct {
+ TRQ bool
+ MRQ bool
+ MSI uint8
+ MFSI uint8
+ ASEL *Dot11ASEL
+ MFB *uint8
+}
+
+type Dot11ASEL struct {
+ Command uint8
+ Data uint8
+}
+
+type Dot11CodingType uint8
+
+const (
+ Dot11CodingTypeBCC = 0
+ Dot11CodingTypeLDPC = 1
+)
+
+func (a Dot11CodingType) String() string {
+ switch a {
+ case Dot11CodingTypeBCC:
+ return "BCC"
+ case Dot11CodingTypeLDPC:
+ return "LDPC"
+ default:
+ return "Unknown coding type"
+ }
+}
+
+func (m *Dot11HTControlMFB) NoFeedBackPresent() bool {
+ return m.VHTMCS == 15 && m.NumSTS == 7
}
func decodeDot11(data []byte, p gopacket.PacketBuilder) error {
d := &Dot11{}
- return decodingLayerDecoder(d, data, p)
+ err := d.DecodeFromBytes(data, p)
+ if err != nil {
+ return err
+ }
+ p.AddLayer(d)
+ if d.DataLayer != nil {
+ p.AddLayer(d.DataLayer)
+ }
+ return p.NextDecoder(d.NextLayerType())
}
func (m *Dot11) LayerType() gopacket.LayerType { return LayerTypeDot11 }
func (m *Dot11) CanDecode() gopacket.LayerClass { return LayerTypeDot11 }
func (m *Dot11) NextLayerType() gopacket.LayerType {
- if m.Flags.WEP() {
- return (LayerTypeDot11WEP)
+ if m.DataLayer != nil {
+ if m.Flags.WEP() {
+ return LayerTypeDot11WEP
+ }
+ return m.DataLayer.(gopacket.DecodingLayer).NextLayerType()
}
-
return m.Type.LayerType()
}
+func createU8(x uint8) *uint8 {
+ return &x
+}
+
+var dataDecodeMap = map[Dot11Type]func() gopacket.DecodingLayer{
+ Dot11TypeData: func() gopacket.DecodingLayer { return &Dot11Data{} },
+ Dot11TypeDataCFAck: func() gopacket.DecodingLayer { return &Dot11DataCFAck{} },
+ Dot11TypeDataCFPoll: func() gopacket.DecodingLayer { return &Dot11DataCFPoll{} },
+ Dot11TypeDataCFAckPoll: func() gopacket.DecodingLayer { return &Dot11DataCFAckPoll{} },
+ Dot11TypeDataNull: func() gopacket.DecodingLayer { return &Dot11DataNull{} },
+ Dot11TypeDataCFAckNoData: func() gopacket.DecodingLayer { return &Dot11DataCFAckNoData{} },
+ Dot11TypeDataCFPollNoData: func() gopacket.DecodingLayer { return &Dot11DataCFPollNoData{} },
+ Dot11TypeDataCFAckPollNoData: func() gopacket.DecodingLayer { return &Dot11DataCFAckPollNoData{} },
+ Dot11TypeDataQOSData: func() gopacket.DecodingLayer { return &Dot11DataQOSData{} },
+ Dot11TypeDataQOSDataCFAck: func() gopacket.DecodingLayer { return &Dot11DataQOSDataCFAck{} },
+ Dot11TypeDataQOSDataCFPoll: func() gopacket.DecodingLayer { return &Dot11DataQOSDataCFPoll{} },
+ Dot11TypeDataQOSDataCFAckPoll: func() gopacket.DecodingLayer { return &Dot11DataQOSDataCFAckPoll{} },
+ Dot11TypeDataQOSNull: func() gopacket.DecodingLayer { return &Dot11DataQOSNull{} },
+ Dot11TypeDataQOSCFPollNoData: func() gopacket.DecodingLayer { return &Dot11DataQOSCFPollNoData{} },
+ Dot11TypeDataQOSCFAckPollNoData: func() gopacket.DecodingLayer { return &Dot11DataQOSCFAckPollNoData{} },
+}
+
func (m *Dot11) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error {
if len(data) < 10 {
df.SetTruncated()
@@ -384,7 +966,112 @@ func (m *Dot11) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error {
offset += 6
}
- m.BaseLayer = BaseLayer{Contents: data[0:offset], Payload: data[offset : len(data)-4]}
+ if m.Type.QOS() {
+ if len(data) < offset+2 {
+ df.SetTruncated()
+ return fmt.Errorf("Dot11 length %v too short, %v required", len(data), offset+6)
+ }
+ m.QOS = &Dot11QOS{
+ TID: (uint8(data[offset]) & 0x0F),
+ EOSP: (uint8(data[offset]) & 0x10) == 0x10,
+ AckPolicy: Dot11AckPolicy((uint8(data[offset]) & 0x60) >> 5),
+ TXOP: uint8(data[offset+1]),
+ }
+ offset += 2
+ }
+ if m.Flags.Order() && (m.Type.QOS() || mainType == Dot11TypeMgmt) {
+ if len(data) < offset+4 {
+ df.SetTruncated()
+ return fmt.Errorf("Dot11 length %v too short, %v required", len(data), offset+6)
+ }
+
+ htc := &Dot11HTControl{
+ ACConstraint: data[offset+3]&0x40 != 0,
+ RDGMorePPDU: data[offset+3]&0x80 != 0,
+ }
+ m.HTControl = htc
+
+ if data[offset]&0x1 != 0 { // VHT Variant
+ vht := &Dot11HTControlVHT{}
+ htc.VHT = vht
+ vht.MRQ = data[offset]&0x4 != 0
+ vht.UnsolicitedMFB = data[offset+3]&0x20 != 0
+ vht.MFB = Dot11HTControlMFB{
+ NumSTS: uint8(data[offset+1] >> 1 & 0x7),
+ VHTMCS: uint8(data[offset+1] >> 4 & 0xF),
+ BW: uint8(data[offset+2] & 0x3),
+ SNR: int8((-(data[offset+2] >> 2 & 0x20))+data[offset+2]>>2&0x1F) + 22,
+ }
+
+ if vht.UnsolicitedMFB {
+ if !vht.MFB.NoFeedBackPresent() {
+ vht.CompressedMSI = createU8(data[offset] >> 3 & 0x3)
+ vht.STBCIndication = data[offset]&0x20 != 0
+ vht.CodingType = (*Dot11CodingType)(createU8(data[offset+3] >> 3 & 0x1))
+ vht.FbTXBeamformed = data[offset+3]&0x10 != 0
+ vht.GID = createU8(
+ data[offset]>>6 +
+ (data[offset+1] & 0x1 << 2) +
+ data[offset+3]&0x7<<3)
+ }
+ } else {
+ if vht.MRQ {
+ vht.MSI = createU8((data[offset] >> 3) & 0x07)
+ }
+ vht.MFSI = createU8(data[offset]>>6 + (data[offset+1] & 0x1 << 2))
+ }
+
+ } else { // HT Variant
+ ht := &Dot11HTControlHT{}
+ htc.HT = ht
+
+ lac := &Dot11LinkAdapationControl{}
+ ht.LinkAdapationControl = lac
+ lac.TRQ = data[offset]&0x2 != 0
+ lac.MFSI = data[offset]>>6&0x3 + data[offset+1]&0x1<<3
+ if data[offset]&0x3C == 0x38 { // ASEL
+ lac.ASEL = &Dot11ASEL{
+ Command: data[offset+1] >> 1 & 0x7,
+ Data: data[offset+1] >> 4 & 0xF,
+ }
+ } else {
+ lac.MRQ = data[offset]&0x4 != 0
+ if lac.MRQ {
+ lac.MSI = data[offset] >> 3 & 0x7
+ }
+ lac.MFB = createU8(data[offset+1] >> 1)
+ }
+ ht.CalibrationPosition = data[offset+2] & 0x3
+ ht.CalibrationSequence = data[offset+2] >> 2 & 0x3
+ ht.CSISteering = data[offset+2] >> 6 & 0x3
+ ht.NDPAnnouncement = data[offset+3]&0x1 != 0
+ if mainType != Dot11TypeMgmt {
+ ht.DEI = data[offset+3]&0x20 != 0
+ }
+ }
+
+ offset += 4
+ }
+
+ if len(data) < offset+4 {
+ df.SetTruncated()
+ return fmt.Errorf("Dot11 length %v too short, %v required", len(data), offset+4)
+ }
+
+ m.BaseLayer = BaseLayer{
+ Contents: data[0:offset],
+ Payload: data[offset : len(data)-4],
+ }
+
+ if mainType == Dot11TypeData {
+ l := dataDecodeMap[m.Type]()
+ err := l.DecodeFromBytes(m.BaseLayer.Payload, df)
+ if err != nil {
+ return err
+ }
+ m.DataLayer = l.(gopacket.Layer)
+ }
+
m.Checksum = binary.LittleEndian.Uint32(data[len(data)-4 : len(data)])
return nil
}
@@ -397,6 +1084,47 @@ func (m *Dot11) ChecksumValid() bool {
return m.Checksum == h.Sum32()
}
+func (m Dot11) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(24)
+
+ if err != nil {
+ return err
+ }
+
+ buf[0] = (uint8(m.Type) << 2) | m.Proto
+ buf[1] = uint8(m.Flags)
+
+ binary.LittleEndian.PutUint16(buf[2:4], m.DurationID)
+
+ copy(buf[4:10], m.Address1)
+
+ offset := 10
+
+ switch m.Type.MainType() {
+ case Dot11TypeCtrl:
+ switch m.Type {
+ case Dot11TypeCtrlRTS, Dot11TypeCtrlPowersavePoll, Dot11TypeCtrlCFEnd, Dot11TypeCtrlCFEndAck:
+ copy(buf[offset:offset+6], m.Address2)
+ offset += 6
+ }
+ case Dot11TypeMgmt, Dot11TypeData:
+ copy(buf[offset:offset+6], m.Address2)
+ offset += 6
+ copy(buf[offset:offset+6], m.Address3)
+ offset += 6
+
+ binary.LittleEndian.PutUint16(buf[offset:offset+2], (m.SequenceNumber<<4)|m.FragmentNumber)
+ offset += 2
+ }
+
+ if m.Type.MainType() == Dot11TypeData && m.Flags.FromDS() && m.Flags.ToDS() {
+ copy(buf[offset:offset+6], m.Address4)
+ offset += 6
+ }
+
+ return nil
+}
+
// Dot11Mgmt is a base for all IEEE 802.11 management layers.
type Dot11Mgmt struct {
BaseLayer
@@ -432,7 +1160,7 @@ type Dot11WEP struct {
BaseLayer
}
-func (m *Dot11WEP) NextLayerType() gopacket.LayerType { return LayerTypeLLC }
+func (m *Dot11WEP) NextLayerType() gopacket.LayerType { return gopacket.LayerTypePayload }
func (m *Dot11WEP) LayerType() gopacket.LayerType { return LayerTypeDot11WEP }
func (m *Dot11WEP) CanDecode() gopacket.LayerClass { return LayerTypeDot11WEP }
@@ -451,7 +1179,9 @@ type Dot11Data struct {
BaseLayer
}
-func (m *Dot11Data) NextLayerType() gopacket.LayerType { return LayerTypeLLC }
+func (m *Dot11Data) NextLayerType() gopacket.LayerType {
+ return LayerTypeLLC
+}
func (m *Dot11Data) LayerType() gopacket.LayerType { return LayerTypeDot11Data }
func (m *Dot11Data) CanDecode() gopacket.LayerClass { return LayerTypeDot11Data }
@@ -576,23 +1306,10 @@ func (m *Dot11DataCFAckPollNoData) DecodeFromBytes(data []byte, df gopacket.Deco
type Dot11DataQOS struct {
Dot11Ctrl
- TID uint8 /* Traffic IDentifier */
- EOSP bool /* End of service period */
- AckPolicy Dot11AckPolicy
- TXOP uint8
}
func (m *Dot11DataQOS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error {
- if len(data) < 4 {
- df.SetTruncated()
- return fmt.Errorf("Dot11DataQOS length %v too short, %v required", len(data), 4)
- }
- m.TID = (uint8(data[0]) & 0x0F)
- m.EOSP = (uint8(data[0]) & 0x10) == 0x10
- m.AckPolicy = Dot11AckPolicy((uint8(data[0]) & 0x60) >> 5)
- m.TXOP = uint8(data[1])
- // TODO: Mesh Control bytes 2:4
- m.BaseLayer = BaseLayer{Contents: data[0:4], Payload: data[4:]}
+ m.BaseLayer = BaseLayer{Payload: data}
return nil
}
@@ -760,7 +1477,7 @@ func (m *Dot11InformationElement) DecodeFromBytes(data []byte, df gopacket.Decod
func (d *Dot11InformationElement) String() string {
if d.ID == 0 {
- return fmt.Sprintf("802.11 Information Element (SSID: %v)", string(d.Info))
+ return fmt.Sprintf("802.11 Information Element (ID: %v, Length: %v, SSID: %v)", d.ID, d.Length, string(d.Info))
} else if d.ID == 1 {
rates := ""
for i := 0; i < len(d.Info); i++ {
@@ -770,9 +1487,9 @@ func (d *Dot11InformationElement) String() string {
rates += fmt.Sprintf("%.1f* ", float32(d.Info[i]&0x7F)*0.5)
}
}
- return fmt.Sprintf("802.11 Information Element (Rates: %s Mbit)", rates)
+ return fmt.Sprintf("802.11 Information Element (ID: %v, Length: %v, Rates: %s Mbit)", d.ID, d.Length, rates)
} else if d.ID == 221 {
- return fmt.Sprintf("802.11 Information Element (Vendor: ID: %v, Length: %v, OUI: %X, Info: %X)", d.ID, d.Length, d.OUI, d.Info)
+ return fmt.Sprintf("802.11 Information Element (ID: %v, Length: %v, OUI: %X, Info: %X)", d.ID, d.Length, d.OUI, d.Info)
} else {
return fmt.Sprintf("802.11 Information Element (ID: %v, Length: %v, Info: %X)", d.ID, d.Length, d.Info)
}
@@ -971,6 +1688,19 @@ func (m *Dot11MgmtAssociationReq) DecodeFromBytes(data []byte, df gopacket.Decod
return m.Dot11Mgmt.DecodeFromBytes(data, df)
}
+func (m Dot11MgmtAssociationReq) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(4)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint16(buf[0:2], m.CapabilityInfo)
+ binary.LittleEndian.PutUint16(buf[2:4], m.ListenInterval)
+
+ return nil
+}
+
type Dot11MgmtAssociationResp struct {
Dot11Mgmt
CapabilityInfo uint16
@@ -1004,6 +1734,20 @@ func (m *Dot11MgmtAssociationResp) DecodeFromBytes(data []byte, df gopacket.Deco
return m.Dot11Mgmt.DecodeFromBytes(data, df)
}
+func (m Dot11MgmtAssociationResp) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(6)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint16(buf[0:2], m.CapabilityInfo)
+ binary.LittleEndian.PutUint16(buf[2:4], uint16(m.Status))
+ binary.LittleEndian.PutUint16(buf[4:6], m.AID)
+
+ return nil
+}
+
type Dot11MgmtReassociationReq struct {
Dot11Mgmt
CapabilityInfo uint16
@@ -1037,6 +1781,21 @@ func (m *Dot11MgmtReassociationReq) DecodeFromBytes(data []byte, df gopacket.Dec
return m.Dot11Mgmt.DecodeFromBytes(data, df)
}
+func (m Dot11MgmtReassociationReq) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(10)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint16(buf[0:2], m.CapabilityInfo)
+ binary.LittleEndian.PutUint16(buf[2:4], m.ListenInterval)
+
+ copy(buf[4:10], m.CurrentApAddress)
+
+ return nil
+}
+
type Dot11MgmtReassociationResp struct {
Dot11Mgmt
}
@@ -1073,6 +1832,9 @@ func (m *Dot11MgmtProbeReq) NextLayerType() gopacket.LayerType {
type Dot11MgmtProbeResp struct {
Dot11Mgmt
+ Timestamp uint64
+ Interval uint16
+ Flags uint16
}
func decodeDot11MgmtProbeResp(data []byte, p gopacket.PacketBuilder) error {
@@ -1082,10 +1844,39 @@ func decodeDot11MgmtProbeResp(data []byte, p gopacket.PacketBuilder) error {
func (m *Dot11MgmtProbeResp) LayerType() gopacket.LayerType { return LayerTypeDot11MgmtProbeResp }
func (m *Dot11MgmtProbeResp) CanDecode() gopacket.LayerClass { return LayerTypeDot11MgmtProbeResp }
+func (m *Dot11MgmtProbeResp) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error {
+ if len(data) < 12 {
+ df.SetTruncated()
+
+ return fmt.Errorf("Dot11MgmtProbeResp length %v too short, %v required", len(data), 12)
+ }
+
+ m.Timestamp = binary.LittleEndian.Uint64(data[0:8])
+ m.Interval = binary.LittleEndian.Uint16(data[8:10])
+ m.Flags = binary.LittleEndian.Uint16(data[10:12])
+ m.Payload = data[12:]
+
+ return m.Dot11Mgmt.DecodeFromBytes(data, df)
+}
+
func (m *Dot11MgmtProbeResp) NextLayerType() gopacket.LayerType {
return LayerTypeDot11InformationElement
}
+func (m Dot11MgmtProbeResp) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(12)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint64(buf[0:8], m.Timestamp)
+ binary.LittleEndian.PutUint16(buf[8:10], m.Interval)
+ binary.LittleEndian.PutUint16(buf[10:12], m.Flags)
+
+ return nil
+}
+
type Dot11MgmtMeasurementPilot struct {
Dot11Mgmt
}
@@ -1130,6 +1921,20 @@ func (m *Dot11MgmtBeacon) DecodeFromBytes(data []byte, df gopacket.DecodeFeedbac
func (m *Dot11MgmtBeacon) NextLayerType() gopacket.LayerType { return LayerTypeDot11InformationElement }
+func (m Dot11MgmtBeacon) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(12)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint64(buf[0:8], m.Timestamp)
+ binary.LittleEndian.PutUint16(buf[8:10], m.Interval)
+ binary.LittleEndian.PutUint16(buf[10:12], m.Flags)
+
+ return nil
+}
+
type Dot11MgmtATIM struct {
Dot11Mgmt
}
@@ -1167,6 +1972,18 @@ func (m *Dot11MgmtDisassociation) DecodeFromBytes(data []byte, df gopacket.Decod
return m.Dot11Mgmt.DecodeFromBytes(data, df)
}
+func (m Dot11MgmtDisassociation) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(2)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint16(buf[0:2], uint16(m.Reason))
+
+ return nil
+}
+
type Dot11MgmtAuthentication struct {
Dot11Mgmt
Algorithm Dot11Algorithm
@@ -1200,6 +2017,20 @@ func (m *Dot11MgmtAuthentication) DecodeFromBytes(data []byte, df gopacket.Decod
return m.Dot11Mgmt.DecodeFromBytes(data, df)
}
+func (m Dot11MgmtAuthentication) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(6)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint16(buf[0:2], uint16(m.Algorithm))
+ binary.LittleEndian.PutUint16(buf[2:4], m.Sequence)
+ binary.LittleEndian.PutUint16(buf[4:6], uint16(m.Status))
+
+ return nil
+}
+
type Dot11MgmtDeauthentication struct {
Dot11Mgmt
Reason Dot11Reason
@@ -1225,6 +2056,18 @@ func (m *Dot11MgmtDeauthentication) DecodeFromBytes(data []byte, df gopacket.Dec
return m.Dot11Mgmt.DecodeFromBytes(data, df)
}
+func (m Dot11MgmtDeauthentication) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
+ buf, err := b.PrependBytes(2)
+
+ if err != nil {
+ return err
+ }
+
+ binary.LittleEndian.PutUint16(buf[0:2], uint16(m.Reason))
+
+ return nil
+}
+
type Dot11MgmtAction struct {
Dot11Mgmt
}