summaryrefslogtreecommitdiff
path: root/ospfd/ospf_spf.h
diff options
context:
space:
mode:
authorgdt <gdt>2004-08-31 17:28:41 +0000
committergdt <gdt>2004-08-31 17:28:41 +0000
commit630e48072a4a4685a7c04a7b73ae9170d2f0844a (patch)
tree1a343e551a0ce24d8c8c93aa62860742749355ee /ospfd/ospf_spf.h
parent94755ea13e9466fc4590994b551dc23a44571622 (diff)
Assorted changes from work at BBN. Most are minor, and several are in
support of more significant changes not in this commit. The last item in the ChangeLog below may be needed for p2mp to work correctly. 2004-08-31 David Wiggins <dwiggins@bbn.com> * hash.c (hash_iterate): Save next pointer before calling procedure, so that iteration works even if the called procedure deletes the hash backet. * linklist.h (listtail): new macro, not yet used. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_spf.c (ospf_spf_calculate): Many more comments and debug print statements. New function ospf_vertex_dump used in debugging. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_spf.h (struct vertex): Comments for flags and structure members. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_route.c: When finding an alternate route, log cost as well. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_interface.c (ospf_lookup_if_params): Initialize af in struct prefix allocated on stack. 2004-08-31 David Wiggins <dwiggins@bbn.com> * ospf_packet.c (ospf_ls_ack_send_delayed): In p2mp mode, send acks to AllSPFRouters, rather than All-DR.
Diffstat (limited to 'ospfd/ospf_spf.h')
-rw-r--r--ospfd/ospf_spf.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/ospfd/ospf_spf.h b/ospfd/ospf_spf.h
index 73120000..928d98b7 100644
--- a/ospfd/ospf_spf.h
+++ b/ospfd/ospf_spf.h
@@ -20,29 +20,34 @@
* 02111-1307, USA.
*/
-#define OSPF_VERTEX_ROUTER 1
-#define OSPF_VERTEX_NETWORK 2
+/* values for vertex->type */
+#define OSPF_VERTEX_ROUTER 1 /* for a Router-LSA */
+#define OSPF_VERTEX_NETWORK 2 /* for a Network-LSA */
+/* values for vertex->flags */
#define OSPF_VERTEX_PROCESSED 0x01
+/* The "root" is the node running the SPF calculation */
+/* A router or network in an area */
struct vertex
{
u_char flags;
- u_char type;
- struct in_addr id;
- struct lsa_header *lsa;
- u_int32_t distance;
+ u_char type; /* copied from LSA header */
+ struct in_addr id; /* copied from LSA header */
+ struct lsa_header *lsa; /* Router or Network LSA */
+ u_int32_t distance; /* from root to this vertex */
int backlink; /* link index of back-link */
- list child;
- list nexthop;
+ list child; /* list of vertex: children in SPF tree*/
+ list nexthop; /* list of vertex_nexthop from root to this vertex */
};
+/* A nexthop taken on the root node to get to this (parent) vertex */
struct vertex_nexthop
{
- struct ospf_interface *oi;
- struct in_addr router;
- struct vertex *parent;
+ struct ospf_interface *oi; /* output intf on root node */
+ struct in_addr router; /* router address to send to */
+ struct vertex *parent; /* parent in SPF tree */
};
void ospf_spf_calculate_schedule (struct ospf *);