Skip to content

Commit e17bc28

Browse files
authored
Merge pull request #17126 from donaldsharp/ospf_lsa_declarations
ospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for funct…
2 parents df482a0 + 573d807 commit e17bc28

File tree

2 files changed

+77
-89
lines changed

2 files changed

+77
-89
lines changed

ospfd/ospf_lsa.c

+8-9
Original file line numberDiff line numberDiff line change
@@ -2613,8 +2613,7 @@ void ospf_external_lsa_refresh_default(struct ospf *ospf)
26132613
}
26142614
}
26152615

2616-
void ospf_external_lsa_refresh_type(struct ospf *ospf, uint8_t type,
2617-
unsigned short instance, int force)
2616+
void ospf_external_lsa_refresh_type(struct ospf *ospf, uint8_t type, uint8_t instance, int force)
26182617
{
26192618
struct route_node *rn;
26202619
struct external_info *ei;
@@ -3170,9 +3169,9 @@ int ospf_check_nbr_status(struct ospf *ospf)
31703169
}
31713170

31723171

3173-
void ospf_maxage_lsa_remover(struct event *thread)
3172+
void ospf_maxage_lsa_remover(struct event *event)
31743173
{
3175-
struct ospf *ospf = EVENT_ARG(thread);
3174+
struct ospf *ospf = EVENT_ARG(event);
31763175
struct ospf_lsa *lsa, *old;
31773176
struct route_node *rn;
31783177
int reschedule = 0;
@@ -3202,7 +3201,7 @@ void ospf_maxage_lsa_remover(struct event *thread)
32023201
}
32033202

