summaryrefslogtreecommitdiff
path: root/cesar/cp2/beacon/inc
diff options
context:
space:
mode:
authorlaranjeiro2008-05-22 10:53:36 +0000
committerlaranjeiro2008-05-22 10:53:36 +0000
commit9e7d6a2577d553c04fae7ed1e34f8053fd6087ad (patch)
treeabe1ecddd11d0dda0ace1bd08163df4145c26f7c /cesar/cp2/beacon/inc
parent6bfb38c5dad5cd561808d92773d9c3e2f62d1eff (diff)
beacon: tested the region function. Add a file with the length of the bentries.
* Read, only return the address of the next bentry. * write, write the regions provided by the region manager. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2065 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2/beacon/inc')
-rw-r--r--cesar/cp2/beacon/inc/bentry_size.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/cesar/cp2/beacon/inc/bentry_size.h b/cesar/cp2/beacon/inc/bentry_size.h
new file mode 100644
index 0000000000..96f4c6240f
--- /dev/null
+++ b/cesar/cp2/beacon/inc/bentry_size.h
@@ -0,0 +1,85 @@
+#ifndef cp2_beacon_inc_bentry_size_h
+#define cp2_beacon_inc_bentry_size_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp2/beacon/inc/bentry_size.h
+ * \brief Define the size in bytes off all beacon entries.
+ * \ingroup cp2_beacon
+ *
+ * Each beacon entries is define here, and all macros necessary to compute the
+ * length of any bentry payload.
+ *
+ * \warn all definition here are in BYTES, to convert in bits use the
+ * BYTES_SIZE_TO_BITS macro define in lib/utils.h
+ */
+
+/* Static size bentry. */
+
+/** Bentry header size. */
+#define CP_BEACON_ENTRY_HEADER 2
+
+/** Mac Address bentry size. */
+#define CP_BEACON_ENTRY_MAC_ADDRESS 6
+
+/** Discover Bentry. */
+#define CP_BEACON_ENTRY_DISCOVER 1
+
+/** Discover Info Bentry. */
+#define CP_BEACON_ENTRY_DISCOVER_INFO 4
+
+/** Beacon Period Start Time Offset. */
+#define CP_BEACON_ENTRY_BPSTO 3
+
+/** Encryption key change. */
+#define CP_BEACON_ENTRY_EKC 2
+
+/** Handover. */
+#define CP_BEACON_ENTRY_HOIP 2
+
+/** Beacon Relocation. */
+#define CP_BEACON_ENTRY_RLO 3
+
+/** AC Line synchronisation. */
+#define CP_BEACON_ENTRY_ACL 2
+
+/** Change Num Slots. */
+#define CP_BEACON_ENTRY_CHANGE_NUMSLOTS 2
+
+/** Change hybrid mode. */
+#define CP_BEACON_ENTRY_CHANGE_HM 1
+
+/** Change SNID. */
+#define CP_BEACON_ENTRY_CHANGE_SNID 1
+
+/* Variable ones. */
+
+/** Define the size in bytes of a SAI with start time. */
+#define CP_BEACON_ENTRY_SCHED_SAI_STPF 4
+
+/** Define the size in bytes of a SAI without start time. */
+#define CP_BEACON_ENTRY_SCHED_SAI_NSTPF 3
+
+/** Define the macro to compute a non persistent schedule bentry. */
+#define CP_BEACON_ENTRY_NON_PERSISTENT_SCHED(sai, nsai) (1 + \
+ (sai * CP_BEACON_ENTRY_SCHED_SAI_STPF) + \
+ (nsai * CP_BEACON_ENTRY_SCHED_SAI_NSTPF))
+
+
+/** Define the macro to compute a persistent schedule bentry. */
+#define CP_BEACON_ENTRY_PERSISTENT_SCHED(sai, nsai) (2 + \
+ (sai * CP_BEACON_ENTRY_SCHED_SAI_STPF) + \
+ (nsai * CP_BEACON_ENTRY_SCHED_SAI_NSTPF))
+
+/** Define the size in bytes of a region definition. */
+#define CP_BEACON_ENTRY_REGION_SIZE 2
+
+/** Define the Macro to compute a region bentry. */
+#define CP_BEACON_ENTRY_REGION(nr) (1 + CP_BEACON_ENTRY_REGION_SIZE * nr)
+
+#endif /* cp2_beacon_inc_bentry_size_h */