summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Carré2011-12-12 17:08:04 +0100
committerThierry Carré2012-05-10 17:02:56 +0200
commit9cd3b62f9df2feb017eb5fadcb3f280711d00361 (patch)
treea71fe76dced77990cab540d0aa6d4d8f93a7228a
parent15a4cfc7b71864c955ede025465565413ab2cd43 (diff)
cesar/cp/sta/mgr: net_list.c not used, and so removed
-rw-r--r--cesar/cp/sta/mgr/src/net_list.c265
1 files changed, 0 insertions, 265 deletions
diff --git a/cesar/cp/sta/mgr/src/net_list.c b/cesar/cp/sta/mgr/src/net_list.c
deleted file mode 100644
index 1017b8494b..0000000000
--- a/cesar/cp/sta/mgr/src/net_list.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2008 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file cp/sta/mgr/src/net_list.c
- * \brief Network list manager.
- * \ingroup cp_sta_mgr
- *
- */
-#include "common/std.h"
-#include "mac/common/timings.h"
-
-#include "cp/defs.h"
-#include "cp/sta/mgr/net_list.h"
-
-#include "cp/sta/mgr/inc/net_list.h"
-#include "cp/sta/mgr/inc/sta.h"
-
-#include "cp/inc/context.h"
-/**
- * Initialise the lists.
- * \param ctx the module context.
- * \param network the network list.
- */
-void
-cp_net_list_init (cp_t *ctx, cp_net_list_t *network)
-{
- uint i;
-
- dbg_assert (ctx);
- dbg_assert (network);
-
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- cp_net_init (ctx, &network->networks[i]);
- }
-}
-
-/** Uninitialise the network list.
- * \param ctx the module context.
- * \param network the network list.
- */
-void
-cp_net_list_uninit (cp_t *ctx, cp_net_list_t *network)
-{
- uint i;
- dbg_assert (ctx);
- dbg_assert (network);
-
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- cp_net_uninit (ctx, &network->networks[i]);
- }
-}
-
-/**
- * Add an AVLN to the list.
- * \param ctx the module context.
- * \param network the network list.
- * \param snid The AVLN's SNID to add.
- * \param nid The AVLN's NID to add.
- * \return return the network added.
- */
-cp_net_t *
-cp_net_list_add_avln (cp_t *ctx, cp_net_list_t *network,
- cp_snid_t snid, cp_nid_t nid)
-{
- uint i;
- cp_net_t *net;
- dbg_assert (ctx);
- dbg_assert (HPAV_NID_IS_VALID (nid));
- dbg_assert (network);
- net = cp_net_list_get_avln (ctx, network, snid, nid);
-
- if (!net)
- {
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- if (network->networks[i].present == false)
- {
- net = &network->networks[i];
- break;
- }
- }
- }
-
- // No net available.
- if (!net)
- return NULL;
-
- // Insert it as present.
- if (!net->present)
- {
- net->present = true;
- net->snid = snid;
- net->nid = nid;
- }
-
- return net;
-}
-
-/**
- * Removes an AVLN from the sta manager.
- * \param ctx the module context.
- * \param network the network list.
- * \param snid The AVLN's SNID to remove.
- * \param nid The AVLN's NID to remove.
- */
-void
-cp_net_list_remove_avln (cp_t *ctx, cp_net_list_t *network,
- cp_snid_t snid, cp_nid_t nid)
-{
- cp_net_t *net;
- dbg_assert (network);
- dbg_assert (HPAV_NID_IS_VALID (nid));
- dbg_assert (ctx);
-
- net = cp_net_list_get_avln (ctx, network, snid, nid);
-
- // Test if the network exist
- if (!net)
- return;
-
- cp_net_uninit (ctx, net);
-}
-
-/**
- * Returns the AVLN corresponding to the snid and nid.
- * \param ctx the module context.
- * \param network the network list.
- * \param snid The AVLN's snid to get.
- * \param nid The AVLN's NID to get.
- * \return return the network.
- */
-cp_net_t *
-cp_net_list_get_avln (cp_t *ctx, cp_net_list_t *network,
- cp_snid_t snid, cp_nid_t nid)
-{
- uint i;
- dbg_assert (ctx);
- dbg_assert (HPAV_NID_IS_VALID (nid));
- dbg_assert (network);
-
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- if (nid == network->networks[i].nid
- && snid == network->networks[i].snid
- && network->networks[i].present)
- return &network->networks[i];
- }
- return NULL;
-}
-
-cp_net_t *
-cp_net_list_get_first_avln (cp_t *ctx, cp_net_list_t *network)
-{
- dbg_assert (ctx);
- dbg_assert (network);
- cp_net_t *net;
- /* Loop over nets. */
- for (net = &network->networks[0];
- net != &network->networks[CP_NET_LIST_NB_AVLN];
- net++)
- {
- if (net->present)
- return net;
- }
- /* None found. */
- return NULL;
-}
-
-cp_net_t *
-cp_net_list_get_next_avln (cp_t *ctx, cp_net_list_t *network, cp_net_t *prev)
-{
- dbg_assert (ctx);
- dbg_assert (network);
- dbg_assert (prev);
- cp_net_t *net;
- /* Loop over nets. */
- for (net = prev + 1;
- net != &network->networks[CP_NET_LIST_NB_AVLN];
- net++)
- {
- if (net->present)
- return net;
- }
- /* None found. */
- return NULL;
-}
-
-/**
- * Create a 16 bits flag indicating which SNID are in use.
- * \param ctx the module context.
- * \param network the network list.
- * \return A 16 bits flag
- */
-u16
-cp_net_list_get_snid_present (cp_t *ctx, cp_net_list_t *network)
-{
- u16 snidflags = 0;
- uint i;
-
- dbg_assert (ctx);
-
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- if (network->networks[i].present)
- {
- snidflags |= (u16) (1 << (network->networks[i].snid));
- }
- }
-
- return snidflags;
-}
-
-/**
- * Get the number of discovered station on all AVLNs.
- * \param ctx the module context.
- * \param network the network list.
- * \return the number of discovered station.
- */
-u8
-cp_net_list_get_num_discovered_stas (cp_t *ctx, cp_net_list_t *network)
-{
- u8 num = 0;
- uint i;
-
- dbg_assert (ctx);
-
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- num += cp_net_get_num_discovered_stas (ctx, &network->networks[i]);
- }
-
- return num;
-}
-
-/**
- * Get the number of discovered networks.
- * \param ctx the module context.
- * \param network the network list.
- * \return the number of discovered networks.
- */
-u8
-cp_net_list_get_num_discovered_net (cp_t *ctx, cp_net_list_t *network)
-{
- u8 num = 0;
- uint i;
-
- dbg_assert (network);
-
- for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
- {
- if ((ctx->sta_mgr.our_avln != &network->networks[i])
- && network->networks[i].present)
- num ++;
- }
-
- return num;
-}
-