aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/README.md b/README.md
index 6984dee..f51a87f 100644
--- a/README.md
+++ b/README.md
@@ -18,42 +18,50 @@ Because the vhost and vrouter are so similar, we maintain most of the logic with
We build our abstractions for the IP layer and interfaces with the following structs:
type Interface struct {
+
Name string
IpPrefix netip.Prefix
UdpAddr netip.AddrPort
-
RecvSocket net.UDPConn
SocketChannel chan bool
State bool
+
}
type Neighbor struct {
+
Name string
VipAddr netip.Addr
UdpAddr netip.AddrPort
+
}
type RIPHeader struct {
+
command uint16
numEntries uint16
+
}
type RIPEntry struct {
+
prefix netip.Prefix
cost uint32
+
}
type Hop struct {
+
Cost uint32
Type string
-
Interface *Interface
VIP netip.Addr
+
}
With these structs, we are able to maintain the information necessary for the IPStack to function and for the vhost and vrouter to interact with its interfaces, neighbors, and routes when applicable.
-# Initialization
+# Initialization/Main Thread
First we, parse the lnxfile and populate our the data structures such as myInterfaces, myNeighbors and routingTable based on the specification in the lnx files. For each not we create a UDP listener conn and utilize a go routines to listen on the UDP socket.