From e7cefb51f9cfd0012384239ee736375841af7a76 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 27 Jun 2015 19:40:20 +0900 Subject: table: simplify Path.getPathAttr() Signed-off-by: ISHIDA Wataru --- packet/bgp.go | 4 ++-- packet/validate.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packet') diff --git a/packet/bgp.go b/packet/bgp.go index e12d7cda..f5afc948 100644 --- a/packet/bgp.go +++ b/packet/bgp.go @@ -1864,7 +1864,7 @@ type PathAttributeInterface interface { Serialize() ([]byte, error) Len() int getFlags() BGPAttrFlag - getType() BGPAttrType + GetType() BGPAttrType ToApiStruct() *api.PathAttr } @@ -1889,7 +1889,7 @@ func (p *PathAttribute) getFlags() BGPAttrFlag { return p.Flags } -func (p *PathAttribute) getType() BGPAttrType { +func (p *PathAttribute) GetType() BGPAttrType { return p.Type } diff --git a/packet/validate.go b/packet/validate.go index 3da96387..2afd53c4 100644 --- a/packet/validate.go +++ b/packet/validate.go @@ -23,10 +23,10 @@ func ValidateUpdateMsg(m *BGPUpdate, rfs map[RouteFamily]bool) (bool, error) { // check path attribute for _, a := range m.PathAttributes { // check duplication - if _, ok := seen[a.getType()]; !ok { - seen[a.getType()] = a + if _, ok := seen[a.GetType()]; !ok { + seen[a.GetType()] = a } else { - eMsg := "the path attribute apears twice. Type : " + strconv.Itoa(int(a.getType())) + eMsg := "the path attribute apears twice. Type : " + strconv.Itoa(int(a.GetType())) return false, NewMessageError(eCode, eSubCodeAttrList, nil, eMsg) } -- cgit v1.2.3