summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp
diff options
context:
space:
mode:
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 (