summaryrefslogtreecommitdiff
path: root/cesar/cp/sta
diff options
context:
space:
mode:
authorNélio Laranjeiro2012-07-02 16:18:08 +0200
committerNélio Laranjeiro2012-07-23 16:20:41 +0200
commite1d08f1096c410d60a399c017b78b012ee48b35d (patch)
tree43d67a265769be0fd3195c29419eef2cb0312c87 /cesar/cp/sta
parentfafd97d92a5a7695e558bebde8adc1a91c8362e3 (diff)
cesar/cp/av/sta/mgr: move sta_mgr_set_tracking to common dir, refs #3222
Diffstat (limited to 'cesar/cp/sta')
-rw-r--r--cesar/cp/sta/mgr/src/sta_mgr.c21
-rw-r--r--cesar/cp/sta/mgr/sta_mgr.h12
2 files changed, 33 insertions, 0 deletions
diff --git a/cesar/cp/sta/mgr/src/sta_mgr.c b/cesar/cp/sta/mgr/src/sta_mgr.c
index 50836c8731..b12bbce983 100644
--- a/cesar/cp/sta/mgr/src/sta_mgr.c
+++ b/cesar/cp/sta/mgr/src/sta_mgr.c
@@ -577,3 +577,24 @@ cp_sta_mgr__assoc__timeout (cp_t *ctx, uint time_ms)
}
}
}
+
+void
+cp_sta_mgr_set_tracking (cp_t *ctx, cp_snid_t snid, cp_nid_t nid)
+{
+ dbg_assert (ctx);
+ dbg_assert (HPAV_NID_IS_VALID (nid));
+#if CONFIG_DEBUG
+ bool found = false;
+ cp_net_t *net;
+ for (net = cp_sta_mgr_get_first_avln (ctx);
+ net;
+ net = cp_sta_mgr_get_next_avln (ctx, net))
+ {
+ if (cp_net_get_snid (ctx, net) == snid
+ && cp_net_get_nid (ctx, net) == nid)
+ found = true;
+ }
+ dbg_assert (found);
+#endif
+ ctx->sta_mgr.sta_own_data.snid = snid;
+}
diff --git a/cesar/cp/sta/mgr/sta_mgr.h b/cesar/cp/sta/mgr/sta_mgr.h
index 6fe5207c1c..bfc955ab90 100644
--- a/cesar/cp/sta/mgr/sta_mgr.h
+++ b/cesar/cp/sta/mgr/sta_mgr.h
@@ -305,6 +305,18 @@ cp_sta_mgr_commit_to_dataplane (cp_t *ctx);
void
cp_sta_mgr__assoc__timeout (cp_t *ctx, uint time_ms);
+/**
+ * Set the SNID of the station to track the correct AVLN.
+ * \param ctx the module context.
+ * \param snid the station SNID.
+ * \param nid the network identifier to track.
+ *
+ * Be careful, this function does not modify our AVLN snid to do some use
+ * cp_sta_own_data_set_snid.
+ */
+void
+cp_sta_mgr_set_tracking (cp_t *ctx, cp_snid_t snid, cp_nid_t nid);
+
END_DECLS
#endif /* cp_sta_mgr_h */