From 62da72e26d8784bd804802f19c693b0eb53889a8 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Tue, 20 Jan 2015 21:01:50 +0000 Subject: [PATCH] cosmetic: move a bunch of error types to where they belong --- router/crypto.go | 5 +++++ router/forwarder.go | 4 ++++ router/peers.go | 7 +++++++ router/types.go | 20 -------------------- router/udp_sender.go | 4 ++++ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/router/crypto.go b/router/crypto.go index 044b3eff..ef9c1b4b 100644 --- a/router/crypto.go +++ b/router/crypto.go @@ -269,6 +269,11 @@ type NaClDecryptorInstance struct { nonceChan chan *[24]byte } +type PacketDecodingError struct { + Fatal bool + Desc string +} + func NewNonDecryptor(conn *LocalConnection) *NonDecryptor { return &NonDecryptor{conn: conn} } diff --git a/router/forwarder.go b/router/forwarder.go index a06a55c7..30828464 100644 --- a/router/forwarder.go +++ b/router/forwarder.go @@ -7,6 +7,10 @@ import ( "time" ) +type FrameTooBigError struct { + EPMTU int // effective pmtu, i.e. what we tell packet senders +} + func (conn *LocalConnection) ensureForwarders() error { if conn.forwardChan != nil || conn.forwardChanDF != nil { return nil diff --git a/router/peers.go b/router/peers.go index cb85ad47..568ad9d9 100644 --- a/router/peers.go +++ b/router/peers.go @@ -16,6 +16,13 @@ type Peers struct { onGC func(*Peer) } +type UnknownPeersError struct { +} + +type NameCollisionError struct { + Name PeerName +} + func NewPeers(ourself *Peer, macs *MacCache, onGC func(*Peer)) *Peers { return &Peers{ ourself: ourself, diff --git a/router/types.go b/router/types.go index f68d307b..fc99b653 100644 --- a/router/types.go +++ b/router/types.go @@ -10,26 +10,6 @@ type UDPPacket struct { Sender *net.UDPAddr } -type MsgTooBigError struct { - PMTU int // actual pmtu, i.e. what the kernel told us -} - -type FrameTooBigError struct { - EPMTU int // effective pmtu, i.e. what we tell packet senders -} - -type UnknownPeersError struct { -} - -type NameCollisionError struct { - Name PeerName -} - -type PacketDecodingError struct { - Fatal bool - Desc string -} - type LocalAddress struct { ip net.IP network *net.IPNet diff --git a/router/udp_sender.go b/router/udp_sender.go index 68a75f3d..26928f3c 100644 --- a/router/udp_sender.go +++ b/router/udp_sender.go @@ -26,6 +26,10 @@ type RawUDPSender struct { conn *LocalConnection } +type MsgTooBigError struct { + PMTU int // actual pmtu, i.e. what the kernel told us +} + func NewSimpleUDPSender(conn *LocalConnection) *SimpleUDPSender { return &SimpleUDPSender{udpConn: conn.Router.UDPListener, conn: conn} }