summaryrefslogtreecommitdiffhomepage
path: root/table
AgeCommit message (Collapse)Author
2018-07-07follow Standard Go Project LayoutFUJITA Tomonori
https://github.com/golang-standards/project-layout Now you can see clearly what are private and public library code. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-06Fixing all megacheck errors.FUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-06table: Sort in table packageSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-07-06api: remove table/ usage in util.goFUJITA Tomonori
This is a part of work removing table/ usage in api/. api/ will depend on only protobuf stuff and packet/. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-22Fixing all megacheck errors.Jeff Bean
2018-06-13table: support AfiSafiIn Policy Condition matchMarcin Ptaszyński
2018-06-13table: arrange fields to reduce paddingChris Stockton
This reduces the table.Path size from 88 to 72 which adds up considerably since it is the most allocated persistent object.
2018-06-11table: fix Clone() to inherite the attribute hash valueFUJITA Tomonori
CreateUpdateMsgFromPaths() assumes that a path has a proper hash value. If a path doesn't, the function takes too long. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-05table: fix potential panics in tableKeyChris Stockton
It is possible for a call from other Table methods for an interface that does not match the tables route family to reach the type assertion and panic. This change better reflects the intention of the code by checking the concrete type using a type switch instead.
2018-06-05config: Accept CLUSTER_ID as an integer valueIWASE Yusuke
Currently, only IPv4 address is acceptable for the CLUSTER_ID setting, this patch enables to specify the CLUSTER_ID as a 32-bit unsigned integer. With this expansion, "Config.RouteReflectorClusterId" stores the raw configured value for the CLUSTER_ID and "State.RouteReflectorClusterId" stores the value used for construct the CLUSTER_LIST attribute. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-05table: support nexthop match policyurban
2018-05-29table: fix DropStale method in AdjRibFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: update accepted number in adj-in rib after softreset-inFUJITA Tomonori
update accepted number in adj-in rib after AllowOwnAs has changed. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: fix accepted number in adj-in ribFUJITA Tomonori
fix accepted number in adj-in rib when it has an as-looped path. adding another member to Path struct is pain. Should be fixed later. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: remove unused Exists method in AdjRib strctureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28table: remove unused id in AdjRib strctureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-24fix withdraw with addpath and rtc enabledFUJITA Tomonori
Needs withdrawn paths that includes attributes. The attributes are necessary because they are used with rtc table to check if the paths were sent. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-23zclient: Avoid flapping of nexthop reachabilityIWASE Yusuke
Currently, GoBGP sends the ROUTE_DELETE messages to Zebra for the paths whose nexthop was determined as unreachable by IGP, but when Zebra received the ROUTE_DELETE messages for the unreachable nexthop, Zebra will send the NEXTHOP_UPDATE message with the given nexthop is reachable via the default interface. This message unexpectedly causes updates of the unreachable path to be reachable (not true though). Then GoBGP will send ROUTE_ADD messages to Zebra, but those paths soon will be invalidated via the NEXTHOP_UPDATE message, GoBGP will send the ROUTE_DELETE messages and ... (infinite loop). This patch fixes to avoid sending the ROUTE_DELETE messages for the unreachable paths because those paths are inactivated on Zebra and not installed to FIB. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23fix: missing validateCondition in ReplaceStatementlnever
2018-05-11fix add-path with vrf-neighborFUJITA Tomonori
close #1661 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-10make Path objects in rib read-onlyFUJITA Tomonori
Now you can read Path objects in rib safely. Nobody modifies them. GetRib() API doesn't need to clone the objects. With full routes, this avoid allocating temporary huge memory. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: use shorter key for map of ipv4 and ipv6 prefixesFUJITA Tomonori
save about 100MB memory. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove Radixkey member in Destination structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove key member in Path structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove uuid member in originInfo structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove VrfIds member in Path structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07avoid updating Path in the rib via MarkStale()FUJITA Tomonori
A path object in the adj-in is also in the master rib. We can't update such. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07table: remove withdraw/newPath/oldPath Lists in DestinationFUJITA Tomonori
Shrink memory usage. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07preparation for shrinking Destination structureFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-07use sorted single master table for route server setupFUJITA Tomonori
https://github.com/osrg/gobgp/issues/1249 The IN policy was removed. The modification by the IMPORT policy are visible to all route server peers. This saves some dozens bytes memory per a path. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-04-25Restore PathIdentifier for paths belonging to VRFsDavid Barroso
2018-04-03packet/bgp: Getter functions for AS segmentIWASE Yusuke
This patch adds getter functions for the segment type and AS list of each segment without using type assertion. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-04-03packet/bgp: Remove length argument from NewEVPNNLRIIWASE Yusuke
The length value can be retrieved from the route type specific data field and need not to be specified at the initialization. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-21table: fix handleMacMobility()FUJITA Tomonori
needs to find a diffrent ESI with the same mac address. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-16table/path: Originator ID for locally generated pathsIWASE Yusuke
The current implementation unexpectedly sets "0.0.0.0" as the ORIGINATOR_ID value for the locally generated paths when acting as a Route Reflector. This patch fixes to set own Router ID as the ORIGINATOR_ID value. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-13packet/bgp: Remove raw binary field on PathAttributeIWASE Yusuke
The current implementation, PathAttribute stores the raw binary data as "Value" field, but this field increases the memory consumption. This patch removes "Value" field to slim down. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-08config: Option to disable best path selectionIWASE Yusuke
Note: When this option is specified, no path will be redistributed to any peer, because there is no best path. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-06table: Change type of BestPathReason to uint8IWASE Yusuke
The current type is string, which size is multiple of byte(=uint8). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-02-06table: replace time.Time struct with int64 in originInfo structFUJITA Tomonori
We don't need nanosecond precision. shrinks from 96 to 80 bytes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-06table: change originInfo struct layout to reduce the sizeFUJITA Tomonori
shrinks from 112 to 96 bytes. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-24*: Use strconv.ParseUint instead of strconv.Atoi()IWASE Yusuke
For the 32-bit platform compatibility. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-01-23fix breakage with the latest github.com/satori/go.uuidFUJITA Tomonori
The API has changed with the master branch of go.uuid. GoBGP uses the dependency management tool so it's not problem. However, there are projects using GoBGP as a library and doesn't use a dependency management tool... GoBGP has used a released version of go.uuid so now I have to change Gopkg.toml to use tha master branch. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-21cli: Enable to filter EVPN routes by Route TypeIWASE Yusuke
Currently, "gobgp" command supports only to display all routes on RIBs, but with huge RIBs, it is convenient to select routes by a part of NLRI fields. This patch enables to filter routes by EVPN Route Type. For example, when 5 routes for each route type; $ gobgp global rib -a evpn Network Labels Next Hop AS_PATH Age Attrs *> [type:A-D][rd:65000:100][esi:single-homed][etag:10] [10] 0.0.0.0 00:01:09 [{Origin: ?}] *> [type:Prefix][rd:65000:100][etag:10][prefix:10.0.0.0/24] [0] 0.0.0.0 00:00:04 [{Origin: ?} [ESI: single-homed] [GW: 0.0.0.0]] *> [type:esi][rd:65000:100][esi:single-homed][ip:10.0.0.1] 0.0.0.0 00:00:19 [{Origin: ?}] *> [type:macadv][rd:65000:100][etag:10][mac:aa:bb:cc:dd:ee:ff][ip:10.0.0.1] [20,30] 0.0.0.0 00:00:54 [{Origin: ?} [ESI: single-homed]] *> [type:multicast][rd:65000:100][etag:10][ip:10.0.0.1] 0.0.0.0 00:00:33 [{Origin: ?}] You can select multicast route as following; $ gobgp global rib -a evpn multicast Network Labels Next Hop AS_PATH Age Attrs *> [type:multicast][rd:65000:100][etag:10][ip:10.0.0.1] 0.0.0.0 00:03:02 [{Origin: ?}] Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-12-20table: fix converting 2bytes to 4bytes AS PATHFUJITA Tomonori
On some conditions, we add some ASes to As4PathParam.AS but don't update As4PathParam.Num (the number of ASes). It breaks serialization of AS4PathParam. Instead of modifying the internal of As4PathParam, let's create a new As4PathParam object. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-16table/policy: Support prefix representation in NeighborSetSatoshi Fujimoto
Currently, "neighbor-set" supports only IP address representation and IP prefix representation(such as "192.168.0.0/24") is not supported. This commit enables to accept the prefix representation for "neighbor-set" to allow neighbors to be specified as range. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-26cmd/neighbor: Refactor ShowRoute()Satoshi Fujimoto
For readability and maintainability, separate ShowRoute() into some small functions. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@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-23table: use Path's hash value for mergingFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-23table: add attribute hash value to Path structureFUJITA Tomonori
This is for batching paths into one bgp message. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>