diff options
Diffstat (limited to 'src/conn_linux.go')
-rw-r--r-- | src/conn_linux.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/conn_linux.go b/src/conn_linux.go index 8942b03..4a5a3f0 100644 --- a/src/conn_linux.go +++ b/src/conn_linux.go @@ -133,7 +133,7 @@ func sockaddrToString(addr unix.RawSockaddrInet6) string { } } -func (end *Endpoint) DestinationIP() net.IP { +func (end *Endpoint) DstIP() net.IP { switch end.dst.Family { case unix.AF_INET6: return end.dst.Addr[:] @@ -150,20 +150,24 @@ func (end *Endpoint) DestinationIP() net.IP { } } -func (end *Endpoint) SourceToBytes() []byte { +func (end *Endpoint) SrcToBytes() []byte { ptr := unsafe.Pointer(&end.src) arr := (*[unix.SizeofSockaddrInet6]byte)(ptr) return arr[:] } -func (end *Endpoint) SourceToString() string { +func (end *Endpoint) SrcToString() string { return sockaddrToString(end.src) } -func (end *Endpoint) DestinationToString() string { +func (end *Endpoint) DstToString() string { return sockaddrToString(end.dst) } +func (end *Endpoint) ClearDst() { + end.dst = unix.RawSockaddrInet6{} +} + func (end *Endpoint) ClearSrc() { end.src = unix.RawSockaddrInet6{} } |