Skip to content

Commit

Permalink
init evpn class
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
  • Loading branch information
xiaopeng163 committed Jan 21, 2016
1 parent 73da0eb commit 41500bd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions yabgp/common/safn.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
SAFNUM_TUNNEL = 64 # draft-nalawade-kapoor-tunnel-safi-02.txt
SAFNUM_VPLS = 65
SAFNUM_MDT = 66 # rfc6037
SAFNUM_EVPN = 70 # RFC 7432
SAFNUM_BGPLS = 71
SAFNUM_LAB_VPNUNICAST = 128 # Draft-rosen-rfc2547bis-03
SAFNUM_LAB_VPNMULCAST = 129
Expand Down
7 changes: 7 additions & 0 deletions yabgp/message/attribute/mpreachnlri.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ def parse(cls, value):
else:
return dict(afi_safi=(afi, safi), nexthop=nexthop, nlri=nlri)

# for l2vpn
elif afi == afn.AFNUM_L2VPN:
if safi == safn.SAFNUM_EVPN:
pass
else:
nlri = repr(nlri_bin)

else:
nlri = repr(nlri_bin)

Expand Down
38 changes: 38 additions & 0 deletions yabgp/message/attribute/nlri/evpn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from yabgp.message.attribute.nlri import NLRI
from yabgp.message.attribute.nlri.mpls_vpn import MPLSVPN


class EVPN(MPLSVPN, NLRI):
"""
The format of the EVPN NLRI is as follows:
+-----------------------------------+
| Route Type (1 octet) |
+-----------------------------------+
| Length (1 octet) |
+-----------------------------------+
| Route Type specific (variable) |
+-----------------------------------+
"""

@classmethod
def parse(cls, nlri_data):
pass

@classmethod
def construct(cls, nlri_list):
pass

0 comments on commit 41500bd

Please sign in to comment.