#include "filter.h"
#include "log.h"
+#include "vrf.h"
#include "ospf_memory.h"
#include "ospf_dump_api.h"
/* 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 */
/* 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;
/* 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
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
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. */
/* 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)
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
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. */
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,
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 *,
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 */