diff options
author | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2018-05-29 09:31:23 +0900 |
---|---|---|
committer | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2018-06-13 13:50:30 +0900 |
commit | 0c334f5b3f8d330ced71649316c894119b2432d3 (patch) | |
tree | fe85e3e7e2bba38548d3519ff5373cedc9e8ff1f /packet | |
parent | 4c63ed5d87f28ba2a829cec8cb65c01388a703ed (diff) |
gobgpd: Use gRPC APIs Instead of BgpServer functions
In order to integarate the setting via configuration files and via gRPC API,
This commit fixes gobgpd to use gRPC APIs
instead of using BgpServer functions directly, for consistency.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'packet')
-rw-r--r-- | packet/bgp/bgp.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 88464cf2..d12c3e2f 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -6645,6 +6645,19 @@ func ParseRouteTarget(rt string) (ExtendedCommunityInterface, error) { return ParseExtendedCommunity(EC_SUBTYPE_ROUTE_TARGET, rt) } +func SerializeExtendedCommunities(comms []ExtendedCommunityInterface) ([][]byte, error) { + var bufs [][]byte + var err error + for _, c := range comms { + buf, err := c.Serialize() + if err != nil { + return nil, err + } + bufs = append(bufs, buf) + } + return bufs, err +} + type ValidationState uint8 const ( |