summaryrefslogtreecommitdiff
path: root/cp2/sta/mgr/sta_mgr.h
diff options
context:
space:
mode:
authorlaranjeiro2008-03-28 13:33:33 +0000
committerlaranjeiro2008-03-28 13:33:33 +0000
commite807c0ce6aa0fdf24ffd17ccea87308a4a0ce6e1 (patch)
treec6a65b3f39d50079ad317d3ad8ca4d3134d808c0 /cp2/sta/mgr/sta_mgr.h
parentf184d16826377e4eefda0f08fb1ecf33c9736280 (diff)
CP2: Sta manager, data and net_list functions.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1685 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cp2/sta/mgr/sta_mgr.h')
-rw-r--r--cp2/sta/mgr/sta_mgr.h154
1 files changed, 154 insertions, 0 deletions
diff --git a/cp2/sta/mgr/sta_mgr.h b/cp2/sta/mgr/sta_mgr.h
new file mode 100644
index 0000000000..b874fcdd82
--- /dev/null
+++ b/cp2/sta/mgr/sta_mgr.h
@@ -0,0 +1,154 @@
+#ifndef cp2_sta_data_sta_mgr_h
+#define cp2_sta_data_sta_mgr_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp2/sta/data/sta_mgr.h
+ * \brief Station and AVLN manager.
+ * \ingroup cp_sta_data
+ *
+ * Manage the network list and its Stations. The station manager job it to
+ * keep the integrity of the differents databases.
+ */
+
+#include "cp2/sta/data/net_list.h"
+#include "cp2/sta/data/sta_data.h"
+
+struct cp_sta_mgr_t
+{
+ u16 current_sta_avln;
+};
+typedef struct cp_sta_mgr_t cp_sta_mgr_t;
+
+/** Initialise the sta manager.
+ * \return the sta manager context.
+ */
+cp_sta_mgr_t *
+cp_sta_mgr_init(void);
+
+/** Uninitialise the sta manager.
+ * \param ctx the sta manager context.
+ */
+void
+cp_sta_mgr_uninit(cp_sta_mgr_t *ctx);
+
+/** Get an AVLN from the sta manager.
+ * \param ctx the sta manager context.
+ * \return the avln identified by its snid.
+ *
+ * This function shall return an avln with the snid provided or NULL if the
+ * avln does not exists.
+ */
+cp_net_list_t*
+cp_sta_mgr_get_avln(cp_sta_mgr_t *ctx, u16 snid);
+
+/** Get our AVLN.
+ * \param ctx the sta manager context.
+ * \return Our AVLN.
+ */
+cp_net_list_t*
+cp_sta_mgr_get_our_avln(cp_sta_mgr_t *ctx);
+
+/** Add an AVLN.
+ * \param ctx the sta manager context.
+ * \param snid the new avln's snid.
+ * \return the new avln.
+ */
+cp_net_list_t*
+cp_sta_mgr_add_avln(cp_sta_mgr_t *ctx, u16 snid);
+
+/** Remove an AVLN from the list and all the STAs associated in it.
+ * \param ctx the sta manager context.
+ * \param snid the avln snid.
+ *
+ * This function shall not remove our AVLN.
+ */
+void
+cp_sta_mgr_remove_avln(u16 snid);
+
+/** Add a station to a specified AVLN.
+ * \param ctx the sta manager context.
+ * \param tei the tei of the station
+ * \param mac_addr the mac address
+ * \param added true if the station was just create, flase otherwise.
+ * \return the station just created.
+ *
+ * This function shall return the station just created and fill the added
+ * boolean parameters with true value if the station has just been created or
+ * false if the station already exists.
+ */
+cp_sta_t*
+cp_sta_mgr_add_sta(cp_sta_mgr_t *ctx, u16 snid, u8 tei, mac_t mac_addr,
+ bool added);
+
+/** Remove a sta from the specified AVLN.
+ * \param ctx the sta manager context.
+ * \param snid the AVLN's snid.
+ * \param tei the station tei.
+ */
+void
+cp_sta_mgr_remove_sta(cp_sta_mgr_t *ctx, u16 snid, u8 tei);
+
+/** Add a STA to our AVLN.
+ * \param ctx the sta manager context.
+ * \param tei the station tei
+ * \param mac_address the station mac address.
+ * \param added true if the station was just create, flase otherwise.
+ * \return the station just created.
+ *
+ * This function shall return the station just created and fill the added
+ * boolean parameters with true value if the station has just been created or
+ * false if the station already exists.
+ */
+cp_sta_t*
+cp_sta_mgr_add_sta_our_avln(cp_sta_mgr_t *ctx, u8 tei, mac_t mac_address);
+
+/** Remove a STA of our AVLN.
+ * \param ctx the sta manager context.
+ * \param tei the station tei.
+ */
+void
+cp_sta_mgr_remove_sta_our_avln(cp_sta_mgr_t *ctx, u8 tei);
+
+/** Get a STA from an AVLN.
+ * \param ctx the sta manager context.
+ * \param snid the AVLN's snid.
+ * \param tei the STA's tei.
+ * \return The station associated of NULL of no tei is associated.
+ */
+cp_sta_t*
+cp_sta_mgr_get_sta(cp_sta_mgr_t *ctx, u16 snid, u8 tei);
+
+/** Get the STA in our AVLN corresponding to the tei provided.
+ * \param ctx the sta manager context.
+ * \param tei the station's tei
+ * \return the station corresponding to the tei.
+ */
+cp_sta_t*
+cp_sta_mgr_get_sta_in_avln(cp_sta_mgr_t *ctx, u8 tei);
+
+/** Update the STA data in our AVLN.
+ * \param ctx the sta manager context.
+ * \param sta the station to update
+ * \param tei the station's new tei
+ * \param mac address the station's new mac address.
+ */
+void
+cp_sta_mgr_update_sta_in_avln(cp_sta_mgr_t *ctx, cp_sta_t *sta,
+ u8 tei, mac_t mac_addr);
+
+/** Update the STA data in any AVLN.
+ * \param ctx the sta manager context.
+ * \param sta the station to update the data.
+ * \param tei the station new tei.
+ * \param mac_addr the station's new mac address.
+ */
+void
+cp_sta_mgr_update_sta(cp_sta_t sta, u8 tei, mac_t mac_addr);
+
+#endif /* cp2_sta_data_sta_mgr_h */