From 99cccf981227a482cbd6404b664bd4f7cc9a1720 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 25 Apr 2015 10:06:56 +0000 Subject: table: add support for encapsulation nlri add encap end point route(10.0.0.1) with vni 20 $ gobgp global rib add 10.0.0.1 20 -a encap check it $ gobgp global rib -a encap Please specify one command of: add or del Network Next Hop AS_PATH Age Attrs *> 10.0.0.1 0.0.0.0 [64512] 00:00:01 [{Origin: IGP} {Encap: < VXLAN | color: 20 >}] Signed-off-by: ISHIDA Wataru --- api/gobgp.pb.go | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'api/gobgp.pb.go') diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go index 0e2874dd..4fb2413a 100644 --- a/api/gobgp.pb.go +++ b/api/gobgp.pb.go @@ -101,6 +101,7 @@ const ( SAFI_UNICAST SAFI = 1 SAFI_MULTICAST SAFI = 2 SAFI_MPLS_LABEL SAFI = 4 + SAFI_ENCAP SAFI = 7 SAFI_VPLS SAFI = 65 SAFI_EVPN SAFI = 70 SAFI_MPLS_VPN SAFI = 128 @@ -113,6 +114,7 @@ var SAFI_name = map[int32]string{ 1: "UNICAST", 2: "MULTICAST", 4: "MPLS_LABEL", + 7: "ENCAP", 65: "VPLS", 70: "EVPN", 128: "MPLS_VPN", @@ -124,6 +126,7 @@ var SAFI_value = map[string]int32{ "UNICAST": 1, "MULTICAST": 2, "MPLS_LABEL": 4, + "ENCAP": 7, "VPLS": 65, "EVPN": 70, "MPLS_VPN": 128, @@ -228,6 +231,32 @@ func (x EVPN_TYPE) String() string { return proto.EnumName(EVPN_TYPE_name, int32(x)) } +type ENCAP_SUBTLV_TYPE int32 + +const ( + ENCAP_SUBTLV_TYPE_UNKNOWN_SUBTLV_TYPE ENCAP_SUBTLV_TYPE = 0 + ENCAP_SUBTLV_TYPE_ENCAPSULATION ENCAP_SUBTLV_TYPE = 1 + ENCAP_SUBTLV_TYPE_PROTOCOL ENCAP_SUBTLV_TYPE = 2 + ENCAP_SUBTLV_TYPE_COLOR ENCAP_SUBTLV_TYPE = 4 +) + +var ENCAP_SUBTLV_TYPE_name = map[int32]string{ + 0: "UNKNOWN_SUBTLV_TYPE", + 1: "ENCAPSULATION", + 2: "PROTOCOL", + 4: "COLOR", +} +var ENCAP_SUBTLV_TYPE_value = map[string]int32{ + "UNKNOWN_SUBTLV_TYPE": 0, + "ENCAPSULATION": 1, + "PROTOCOL": 2, + "COLOR": 4, +} + +func (x ENCAP_SUBTLV_TYPE) String() string { + return proto.EnumName(ENCAP_SUBTLV_TYPE_name, int32(x)) +} + type BGP_ATTR_TYPE int32 const ( @@ -431,8 +460,12 @@ func (m *Nlri) GetEvpnNlri() *EVPNNlri { } type TunnelEncapSubTLV struct { - Type uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Type ENCAP_SUBTLV_TYPE `protobuf:"varint,1,opt,name=type,enum=api.ENCAP_SUBTLV_TYPE" json:"type,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Key uint32 `protobuf:"varint,3,opt,name=key" json:"key,omitempty"` + Cookie string `protobuf:"bytes,4,opt,name=cookie" json:"cookie,omitempty"` + Protocol uint32 `protobuf:"varint,5,opt,name=protocol" json:"protocol,omitempty"` + Color uint32 `protobuf:"varint,6,opt,name=color" json:"color,omitempty"` } func (m *TunnelEncapSubTLV) Reset() { *m = TunnelEncapSubTLV{} } @@ -616,6 +649,7 @@ func init() { proto.RegisterEnum("api.Origin", Origin_name, Origin_value) proto.RegisterEnum("api.TUNNEL_TYPE", TUNNEL_TYPE_name, TUNNEL_TYPE_value) proto.RegisterEnum("api.EVPN_TYPE", EVPN_TYPE_name, EVPN_TYPE_value) + proto.RegisterEnum("api.ENCAP_SUBTLV_TYPE", ENCAP_SUBTLV_TYPE_name, ENCAP_SUBTLV_TYPE_value) proto.RegisterEnum("api.BGP_ATTR_TYPE", BGP_ATTR_TYPE_name, BGP_ATTR_TYPE_value) proto.RegisterEnum("api.Error_ErrorCode", Error_ErrorCode_name, Error_ErrorCode_value) } -- cgit v1.2.3