summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/cl/Module2
-rw-r--r--cesar/cl/inc/bridge_table.h2
-rw-r--r--cesar/cl/src/cl_mactotei.c2
-rw-r--r--cesar/cl/test/bridge_table/Makefile2
-rw-r--r--cesar/cl/test/mac_lookup_table/Makefile10
-rw-r--r--cesar/lib/Module3
-rw-r--r--cesar/lib/inc/mac_lookup_table.h (renamed from cesar/cl/inc/mac_lookup_table.h)14
-rw-r--r--cesar/lib/mac_lookup_table.h (renamed from cesar/cl/mac_lookup_table.h)14
-rw-r--r--cesar/lib/src/mac_lookup_table.c (renamed from cesar/cl/src/mac_lookup_table.c)21
-rw-r--r--cesar/lib/test/mac_lookup_table/Makefile8
-rw-r--r--cesar/lib/test/mac_lookup_table/src/mac_lookup_table.c (renamed from cesar/cl/test/mac_lookup_table/src/mac_lookup_table.c)4
11 files changed, 41 insertions, 41 deletions
diff --git a/cesar/cl/Module b/cesar/cl/Module
index 7ecc9fdcb5..517ee1f635 100644
--- a/cesar/cl/Module
+++ b/cesar/cl/Module
@@ -1,4 +1,4 @@
-SOURCES := cl.c cl_mactotei.c mac_lookup_table.c bridge_table.c data_rate.c
+SOURCES := cl.c cl_mactotei.c bridge_table.c data_rate.c
ifeq ($(CONFIG_TRACE),y)
SOURCES += trace.c
endif
diff --git a/cesar/cl/inc/bridge_table.h b/cesar/cl/inc/bridge_table.h
index dc6c6e3dca..546d7f3e68 100644
--- a/cesar/cl/inc/bridge_table.h
+++ b/cesar/cl/inc/bridge_table.h
@@ -15,7 +15,7 @@
* Private declarations for the bridge table module.
*/
-#include "cl/mac_lookup_table.h" // mac_lookup_table_t
+#include "lib/mac_lookup_table.h" // mac_lookup_table_t
/**
* Maximum number of MAC addresses in the temporary bridge table.
diff --git a/cesar/cl/src/cl_mactotei.c b/cesar/cl/src/cl_mactotei.c
index a91c08a097..57a6dbe900 100644
--- a/cesar/cl/src/cl_mactotei.c
+++ b/cesar/cl/src/cl_mactotei.c
@@ -17,7 +17,7 @@
#include "cl/inc/cl.h" // cl_t
#include "mac/common/defs.h" // MAC_TEI_IS_STA
-#include "cl/mac_lookup_table.h" // mac_lookup_*
+#include "lib/mac_lookup_table.h" // mac_lookup_*
#include "mac/common/ntb.h" // mac_ntb
/**
diff --git a/cesar/cl/test/bridge_table/Makefile b/cesar/cl/test/bridge_table/Makefile
index ef6f606507..9244d0363e 100644
--- a/cesar/cl/test/bridge_table/Makefile
+++ b/cesar/cl/test/bridge_table/Makefile
@@ -5,6 +5,6 @@ HOST_PROGRAMS = bridge_table
bridge_table_SOURCES = bridge_table.c
bridge_table_MODULES = lib cl
# Overrides source of the cl module.
-cl_MODULE_SOURCES = mac_lookup_table.c bridge_table.c
+cl_MODULE_SOURCES = bridge_table.c
include $(BASE)/common/make/top.mk
diff --git a/cesar/cl/test/mac_lookup_table/Makefile b/cesar/cl/test/mac_lookup_table/Makefile
deleted file mode 100644
index 887fb72122..0000000000
--- a/cesar/cl/test/mac_lookup_table/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-BASE = ../../..
-
-HOST_PROGRAMS = mac_lookup_table
-
-mac_lookup_table_SOURCES = mac_lookup_table.c
-mac_lookup_table_MODULES = lib cl
-# Overrides source of the cl module.
-cl_MODULE_SOURCES = mac_lookup_table.c
-
-include $(BASE)/common/make/top.mk
diff --git a/cesar/lib/Module b/cesar/lib/Module
index f72a8224c7..d462ee6830 100644
--- a/cesar/lib/Module
+++ b/cesar/lib/Module
@@ -1,6 +1,7 @@
SOURCES := mt19937ar.c crc.c dbg.c heap.c test.c blk.c slab.c list.c \
aatree.c try.c fixed.c \
- swap.c read_word.c bitstream.c circular_buffer.c mbox.c
+ swap.c read_word.c bitstream.c circular_buffer.c mbox.c \
+ mac_lookup_table.c
ifeq ($(CONFIG_HEAP_SKEW),y)
SOURCES += skewheap.c
endif
diff --git a/cesar/cl/inc/mac_lookup_table.h b/cesar/lib/inc/mac_lookup_table.h
index 2328c6ece6..c235bcfd9a 100644
--- a/cesar/cl/inc/mac_lookup_table.h
+++ b/cesar/lib/inc/mac_lookup_table.h
@@ -1,16 +1,16 @@
-#ifndef cl_inc_mac_lookup_table_h
-#define cl_inc_mac_lookup_table_h
+#ifndef lib_inc_mac_lookup_table_h
+#define lib_inc_mac_lookup_table_h
/* Cesar project {{{
*
- * Copyright (C) 2008 Spidcom
+ * Copyright (C) 2009 Spidcom
*
* <<<Licence>>>
*
* }}} */
/**
- * \file cl/inc/mac_lookup_table.h
+ * \file lib/inc/mac_lookup_table.h
* \brief MAC lookup table private header.
- * \ingroup cl
+ * \ingroup lib
*
* The MAC lookup table relies on the 512 bytes block allocator module. In
* fact, all entries are stored on those blocks.
@@ -34,6 +34,8 @@
* optimized search on the table.
*/
+#include "lib/blk.h"
+
/**
* A data entry of the MAC lookup table.
* The entry contains the MAC address (stored on 48 bits) field and the extra
@@ -224,4 +226,4 @@ mac_lookup_table_compare (mac_lookup_table_t* table, uint pos1, uint pos2)
END_DECLS
-#endif /* cl_inc_mac_lookup_table_h */
+#endif /* lib_inc_mac_lookup_table_h */
diff --git a/cesar/cl/mac_lookup_table.h b/cesar/lib/mac_lookup_table.h
index d8f8bf6ea6..52e0334702 100644
--- a/cesar/cl/mac_lookup_table.h
+++ b/cesar/lib/mac_lookup_table.h
@@ -1,16 +1,16 @@
-#ifndef cl_mac_lookup_table_h
-#define cl_mac_lookup_table_h
+#ifndef lib_mac_lookup_table_h
+#define lib_mac_lookup_table_h
/* Cesar project {{{
*
- * Copyright (C) 2008 Spidcom
+ * Copyright (C) 2009 Spidcom
*
* <<<Licence>>>
*
* }}} */
/**
- * \file cl/mac_lookup_table.h
- * \brief MAC lookup table public API header.
- * \ingroup cl
+ * \file lib/mac_lookup_table.h
+ * \brief Table to store and lookup MAC addresses and 16 bits of data.
+ * \ingroup lib
*
* This module handles a generic table of MAC addresses (stored on 48 bits)
* with some extra informations stored on 16 bits. You are free to organise
@@ -190,4 +190,4 @@ mac_lookup_entry_count (mac_lookup_table_t *table);
END_DECLS
-#endif /* cl_mac_lookup_table_h */
+#endif /* lib_mac_lookup_table_h */
diff --git a/cesar/cl/src/mac_lookup_table.c b/cesar/lib/src/mac_lookup_table.c
index 75ac0f9fc4..17a8cf302f 100644
--- a/cesar/cl/src/mac_lookup_table.c
+++ b/cesar/lib/src/mac_lookup_table.c
@@ -1,21 +1,19 @@
/* Cesar project {{{
*
- * Copyright (C) 2008 Spidcom
+ * Copyright (C) 2009 Spidcom
*
* <<<Licence>>>
*
* }}} */
/**
- * \file cl/src/mac_lookup_table.c
+ * \file lib/src/mac_lookup_table.c
* \brief MAC lookup table implementation.
- * \ingroup cl
- *
+ * \ingroup lib
*/
#include "common/std.h"
-#include "lib/blk.h" // blk_*
-#include "cl/mac_lookup_table.h" // mac_lookup_* public
-#include "cl/inc/mac_lookup_table.h" // mac_lookup_* private
+#include "lib/mac_lookup_table.h" // mac_lookup_* public
+#include "lib/inc/mac_lookup_table.h" // mac_lookup_* private
#define LIB_HEAPSORT_USER_TYPE mac_lookup_table_t
#define LIB_HEAPSORT_USER_COMP_LESSER mac_lookup_table_compare
@@ -250,6 +248,7 @@ mac_lookup_table_swap (mac_lookup_table_t* table, uint pos1, uint pos2)
{
/* Check parameters. */
dbg_assert (table);
+ dbg_assert (pos1 != pos2);
/* Get entries at positions. */
mac_lookup_data_entry_t *entry1, *entry2;
@@ -314,10 +313,10 @@ mac_lookup_table_find_update (mac_lookup_table_t *table,
}
uint
-mac_lookup_table_copy_conditional
- (mac_lookup_table_t *indexed_table,
- mac_lookup_block_header_t *non_sorted_table,
- u16 mask, u16 value, bool negate)
+mac_lookup_table_copy_conditional (
+ mac_lookup_table_t *indexed_table,
+ mac_lookup_block_header_t *non_sorted_table, u16 mask, u16 value,
+ bool negate)
{
/* Check parameters. */
dbg_assert (indexed_table);
diff --git a/cesar/lib/test/mac_lookup_table/Makefile b/cesar/lib/test/mac_lookup_table/Makefile
new file mode 100644
index 0000000000..4f3729f919
--- /dev/null
+++ b/cesar/lib/test/mac_lookup_table/Makefile
@@ -0,0 +1,8 @@
+BASE = ../../..
+
+HOST_PROGRAMS = test_mac_lookup_table
+
+test_mac_lookup_table_SOURCES = mac_lookup_table.c
+test_mac_lookup_table_MODULES = lib
+
+include $(BASE)/common/make/top.mk
diff --git a/cesar/cl/test/mac_lookup_table/src/mac_lookup_table.c b/cesar/lib/test/mac_lookup_table/src/mac_lookup_table.c
index 00d7dcfd9f..c45cb6731f 100644
--- a/cesar/cl/test/mac_lookup_table/src/mac_lookup_table.c
+++ b/cesar/lib/test/mac_lookup_table/src/mac_lookup_table.c
@@ -6,9 +6,9 @@
*
* }}} */
/**
- * \file cl/test/src/mac_lookup_table.c
+ * \file lib/test/src/mac_lookup_table.c
* \brief MAC lookup table test.
- * \ingroup cl
+ * \ingroup lib
*
* Test the MAC lookup table.
*/