1
2
3
4
5
6
7 package route
8
9 func (w *wireFormat) parseInterfaceMulticastAddrMessage(_ RIBType, b []byte) (Message, error) {
10 if len(b) < w.bodyOff {
11 return nil, errMessageTooShort
12 }
13 l := int(nativeEndian.Uint16(b[:2]))
14 if len(b) < l {
15 return nil, errInvalidMessage
16 }
17 m := &InterfaceMulticastAddrMessage{
18 Version: int(b[2]),
19 Type: int(b[3]),
20 Flags: int(nativeEndian.Uint32(b[8:12])),
21 Index: int(nativeEndian.Uint16(b[12:14])),
22 raw: b[:l],
23 }
24 var err error
25 m.Addrs, err = parseAddrs(uint(nativeEndian.Uint32(b[4:8])), parseKernelInetAddr, b[w.bodyOff:])
26 if err != nil {
27 return nil, err
28 }
29 return m, nil
30 }
31
View as plain text