summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp_test.go
AgeCommit message (Collapse)Author
2018-03-19packet/bgp: make serialization of ipv4/v6 nlri goroutine-safeFUJITA Tomonori
The serialization of ipv4/v6 nlri should be goroutine-safe but somehow not. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-21packet/bgp: Rename AigpTLV to AigpTLVInterfaceIWASE Yusuke
The other interface types in "packet/bgp" package have "Interface" suffix. This patch fixes to follow this naming convention. Golang's naming convention recommends to use "er" suffix though. Also, this patch moves the AIGP TLVs definitions to the near of the PathAttributeAigp structure and defines NewAigpTLVDefault function. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-13packet/bgp: Refactor TunnelEncapSubTLV structureIWASE Yusuke
This patch refactors the structure of TunnelEncapSubTLV sub-types to have the similar structure of PathAttribute sub-types, and makes easy to implement MarshalJSON() functions for TunnelEncapSubTLV sub-types. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-12-17packet/bgp: use strconv.FormatInt() instead of strconv.Itoa() in testsVincent Bernat
Itoa() takes an int which will only be 32-bit on i386 and similar architectures. In tests, some constants are too big. Therefore, switch all uses of strconv.Itoa() to strconv.FormatInt(). Without this change, we get: ``` src/github.com/osrg/gobgp/packet/bgp/bgp_test.go:1123:41: constant 2864434397 overflows int ```
2017-12-06packet/bgp: JSON encode of MP_UNREACH_NLRI attributeVincent Bernat
MP_REACH_NLRI was already correctly encoded in JSON, while this was not the case for MP_UNREACH_NLRI. Before: ```json "PathAttributes": [ { "type": 15, "value": "AAIBQCABDbgAEwAA" } ] ``` After: ```json "PathAttributes": [ { "type": 15, "afi": 2, "value": [ { "prefix": "2001:db8:8::/64" } ], "safi": 1 } ] ``` This commit also adds two tests not directly related to JSON encoding as I was first thinking the problem may be related to incorrect parsing of the path attribute.
2017-11-28packet/bgp: Use fixed len types in FlowSpec componentsIWASE Yusuke
Currently, the "FlowSpecComponentItem" uses int type for the "Op" and "Value" fields, but Golang int type has 4 bytes length on the 32-bit env and 8 bytes length on the 64-bit env. For example, to support the SNAP (Type 20) rule, which has 5 bytes value field, int type has not enough length on 32-bit env. This patch fixes to use the fixed length integer types for the FlowSpec components and avoid overflows of value range. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-24packet/bgp: Sort FlowSpec rules when decoding/creatingIWASE Yusuke
Currently, we sort the FlowSpec rules when creating a new path containing the FlowSpec NLRI and when parsing CLI arguments for the FlowSpec rules. This patch moves sorting the rules into the inside of the "packet" module and sorts them when decoding binary and creating new NLRI. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: EVPN ESI parser from string sliceIWASE Yusuke
This patch introduces a new function to parse EVPN ESI from string slice which passed via CLI for example. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-09-29packet/bgp: Add Unit Tests for Revised Error HandlingSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-26add LocalPathIdentifierFUJITA Tomonori
add-path support needs two identifiers, remote (rx) and local (tx). The remote identifiers are assigined by remote peers, the local ones are assigned by gobgpd itself. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-10packet: Use bitmask operand format to fragmentSatoshi Fujimoto
RFC 5575 suggests using "bitmask operand format" for fragmentation field, but GoBGP does not have an interface to configure it. This patch introduce the way to configure bitmask operands for "fragment" field. The syntax is similar to TCP flags rules. For example: =not-a-fragment =is-fragment&!last-fragment Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-04packet: support addpath decoding/encodingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-06-01Fix RouteDistinguisher parsing and VPNV6 VRF rib parsingLamanna
2017-05-23packet/bgp: Redirect-IPv6 Flow Spec Traffic Filtering ActionSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-04-04packet/bgp: add extended-nexthop capabilityISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04packet/bgp: fix mp-reach-nlri attribute decoder/encoderISHIDA Wataru
Current mp-reach-nlri attribute decoder/encoder assumes NLRI's address family and that of nexthop is the same. However, when extended nexthop capability(RFC5549) is negotiated, this is not the case. This commit removes the assumption. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-03-02flowspec: comply with new draft RFC5575bis normalized operatorsMatthieu Texier
2017-01-16packet/bgp/bgp_test: UT for PathAttributeMpReachNLRIIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-01-16packet/bgp/bgp_test: UT for IPv6 MpReachNLRI with IPv4 peeringIWASE Yusuke
This patch adds a test case for PathAttributeMpReachNLRI with IPv6 prefix and IPv4 peering (IPv4 nexthop address). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2016-11-17add go vet testWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-10-04packet/bgp: fix handling of IPv4 mapped IPv6 prefixesWataru Ishida
closes #1117 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-10-02packet/bgp: fix bug of CompareFlowSpecNLRI()Wataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-09-15bgp/cli: support evpn route type 5 (ip prefix advertisement)Wataru Ishida
see draft-ietf-bess-evpn-prefix-advertisement-03 $ gobgp g ri -a evpn add prefix 10.0.0.0/24 etag 20 rd 100:100 rt 100:100 gw 10.10.10.10 label 100 $ gobgp g ri -a evpn add prefix 200::/64 etag 20 rd 100:100 rt 100:100 gw 200::1 label 10000 close #1082 Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-06-30bgp: fix bug of flowspec vpn parser/serializerISHIDA Wataru
close #997 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-05-10server: pretty notification error code logFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-04-20packet: fix encap nlri (add encap ipv6 nlri)ISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-12packet: create bmp packageFUJITA Tomonori
move bmp stuff from bgp to bmp package. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-03-31move packet/*.go to packet/bgp/*.go for Go's conventionFUJITA Tomonori
Later, we move non-bgp protocol stuff like mrt under their own direcotries. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>