aboutsummaryrefslogtreecommitdiffstats
path: root/src/conn.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-17 17:25:45 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-17 17:25:58 +0100
commitfa399a91d5da9874cbf248e00db8dbd87b587e91 (patch)
tree8aaca42f4a3cc11666c12d5077e8ed5ac35200a8 /src/conn.go
parentAllows passing UAPI fd to service (diff)
downloadwireguard-go-fa399a91d5da9874cbf248e00db8dbd87b587e91.tar.xz
wireguard-go-fa399a91d5da9874cbf248e00db8dbd87b587e91.zip
Ported remaining netns.sh
- Ported remaining netns.sh tests - Begin work on generic implementation of bind interface
Diffstat (limited to 'src/conn.go')
-rw-r--r--src/conn.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/conn.go b/src/conn.go
index a047bb6..3cf00ab 100644
--- a/src/conn.go
+++ b/src/conn.go
@@ -15,6 +15,22 @@ type UDPBind interface {
Close() error
}
+/* An Endpoint maintains the source/destination caching for a peer
+ *
+ * dst : the remote address of a peer
+ * src : the local address from which datagrams originate going to the peer
+ *
+ */
+type UDPEndpoint interface {
+ ClearSrc() // clears the source address
+ ClearDst() // clears the destination address
+ SrcToString() string // returns the local source address (ip:port)
+ DstToString() string // returns the destination address (ip:port)
+ DstToBytes() []byte // used for mac2 cookie calculations
+ DstIP() net.IP
+ SrcIP() net.IP
+}
+
func parseEndpoint(s string) (*net.UDPAddr, error) {
// ensure that the host is an IP address