summaryrefslogtreecommitdiffhomepage
path: root/api
AgeCommit message (Collapse)Author
2018-08-08rpc cleanupFUJITA Tomonori
- clean up RPC function names - rewrite gobgp command to use the api instead of config package - delete unused client package Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-08remove package dependency except for grpc in api/FUJITA Tomonori
Nothing except for protobuf IDL files and files generated by protobuf in api/. Try to make the APIs portable to any languages. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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-06api: move api/policy.go to gobgp/cmd/FUJITA Tomonori
Some functions might be useful as public APIs but for now make everything private. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-06api: decrease the dependencyFUJITA Tomonori
move grpc_server.go to server/ 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-06cmd: Implement PrettyString()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-07-06cmd: Remove table/ usage in policy.goSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-07-06gobgp: fix client.AddPath to use api.Path instead of table.PathFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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-21api: Use capability.proto in message PeerConfIWASE Yusuke
The current formats of the remote/local capabilities in message PeerConf are the binary type representation, this patch fixes to use the structures defined in capability.proto file. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-21api: Define protobuf for BGP CapabilitiesIWASE Yusuke
Example of protoc command: $ export PROTOBUF=${HOME}/protobuf/src $ export GOBGP=${GOPATH}/src/github.com/osrg/gobgp $ protoc \ -I ${PROTOBUF} \ -I ${GOBGP}/api \ --go_out=plugins=grpc:${GOBGP}/api \ ${GOBGP}/api/gobgp.proto \ ${GOBGP}/api/attribute.proto \ ${GOBGP}/api/capability.proto Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-19api: Use attribute.proto struct in message VrfIWASE Yusuke
The current formats of the RD and import/export RTs in message Vrf are the binary type representation, this patch fixes to use the structures defined in attribute.proto file. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-14simple staticcheck issuesJeff Bean
2018-06-13table: support AfiSafiIn Policy Condition matchMarcin Ptaszyński
2018-06-13api: Implement Shutdonw()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Implement AddCollector()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Implement UpdatePolicy()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Implement PeerGroup and DynamicNeighbor APISatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Add missing fields to Peer struct conversion functionsSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Add some fields to notify Graceful Restart stateSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Fix StartServerAPISatoshi Fujimoto
Currently, StartServerAPI accepts few parameters and setting such as BGP confederation and graceful restart cannot be configured via gRPC API. This commit fixes this API to accept all the parameters which is configurable in a configuration file/ Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13config: Change "RedistributeRouteTypeList" to []stringSatoshi Fujimoto
RedistributeRouteTypeList is []InstallProtocolType, but InstallProtocolType only defines limited number of protocols, And currently, EnableZebra() in gRPC API validates its request with the protocols defined by InstallProtocolType, so the protocols such as "babel" or "lldp" could not be configured to Zebra, via gRPC API. This patch fixes RedistributeRouteTypeList to be []string, and fixes EnableZebra() to validate with the protocols defined in zapi.go. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-06-13api: Use api/attribute.proto structure in gRPC APIIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-06-13api: Define protobuf structure for BGP Path AttributesIWASE Yusuke
Example of protoc command: $ export PROTOBUF=${HOME}/protobuf/src $ export GOBGP=${GOPATH}/src/github.com/osrg/gobgp $ protoc \ -I ${PROTOBUF} \ -I ${GOBGP}/api \ --go_out=plugins=grpc:${GOBGP}/api \ ${GOBGP}/api/gobgp.proto \ ${GOBGP}/api/attribute.proto Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-06-05Fix: ruby client failed with "Enum value '_' does not start with an ↵Shintaro Kojima
uppercase letter as is required for Ruby constants"
2018-05-31cli: Implement "neighbor update" commandIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-30api: fix rpki regressionFUJITA Tomonori
the commit 8c453bc9369e4cd96d19b9598bebb0ea2e23e991 fixes NewROAListFromApiStructList() to check an error strictly. However, this breaks the rpki table command: $ gobgp rpki table invalid CIDR address: 1.0.16.0 NewROAListFromApiStructList() has a bug about getting the address family from an IP address. The address family was not used (other information are used though) so before the commit, the command worked. This fixes the bug in NewROAListFromApiStructList(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-22cmd: Remove uncaught error on ParseCIDR()Satoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
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: remove uuid member in originInfo 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-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-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-12api: Support current flag in MonitorPeerState APIIWASE Yusuke
This patch adds "current" flag in MonitorPeerState API and enables to get the current (existing) neighbors when gRPC client connecting to GoBGP daemon. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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-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>
2017-11-16api: Activate address family using Peer.AfiSafisIWASE Yusuke
Currently, to configure per AFI-SAFI settings when adding neighbor via gRPC API, it is require to specify the both Peer.Families and Peer.AfiSafis fields. If Peer.Families is omitted, settings in Peer.AfiSafis are ignored and the given address families are not activated. This patch enables to configure per AFI-SAFI settings and activate the address family with only Peer.AfiSafis (without Peer.Families). Note: For the backward compatibility, if only Peer.Families is specified, this patch creates per AFI-SAFI settings with the default settings. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-16api: Define constants for address familiesIWASE Yusuke
To call some gRPC APIs, it is required to specify the address family value which is combined value of AFI and SAFI values, so users of gRPC APIs need to calculate this value. This patch introduces the constants for the address families for the convenience. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-13api/grpc_server: Remove redundant loop for gRPC serverIWASE Yusuke
gRPC server should try to start serving only once because it send stopped signal to the waiter if server could not start. This patch removes redundant "for" loop to improve code inspection result. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-13api/grpc_server: Avoid name collision "server"IWASE Yusuke
To improve code inspection result, this patch renames "server" variables in NewServer() to "s" because "server" collides the imported package name "github.com/osrg/gobgp/server". Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-13api/grpc_server: Use make() for an empty slice declarationIWASE Yusuke
To improve code inspection result, this patch uses make() for an empty slice declaration instead of using empty literal initializer. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-13api/grpc_server: Avoid index error when invalid set-med valueIWASE Yusuke
Currently, with a invalid "set-med" value in a policy action, GoBGP will raise panic of "index out of range" because the unmatched regular expression is not handled. This patch fixes to handle errors during parsing the given med value. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-12cli: Support address families when adding neighborIWASE Yusuke
Currently, "gobgp" command does not support to configure address families capability when adding a new neighbor. This patch introduces a new option field to "gobgp neighbor add" command and enables to configure address families capability. Example: Specify address family names in comma separated format $ gobgp neighbor add 10.0.0.3 as 65003 family ipv4-unicast,l2vpn-evpn $ gobgp neighbor 10.0.0.3 ...(snip)... Neighbor capabilities: multiprotocol: ipv4-unicast: advertised l2vpn-evpn: advertised route-refresh: advertised 4-octet-as: advertised ...(snip)... 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-10-03api: Enable to set/get add-paths config via gRPCIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-09-25api: GetPath API alternative to GetRibIWASE Yusuke
With the extremely large RIBs, GetRib gRPC API hits the limits of each message size, because this API is using simple request/response RPC. This patch introduces a new API GetPath which using streaming RPC and can retrieve RIBs even if extremely large. Note: GetRib can be replaced with GetPath and obsoleted in the future. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>