diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-25 22:12:34 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-25 22:12:34 -0800 |
commit | 94e35ee50de5750d46ae32b1c9d736671a0e84a6 (patch) | |
tree | d6e1d461cff683308cd91db7e7cbf25b8d48b82d /table/path.go | |
parent | 0adb1d0dcd57b17444a3364e576b3bcf94266ce4 (diff) |
packet: define BGPPathAttr type
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/table/path.go b/table/path.go index 635cbf5d..4d4e0c44 100644 --- a/table/path.go +++ b/table/path.go @@ -27,7 +27,7 @@ import ( type Path interface { String() string GetPathAttrs() []bgp.PathAttributeInterface - GetPathAttr(int) (int, bgp.PathAttributeInterface) + GetPathAttr(bgp.BGPAttrType) (int, bgp.PathAttributeInterface) getRouteFamily() RouteFamily setSource(source *PeerInfo) getSource() *PeerInfo @@ -193,7 +193,7 @@ func (pd *PathDefault) GetPathAttrs() []bgp.PathAttributeInterface { return pd.pathAttrs } -func (pd *PathDefault) GetPathAttr(pattrType int) (int, bgp.PathAttributeInterface) { +func (pd *PathDefault) GetPathAttr(pattrType bgp.BGPAttrType) (int, bgp.PathAttributeInterface) { attrMap := [bgp.BGP_ATTR_TYPE_AS4_AGGREGATOR + 1]reflect.Type{} attrMap[bgp.BGP_ATTR_TYPE_ORIGIN] = reflect.TypeOf(&bgp.PathAttributeOrigin{}) attrMap[bgp.BGP_ATTR_TYPE_AS_PATH] = reflect.TypeOf(&bgp.PathAttributeAsPath{}) |