From 8b27a70aa14bc80ebabbb6e5cc14611b74cf6799 Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 23 Oct 2023 18:11:41 -0400 Subject: comments and refactoring --- README.md | 14 +++++++++++--- 1 file 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. -- cgit v1.2.3-70-g09d2