#define OSPF_LS_REFRESH_JITTER 60
struct ospf_external {
- u_short instance;
+ unsigned short instance;
struct route_table *external_info;
};
struct thread_master *master;
/* Various OSPF global configuration. */
- u_char options;
+ uint8_t options;
#define OSPF_MASTER_SHUTDOWN (1 << 0) /* deferred-shutdown */
};
struct ospf_redist {
- u_short instance;
+ unsigned short instance;
/* Redistribute metric info. */
struct {
struct ospf {
/* OSPF's running state based on the '[no] router ospf [<instance>]'
* config. */
- u_char oi_running;
+ uint8_t oi_running;
/* OSPF instance ID */
- u_short instance;
+ unsigned short instance;
/* 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 */
+ vrf_id_t vrf_id; /* VRF Id */
+ char *name; /* VRF name */
/* ABR/ASBR internal flags. */
- u_char flags;
+ uint8_t flags;
#define OSPF_FLAG_ABR 0x0001
#define OSPF_FLAG_ASBR 0x0002
/* ABR type. */
- u_char abr_type;
+ uint8_t abr_type;
#define OSPF_ABR_UNKNOWN 0
#define OSPF_ABR_STAND 1
#define OSPF_ABR_IBM 2
#define OSPF_ABR_DEFAULT OSPF_ABR_CISCO
/* NSSA ABR */
- u_char anyNSSA; /* Bump for every NSSA attached. */
+ uint8_t anyNSSA; /* Bump for every NSSA attached. */
/* Configured variables. */
- u_char config;
+ uint8_t config;
#define OSPF_RFC1583_COMPATIBLE (1 << 0)
#define OSPF_OPAQUE_CAPABLE (1 << 2)
#define OSPF_LOG_ADJACENCY_CHANGES (1 << 3)
#define OSPF_LOG_ADJACENCY_DETAIL (1 << 4)
/* Opaque-LSA administrative flags. */
- u_char opaque;
+ uint8_t opaque;
#define OPAQUE_OPERATION_READY_BIT (1 << 0)
/* 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;
+ uint8_t stub_router_admin_set;
#define OSPF_STUB_ROUTER_ADMINISTRATIVE_SET 1
#define OSPF_STUB_ROUTER_ADMINISTRATIVE_UNSET 0
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
- u_int32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */
+ uint32_t ref_bandwidth; /* Reference Bandwidth (Kbps). */
struct route_table *networks; /* OSPF config networks. */
struct list *vlinks; /* Configured Virtual-Links. */
struct list *areas; /* OSPF areas. */
struct ospf_area *backbone; /* Pointer to the Backbone Area. */
struct list *oiflist; /* ospf interfaces */
- u_char passive_interface_default; /* passive-interface default */
+ uint8_t passive_interface_default; /* passive-interface default */
/* LSDB of AS-external-LSAs. */
struct ospf_lsdb *lsdb;
/* Flags. */
- int external_origin; /* AS-external-LSA origin flag. */
int ase_calc; /* ASE calculation flag. */
struct list *opaque_lsa_self; /* Type-11 Opaque-LSAs */
struct thread *t_distribute_update; /* Distirbute list update timer. */
struct thread *t_spf_calc; /* SPF calculation timer. */
struct thread *t_ase_calc; /* ASE calculation timer. */
- 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. */
/ OSPF_LSA_REFRESHER_GRANULARITY \
+ 1)
struct {
- u_int16_t index;
+ uint16_t index;
struct list *qs[OSPF_LSA_REFRESHER_SLOTS];
} lsa_refresh_queue;
struct thread *t_lsa_refresher;
time_t lsa_refresher_started;
#define OSPF_LSA_REFRESH_INTERVAL_DEFAULT 10
- u_int16_t lsa_refresh_interval;
+ uint16_t lsa_refresh_interval;
/* Distance parameter. */
- u_char distance_all;
- u_char distance_intra;
- u_char distance_inter;
- u_char distance_external;
+ uint8_t distance_all;
+ uint8_t distance_intra;
+ uint8_t distance_inter;
+ uint8_t distance_external;
/* Statistics for LSA origination. */
- u_int32_t lsa_originate_count;
+ uint32_t lsa_originate_count;
/* Statistics for LSA used for new instantiation. */
- u_int32_t rx_lsa_count;
+ uint32_t rx_lsa_count;
/* 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;
+ uint32_t if_ospf_cli_count;
struct route_table *distance_table;
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
int shortcut_capability; /* Other ABRs agree on S-bit */
- u_int32_t default_cost; /* StubDefaultCost. */
+ uint32_t default_cost; /* StubDefaultCost. */
int auth_type; /* Authentication type. */
- u_char NSSATranslatorRole; /* NSSA configured role */
- /* $FRR indent$ */
- /* clang-format off */
+ uint8_t NSSATranslatorRole; /* NSSA configured role */
#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 */
+ uint8_t NSSATranslatorState; /* NSSA operational role */
#define OSPF_NSSA_TRANSLATE_DISABLED 0
#define OSPF_NSSA_TRANSLATE_ENABLED 1
int NSSATranslatorStabilityInterval;
- u_char transit; /* TransitCapability. */
- /* $FRR indent$ */
- /* clang-format off */
+ uint8_t transit; /* TransitCapability. */
#define OSPF_TRANSIT_FALSE 0
#define OSPF_TRANSIT_TRUE 1
struct route_table *ranges; /* Configured Area Ranges. */
/* RFC3137 stub router state flags for area */
- u_char stub_router_state;
+ uint8_t stub_router_state;
#define OSPF_AREA_ADMIN_STUB_ROUTED (1 << 0) /* admin stub-router set */
#define OSPF_AREA_IS_STUB_ROUTED (1 << 1) /* stub-router active */
#define OSPF_AREA_WAS_START_STUB_ROUTED (1 << 2) /* startup SR was done */
struct thread *t_opaque_lsa_self; /* Type-10 Opaque-LSAs origin. */
/* Statistics field. */
- u_int32_t spf_calculation; /* SPF Calculation Count. */
+ uint32_t spf_calculation; /* SPF Calculation Count. */
/* Time stamps. */
struct timeval ts_spf; /* SPF calculation time stamp. */
/* Router count. */
- u_int32_t abr_count; /* ABR router in this area. */
- u_int32_t asbr_count; /* ASBR router in this area. */
+ uint32_t abr_count; /* ABR router in this area. */
+ uint32_t asbr_count; /* ASBR router in this area. */
/* Counters. */
- u_int32_t act_ints; /* Active interfaces. */
- u_int32_t full_nbrs; /* Fully adjacent neighbors. */
- u_int32_t full_vls; /* Fully adjacent virtual neighbors. */
+ uint32_t act_ints; /* Active interfaces. */
+ uint32_t full_nbrs; /* Fully adjacent neighbors. */
+ uint32_t full_vls; /* Fully adjacent virtual neighbors. */
};
/* OSPF config network structure. */
struct ospf_neighbor *nbr;
/* Neighbor priority. */
- u_char priority;
+ uint8_t priority;
/* Poll timer value. */
- u_int32_t v_poll;
+ uint32_t v_poll;
/* Poll timer thread. */
struct thread *t_poll;
/* State change. */
- u_int32_t state_change;
+ uint32_t state_change;
};
/* Macro. */
extern struct zebra_privs_t ospfd_privs;
/* Prototypes. */
-extern const char *ospf_redist_string(u_int route_type);
-extern struct ospf *ospf_lookup_instance(u_short);
-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,
+extern const char *ospf_redist_string(unsigned int route_type);
+extern struct ospf *ospf_lookup_instance(unsigned short);
+extern struct ospf *ospf_get(unsigned short instance, const char *name);
+extern struct ospf *ospf_get_instance(unsigned short);
+extern struct ospf *ospf_lookup_by_inst_name(unsigned 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 int ospf_timers_refresh_unset(struct ospf *);
extern int ospf_nbr_nbma_set(struct ospf *, struct in_addr);
extern int ospf_nbr_nbma_unset(struct ospf *, struct in_addr);
-extern int ospf_nbr_nbma_priority_set(struct ospf *, struct in_addr, u_char);
+extern int ospf_nbr_nbma_priority_set(struct ospf *, struct in_addr, uint8_t);
extern int ospf_nbr_nbma_priority_unset(struct ospf *, struct in_addr);
extern int ospf_nbr_nbma_poll_interval_set(struct ospf *, struct in_addr,
unsigned int);
extern void ospf_interface_area_set(struct ospf *, struct interface *);
extern void ospf_interface_area_unset(struct ospf *, struct interface *);
+extern bool ospf_interface_area_is_already_set(struct ospf *ospf,
+ struct interface *ifp);
extern void ospf_route_map_init(void);
const char *ospf_vrf_id_to_name(vrf_id_t vrf_id);
int ospf_area_nssa_no_summary_set(struct ospf *, struct in_addr);
+const char *ospf_get_name(const struct ospf *ospf);
#endif /* _ZEBRA_OSPFD_H */