This commit is contained in:
Jim Colderwood 2024-04-25 14:19:28 +01:00
parent 2d381d2a85
commit 36b6ad3b33
2 changed files with 5 additions and 5 deletions

View File

@ -13,12 +13,12 @@ func callback(r *ripv2.Routes) {
}
func main() {
config := config.Read("config.json")
conf := config.Read("config.json")
rip := ripv2.New()
routes := ripv2.Init()
log.Println("Running")
routes.Timer()
rip.Run(config, callback)
rip.Run(conf, callback)
/* NOT REACHED */
}

View File

@ -44,9 +44,9 @@ func (m *Message) MParse(b *[]byte, n int) error {
for i := 0; i < (n-4)/20; i++ {
m.RIP[i].AFI = binary.BigEndian.Uint16(ripentry[0:2])
m.RIP[i].RouteTag = binary.BigEndian.Uint16(ripentry[2:4])
m.RIP[i].Addr = binary.BigEndian.Uint32(ripentry[4:8]) //net.IPv4(ripentry[4], ripentry[5], ripentry[6], ripentry[7])
m.RIP[i].Subnet = binary.BigEndian.Uint32(ripentry[8:12]) //net.IPv4Mask(ripentry[8], ripentry[9], ripentry[10], ripentry[11])
m.RIP[i].Nexthop = binary.BigEndian.Uint32(ripentry[12:16]) //net.IPv4(ripentry[12], ripentry[13], ripentry[14], ripentry[15])
m.RIP[i].Addr = binary.BigEndian.Uint32(ripentry[4:8])
m.RIP[i].Subnet = binary.BigEndian.Uint32(ripentry[8:12])
m.RIP[i].Nexthop = binary.BigEndian.Uint32(ripentry[12:16])
m.RIP[i].Metric = binary.BigEndian.Uint32(ripentry[16:20])
indexA += 20
indexB += 20