Initial implementation of source caching
Yet untested.
This commit is contained in:
parent
a72b0f7ae5
commit
e86d03dca2
10 changed files with 84 additions and 83 deletions
|
|
@ -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{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue