summaryrefslogtreecommitdiff
path: root/cesar/lib
diff options
context:
space:
mode:
authorThierry Carré2011-10-28 14:13:45 +0200
committerThierry Carré2011-11-03 09:33:10 +0100
commit00da57e927a571fd445b1889d0004b6ccff5c455 (patch)
tree7b3ae292e9fa326c6172267f842d98f467305ef9 /cesar/lib
parent09a63246d9bb7f50e1013222011693ca3e653d39 (diff)
cesar/{cp,cl,lib): return mactotei table into a vendor specific mme, refs #2559
Diffstat (limited to 'cesar/lib')
-rw-r--r--cesar/lib/mac_lookup_table.h12
-rw-r--r--cesar/lib/src/mac_lookup_table.c14
2 files changed, 26 insertions, 0 deletions
diff --git a/cesar/lib/mac_lookup_table.h b/cesar/lib/mac_lookup_table.h
index 4c1d3b77e2..56d0afc855 100644
--- a/cesar/lib/mac_lookup_table.h
+++ b/cesar/lib/mac_lookup_table.h
@@ -122,6 +122,18 @@ mac_lookup_table_convert (mac_lookup_block_header_t *table);
void
mac_lookup_table_release (mac_lookup_table_t *table);
+
+/**
+ * Find an entry by its MAC address into the MAC lookup table.
+ * \param table the MAC lookup table.
+ * \param position index which should be valid in the MAC lookup table.
+ * \param mac_address return parameter found at position.
+ * \param extra_info return parameter found at position.
+ */
+void
+mac_lookup_table_get_entry (mac_lookup_table_t *table, uint position,
+ mac_t *mac_address, u16 *extra_info);
+
/**
* Find an entry by its MAC address into the MAC lookup table.
* \param table the MAC lookup table in which to search the MAC address.
diff --git a/cesar/lib/src/mac_lookup_table.c b/cesar/lib/src/mac_lookup_table.c
index 706dbd3cf4..934115a7e2 100644
--- a/cesar/lib/src/mac_lookup_table.c
+++ b/cesar/lib/src/mac_lookup_table.c
@@ -301,6 +301,20 @@ mac_lookup_table_swap (mac_lookup_table_t* table, uint pos1, uint pos2)
*entry2 = copy;
}
+void
+mac_lookup_table_get_entry (mac_lookup_table_t *table, uint position,
+ mac_t *mac_address, u16 *extra_info)
+{
+ dbg_assert (mac_address);
+ dbg_assert (extra_info);
+
+ mac_lookup_data_entry_t *r = mac_lookup_get_data_entry (table, position);
+ dbg_assert (r);
+
+ *mac_address = r->mac_address;
+ *extra_info = r->extra_info;
+}
+
mac_lookup_data_entry_t *
mac_lookup_table_find (mac_lookup_table_t *table, mac_t mac_address)
{