summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2018-05-29 09:31:23 +0900
committerSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2018-06-13 13:50:30 +0900
commit0c334f5b3f8d330ced71649316c894119b2432d3 (patch)
treefe85e3e7e2bba38548d3519ff5373cedc9e8ff1f /packet/bgp
parent4c63ed5d87f28ba2a829cec8cb65c01388a703ed (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/bgp')
-rw-r--r--packet/bgp/bgp.go13
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 (