cleanup
This commit is contained in:
parent
6fe049546b
commit
12f30095de
@ -9,7 +9,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func New() Message {
|
func New() Message {
|
||||||
return Message{}
|
var message Message
|
||||||
|
message.RIP = make([]RIP, 25)
|
||||||
|
return message
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Message) MParse(b *[]byte, n int) error {
|
func (m *Message) MParse(b *[]byte, n int) error {
|
||||||
|
@ -46,7 +46,7 @@ func (r *Routes) append(route Route) {
|
|||||||
r.Routes[string(bs)] = k
|
r.Routes[string(bs)] = k
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Routes) ParseRoutes(addr net.UDPAddr, rip *[25]ripv2.RIP) {
|
func (r *Routes) ParseRoutes(addr net.UDPAddr, rip *[]ripv2.RIP) {
|
||||||
var route Route
|
var route Route
|
||||||
for _, rip := range *rip {
|
for _, rip := range *rip {
|
||||||
/* if not af_inet */
|
/* if not af_inet */
|
||||||
|
@ -18,7 +18,7 @@ type Message struct {
|
|||||||
Command Command
|
Command Command
|
||||||
Version Version
|
Version Version
|
||||||
Zero uint16
|
Zero uint16
|
||||||
RIP [25]RIP
|
RIP []RIP
|
||||||
}
|
}
|
||||||
|
|
||||||
type RIP struct {
|
type RIP struct {
|
||||||
|
@ -27,7 +27,6 @@ func command(command COMMAND, r *routes.Route) error {
|
|||||||
default:
|
default:
|
||||||
return errors.New("command not supported")
|
return errors.New("command not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd.Run()
|
return cmd.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user