mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
yeah i should have done this before, i know
This commit is contained in:
commit
0091ffdbb3
33 changed files with 25678 additions and 0 deletions
27
firewall/redirection.go
Normal file
27
firewall/redirection.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package firewall
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Redirection struct {
|
||||
Interface string
|
||||
Protocol string
|
||||
SrcAddress string
|
||||
SrcPort int
|
||||
DstAddress string
|
||||
DstPort int
|
||||
}
|
||||
|
||||
func NewRedirection(iface string, proto string, port_from int, addr_to string, port_to int) *Redirection {
|
||||
return &Redirection{
|
||||
Interface: iface,
|
||||
Protocol: proto,
|
||||
SrcAddress: "",
|
||||
SrcPort: port_from,
|
||||
DstAddress: addr_to,
|
||||
DstPort: port_to,
|
||||
}
|
||||
}
|
||||
|
||||
func (r Redirection) String() string {
|
||||
return fmt.Sprintf("[%s] (%s) %s:%d -> %s:%d", r.Interface, r.Protocol, r.SrcAddress, r.SrcPort, r.DstAddress, r.DstPort)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue