diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-01-13 16:29:14 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-16 18:17:48 +0900 |
commit | 0df994639ebbe69b9be015d07fb93e36379eec5a (patch) | |
tree | a4b51a9a55d32caf79686a77cca91fae1bf972b5 /packet/bgp.go | |
parent | c65fe8515e64ee4c61331fd266d4fe51a10b45ff (diff) |
packet: add functions to get PathAttribute flags and Type
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp.go')
-rw-r--r-- | packet/bgp.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go index 407b4b9f..3e11bf8c 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -1104,6 +1104,8 @@ type PathAttributeInterface interface { DecodeFromBytes([]byte) error Serialize() ([]byte, error) Len() int + getFlags() uint8 + getType() BGPAttrType } type PathAttribute struct { @@ -1123,6 +1125,14 @@ func (p *PathAttribute) Len() int { return int(l) } +func (p *PathAttribute) getFlags() uint8 { + return p.Flags +} + +func (p *PathAttribute) getType() BGPAttrType { + return p.Type +} + func (p *PathAttribute) DecodeFromBytes(data []byte) error { eCode := uint8(BGP_ERROR_UPDATE_MESSAGE_ERROR) eSubCode := uint8(BGP_ERROR_SUB_ATTRIBUTE_LENGTH_ERROR) |