mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 14:03:17 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
7356bf2295
commit
5314e9ff50
2 changed files with 14 additions and 21 deletions
|
@ -7,25 +7,19 @@ import (
|
|||
"github.com/google/gopacket/layers"
|
||||
)
|
||||
|
||||
func NewDot11Deauth(a1 net.HardwareAddr, a2 net.HardwareAddr, a3 net.HardwareAddr, t layers.Dot11Type, reason layers.Dot11Reason, seq uint16) (error, []byte) {
|
||||
var (
|
||||
deauth layers.Dot11MgmtDeauthentication
|
||||
dot11Layer layers.Dot11
|
||||
radioTapLayer layers.RadioTap
|
||||
)
|
||||
|
||||
deauth.Reason = reason
|
||||
|
||||
dot11Layer.Address1 = a1
|
||||
dot11Layer.Address2 = a2
|
||||
dot11Layer.Address3 = a3
|
||||
dot11Layer.Type = t
|
||||
dot11Layer.SequenceNumber = seq
|
||||
|
||||
func NewDot11Deauth(a1 net.HardwareAddr, a2 net.HardwareAddr, a3 net.HardwareAddr, seq uint16) (error, []byte) {
|
||||
return Serialize(
|
||||
&radioTapLayer,
|
||||
&dot11Layer,
|
||||
&deauth,
|
||||
&layers.RadioTap{},
|
||||
&layers.Dot11{
|
||||
Address1: a1,
|
||||
Address2: a2,
|
||||
Address3: a3,
|
||||
Type: layers.Dot11TypeMgmtDeauthentication,
|
||||
SequenceNumber: seq,
|
||||
},
|
||||
&layers.Dot11MgmtDeauthentication{
|
||||
Reason: layers.Dot11ReasonClass2FromNonAuth,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue