cosmetic: move Router type from types.go to router.go

This commit is contained in:
Matthias Radestock committed 2015-01-20 20:49:23 +00:00
1 parent 74563c6e3a
commit c6b68dd2bd
2 files changed
+14 -15

No files matched your search

+14
View File
@@ -17,6 +17,20 @@ const macMaxAge = 10 * time.Minute // [1]
// [1] should be greater than typical ARP cache expiries, i.e. > 3/2 *
// /proc/sys/net/ipv4_neigh/*/base_reachable_time_ms on Linux
type Router struct {
Iface *net.Interface
Ourself *LocalPeer
Macs *MacCache
Peers *Peers
Routes *Routes
ConnectionMaker *ConnectionMaker
UDPListener *net.UDPConn
Password *[]byte
ConnLimit int
BufSz int
LogFrame func(string, []byte, *layers.Ethernet)
}
func NewRouter(iface *net.Interface, name PeerName, password []byte, connLimit int, bufSz int, logFrame func(string, []byte, *layers.Ethernet)) *Router {
router := &Router{
Iface: iface,
-15
View File
@@ -1,24 +1,9 @@
package router
import (
"code.google.com/p/gopacket/layers"
"net"
)
type Router struct {
Iface *net.Interface
Ourself *LocalPeer
Macs *MacCache
Peers *Peers
Routes *Routes
ConnectionMaker *ConnectionMaker
UDPListener *net.UDPConn
Password *[]byte
ConnLimit int
BufSz int
LogFrame func(string, []byte, *layers.Ethernet)
}
type UDPPacket struct {
Name PeerName
Packet []byte