summaryrefslogtreecommitdiff
path: root/cesar/test_general/station/overide/cp/secu
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/test_general/station/overide/cp/secu')
-rw-r--r--cesar/test_general/station/overide/cp/secu/Module1
-rw-r--r--cesar/test_general/station/overide/cp/secu/inc/context.h24
-rw-r--r--cesar/test_general/station/overide/cp/secu/secu.h58
-rw-r--r--cesar/test_general/station/overide/cp/secu/src/secu.c74
4 files changed, 157 insertions, 0 deletions
diff --git a/cesar/test_general/station/overide/cp/secu/Module b/cesar/test_general/station/overide/cp/secu/Module
new file mode 100644
index 0000000000..9087aae87c
--- /dev/null
+++ b/cesar/test_general/station/overide/cp/secu/Module
@@ -0,0 +1 @@
+SOURCES:=secu.c
diff --git a/cesar/test_general/station/overide/cp/secu/inc/context.h b/cesar/test_general/station/overide/cp/secu/inc/context.h
new file mode 100644
index 0000000000..f7772ad9bc
--- /dev/null
+++ b/cesar/test_general/station/overide/cp/secu/inc/context.h
@@ -0,0 +1,24 @@
+#ifndef cp_beacon_test_central_beacon_overide_cp_secu_inc_context_h
+#define cp_beacon_test_central_beacon_overide_cp_secu_inc_context_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/beacon/test/central_beacon/overide/cp/secu/inc/context.h
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+
+struct cp_secu_t
+{
+ bool kbc;
+ u8 eks;
+};
+
+#endif /* cp_beacon_test_central_beacon_overide_cp_secu_inc_context_h */
diff --git a/cesar/test_general/station/overide/cp/secu/secu.h b/cesar/test_general/station/overide/cp/secu/secu.h
new file mode 100644
index 0000000000..c571679059
--- /dev/null
+++ b/cesar/test_general/station/overide/cp/secu/secu.h
@@ -0,0 +1,58 @@
+#ifndef cp_beacon_test_central_beacon_overide_cp_secu_secu_h
+#define cp_beacon_test_central_beacon_overide_cp_secu_secu_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/beacon/test/central_beacon/overide/cp/secu/secu.h
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+
+#include "cp/secu/secu.h"
+
+typedef struct cp_secu_t cp_secu_t;
+
+/**
+ * Initialize the security layer
+ *
+ * \return the security context.
+ */
+cp_secu_t *
+cp_secu_init (void);
+
+/**
+ * Uninitialize the seucurity layer
+ *
+ * \param ctx the security context.
+ */
+void
+cp_secu_uninit (cp_secu_t *ctx);
+
+/**
+ * Get Key being change
+ * 0 for a frame level encyption key NEK.
+ * 1 for a payload encryption key.
+ *
+ * \param ctx the security context.
+ * \return the boolean value
+ */
+bool
+cp_secu_get_kbc (cp_secu_t *ctx);
+
+/**
+ * Get the new EKS for the next beacon period.
+ *
+ * \param ctx the security context
+ * \return the eks value.
+ */
+u8
+cp_secu_get_eks (cp_secu_t *ctx);
+
+#endif /* cp_beacon_test_central_beacon_overide_cp_secu_secu_h */
diff --git a/cesar/test_general/station/overide/cp/secu/src/secu.c b/cesar/test_general/station/overide/cp/secu/src/secu.c
new file mode 100644
index 0000000000..b2fa99d671
--- /dev/null
+++ b/cesar/test_general/station/overide/cp/secu/src/secu.c
@@ -0,0 +1,74 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/beacon/test/central_beacon/overide/cp/secu/src/secu.c
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+#include "common/std.h"
+
+#include "cp/secu/secu.h"
+#include "cp/secu/inc/context.h"
+
+// static declaration
+static cp_secu_t secu_global;
+
+/**
+ * Initialize the security layer
+ *
+ * \return the security context.
+ */
+cp_secu_t *
+cp_secu_init (void)
+{
+ return &secu_global;
+}
+
+/**
+ * Uninitialize the seucurity layer
+ *
+ * \param ctx the security context.
+ */
+void
+cp_secu_uninit (cp_secu_t *ctx)
+{
+ dbg_assert (ctx);
+}
+
+/**
+ * Get Key being change
+ * 0 for a frame level encyption key NEK.
+ * 1 for a payload encryption key.
+ *
+ * \param ctx the security context.
+ * \return the boolean value
+ */
+bool
+cp_secu_get_kbc (cp_secu_t *ctx)
+{
+ dbg_assert (ctx);
+
+ return ctx->kbc;
+}
+
+/**
+ * Get the new EKS for the next beacon period.
+ *
+ * \param ctx the security context
+ * \return the eks value.
+ */
+u8
+cp_secu_get_eks (cp_secu_t *ctx)
+{
+ dbg_assert (ctx);
+
+ return ctx->eks;
+}
+