diff options
| author | Paul Jakma <paul@opensourcerouting.org> | 2014-10-09 14:19:51 +0100 | 
|---|---|---|
| committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-05-26 20:46:24 +0000 | 
| commit | d3a9c768789d10ba8b947510eb20bdc20a336224 (patch) | |
| tree | ec5b8372b71ddf89dd93641aa6d482d2c57755a0 /ospfd/ospf_spf.h | |
| parent | 7498d58d56705851de9db5f5676aaa7da3ebe35b (diff) | |
ospfd: Some small tweaks to the SPF execution reason patch
* ospf_spf.h: use an enum for the reason, and have it as a new argument to
  ospf_spf_calculate_schedule, no need for additional call, and let compiler
  do the checking.
* ospf_spf.c: format changes - Quagga coding style places function names
  at the start of a new line, for easy grepping for definition.
  (ospf_spf_calculate_timer) Change the log format of SPF execution time to
  avoid ginormous line, and make logging conditional, as is the norm.
(cherry picked from commit b6eef003e1a79471addea0b01853b08aed812cc8)
Conflicts:
	ospfd/ospf_spf.c
Diffstat (limited to 'ospfd/ospf_spf.h')
| -rw-r--r-- | ospfd/ospf_spf.h | 28 | 
1 files changed, 13 insertions, 15 deletions
diff --git a/ospfd/ospf_spf.h b/ospfd/ospf_spf.h index c9c539ad7a..e33b3e5f53 100644 --- a/ospfd/ospf_spf.h +++ b/ospfd/ospf_spf.h @@ -59,22 +59,20 @@ struct vertex_parent    int backlink;			/* index back to parent for router-lsa's */  }; -extern void ospf_spf_calculate_schedule (struct ospf *); +/* What triggered the SPF ? */ +typedef enum { +  SPF_FLAG_ROUTER_LSA_INSTALL = 1, +  SPF_FLAG_NETWORK_LSA_INSTALL, +  SPF_FLAG_SUMMARY_LSA_INSTALL, +  SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL, +  SPF_FLAG_MAXAGE, +  SPF_FLAG_ABR_STATUS_CHANGE, +  SPF_FLAG_ASBR_STATUS_CHANGE, +  SPF_FLAG_CONFIG_CHANGE, +} ospf_spf_reason_t; + +extern void ospf_spf_calculate_schedule (struct ospf *, ospf_spf_reason_t);  extern void ospf_rtrs_free (struct route_table *);  /* void ospf_spf_calculate_timer_add (); */ - -/* What triggered the SPF ? Can have at most 32 reasons with this */ -#define SPF_FLAG_ROUTER_LSA_INSTALL 0x1 -#define SPF_FLAG_NETWORK_LSA_INSTALL 0x2 -#define SPF_FLAG_SUMMARY_LSA_INSTALL 0x4 -#define SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL 0x8 -#define SPF_FLAG_MAXAGE 0x10 -#define SPF_FLAG_ABR_STATUS_CHANGE 0x20 -#define SPF_FLAG_ASBR_STATUS_CHANGE 0x40 -#define SPF_FLAG_MAX_VALUE 0x40	/* Update this when adding flags */ -#define SPF_FLAG_MISC 0x1000000	/* Keep this last */ - -extern void ospf_flag_spf_reason (unsigned int reason); -  #endif /* _QUAGGA_OSPF_SPF_H */  | 
