summaryrefslogtreecommitdiffhomepage
path: root/packet
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-06-27 19:40:20 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-01 11:06:08 +0900
commite7cefb51f9cfd0012384239ee736375841af7a76 (patch)
tree82555f46303195712765f4c0e3c7b978b5ded253 /packet
parent9b35be73826689b15839105ce0f386bbdaf56f06 (diff)
table: simplify Path.getPathAttr()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet')
-rw-r--r--packet/bgp.go4
-rw-r--r--packet/validate.go6
2 files changed, 5 insertions, 5 deletions
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)
}