diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-04-09 22:23:46 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-04-09 22:23:46 +0900 |
commit | f3342c236eff5e5bc378fd320b538a0f02ac20e3 (patch) | |
tree | 25b573bd26acb92b5ae0d7f60dc18eeff822bfa6 /packet/bgp_test.go | |
parent | a1c1142ee400e8c90613fe27f3f6499b4678eabf (diff) |
packet: fix EVPN parser/serializer
Also add unit test.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp_test.go')
-rw-r--r-- | packet/bgp_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packet/bgp_test.go b/packet/bgp_test.go index d2d99b9e..97734606 100644 --- a/packet/bgp_test.go +++ b/packet/bgp_test.go @@ -83,6 +83,24 @@ func update() *BGPMessage { mp_nlri4 := []AddrPrefixInterface{NewLabelledIPAddrPrefix(25, "192.168.0.0", *NewLabel(5, 6, 7))} + mac, _ := net.ParseMAC("01:23:45:67:89:ab") + mp_nlri5 := []AddrPrefixInterface{ + NewEVPNNLRI(EVPN_ROUTE_TYPE_ETHERNET_AUTO_DISCOVERY, 0, + &EVPNEthernetAutoDiscoveryRoute{NewRouteDistinguisherFourOctetAS(5, 6), + EthernetSegmentIdentifier{ESI_ARBITRARY, make([]byte, 9)}, 2, 2}), + NewEVPNNLRI(EVPN_ROUTE_TYPE_MAC_IP_ADVERTISEMENT, 0, + &EVPNMacIPAdvertisementRoute{NewRouteDistinguisherFourOctetAS(5, 6), + EthernetSegmentIdentifier{ESI_ARBITRARY, make([]byte, 9)}, 3, 48, + mac, 32, net.ParseIP("192.2.1.2"), + []uint32{3}}), + NewEVPNNLRI(EVPN_INCLUSIVE_MULTICAST_ETHERNET_TAG, 0, + &EVPNMulticastEthernetTagRoute{NewRouteDistinguisherFourOctetAS(5, 6), 3, 32, net.ParseIP("192.2.1.2")}), + NewEVPNNLRI(EVPN_ETHERNET_SEGMENT_ROUTE, 0, + &EVPNEthernetSegmentRoute{NewRouteDistinguisherFourOctetAS(5, 6), + EthernetSegmentIdentifier{ESI_ARBITRARY, make([]byte, 9)}, + 32, net.ParseIP("192.2.1.1")}), + } + p := []PathAttributeInterface{ NewPathAttributeOrigin(3), NewPathAttributeAsPath(aspath1), @@ -104,6 +122,7 @@ func update() *BGPMessage { NewPathAttributeMpReachNLRI("1023::", mp_nlri2), NewPathAttributeMpReachNLRI("fe80::", mp_nlri3), NewPathAttributeMpReachNLRI("129.1.1.1", mp_nlri4), + NewPathAttributeMpReachNLRI("129.1.1.1", mp_nlri5), NewPathAttributeMpUnreachNLRI(mp_nlri), //NewPathAttributeMpReachNLRI("112.22.2.0", []AddrPrefixInterface{}), //NewPathAttributeMpUnreachNLRI([]AddrPrefixInterface{}), |