summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ri.h
diff options
context:
space:
mode:
authorOlivier Dugeon <olivier.dugeon@orange.com>2018-01-18 19:11:11 +0100
committerOlivier Dugeon <olivier.dugeon@orange.com>2018-01-18 19:11:11 +0100
commitcf9b9f77f638923f5a44fdd14ce2725631ffa526 (patch)
tree70b0b5c8181c23a4fd8faf5750e80083a422c728 /ospfd/ospf_ri.h
parentMerge pull request #1626 from LabNConsulting/working/master/vnc-config (diff)
downloadfrr-cf9b9f77f638923f5a44fdd14ce2725631ffa526.tar.xz
frr-cf9b9f77f638923f5a44fdd14ce2725631ffa526.zip
OSPFD: Add Experimental Segment Routing support
This is an implementation of draft-ietf-ospf-segment-routing-extensions-24 and RFC7684 for Extended Link & Prefix Opaque LSA. Look to doc/OSPF_SR.rst for implementation details & known limitations. New files: - ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB) - ospfd/ospf_sr.c: Main functions for Segment Routing support - ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684 - ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation - doc/OSPF-SRr.rst: Documentation Modified Files: - doc/ospfd.texi: Add new Segment Routing CLI command definition - lib/command.h: Add new string command for Segment Routing CLI - lib/mpls.h: Add default value for SRGB - lib/route_types.txt: Add new OSPF Segment Routing route type - ospfd/ospf_dump.[c,h]: Add OSPF SR debug - ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type - ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function - ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c() - ospfd/ospf_ri.h: Add new Router Information SR SubTLVs - ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger update of NHLFE - ospfd/ospfd.h: Add new thread for Segment Routing scheduler - ospfd/subdir.am: Add new files - vtysh/Makefile.am: Add new ospf_sr.c file for vtysh - zebra/kernel_netlink.c: Add new OSPF_SR route type - zebra/rt_netlink.[c,h]: Add new OSPF_SR route type - zebra/zebra_mpls.h: Add new OSPF_SR route type Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_ri.h')
-rw-r--r--ospfd/ospf_ri.h54
1 files changed, 32 insertions, 22 deletions
diff --git a/ospfd/ospf_ri.h b/ospfd/ospf_ri.h
index 2d90730d9..3fb83141b 100644
--- a/ospfd/ospf_ri.h
+++ b/ospfd/ospf_ri.h
@@ -1,11 +1,13 @@
/*
* This is an implementation of RFC4970 Router Information
* with support of RFC5088 PCE Capabilites announcement
+ * and support of draft-ietf-ospf-segment-routing-extensions-18
+ * for Segment Routing Capabilities announcement
+ *
*
* Module name: Router Information
- * Version: 0.99.22
- * Created: 2012-02-01 by Olivier Dugeon
- * Copyright (C) 2012 Orange Labs http://www.orange.com/
+ * Author: Olivier Dugeon <olivier.dugeon@orange.com>
+ * Copyright (C) 2012 - 2017 Orange Labs http://www.orange.com/
*
* This file is part of GNU Zebra.
*
@@ -33,7 +35,7 @@
*
* 24 16 8 0
* +--------+--------+--------+--------+
- * | 1 | MBZ |........|........|
+ * | 4 | MBZ |........|........|
* +--------+--------+--------+--------+
* |<-Type->|<Resv'd>|<-- Instance --->|
*
@@ -57,9 +59,8 @@
* +--------+--------+--------+--------+ |
* | LS checksum | Length | V
* +--------+--------+--------+--------+ ---
- * | Type | Length | A
- * +--------+--------+--------+--------+ | TLV part for Router Information;
- * Values might be
+ * | Type | Length | A TLV part for Router Information;
+ * +--------+--------+--------+--------+ | Values might be
* | Values ... | V structured as a set of sub-TLVs.
* +--------+--------+--------+--------+ ---
*/
@@ -68,9 +69,9 @@
* Following section defines TLV body parts.
*/
-/* Up to now, 8 code point have been assigned to Router Information */
+/* Up to now, 11 code points have been assigned to Router Information */
/* Only type 1 Router Capabilities and 6 PCE are supported with this code */
-#define RI_IANA_MAX_TYPE 8
+#define RI_IANA_MAX_TYPE 11
/* RFC4970: Router Information Capabilities TLV */ /* Mandatory */
#define RI_TLV_CAPABILITIES 1
@@ -80,12 +81,13 @@ struct ri_tlv_router_cap {
u_int32_t value;
};
-#define RI_GRACE_RESTART 0x01
-#define RI_GRACE_HELPER 0x02
-#define RI_STUB_SUPPORT 0x04
-#define RI_TE_SUPPORT 0x08
-#define RI_P2P_OVER_LAN 0x10
-#define RI_TE_EXPERIMENTAL 0x20
+/* Capabilities bits are left align */
+#define RI_GRACE_RESTART 0x80000000
+#define RI_GRACE_HELPER 0x40000000
+#define RI_STUB_SUPPORT 0x20000000
+#define RI_TE_SUPPORT 0x10000000
+#define RI_P2P_OVER_LAN 0x08000000
+#define RI_TE_EXPERIMENTAL 0x04000000
#define RI_TLV_LENGTH 4
@@ -151,22 +153,30 @@ struct ri_pce_subtlv_neighbor {
#define RI_PCE_SUBTLV_CAP_FLAG 5
#define PCE_CAP_GMPLS_LINK 0x0001
-#define PCE_CAP_BIDIRECTIONAL 0x0002
-#define PCE_CAP_DIVERSE_PATH 0x0004
-#define PCE_CAP_LOAD_BALANCE 0x0008
-#define PCE_CAP_SYNCHRONIZED 0x0010
+#define PCE_CAP_BIDIRECTIONAL 0x0002
+#define PCE_CAP_DIVERSE_PATH 0x0004
+#define PCE_CAP_LOAD_BALANCE 0x0008
+#define PCE_CAP_SYNCHRONIZED 0x0010
#define PCE_CAP_OBJECTIVES 0x0020
#define PCE_CAP_ADDITIVE 0x0040
-#define PCE_CAP_PRIORIZATION 0x0080
-#define PCE_CAP_MULTIPLE_REQ 0x0100
+#define PCE_CAP_PRIORIZATION 0x0080
+#define PCE_CAP_MULTIPLE_REQ 0x0100
struct ri_pce_subtlv_cap_flag {
struct tlv_header header; /* Type = 5; Length = n x 4 bytes. */
u_int32_t value;
};
+/* Structure to share flooding scope info for Segment Routing */
+struct scope_info {
+ u_int8_t scope;
+ struct in_addr area_id;
+};
+
/* Prototypes. */
extern int ospf_router_info_init(void);
extern void ospf_router_info_term(void);
-
+extern int ospf_router_info_enable(void);
+extern void ospf_router_info_update_sr(bool, struct sr_srgb, u_int8_t);
+extern struct scope_info ospf_router_info_get_flooding_scope(void);
#endif /* _ZEBRA_OSPF_ROUTER_INFO_H */