summaryrefslogtreecommitdiffhomepage
path: root/packet
AgeCommit message (Collapse)Author
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: Use regexp to parse FlowSpec rulesIWASE Yusuke
Currently, the parser for the string representation of FlowSpec rules splits the given string into characters and validates them character by character. So we need to handle the unexpected white spaces carefully. This patch introduces the regular expressions to parse the FlowSpec rules and simplify the parsers. Also improves robustness for the unexpectedly inserted white spaces like "& == tcp". Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-24packet/bgp: Refactor construction of FlowSpec rules stringIWASE Yusuke
This patch introduces String() functions for the flags and reserved values related to the FlowSpec rules. Also removes the unused types and functions. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-24packet/bgp: Invert FlowSpec bitmask operand positionIWASE Yusuke
Currently, if the both NOT and MATCH bit are set for the FlowSpec bitmask operand, the string representation will be "=!". For the readability and the consistency with the representation of numeric operator, it should be "!=". This patch inverts "=!" into "!=" for the bitmask operand. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-24cli: Improve arguments extraction for FlowSpec rulesIWASE Yusuke
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-23table: fix merging of v4 paths with addpath enabledFUJITA Tomonori
V4 NLRI needs more 4 bytes with addpath enabled. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-21packet/bgp: Support EVPN Router's MAC Extended CommunityIWASE Yusuke
This patch supports EVPN Router's MAC Extended Community which described on "draft-ietf-bess-evpn-inter-subnet-forwarding". According to "draft-ietf-bess-evpn-prefix-advertisement" This extended community might be carried with EVPN IP Prefix Route NLRI. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Zeros if GW in EVPN Prefix route omittedIWASE Yusuke
According to "draft-ietf-bess-evpn-prefix-advertisement-08", the GW IP field SHOULD be zero if it is not used, but currently, GoBGP skips encoding the GW IP field (not composed). This patch fixes to fill zeros to solve this problem. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Check range of EVPN related Label fieldIWASE Yusuke
This patch enables to check the value range of Label included in EVPN routes or PMSI Tunnel attribute when decoding and serialising it. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Use ESI str in EVPN Ethernet Segment RouteIWASE Yusuke
This patch fixes to use the string representation of ESI in the string representation of EVPN Ethernet Segment Route. Currently, displayed in the default representation of ESI structure. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Avoid raw binary in EVPN ESI stringIWASE Yusuke
Currently, the value field of EVPN ESI might be corrupted when ESI type is ARBITRARY (not "single-homed") or unknown type because the value field will be formatted as the raw byte slice in this case. This patch fixes to convert the byte slice into the colon separated hex values which is corresponding to the format of the CLI input. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Use decimal AS number in EVPN ESIIWASE Yusuke
Currently, the representation of AS number in EVPN ESI Type AS (Type 5) uses the colon separated 2 octet values format, but in other places, the AS4_PATH attribute for example, the single decimal format is used. This patch fixes to use the decimal AS number for the consistency with the AS_PATH/AS4_PATH attributes and also the CLI input format. 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-11-20packet/bgp: Rename snake case to camel caseIWASE Yusuke
This patch renames some variable names in snake case (e.g., "last_byte_value") to that in the camel case (e.g., "lastByte") because Go prefers the camel case for variable names. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-19packet/bgp: fix flowspec parser about cmd badly argsnnao45
2017-11-07packet/bgp: Add Validation for BGP ConfederationsSatoshi Fujimoto
RFC 5065 says that: "It is a error for a BGP speaker to receive an update message from a confederation peer that is not in the same Member-AS that does not have AS_CONFED_SEQUENCE as the first segment." Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-07*: Fix problems pointed by 'go vet'Satoshi Fujimoto
In the near feature (likely in Go1.10), 'go test' will never work if 'go vet' fails. (See: https://github.com/golang/go/issues/18084) This commit is for dealing with such a situation (and also for improving the quality of our code). Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-06packet/bgp: Avoid Varied Flag Representations in Flowspec FilterSatoshi Fujimoto
Currently, the parsing results of flags in flowsspec filter will be varied every time they are parsed. For example, the tcp-flag '=UFP' may be represented to '=UPF' or '=PUF' and so on. This is due to the use of interation to map. Iterations over maps does not happen in a consistent order. This fixes it by iterating sorted slices instead of maps. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-03packet/bgp: Remove non route key fields from stringIWASE Yusuke
RFC7432 and draft-ietf-bess-evpn-prefix-advertisement says some fields in EVPN NLRIs (e.g., MPLS Label(s)) should no be treated as the route key, but currently, GoBGP's string representations of EVPN NLRIs include all fields. So the paths should be treated as the same (e.g., only different in MPLS Label and other field is the same) can be treated as the different. This patch removes non route key fields from NLRI string representation and fixes this problem. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-01Fix some typos found by spell checkerIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-01Fix some spelling for spell checker's testIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-10-07packet/bmp: fix "length" spellingVincent Bernat
2017-10-03packet/mrt: Enable RibEntry to switch add-path enabledIWASE Yusuke
Because path_id = 0 is valid Path ID, we cannot determine whether add-path is enabled based on just a value of path_id. This patch adds a new argument to switch add-path features. 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-09-29server: Revised Error Handling (RFC7606)Satoshi Fujimoto
This patch enables GoBGP to keep the session established even if the received BGPUpdate message contains some errors, and to handle these errors according to what defined in RFC7606. This feature is enabled when 'treat-as-withdraw' in 'neighbors.error-handling.config' is specified to true in the GoBGP config file. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29packet/bgp: Return ErrorHandling in decoding/validating BGPUpdateSatoshi Fujimoto
For Revised Error Handling(RFC7606), this patch modifies the BGPUpdate message decoder/validator to return ErrorHandling according to what was detected as an error. In addition, this patch adds some validation defined in RFC7606. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29server/bgp: Extend MessageError for Revised Error HandlingSatoshi Fujimoto
This patch extends MessageError to contain error handling level and error path attribute. These informations are needed to Revised Error Handling (RFC7606). Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29bgp/validate: Check Wellknown Attributes exist with MultiProtocolSatoshi Fujimoto
RFC4760 says "An UPDATE message that carries the MP_REACH_NLRI MUST also carry the ORIGIN and the AS_PATH attributes". This patch adds a validation to comply with it. 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-10const: Rename TcpFlagOp to BitmaskFlagOpSatoshi Fujimoto
This flag format is not only used for "tcp-flag" field, but also "fragment" field. To express the above, this patch renames the format. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-10flowspec: Set AND to correct operand for TCP FlagsSatoshi Fujimoto
Currently, if TCP Flags field is specified from CLI command, GoBGP sets 'AND' bit to the invalid operand. RFC 5575 says it represents the previous term is logically ANDed or not, and "It should be unset in the first operator byte of a sequence". This patch fixes this to comply with RFC5575. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-04support addpath recvISHIDA Wataru
2017-07-04packet: support addpath decoding/encodingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-07-04packet: add marshalling option infraISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-06-23packet: fix addpath capability parser/serializerFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-08packet/mrt: BGP with Geo-Location Extensions (RFC6397)IWASE Yusuke
This patch enables to decode/encode MRT format with BGP routing information including the geographical location which described in RFC6397. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-03packet/bmp: Implement Route Mirroring messageIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-06-01Fix RouteDistinguisher parsing and VPNV6 VRF rib parsingLamanna
2017-06-01packet/mrt: BGP Additional Path Extensions (RFC8050)IWASE Yusuke
This patch enables to decode/encode MRT format with BGP Additional Path Extensions which described in RFC8050. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-23bmp: Implement Information TLV on Termination messagesIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-23bmp: Implement Information TLV on Initiation messageIWASE Yusuke
Currently, the TLV fields are implemented as BMPTLV on the Initiation messages, but not enough decoded and required to be constructed in binary format. This patch introduces BMPInfoTLV and makes easy to handle the TLV fields. Note: This patch obsoletes BMPTLV structure. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-23bmp: Remove redundant error value declarationIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-05-23flowspec: handling of >2 logical elements and fixed testDenis Shevchenko
2017-05-23flowspec: formatting of flowspec ranges in nice orderDenis Shevchenko
2017-05-23flowspec: correct handling of | bit case in opflagsDenis Shevchenko
2017-05-23flowspec: correct place for & bit in opflagsDenis Shevchenko
2017-05-23cli: Add User Interface for Redirect-IPv6 actionSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>