]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospfd.h
*: conform with COMMUNITY.md formatting rules, via 'make indent'
[mirror_frr.git] / ospfd / ospfd.h
index b49bbdc17dfd33ae1a09acafa19c4953c0eb7ce6..bed446085e467c8fb85afe89ef77a1109a4498a8 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "filter.h"
 #include "log.h"
+#include "vrf.h"
 
 #include "ospf_memory.h"
 #include "ospf_dump_api.h"
@@ -92,13 +93,6 @@ struct ospf_master {
        /* OSPF thread master. */
        struct thread_master *master;
 
-       /* Zebra interface list. */
-       struct list *iflist;
-
-       /* Redistributed external information. */
-       struct list *external[ZEBRA_ROUTE_MAX + 1];
-#define EXTERNAL_INFO(E)      (E->external_info)
-
        /* Various OSPF global configuration. */
        u_char options;
 #define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */
@@ -135,6 +129,10 @@ struct ospf {
        /* OSPF Router ID. */
        struct in_addr router_id;       /* Configured automatically. */
        struct in_addr router_id_static; /* Configured manually. */
+       struct in_addr router_id_zebra;
+
+       vrf_id_t vrf_id; /* VRF Id */
+       char *name;      /* VRF name */
 
        /* ABR/ASBR internal flags. */
        u_char flags;
@@ -167,8 +165,6 @@ struct ospf {
        /* RFC3137 stub router. Configured time to stay stub / max-metric */
        unsigned int stub_router_startup_time;  /* seconds */
        unsigned int stub_router_shutdown_time; /* seconds */
-                                               /* $FRR indent$ */
-                                               /* clang-format off */
 #define OSPF_STUB_ROUTER_UNCONFIGURED    0
        u_char stub_router_admin_set;
 #define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET     1
@@ -189,8 +185,6 @@ struct ospf {
                spf_hold_multiplier; /* Adaptive multiplier for hold time */
 
        int default_originate;  /* Default information originate. */
-                                     /* $FRR indent$ */
-                                     /* clang-format off */
 #define DEFAULT_ORIGINATE_NONE         0
 #define DEFAULT_ORIGINATE_ZEBRA                1
 #define DEFAULT_ORIGINATE_ALWAYS       2
@@ -242,6 +236,7 @@ struct ospf {
        struct thread *t_external_lsa;      /* AS-external-LSA origin timer. */
        struct thread
                *t_opaque_lsa_self; /* Type-11 Opaque-LSAs origin event. */
+       struct thread *t_sr_update; /* Segment Routing update timer */
 
        unsigned int maxage_delay;      /* Delay on Maxage remover timer, sec */
        struct thread *t_maxage;        /* MaxAge LSA remover timer. */
@@ -302,11 +297,21 @@ struct ospf {
        /* Statistics for LSA used for new instantiation. */
        u_int32_t rx_lsa_count;
 
-       /* Counter of "ip ospf area x.x.x.x" */
+       /* Counter of "ip ospf area x.x.x.x" used
+        * for multual exclusion of network command under
+        * router ospf or ip ospf area x under interface. */
        u_int32_t if_ospf_cli_count;
 
        struct route_table *distance_table;
 
+       /* Used during ospf instance going down send LSDB
+        * update to neighbors immediatly */
+       uint8_t inst_shutdown;
+
+       /* Redistributed external information. */
+       struct list *external[ZEBRA_ROUTE_MAX + 1];
+#define EXTERNAL_INFO(E)      (E->external_info)
+
        QOBJ_FIELDS
 };
 DECLARE_QOBJ_TYPE(ospf)
@@ -334,8 +339,6 @@ struct ospf_area {
        int external_routing;    /* ExternalRoutingCapability. */
        int no_summary;          /* Don't inject summaries into stub.*/
        int shortcut_configured; /* Area configured as shortcut. */
-                                /* $FRR indent$ */
-                                /* clang-format off */
 #define OSPF_SHORTCUT_DEFAULT  0
 #define OSPF_SHORTCUT_ENABLE   1
 #define OSPF_SHORTCUT_DISABLE  2
@@ -345,21 +348,15 @@ struct ospf_area {
 
 
        u_char NSSATranslatorRole;  /* NSSA configured role */
-                                   /* $FRR indent$ */
-                                   /* clang-format off */
 #define OSPF_NSSA_ROLE_NEVER     0
 #define OSPF_NSSA_ROLE_CANDIDATE 1
 #define OSPF_NSSA_ROLE_ALWAYS    2
        u_char NSSATranslatorState; /* NSSA operational role */
-                                   /* $FRR indent$ */
-                                   /* clang-format off */
 #define OSPF_NSSA_TRANSLATE_DISABLED 0
 #define OSPF_NSSA_TRANSLATE_ENABLED  1
        int NSSATranslatorStabilityInterval;
 
        u_char transit;             /* TransitCapability. */
-                                   /* $FRR indent$ */
-                                   /* clang-format off */
 #define OSPF_TRANSIT_FALSE      0
 #define OSPF_TRANSIT_TRUE       1
        struct route_table *ranges; /* Configured Area Ranges. */
@@ -500,13 +497,16 @@ extern const int ospf_redistributed_proto_max;
 extern struct zclient *zclient;
 extern struct thread_master *master;
 extern int ospf_zlog;
+extern struct zebra_privs_t ospfd_privs;
 
 /* Prototypes. */
 extern const char *ospf_redist_string(u_int route_type);
-extern struct ospf *ospf_lookup(void);
 extern struct ospf *ospf_lookup_instance(u_short);
-extern struct ospf *ospf_get(void);
+extern struct ospf *ospf_get(u_short instance, const char *name);
 extern struct ospf *ospf_get_instance(u_short);
+extern struct ospf *ospf_lookup_by_inst_name(u_short instance,
+                                            const char *name);
+extern struct ospf *ospf_lookup_by_vrf_id(vrf_id_t vrf_id);
 extern void ospf_finish(struct ospf *);
 extern void ospf_router_id_update(struct ospf *ospf);
 extern int ospf_network_set(struct ospf *, struct prefix_ipv4 *, struct in_addr,
@@ -520,7 +520,7 @@ extern int ospf_area_stub_unset(struct ospf *, struct in_addr);
 extern int ospf_area_no_summary_set(struct ospf *, struct in_addr);
 extern int ospf_area_no_summary_unset(struct ospf *, struct in_addr);
 extern int ospf_area_nssa_set(struct ospf *, struct in_addr);
-extern int ospf_area_nssa_unset(struct ospf *, struct in_addr);
+extern int ospf_area_nssa_unset(struct ospf *, struct in_addr, int);
 extern int ospf_area_nssa_translator_role_set(struct ospf *, struct in_addr,
                                              int);
 extern int ospf_area_export_list_set(struct ospf *, struct ospf_area *,
@@ -559,11 +559,17 @@ extern struct ospf_area *ospf_area_lookup_by_area_id(struct ospf *,
 extern void ospf_area_add_if(struct ospf_area *, struct ospf_interface *);
 extern void ospf_area_del_if(struct ospf_area *, struct ospf_interface *);
 
-extern void ospf_interface_area_set(struct interface *);
-extern void ospf_interface_area_unset(struct interface *);
+extern void ospf_interface_area_set(struct ospf *, struct interface *);
+extern void ospf_interface_area_unset(struct ospf *, struct interface *);
 
 extern void ospf_route_map_init(void);
 
 extern void ospf_master_init(struct thread_master *master);
+extern void ospf_vrf_init(void);
+extern void ospf_vrf_terminate(void);
+extern void ospf_vrf_link(struct ospf *ospf, struct vrf *vrf);
+extern void ospf_vrf_unlink(struct ospf *ospf, struct vrf *vrf);
+const char *ospf_vrf_id_to_name(vrf_id_t vrf_id);
+int ospf_area_nssa_no_summary_set(struct ospf *, struct in_addr);
 
 #endif /* _ZEBRA_OSPFD_H */