diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-06-20 16:46:52 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-06-21 10:29:11 +0900 |
commit | 92814f7b85c01ffc7eca750cfec3b7bbc200a2d3 (patch) | |
tree | e1d3d261036d427549fe3d5b4c96200ae1e23e35 | |
parent | 3e6eb608a2de03af275082d16e425e365a0e7739 (diff) |
packet/bgp: Missing New func for BGP Capabilities
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r-- | packet/bgp/bgp.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 13320e54..ae62d3bf 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -433,6 +433,14 @@ type CapCarryingLabelInfo struct { DefaultParameterCapability } +func NewCapCarryingLabelInfo() *CapCarryingLabelInfo { + return &CapCarryingLabelInfo{ + DefaultParameterCapability{ + CapCode: BGP_CAP_CARRYING_LABEL_INFO, + }, + } +} + type CapExtendedNexthopTuple struct { NLRIAFI uint16 NLRISAFI uint16 @@ -881,6 +889,15 @@ type CapUnknown struct { DefaultParameterCapability } +func NewCapUnknown(code BGPCapabilityCode, value []byte) *CapUnknown { + return &CapUnknown{ + DefaultParameterCapability{ + CapCode: code, + CapValue: value, + }, + } +} + func DecodeCapability(data []byte) (ParameterCapabilityInterface, error) { if len(data) < 2 { return nil, NewMessageError(BGP_ERROR_OPEN_MESSAGE_ERROR, BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY, nil, "Not all ParameterCapability bytes available") |