diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-09-05 10:13:37 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-09-17 13:36:45 +0900 |
commit | 0716d2cba1e2c636ff02272dd721a1b35d7883a9 (patch) | |
tree | b954e2f23225119da6173a69230f4c6cfdc18188 | |
parent | a5f24fe3e32ba1f8e210e77917d8dd28ad9e96b9 (diff) |
packet/zebra: Constants for supporting FRRouting format
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/lib/packet/zebra.py | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/ryu/lib/packet/zebra.py b/ryu/lib/packet/zebra.py index 62b4d8ff..71d8947b 100644 --- a/ryu/lib/packet/zebra.py +++ b/ryu/lib/packet/zebra.py @@ -40,6 +40,7 @@ LOG = logging.getLogger(__name__) # Default Zebra protocol version _DEFAULT_VERSION = 3 +_DEFAULT_FRR_VERSION = 4 # Constants in quagga/lib/zebra.h @@ -78,6 +79,59 @@ ZEBRA_NEXTHOP_UNREGISTER = 28 ZEBRA_NEXTHOP_UPDATE = 29 ZEBRA_MESSAGE_MAX = 30 +# Zebra message types on FRRouting +FRR_ZEBRA_INTERFACE_ADD = 0 +FRR_ZEBRA_INTERFACE_DELETE = 1 +FRR_ZEBRA_INTERFACE_ADDRESS_ADD = 2 +FRR_ZEBRA_INTERFACE_ADDRESS_DELETE = 3 +FRR_ZEBRA_INTERFACE_UP = 4 +FRR_ZEBRA_INTERFACE_DOWN = 5 +FRR_ZEBRA_IPV4_ROUTE_ADD = 6 +FRR_ZEBRA_IPV4_ROUTE_DELETE = 7 +FRR_ZEBRA_IPV6_ROUTE_ADD = 8 +FRR_ZEBRA_IPV6_ROUTE_DELETE = 9 +FRR_ZEBRA_REDISTRIBUTE_ADD = 10 +FRR_ZEBRA_REDISTRIBUTE_DELETE = 11 +FRR_ZEBRA_REDISTRIBUTE_DEFAULT_ADD = 12 +FRR_ZEBRA_REDISTRIBUTE_DEFAULT_DELETE = 13 +FRR_ZEBRA_ROUTER_ID_ADD = 14 +FRR_ZEBRA_ROUTER_ID_DELETE = 15 +FRR_ZEBRA_ROUTER_ID_UPDATE = 16 +FRR_ZEBRA_HELLO = 17 +FRR_ZEBRA_NEXTHOP_REGISTER = 18 +FRR_ZEBRA_NEXTHOP_UNREGISTER = 19 +FRR_ZEBRA_NEXTHOP_UPDATE = 20 +FRR_ZEBRA_INTERFACE_NBR_ADDRESS_ADD = 21 +FRR_ZEBRA_INTERFACE_NBR_ADDRESS_DELETE = 22 +FRR_ZEBRA_INTERFACE_BFD_DEST_UPDATE = 23 +FRR_ZEBRA_IMPORT_ROUTE_REGISTER = 24 +FRR_ZEBRA_IMPORT_ROUTE_UNREGISTER = 25 +FRR_ZEBRA_IMPORT_CHECK_UPDATE = 26 +FRR_ZEBRA_IPV4_ROUTE_IPV6_NEXTHOP_ADD = 27 +FRR_ZEBRA_BFD_DEST_REGISTER = 28 +FRR_ZEBRA_BFD_DEST_DEREGISTER = 29 +FRR_ZEBRA_BFD_DEST_UPDATE = 30 +FRR_ZEBRA_BFD_DEST_REPLAY = 31 +FRR_ZEBRA_REDISTRIBUTE_IPV4_ADD = 32 +FRR_ZEBRA_REDISTRIBUTE_IPV4_DEL = 33 +FRR_ZEBRA_REDISTRIBUTE_IPV6_ADD = 34 +FRR_ZEBRA_REDISTRIBUTE_IPV6_DEL = 35 +FRR_ZEBRA_VRF_UNREGISTER = 36 +FRR_ZEBRA_VRF_ADD = 37 +FRR_ZEBRA_VRF_DELETE = 38 +FRR_ZEBRA_INTERFACE_VRF_UPDATE = 39 +FRR_ZEBRA_BFD_CLIENT_REGISTER = 40 +FRR_ZEBRA_INTERFACE_ENABLE_RADV = 41 +FRR_ZEBRA_INTERFACE_DISABLE_RADV = 42 +FRR_ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB = 43 +FRR_ZEBRA_INTERFACE_LINK_PARAMS = 44 +FRR_ZEBRA_MPLS_LABELS_ADD = 45 +FRR_ZEBRA_MPLS_LABELS_DELETE = 46 +FRR_ZEBRA_IPV4_NEXTHOP_ADD = 47 +FRR_ZEBRA_IPV4_NEXTHOP_DELETE = 48 +FRR_ZEBRA_IPV6_NEXTHOP_ADD = 49 +FRR_ZEBRA_IPV6_NEXTHOP_DELETE = 50 + # Zebra route types ZEBRA_ROUTE_SYSTEM = 0 ZEBRA_ROUTE_KERNEL = 1 @@ -95,6 +149,30 @@ ZEBRA_ROUTE_OLSR = 12 ZEBRA_ROUTE_BABEL = 13 ZEBRA_ROUTE_MAX = 14 +# Zebra route types on FRRouting +FRR_ZEBRA_ROUTE_SYSTEM = 0 +FRR_ZEBRA_ROUTE_KERNEL = 1 +FRR_ZEBRA_ROUTE_CONNECT = 2 +FRR_ZEBRA_ROUTE_STATIC = 3 +FRR_ZEBRA_ROUTE_RIP = 4 +FRR_ZEBRA_ROUTE_RIPNG = 5 +FRR_ZEBRA_ROUTE_OSPF = 6 +FRR_ZEBRA_ROUTE_OSPF6 = 7 +FRR_ZEBRA_ROUTE_ISIS = 8 +FRR_ZEBRA_ROUTE_BGP = 9 +FRR_ZEBRA_ROUTE_PIM = 10 +FRR_ZEBRA_ROUTE_HSLS = 11 +FRR_ZEBRA_ROUTE_OLSR = 12 +FRR_ZEBRA_ROUTE_TABLE = 13 +FRR_ZEBRA_ROUTE_LDP = 14 +FRR_ZEBRA_ROUTE_VNC = 15 +FRR_ZEBRA_ROUTE_VNC_DIRECT = 16 +FRR_ZEBRA_ROUTE_VNC_DIRECT_RH = 17 +FRR_ZEBRA_ROUTE_BGP_DIRECT = 18 +FRR_ZEBRA_ROUTE_BGP_DIRECT_EXT = 19 +FRR_ZEBRA_ROUTE_ALL = 20 +FRR_ZEBRA_ROUTE_MAX = 21 + # Zebra message flags ZEBRA_FLAG_INTERNAL = 0x01 ZEBRA_FLAG_SELFROUTE = 0x02 @@ -105,6 +183,17 @@ ZEBRA_FLAG_FIB_OVERRIDE = 0x20 ZEBRA_FLAG_STATIC = 0x40 ZEBRA_FLAG_REJECT = 0x80 +# Zebra message flags on FRRouting +FRR_ZEBRA_FLAG_INTERNAL = 0x01 +FRR_ZEBRA_FLAG_SELFROUTE = 0x02 +FRR_ZEBRA_FLAG_BLACKHOLE = 0x04 +FRR_ZEBRA_FLAG_IBGP = 0x08 +FRR_ZEBRA_FLAG_SELECTED = 0x10 +FRR_ZEBRA_FLAG_STATIC = 0x40 +FRR_ZEBRA_FLAG_REJECT = 0x80 +FRR_ZEBRA_FLAG_SCOPE_LINK = 0x100 +FRR_ZEBRA_FLAG_FIB_OVERRIDE = 0x200 + # Zebra nexthop flags ZEBRA_NEXTHOP_IFINDEX = 1 ZEBRA_NEXTHOP_IFNAME = 2 @@ -116,6 +205,13 @@ ZEBRA_NEXTHOP_IPV6_IFINDEX = 7 ZEBRA_NEXTHOP_IPV6_IFNAME = 8 ZEBRA_NEXTHOP_BLACKHOLE = 9 +# Zebra nexthop flags on FRRouting +FRR_ZEBRA_NEXTHOP_IFINDEX = 1 +FRR_ZEBRA_NEXTHOP_IPV4 = 2 +FRR_ZEBRA_NEXTHOP_IPV4_IFINDEX = 3 +FRR_ZEBRA_NEXTHOP_IPV6 = 4 +FRR_ZEBRA_NEXTHOP_IPV6_IFINDEX = 5 +FRR_ZEBRA_NEXTHOP_BLACKHOLE = 6 # Constants in quagga/lib/zclient.h @@ -127,6 +223,16 @@ ZAPI_MESSAGE_METRIC = 0x08 ZAPI_MESSAGE_MTU = 0x10 ZAPI_MESSAGE_TAG = 0x20 +# Zebra API message flags on FRRouting. +# Note: Constants for TAG/MTU is inverted from Quagga version. +FRR_ZAPI_MESSAGE_NEXTHOP = 0x01 +FRR_ZAPI_MESSAGE_IFINDEX = 0x02 +FRR_ZAPI_MESSAGE_DISTANCE = 0x04 +FRR_ZAPI_MESSAGE_METRIC = 0x08 +FRR_ZAPI_MESSAGE_TAG = 0x10 +FRR_ZAPI_MESSAGE_MTU = 0x20 +FRR_ZAPI_MESSAGE_SRCPFX = 0x40 +FRR_ZAPI_MESSAGE_LABEL = 0x80 # Constants in quagga/lib/if.h @@ -142,6 +248,8 @@ INTERFACE_HWADDR_MAX = 20 ZEBRA_INTERFACE_ACTIVE = 1 << 0 ZEBRA_INTERFACE_SUB = 1 << 1 ZEBRA_INTERFACE_LINKDETECTION = 1 << 2 +# Followings are extended on FRRouting +ZEBRA_INTERFACE_VRF_LOOPBACK = 1 << 3 # Zebra interface connected address flags ZEBRA_IFA_SECONDARY = 1 << 0 @@ -220,6 +328,18 @@ LP_TE_METRIC = 0x2000 # "non-official" architectural constants MAX_CLASS_TYPE = 8 +# Constants in frr/zebra/zebra_ptm.h + +# Interface PTM Enable configuration +ZEBRA_IF_PTM_ENABLE_OFF = 0 +ZEBRA_IF_PTM_ENABLE_ON = 1 +ZEBRA_IF_PTM_ENABLE_UNSPEC = 2 + +# PTM status +ZEBRA_PTM_STATUS_DOWN = 0 +ZEBRA_PTM_STATUS_UP = 1 +ZEBRA_PTM_STATUS_UNKNOWN = 2 + # Utility functions/classes |