mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
refact: target -> endpoint
This commit is contained in:
parent
305e22ee2e
commit
36352311fb
3 changed files with 7 additions and 7 deletions
|
@ -128,7 +128,7 @@ func (tp *Targets) Remove(ip, mac string) {
|
|||
if e, found := tp.Targets[mac]; found {
|
||||
tp.TTL[mac]--
|
||||
if tp.TTL[mac] == 0 {
|
||||
tp.Session.Events.Add("target.lost", e)
|
||||
tp.Session.Events.Add("endpoint.lost", e)
|
||||
delete(tp.Targets, mac)
|
||||
delete(tp.TTL, mac)
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ func (tp *Targets) AddIfNew(ip, mac string) *net.Endpoint {
|
|||
|
||||
e := net.NewEndpoint(ip, mac)
|
||||
e.ResolvedCallback = func(e *net.Endpoint) {
|
||||
tp.Session.Events.Add("target.resolved", e)
|
||||
tp.Session.Events.Add("endpoint.resolved", e)
|
||||
}
|
||||
|
||||
if alias, found := tp.Aliases[mac]; found {
|
||||
|
@ -181,7 +181,7 @@ func (tp *Targets) AddIfNew(ip, mac string) *net.Endpoint {
|
|||
tp.Targets[mac] = e
|
||||
tp.TTL[mac] = TargetsDefaultTTL
|
||||
|
||||
tp.Session.Events.Add("target.new", e)
|
||||
tp.Session.Events.Add("endpoint.new", e)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue