MCPcopy
hub / github.com/bettercap/bettercap / NewRedirection

Function NewRedirection

firewall/redirection.go:14–23  ·  view source on GitHub ↗
(iface string, proto string, port_from int, addr_to string, port_to int)

Source from the content-addressed store, hash-verified

12}
13
14func NewRedirection(iface string, proto string, port_from int, addr_to string, port_to int) *Redirection {
15 return &Redirection{
16 Interface: iface,
17 Protocol: proto,
18 SrcAddress: "",
19 SrcPort: port_from,
20 DstAddress: addr_to,
21 DstPort: port_to,
22 }
23}
24
25func (r Redirection) String() string {
26 return fmt.Sprintf("[%s] (%s) %s:%d -> %s:%d", r.Interface, r.Protocol, r.SrcAddress, r.SrcPort, r.DstAddress, r.DstPort)

Callers 9

ConfigureMethod · 0.92
ConfigureMethod · 0.92
ConfigureMethod · 0.92
ConfigureMethod · 0.92
TestNewRedirectionFunction · 0.85
BenchmarkNewRedirectionFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestNewRedirectionFunction · 0.68
BenchmarkNewRedirectionFunction · 0.68