aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/x300/include/link_state_route_proto.h
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2014-03-25 15:59:03 -0700
committermichael-west <michael.west@ettus.com>2014-03-25 15:59:03 -0700
commit04292f9b109479b639add31f83fd240a6387f488 (patch)
tree4b8723a4ae63626029704f901ee0083bb23bc1e9 /firmware/x300/include/link_state_route_proto.h
parent09915aa57bc88099cbcbbe925946ae65bc0ad8f0 (diff)
parentff8a1252f3a51369abe0a165d963b781089ec66c (diff)
downloaduhd-04292f9b109479b639add31f83fd240a6387f488.tar.gz
uhd-04292f9b109479b639add31f83fd240a6387f488.tar.bz2
uhd-04292f9b109479b639add31f83fd240a6387f488.zip
Merge branch 'master' into mwest/b200_docs
Diffstat (limited to 'firmware/x300/include/link_state_route_proto.h')
-rw-r--r--firmware/x300/include/link_state_route_proto.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/firmware/x300/include/link_state_route_proto.h b/firmware/x300/include/link_state_route_proto.h
new file mode 100644
index 000000000..8feb3e717
--- /dev/null
+++ b/firmware/x300/include/link_state_route_proto.h
@@ -0,0 +1,56 @@
+
+// Copyright 2013 Ettus Research LLC
+
+#ifndef INCLUDED_LINK_STATE_ROUTE_PROTO_H
+#define INCLUDED_LINK_STATE_ROUTE_PROTO_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <lwip/ip_addr.h>
+
+//http://en.wikipedia.org/wiki/Link-state_routing_protocol
+
+//! Initialize internals and handler registration
+void link_state_route_proto_init(void);
+
+/*!
+ * Advances the internal counter to determine expired entries.
+ * Call this periodically, along with the other periodic calls.
+ */
+void link_state_route_proto_tick(void);
+
+//! Initiate a periodic update to the neighbor table
+void link_state_route_proto_update(const uint8_t ethno);
+
+//! Flood the network with information about routes
+void link_state_route_proto_flood(const uint8_t ethno);
+
+/*!
+ * Updates the causes cycle cache for the given source ethno.
+ */
+void link_state_route_proto_update_cycle_cache(const uint8_t ethno);
+
+/*!
+ * Determine if the given link is the cause of a cycle (aka routing loop)
+ * This call does not run the algorithm, but rather checks the cache.
+ * This call also differs from the one below, takes the ethnos.
+ */
+bool link_state_route_proto_causes_cycle_cached(const uint8_t eth_src, const uint8_t eth_dst);
+
+//! Determine if the given link is the cause of a cycle (aka routing loop)
+bool link_state_route_proto_causes_cycle(const struct ip_addr *src, const struct ip_addr *dst);
+
+typedef struct
+{
+ struct ip_addr node;
+ struct ip_addr nbor;
+} ls_node_mapping_t;
+
+/*!
+ * Get a pointer to the node mapping table.
+ * The table length will be set to *length.
+ */
+const ls_node_mapping_t *link_state_route_get_node_mapping(size_t *length);
+
+#endif /* INCLUDED_LINK_STATE_ROUTE_PROTO_H */