summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-12-18 11:06:33 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-12-30 20:33:37 +0900
commit06be3c5c2637aebca8a887d9f8d87cc1e9a7692a (patch)
tree27593ebaa548430f756fc3c6ad6ab647ebdbbfe3 /packet/bgp/bgp.go
parent577662422ee02622e4a8277ad570d501e0cf7ebc (diff)
cli: Support EVPN Default Gateway Extended Community
This patch enables to support the Default Gateway Extended Community on the EVPN MAC/IP Advertisement route. Usage Example: $ gobgp global rib -a evpn add macadv aa:bb:cc:dd:ee:ff 10.0.0.1 etag 10 label 20,30 rd 1.1.1.1:65000 default-gateway $ gobgp global rib -a evpn Network Labels Next Hop AS_PATH Age Attrs *> [type:macadv][rd:1.1.1.1:65000][etag:10][mac:aa:bb:cc:dd:ee:ff][ip:10.0.0.1] [20,30] 0.0.0.0 00:00:00 [{Origin: ?} {Extcomms: [default-gateway]} [ESI: single-homed]] Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/bgp/bgp.go')
-rw-r--r--packet/bgp/bgp.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go
index 66e5ff30..28d47cfd 100644
--- a/packet/bgp/bgp.go
+++ b/packet/bgp/bgp.go
@@ -6470,6 +6470,19 @@ func (e *EncapExtended) String() string {
}
}
+type DefaultGatewayExtended struct {
+}
+
+func (e *DefaultGatewayExtended) Serialize() ([]byte, error) {
+ buf := make([]byte, 7)
+ buf[0] = byte(EC_SUBTYPE_DEFAULT_GATEWAY)
+ return buf, nil
+}
+
+func (e *DefaultGatewayExtended) String() string {
+ return "default-gateway"
+}
+
type OpaqueExtended struct {
IsTransitive bool
Value OpaqueExtendedValueInterface
@@ -6494,6 +6507,8 @@ func (e *OpaqueExtended) DecodeFromBytes(data []byte) error {
e.Value = &EncapExtended{
TunnelType: t,
}
+ case EC_SUBTYPE_DEFAULT_GATEWAY:
+ e.Value = &DefaultGatewayExtended{}
default:
e.Value = &DefaultOpaqueExtendedValue{
Value: data, //7byte