32043203
/* TODO: maybe convert this function to a work-queue */
3205-
if (event_should_yield(thread)) {
3204+
if (event_should_yield(event)) {
32063205
OSPF_TIMER_ON(ospf->t_maxage,
32073206
ospf_maxage_lsa_remover, 0);
32083207
route_unlock_node(
@@ -3418,9 +3417,9 @@ static int ospf_lsa_maxage_walker_remover(struct ospf *ospf,
34183417
}
34193418

34203419
/* Periodical check of MaxAge LSA. */
3421-
void ospf_lsa_maxage_walker(struct event *thread)
3420+
void ospf_lsa_maxage_walker(struct event *event)
34223421
{
3423-
struct ospf *ospf = EVENT_ARG(thread);
3422+
struct ospf *ospf = EVENT_ARG(event);
34243423
struct route_node *rn;
34253424
struct ospf_lsa *lsa;
34263425
struct ospf_area *area;
@@ -4157,11 +4156,11 @@ void ospf_refresher_unregister_lsa(struct ospf *ospf, struct ospf_lsa *lsa)
41574156
}
41584157
}
41594158

4160-
void ospf_lsa_refresh_walker(struct event *t)
4159+
void ospf_lsa_refresh_walker(struct event *e)
41614160
{
41624161
struct list *refresh_list;
41634162
struct listnode *node, *nnode;
4164-
struct ospf *ospf = EVENT_ARG(t);
4163+
struct ospf *ospf = EVENT_ARG(e);
41654164
struct ospf_lsa *lsa;
41664165
int i;
41674166
struct list *lsa_to_refresh = list_new();

ospfd/ospf_lsa.h

+69-80
Original file line numberDiff line numberDiff line change
@@ -225,122 +225,111 @@ enum lsid_status { LSID_AVAILABLE = 0, LSID_CHANGE, LSID_NOT_AVAILABLE };
225225
/* Prototypes. */
226226
/* XXX: Eek, time functions, similar are in lib/thread.c */
227227
extern struct timeval int2tv(int);
228-
extern struct timeval msec2tv(int);
228+
extern struct timeval msec2tv(int a);
229229

230-
extern int get_age(struct ospf_lsa *);
231-
extern uint16_t ospf_lsa_checksum(struct lsa_header *);
232-
extern int ospf_lsa_checksum_valid(struct lsa_header *);
233-
extern int ospf_lsa_refresh_delay(struct ospf_lsa *);
230+
extern int get_age(struct ospf_lsa *lsa);
231+
extern uint16_t ospf_lsa_checksum(struct lsa_header *lsah);
232+
extern int ospf_lsa_checksum_valid(struct lsa_header *lsah);
233+
extern int ospf_lsa_refresh_delay(struct ospf_lsa *lsa);
234234

235-
extern const char *dump_lsa_key(struct ospf_lsa *);
236-
extern uint32_t lsa_seqnum_increment(struct ospf_lsa *);
237-
extern void lsa_header_set(struct stream *, uint8_t, uint8_t, struct in_addr,
238-
struct in_addr);
239-
extern struct ospf_neighbor *ospf_nbr_lookup_ptop(struct ospf_interface *);
240-
extern int ospf_check_nbr_status(struct ospf *);
235+
extern const char *dump_lsa_key(struct ospf_lsa *lsa);
236+
extern uint32_t lsa_seqnum_increment(struct ospf_lsa *lsa);
237+
extern void lsa_header_set(struct stream *s, uint8_t options, uint8_t type, struct in_addr id,
238+
struct in_addr router_id);
239+
extern struct ospf_neighbor *ospf_nbr_lookup_ptop(struct ospf_interface *oi);
240+
extern int ospf_check_nbr_status(struct ospf *ospf);
241241

242242
/* Prototype for LSA primitive. */
243243
extern struct ospf_lsa *ospf_lsa_new(void);
244244
extern struct ospf_lsa *ospf_lsa_new_and_data(size_t size);
245-
extern struct ospf_lsa *ospf_lsa_dup(struct ospf_lsa *);
246-
extern void ospf_lsa_free(struct ospf_lsa *);
247-
extern struct ospf_lsa *ospf_lsa_lock(struct ospf_lsa *);
248-
extern void ospf_lsa_unlock(struct ospf_lsa **);
249-
extern void ospf_lsa_discard(struct ospf_lsa *);
250-
extern int ospf_lsa_flush_schedule(struct ospf *, struct ospf_lsa *);
251-
extern struct lsa_header *ospf_lsa_data_new(size_t);
252-
extern struct lsa_header *ospf_lsa_data_dup(struct lsa_header *);
253-
extern void ospf_lsa_data_free(struct lsa_header *);
245+
extern struct ospf_lsa *ospf_lsa_dup(struct ospf_lsa *lsa);
246+
extern void ospf_lsa_free(struct ospf_lsa *lsa);
247+
extern struct ospf_lsa *ospf_lsa_lock(struct ospf_lsa *lsa);
248+
extern void ospf_lsa_unlock(struct ospf_lsa **lsa);
249+
extern void ospf_lsa_discard(struct ospf_lsa *lsa);
250+
extern int ospf_lsa_flush_schedule(struct ospf *ospf, struct ospf_lsa *lsa);
251+
extern struct lsa_header *ospf_lsa_data_new(size_t size);
252+
extern struct lsa_header *ospf_lsa_data_dup(struct lsa_header *lsah);
253+
extern void ospf_lsa_data_free(struct lsa_header *lsah);
254254

255255
/* Prototype for various LSAs */
256256
extern void ospf_router_lsa_body_set(struct stream **s, struct ospf_area *area);
257257
extern uint8_t router_lsa_flags(struct ospf_area *area);
258-
extern int ospf_router_lsa_update(struct ospf *);
259-
extern int ospf_router_lsa_update_area(struct ospf_area *);
258+
extern int ospf_router_lsa_update(struct ospf *ospf);
259+
extern int ospf_router_lsa_update_area(struct ospf_area *area);
260260

261-
extern void ospf_network_lsa_update(struct ospf_interface *);
261+
extern void ospf_network_lsa_update(struct ospf_interface *oi);
262262

263-
extern struct ospf_lsa *
264-
ospf_summary_lsa_originate(struct prefix_ipv4 *, uint32_t, struct ospf_area *);
265-
extern struct ospf_lsa *ospf_summary_asbr_lsa_originate(struct prefix_ipv4 *,
266-
uint32_t,
267-
struct ospf_area *);
263+
extern struct ospf_lsa *ospf_summary_lsa_originate(struct prefix_ipv4 *p, uint32_t metric,
264+
struct ospf_area *area);
265+
extern struct ospf_lsa *ospf_summary_asbr_lsa_originate(struct prefix_ipv4 *p, uint32_t metric,
266+
struct ospf_area *area);
268267

269-
extern struct ospf_lsa *ospf_lsa_install(struct ospf *, struct ospf_interface *,
270-
struct ospf_lsa *);
268+
extern struct ospf_lsa *ospf_lsa_install(struct ospf *ospf, struct ospf_interface *oi,
269+
struct ospf_lsa *lsa);
271270

272271
extern void ospf_nssa_lsa_flush(struct ospf *ospf, struct prefix_ipv4 *p);
273-
extern void ospf_external_lsa_flush(struct ospf *, uint8_t,
274-
struct prefix_ipv4 *,
272+
extern void ospf_external_lsa_flush(struct ospf *ospf, uint8_t type, struct prefix_ipv4 *p,
275273
ifindex_t /* , struct in_addr nexthop */);
276274

277-
extern struct in_addr ospf_get_ip_from_ifp(struct ospf_interface *);
275+
extern struct in_addr ospf_get_ip_from_ifp(struct ospf_interface *oi);
278276

279-
extern struct ospf_lsa *ospf_external_lsa_originate(struct ospf *,
280-
struct external_info *);
277+
extern struct ospf_lsa *ospf_external_lsa_originate(struct ospf *ospf, struct external_info *ei);
281278
extern struct ospf_lsa *ospf_nssa_lsa_originate(struct ospf_area *area,
282279
struct external_info *ei);
283280
extern struct ospf_lsa *ospf_nssa_lsa_refresh(struct ospf_area *area,
284281
struct ospf_lsa *lsa,
285282
struct external_info *ei);
286283
extern void ospf_external_lsa_rid_change(struct ospf *ospf);
287-
extern struct ospf_lsa *ospf_lsa_lookup(struct ospf *ospf, struct ospf_area *,
288-
uint32_t, struct in_addr,
289-
struct in_addr);
290-
extern struct ospf_lsa *ospf_lsa_lookup_by_id(struct ospf_area *, uint32_t,
291-
struct in_addr);
292-
extern struct ospf_lsa *ospf_lsa_lookup_by_header(struct ospf_area *,
293-
struct lsa_header *);
294-
extern int ospf_lsa_more_recent(struct ospf_lsa *, struct ospf_lsa *);
295-
extern int ospf_lsa_different(struct ospf_lsa *, struct ospf_lsa *,
296-
bool ignore_rcvd_flag);
297-
extern void ospf_flush_self_originated_lsas_now(struct ospf *);
298-
299-
extern int ospf_lsa_is_self_originated(struct ospf *, struct ospf_lsa *);
300-
301-
extern struct ospf_lsa *ospf_lsa_lookup_by_prefix(struct ospf_lsdb *, uint8_t,
302-
struct prefix_ipv4 *,
303-
struct in_addr);
304-
305-
extern void ospf_lsa_maxage(struct ospf *, struct ospf_lsa *);
306-
extern uint32_t get_metric(uint8_t *);
307-
308-
extern void ospf_lsa_maxage_walker(struct event *thread);
309-
extern struct ospf_lsa *ospf_lsa_refresh(struct ospf *, struct ospf_lsa *);
310-
311-
extern void ospf_external_lsa_refresh_default(struct ospf *);
312-
313-
extern void ospf_external_lsa_refresh_type(struct ospf *, uint8_t,
314-
unsigned short, int);
315-
extern struct ospf_lsa *ospf_external_lsa_refresh(struct ospf *,
316-
struct ospf_lsa *,
317-
struct external_info *, int,
318-
bool aggr);
284+
extern struct ospf_lsa *ospf_lsa_lookup(struct ospf *ospf, struct ospf_area *area, uint32_t type,
285+
struct in_addr id, struct in_addr adv_router);
286+
extern struct ospf_lsa *ospf_lsa_lookup_by_id(struct ospf_area *area, uint32_t type,
287+
struct in_addr id);
288+
extern struct ospf_lsa *ospf_lsa_lookup_by_header(struct ospf_area *area, struct lsa_header *lsah);
289+
extern int ospf_lsa_more_recent(struct ospf_lsa *l1, struct ospf_lsa *l2);
290+
extern int ospf_lsa_different(struct ospf_lsa *l1, struct ospf_lsa *l2, bool ignore_rcvd_flag);
291+
extern void ospf_flush_self_originated_lsas_now(struct ospf *ospf);
292+
293+
extern int ospf_lsa_is_self_originated(struct ospf *ospf, struct ospf_lsa *lsa);
294+
295+
extern struct ospf_lsa *ospf_lsa_lookup_by_prefix(struct ospf_lsdb *lsdb, uint8_t type,
296+
struct prefix_ipv4 *p, struct in_addr router_id);
297+
298+
extern void ospf_lsa_maxage(struct ospf *ospf, struct ospf_lsa *lsa);
299+
extern uint32_t get_metric(uint8_t *metric);
300+
301+
extern void ospf_lsa_maxage_walker(struct event *event);
302+
extern struct ospf_lsa *ospf_lsa_refresh(struct ospf *ospf, struct ospf_lsa *lsa);
303+
304+
extern void ospf_external_lsa_refresh_default(struct ospf *ospf);
305+
306+
extern void ospf_external_lsa_refresh_type(struct ospf *ospf, uint8_t type, uint8_t instance,
307+
int force);
308+
extern struct ospf_lsa *ospf_external_lsa_refresh(struct ospf *ospf, struct ospf_lsa *lsa,
309+
struct external_info *ei, int force, bool aggr);
319310
extern enum lsid_status ospf_lsa_unique_id(struct ospf *ospf,
320311
struct ospf_lsdb *lsdb,
321312
uint8_t type, struct prefix_ipv4 *p,
322313
struct in_addr *addr);
323-
extern void ospf_schedule_lsa_flood_area(struct ospf_area *, struct ospf_lsa *);
324-
extern void ospf_schedule_lsa_flush_area(struct ospf_area *, struct ospf_lsa *);
314+
extern void ospf_schedule_lsa_flood_area(struct ospf_area *area, struct ospf_lsa *lsa);
315+
extern void ospf_schedule_lsa_flush_area(struct ospf_area *area, struct ospf_lsa *lsa);
325316

326-
extern void ospf_refresher_register_lsa(struct ospf *, struct ospf_lsa *);
327-
extern void ospf_refresher_unregister_lsa(struct ospf *, struct ospf_lsa *);
328-
extern void ospf_lsa_refresh_walker(struct event *thread);
317+
extern void ospf_refresher_register_lsa(struct ospf *ospf, struct ospf_lsa *lsa);
318+
extern void ospf_refresher_unregister_lsa(struct ospf *ospf, struct ospf_lsa *lsa);
319+
extern void ospf_lsa_refresh_walker(struct event *event);
329320

330-
extern void ospf_lsa_maxage_delete(struct ospf *, struct ospf_lsa *);
321+
extern void ospf_lsa_maxage_delete(struct ospf *ospf, struct ospf_lsa *lsa);
331322

332-
extern void ospf_discard_from_db(struct ospf *, struct ospf_lsdb *,
333-
struct ospf_lsa *);
323+
extern void ospf_discard_from_db(struct ospf *ospf, struct ospf_lsdb *lsdb, struct ospf_lsa *lsa);
334324

335-
extern int metric_type(struct ospf *, uint8_t, unsigned short);
336-
extern int metric_value(struct ospf *, uint8_t, unsigned short);
325+
extern int metric_type(struct ospf *ospf, uint8_t src, unsigned short instance);
326+
extern int metric_value(struct ospf *ospf, uint8_t src, unsigned short instance);
337327

338328
extern char link_info_set(struct stream **s, struct in_addr id,
339329
struct in_addr data, uint8_t type, uint8_t tos,
340330
uint16_t cost);
341331

342-
extern struct in_addr ospf_get_nssa_ip(struct ospf_area *);
343-
extern int ospf_translated_nssa_compare(struct ospf_lsa *, struct ospf_lsa *);
332+
extern struct in_addr ospf_get_nssa_ip(struct ospf_area *area);
344333
extern struct ospf_lsa *ospf_translated_nssa_refresh(struct ospf *ospf,
345334
struct ospf_lsa *type7,
346335
struct ospf_lsa *type5);
@@ -351,7 +340,7 @@ extern void ospf_check_and_gen_init_seq_lsa(struct ospf_interface *oi,
351340
struct ospf_lsa *lsa);
352341
extern void ospf_flush_lsa_from_area(struct ospf *ospf, struct in_addr area_id,
353342
int type);
354-
extern void ospf_maxage_lsa_remover(struct event *thread);
343+
extern void ospf_maxage_lsa_remover(struct event *event);
355344
extern bool ospf_check_dna_lsa(const struct ospf_lsa *lsa);
356345
extern void ospf_refresh_area_self_lsas(struct ospf_area *area);
357346

0 commit comments

Comments
 (0)