mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: fixed compilation on windows
This commit is contained in:
parent
1df51fd13a
commit
7f22425dcc
3 changed files with 32 additions and 16 deletions
|
@ -148,22 +148,6 @@ func (mod *Module) createDot11ProbeGraph(ssid string, station *network.Station)
|
|||
return ssidNode, ssidIsNew, staNode, staIsNew, nil
|
||||
}
|
||||
|
||||
func (mod *Module) createBLEServerGraph(dev *network.BLEDevice) (*Node, bool, error) {
|
||||
mac := network.NormalizeMac(dev.Device.ID())
|
||||
node, err := mod.db.FindNode(BLEServer, mac)
|
||||
isNew := node == nil
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
} else if isNew {
|
||||
if node, err = mod.db.CreateNode(BLEServer, mac, dev, ""); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
} else if err = mod.db.UpdateNode(node); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
return node, isNew, nil
|
||||
}
|
||||
|
||||
func (mod *Module) connectAsSame(a, b *Node) error {
|
||||
if aIsB, err := mod.db.FindLastEdgeOfType(a, b, Is); err != nil {
|
||||
return err
|
||||
|
|
22
modules/graph/create_ble.go
Normal file
22
modules/graph/create_ble.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package graph
|
||||
|
||||
import "github.com/bettercap/bettercap/v2/network"
|
||||
|
||||
func (mod *Module) createBLEServerGraph(dev *network.BLEDevice) (*Node, bool, error) {
|
||||
mac := network.NormalizeMac(dev.Device.ID())
|
||||
node, err := mod.db.FindNode(BLEServer, mac)
|
||||
isNew := node == nil
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
} else if isNew {
|
||||
if node, err = mod.db.CreateNode(BLEServer, mac, dev, ""); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
} else if err = mod.db.UpdateNode(node); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
return node, isNew, nil
|
||||
}
|
10
modules/graph/create_ble_unsupported.go
Normal file
10
modules/graph/create_ble_unsupported.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package graph
|
||||
|
||||
import "github.com/bettercap/bettercap/v2/network"
|
||||
|
||||
func (mod *Module) createBLEServerGraph(dev *network.BLEDevice) (*Node, bool, error) {
|
||||
return nil, false, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue