diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-13 20:22:55 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-13 20:22:55 +0900 |
commit | c8d69a3906dc9a6ea9a7257805fbb7682362c367 (patch) | |
tree | 6b2963401bf25159f5619d545641d5801fd29c49 /packet/bgp/validate_test.go | |
parent | f2cea556c18da0419ee64a47653455c3c4dc6811 (diff) |
packet: export pathAttrFlags
Used to check if an attribute is known or unknown.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp/validate_test.go')
-rw-r--r-- | packet/bgp/validate_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packet/bgp/validate_test.go b/packet/bgp/validate_test.go index 490c6402..66eb56d5 100644 --- a/packet/bgp/validate_test.go +++ b/packet/bgp/validate_test.go @@ -146,7 +146,7 @@ func Test_Validate_duplicate_attribute(t *testing.T) { assert := assert.New(t) message := bgpupdate().Body.(*BGPUpdate) // duplicate origin path attribute - originBytes := []byte{byte(pathAttrFlags[BGP_ATTR_TYPE_ORIGIN]), 1, 1, 1} + originBytes := []byte{byte(PathAttrFlags[BGP_ATTR_TYPE_ORIGIN]), 1, 1, 1} origin := &PathAttributeOrigin{} origin.DecodeFromBytes(originBytes) message.PathAttributes = append(message.PathAttributes, origin) @@ -189,7 +189,7 @@ func Test_Validate_invalid_origin(t *testing.T) { assert := assert.New(t) message := bgpupdate().Body.(*BGPUpdate) // origin needs to be well-known - originBytes := []byte{byte(pathAttrFlags[BGP_ATTR_TYPE_ORIGIN]), 1, 1, 5} + originBytes := []byte{byte(PathAttrFlags[BGP_ATTR_TYPE_ORIGIN]), 1, 1, 5} origin := &PathAttributeOrigin{} origin.DecodeFromBytes(originBytes) message.PathAttributes[0] = origin @@ -209,7 +209,7 @@ func Test_Validate_invalid_nexthop_zero(t *testing.T) { // invalid nexthop addr := net.ParseIP("0.0.0.1").To4() - nexthopBytes := []byte{byte(pathAttrFlags[BGP_ATTR_TYPE_NEXT_HOP]), 3, 4} + nexthopBytes := []byte{byte(PathAttrFlags[BGP_ATTR_TYPE_NEXT_HOP]), 3, 4} nexthopBytes = append(nexthopBytes, addr...) nexthop := &PathAttributeNextHop{} nexthop.DecodeFromBytes(nexthopBytes) @@ -230,7 +230,7 @@ func Test_Validate_invalid_nexthop_lo(t *testing.T) { // invalid nexthop addr := net.ParseIP("127.0.0.1").To4() - nexthopBytes := []byte{byte(pathAttrFlags[BGP_ATTR_TYPE_NEXT_HOP]), 3, 4} + nexthopBytes := []byte{byte(PathAttrFlags[BGP_ATTR_TYPE_NEXT_HOP]), 3, 4} nexthopBytes = append(nexthopBytes, addr...) nexthop := &PathAttributeNextHop{} nexthop.DecodeFromBytes(nexthopBytes) @@ -251,7 +251,7 @@ func Test_Validate_invalid_nexthop_de(t *testing.T) { // invalid nexthop addr := net.ParseIP("224.0.0.1").To4() - nexthopBytes := []byte{byte(pathAttrFlags[BGP_ATTR_TYPE_NEXT_HOP]), 3, 4} + nexthopBytes := []byte{byte(PathAttrFlags[BGP_ATTR_TYPE_NEXT_HOP]), 3, 4} nexthopBytes = append(nexthopBytes, addr...) nexthop := &PathAttributeNextHop{} nexthop.DecodeFromBytes(nexthopBytes) |