(data []byte)
| 366 | } |
| 367 | |
| 368 | func (c *CapAddPath) DecodeFromBytes(data []byte) error { |
| 369 | err := c.CapabilityBase.DecodeFromBytes(data) |
| 370 | if err != nil { |
| 371 | return err |
| 372 | } |
| 373 | data = data[2:] |
| 374 | if c.CapLen != 4 { |
| 375 | return NewBgpError(BGP_ERR_MSG_HEADER_ERROR, BGP_ERR_SUB_BAD_MESSAGE_LENGTH, nil, "") |
| 376 | } |
| 377 | if len(data) < 4 { |
| 378 | return NewBgpError(BGP_ERR_MSG_HEADER_ERROR, BGP_ERR_SUB_BAD_MESSAGE_LENGTH, nil, "") |
| 379 | } |
| 380 | c.AfiSafi = AfiSafiValue(Afi(binary.BigEndian.Uint16(data[0:2])), Safi(data[2])) |
| 381 | c.SendRecieve = data[3] |
| 382 | fmt.Println("AfiSafi:", c.AfiSafi, "SendRecieve", c.SendRecieve) |
| 383 | return nil |
| 384 | } |
| 385 | |
| 386 | type CapEnhancedRouteRefresh struct { |
| 387 | CapabilityBase |
nothing calls this directly
no test coverage detected