This commit is contained in:
Manfred Touron
2017-05-18 18:54:23 +02:00
parent dc386661ca
commit 5448f25fd6
645 changed files with 55908 additions and 33297 deletions

View File

@@ -7,6 +7,9 @@
package route
// A Message represents a routing message.
//
// Note: This interface will be changed to support Marshal method in
// future version.
type Message interface {
// Sys returns operating system-specific information.
Sys() []Sys
@@ -49,10 +52,11 @@ func ParseRIB(typ RIBType, b []byte) ([]Message, error) {
b = b[l:]
continue
}
if w, ok := wireFormats[int(b[3])]; !ok {
mtyp := int(b[3])
if fn, ok := parseFns[mtyp]; !ok {
nskips++
} else {
m, err := w.parse(typ, b)
m, err := fn(typ, b)
if err != nil {
return nil, err
}