summaryrefslogtreecommitdiffstats
path: root/ospfd/ospfd.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 21:13:34 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 21:13:34 +0200
commitd7c0a89a3a5697783a6dd89333ab660074790890 (patch)
treeeefa73e502f919b524b8a345437260d4acc23083 /ospfd/ospfd.h
parenttools, doc: update checkpatch for u_int_* (diff)
downloadfrr-d7c0a89a3a5697783a6dd89333ab660074790890.tar.xz
frr-d7c0a89a3a5697783a6dd89333ab660074790890.zip
*: use C99 standard fixed-width integer types
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospfd.h')
-rw-r--r--ospfd/ospfd.h84
1 files changed, 42 insertions, 42 deletions
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
index bed446085..bc9c68d57 100644
--- a/ospfd/ospfd.h
+++ b/ospfd/ospfd.h
@@ -81,7 +81,7 @@
#define OSPF_LS_REFRESH_JITTER 60
struct ospf_external {
- u_short instance;
+ unsigned short instance;
struct route_table *external_info;
};
@@ -94,12 +94,12 @@ struct ospf_master {
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 {
@@ -121,10 +121,10 @@ struct ospf_redist {
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. */
@@ -135,12 +135,12 @@ struct ospf {
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
@@ -149,24 +149,24 @@ struct ospf {
#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 */
#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
@@ -188,7 +188,7 @@ struct ospf {
#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. */
@@ -196,7 +196,7 @@ struct ospf {
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;
@@ -276,31 +276,31 @@ struct ospf {
/ 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;
@@ -343,26 +343,26 @@ struct ospf_area {
#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 */
+ 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 */
+ uint8_t NSSATranslatorState; /* NSSA operational role */
#define OSPF_NSSA_TRANSLATE_DISABLED 0
#define OSPF_NSSA_TRANSLATE_ENABLED 1
int NSSATranslatorStabilityInterval;
- u_char transit; /* TransitCapability. */
+ 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 */
@@ -412,19 +412,19 @@ struct ospf_area {
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. */
@@ -446,16 +446,16 @@ struct ospf_nbr_nbma {
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. */
@@ -500,11 +500,11 @@ 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_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 *);
@@ -535,7 +535,7 @@ extern int ospf_timers_refresh_set(struct ospf *, int);
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);