summaryrefslogtreecommitdiff
path: root/cesar/cp2/cco
diff options
context:
space:
mode:
authorlaranjeiro2008-06-10 12:09:01 +0000
committerlaranjeiro2008-06-10 12:09:01 +0000
commite80fa2a9c108a3466adab29f2810e914eae8bc36 (patch)
tree746b4bbfa95a08f8759bf85b0258184e573fe259 /cesar/cp2/cco
parentaabea906c57fdb561c1c4e1bbfc98eb1d5d2c097 (diff)
cco_action : Fix to use the new MSG interface.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2264 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2/cco')
-rw-r--r--cesar/cp2/cco/action/inc/cco_action.h9
-rw-r--r--cesar/cp2/cco/action/src/cco_action.c239
-rwxr-xr-xcesar/cp2/cco/action/test/src/action-test.c359
-rw-r--r--cesar/cp2/cco/action/test/src/garbage.c176
4 files changed, 422 insertions, 361 deletions
diff --git a/cesar/cp2/cco/action/inc/cco_action.h b/cesar/cp2/cco/action/inc/cco_action.h
index c84fb61276..531826ae1f 100644
--- a/cesar/cp2/cco/action/inc/cco_action.h
+++ b/cesar/cp2/cco/action/inc/cco_action.h
@@ -22,9 +22,9 @@
#define CP_CCO_ACTION_TEI_FLAGS_ROW_SIZE_BITS 32 /* 32 bits. */
/* Default time lease for associated STA (in minutes.) . */
-#define CP_CCO_ACTION_LEASE_UNASSOC 0x7 /* 7 minutes. */
-#define CP_CCO_ACTION_LEASE_ASSOC 0xF /* 15 minutes. */
-#define CP_CCO_ACTION_LEASE_AUTH 0xB40 /* 48 hours. */
+#define CP_CCO_ACTION_LEASE_UNASSOC_MIN 0x7 /* 7 minutes. */
+#define CP_CCO_ACTION_LEASE_ASSOC_MIN 0xF /* 15 minutes. */
+#define CP_CCO_ACTION_LEASE_AUTH_MIN 0xB40 /* 48 hours. */
/* Conversion of minutes to eCos ticks. */
#define MIN_TO_RTC(val) (val * 100)
@@ -34,6 +34,9 @@ struct cp_cco_action_t
/** TEI in use. */
uint tei_flags [CP_CCO_ACTION_TEI_FLAGS_ROW];
+ /** Nek. */
+ cp_key_t nek;
+
/** Random generator. */
lib_rnd_t rnd;
};
diff --git a/cesar/cp2/cco/action/src/cco_action.c b/cesar/cp2/cco/action/src/cco_action.c
index 2dcedb0d2a..c1eebcd5ad 100644
--- a/cesar/cp2/cco/action/src/cco_action.c
+++ b/cesar/cp2/cco/action/src/cco_action.c
@@ -19,17 +19,16 @@
#include "lib/utils.h"
#include "lib/rnd.h"
+#include "common/defs/ethernet.h"
+
#include "cl/cl_mactotei.h"
#include "mac/common/ntb.h"
+#include "mac/common/timings.h"
#include "cp2/defs.h"
#include "cp2/cp.h"
#include "cp2/msg/msg.h"
-#include "cp2/msg/cc_assoc.h"
-#include "cp2/msg/cc_leave.h"
-#include "cp2/msg/cc_set_tei_map.h"
-#include "cp2/msg/cm_get_key.h"
#include "cp2/cco/action/cco_action.h"
#include "cp2/sta/mgr/sta_mgr.h"
@@ -192,7 +191,7 @@ cp_cco_action_garbage (cp_t *ctx)
while (sta)
{
sta_next = cp_net_get_next_sta (net, sta);
- if (less_mod2p32(sta->tei_lease_rtc, cyg_current_time ()))
+ if (less_mod2p32(sta->tei_lease_ms, /*cp_sta_core_date_ms (ctx)*/ 0))
{
// Remove the node from the tei lease.
cp_cco_action_manage_sta_leave (ctx, NULL, sta);
@@ -205,7 +204,7 @@ cp_cco_action_garbage (cp_t *ctx)
while (sta)
{
sta_next = cp_net_get_next_sta (net, sta);
- if (less_mod2p32(sta->tei_lease_rtc, cyg_current_time ()))
+ if (less_mod2p32(sta->tei_lease_ms, /*cp_sta_core_date_ms (ctx)*/ 0))
{
// Remove the node from the tei lease.
cp_net_sta_remove (net, sta);
@@ -237,11 +236,10 @@ cp_cco_action_gen_nek (cp_t *ctx, u8 sl);
void
cp_cco_action_manage_sta_assoc (cp_t *ctx, cp_mme_rx_t * assoc_req)
{
- cc_assoc_req_t assoc;
- cc_assoc_cnf_t cnf;
+ cp_msg_cc_assoc_req_t assoc;
+ cp_msg_cc_assoc_cnf_t cnf;
cp_sta_t *sta;
cp_net_t *net;
- cp_mme_peer_info_t peer_info;
uint tei;
dbg_assert (ctx);
@@ -253,12 +251,12 @@ cp_cco_action_manage_sta_assoc (cp_t *ctx, cp_mme_rx_t * assoc_req)
/* Add the station to the AVLN. */
net = cp_sta_mgr_get_our_avln (ctx);
- if (assoc.request_type == CC_ASSOC_REQ_TYPE_NEW)
+ if (assoc.request_type == CP_MSG_CC_ASSOC_REQ_TYPE_NEW)
{
// If the station already exists.
// Read the mac to TEI table of the CL to get the TEI of the station.
tei = cl_mactotei_table_find_tei_from_mac (ctx->cl,
- assoc_req->header.osa);
+ assoc_req->peer.mac);
if (tei)
{
// The station already exists.
@@ -272,88 +270,121 @@ cp_cco_action_manage_sta_assoc (cp_t *ctx, cp_mme_rx_t * assoc_req)
/* Try to get a TEI. */
tei = cp_cco_action_tei_compute (&ctx->cco_action);
- sta = cp_net_sta_add (net, tei, assoc_req->header.osa,
- false /* not authenticated. */,
- false /* not CCo. */,
- false /* not PCo. */,
- false /* not backup CCo.*/,
- true /* visible */);
+ sta = cp_net_sta_add (net, tei, assoc_req->peer.mac);
if (tei)
{
/* Add the TEI lease corresponding to an unassociated STA. */
- sta->tei_lease_rtc = MIN_TO_RTC(CP_CCO_ACTION_LEASE_ASSOC);
cp_net_commit_to_dataplane (net, ctx);
+ sta->tei_lease_ms =
+ MAC_SEC_TO_MS(CP_CCO_ACTION_LEASE_ASSOC_MIN * 60);
- cnf.result = CC_ASSOC_CNF_SUCCESS;
- cnf.lease_time = CP_CCO_ACTION_LEASE_ASSOC;
+ cnf.result = CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS;
+ cnf.lease_time_min = CP_CCO_ACTION_LEASE_ASSOC_MIN;
}
else
{
- cnf.result = CC_ASSOC_CNF_FAILURE_TEMPORARY_RESSOURCE_EXHAUSTION;
- sta->tei_lease_rtc = MIN_TO_RTC(CP_CCO_ACTION_LEASE_UNASSOC);
+ cnf.result =
+ CP_MSG_CC_ASSOC_CNF_RESULT_FAILURE_TEMPORARY_RESSOURCE_EXHAUSTION;
+ sta->tei_lease_ms =
+ MAC_SEC_TO_MS(CP_CCO_ACTION_LEASE_UNASSOC_MIN * 60);
}
cnf.sta_tei = cp_sta_get_tei (sta);
}
- else if (assoc.request_type == CC_ASSOC_REQ_TYPE_RENEW)
+ else if (assoc.request_type == CP_MSG_CC_ASSOC_REQ_TYPE_RENEW)
{
/* Renew the TEI. */
- sta = cp_net_get_sta (net, assoc_req->mfs->common.tei);
+ sta = cp_net_get_sta (net, assoc_req->peer.tei);
if (sta)
{
/* Renew the TEI. */
- sta->tei_lease_rtc = MIN_TO_RTC(CP_CCO_ACTION_LEASE_AUTH);
+ sta->tei_lease_ms =
+ MAC_SEC_TO_MS(CP_CCO_ACTION_LEASE_AUTH_MIN * 60);
- cnf.result = CC_ASSOC_CNF_SUCCESS;
+ cnf.result = CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS;
cnf.sta_tei = cp_sta_get_tei (sta);
- cnf.lease_time = CP_CCO_ACTION_LEASE_AUTH;
+ cnf.lease_time_min = CP_CCO_ACTION_LEASE_AUTH_MIN;
}
else
{
- cnf.result = CC_ASSOC_CNF_FAILURE_OTHER_REASON;
+ cnf.result = CP_MSG_CC_ASSOC_CNF_RESULT_FAILURE_OTHER_REASON;
cnf.sta_tei = 0;
- cnf.lease_time = 0;
+ cnf.lease_time_min = 0;
}
}
else
- dbg_assert (assoc.request_type == CC_ASSOC_REQ_MAX);
+ dbg_assert (assoc.request_type == CP_MSG_CC_ASSOC_REQ_TYPE_NB);
/* Finishing to fill the cnf context. */
cnf.nid = cp_net_get_nid (net);
cnf.snid = cp_net_get_snid (net);
- /* Create the MME to answer. */
- peer_info.peer_address = assoc_req->header.osa;
- peer_info.v_lan_tag = assoc_req->header.v_lan_tag;
- peer_info.m_type = assoc_req->header.m_type;
-
/* Send the answer. */
- cp_msg_cc_assoc_cnf_send (ctx, peer_info, &cnf);
+ cp_msg_cc_assoc_cnf_send (ctx, &CP_MME_PEER(assoc_req->peer.mac,
+ tei), &cnf);
if (tei
- && assoc.request_type != CC_ASSOC_REQ_TYPE_RENEW)
+ && assoc.request_type != CP_MSG_CC_ASSOC_REQ_TYPE_RENEW)
{
// Send the TEI MAPs.
- cc_set_tei_map_tx_t tei_map_info;
+ cp_mme_tx_t *mme_tx;
+ cp_sta_t *sta_list;
+ cp_sta_t *sta_list_next;
+ cp_mme_peer_t *peer;
// Send unicast.
// It will send all the TEI MAP to the station just associated.
- tei_map_info.type = CC_SET_TEI_MAP_TX_KIND_UNICAST;
- tei_map_info.unicast.mode = CC_SET_TEI_MAP_MODE_ADD;
- tei_map_info.unicast.tei = tei;
- tei_map_info.unicast.peer_info = peer_info;
- cp_msg_cc_set_tei_map_ind_send (ctx, &tei_map_info);
+ peer = &CP_MME_PEER (assoc_req->peer.mac, tei);
+ mme_tx = cp_msg_cc_set_tei_map_ind_send_begin (ctx, peer,
+ CP_MSG_CC_SET_TEI_MAP_IND_MODE_UPDATE,
+ cp_net_get_num_stas (net));
+
+ sta_list = cp_net_get_first (net, CP_STA_STATE_ASSOCIATED);
+ while (sta_list)
+ {
+ enum cp_msg_cc_set_tei_map_ind_status_t station_status;
+
+ switch (cp_sta_get_state (sta_list))
+ {
+ case CP_STA_STATE_ASSOCIATED:
+ station_status = CP_MSG_CC_SET_TEI_MAP_IND_STATUS_ASSOCIATED;
+ break;
+ case CP_STA_STATE_AUTHENTICATED:
+ station_status =
+ CP_MSG_CC_SET_TEI_MAP_IND_STATUS_AUTHENTICATED;
+ break;
+ default:
+ station_status =
+ CP_MSG_CC_SET_TEI_MAP_IND_STATUS_DISASSOCIATED;
+ }
+
+ cp_msg_cc_set_tei_map_ind_send_sta (ctx, mme_tx,
+ cp_sta_get_tei (sta_list),
+ cp_sta_get_mac_address (sta_list),
+ station_status);
+
+ sta_list_next = cp_net_get_next_sta (net, sta_list);
+ blk_release (sta_list);
+ sta_list = sta_list_next;
+ }
+
+ cp_msg_cc_set_tei_map_ind_send_end (ctx, mme_tx);
// Send broadcast.
// Send the TEI and the Mac address of the station just associated to
// all the station of the network.
- tei_map_info.type = CC_SET_TEI_MAP_TX_KIND_BROADCAST;
- tei_map_info.broadcast.mode = CC_SET_TEI_MAP_MODE_ADD;
- tei_map_info.broadcast.tei = tei;
- tei_map_info.broadcast.mac_address = peer_info.peer_address;
- cp_msg_cc_set_tei_map_ind_send (ctx, &tei_map_info);
+ peer = &CP_MME_PEER (ETH_MAC_ADDRESS_BROADCAST);
+ mme_tx = cp_msg_cc_set_tei_map_ind_send_begin (ctx, peer,
+ CP_MSG_CC_SET_TEI_MAP_IND_MODE_ADD, 1);
+
+ cp_msg_cc_set_tei_map_ind_send_sta (ctx, mme_tx,
+ cp_sta_get_tei (sta),
+ cp_sta_get_mac_address (sta),
+ CP_MSG_CC_SET_TEI_MAP_IND_STATUS_ASSOCIATED);
+
+ cp_msg_cc_set_tei_map_ind_send_end (ctx, mme_tx);
}
/* Release the reference on the station. */
@@ -368,16 +399,17 @@ cp_cco_action_manage_sta_assoc (cp_t *ctx, cp_mme_rx_t * assoc_req)
void
cp_cco_action_manage_sta_auth (cp_t *ctx, cp_mme_rx_t * get_key_req)
{
- cm_get_key_req_t req;
- cm_get_key_cnf_t cnf;
+ cp_msg_cm_get_key_req_t req;
+ cp_msg_cm_get_key_cnf_t cnf;
cp_net_t *net;
cp_sta_t *sta;
cp_sta_own_data_t *own_data;
- cp_mme_tx_t mme;
+ cp_mme_peks_t peks;
+ cp_secu_protocol_run_t prun;
dbg_assert (ctx);
dbg_assert (get_key_req);
- dbg_assert (get_key_req->mfs);
+ dbg_assert (get_key_req->peer.tei);
// get the data in the payload of the mme.
cp_msg_cm_get_key_req_receive (ctx, get_key_req, &req);
@@ -386,57 +418,35 @@ cp_cco_action_manage_sta_auth (cp_t *ctx, cp_mme_rx_t * get_key_req)
net = cp_sta_mgr_get_our_avln (ctx);
own_data = cp_sta_mgr_get_sta_own_data (ctx);
// Get the station.
- sta = cp_net_get_sta (net, get_key_req->mfs->common.tei);
+ sta = cp_net_get_sta (net, get_key_req->peer.tei);
if (sta)
{
- cp_key_t nmk_key;
// The station is now considered as authenticated.
- sta->station_state = CP_STA_STATE_AUTHENTICATED;
+ cp_sta_set_state (sta, CP_STA_STATE_AUTHENTICATED);
- cnf.result = CM_GET_KEY_CNF_RESULT_KEY_GRANTED;
+ cnf.result = CP_MSG_CM_GET_KEY_CNF_RESULT_KEY_GRANTED;
- switch (req.req_key_type)
+ if (req.key_type == CP_MSG_KEY_NEK)
{
- case CM_GET_KEY_NMK:
- nmk_key = cp_sta_own_data_get_nmk (own_data);
- memcpy (cnf.key, &nmk_key, sizeof(cp_key_t));
- break;
- case CM_GET_KEY_NEK:
- *cnf.key = own_data->eks_current;
- break;
- case CM_GET_KEY_TEK:
- // TODO : Generate the TEK.
- bitstream_memcpy (cnf.key, sta->tek, TEK_SIZE);
- break;
- case CM_GET_KEY_HASH_KEY:
- // TODO : Generate the HASH KEY.
- break;
- default:
- *cnf.key = CM_GET_KEY_NONCE_ONLY;
+ cnf.key = ctx->cco_action.nek;
}
+ else
+ dbg_assert (req.key_type == CP_MSG_KEY_NEK);
blk_release (sta);
}
// Refuse the request.
else
{
- cnf.result = CM_GET_KEY_CNF_RESULT_REQUEST_REFUSED;
+ cnf.result = CP_MSG_CM_GET_KEY_CNF_RESULT_REQUEST_REFUSED;
}
- cnf.req_key_type = req.req_key_type;
- cnf.your_nonce = req.nonce;
- cnf.my_nonce = lib_rnd32 (&ctx->cco_action.rnd);
+ cnf.key_type = req.key_type;
cnf.nid = req.nid;
-
- // construct the mme header to send the data.
- mme.mfs = get_key_req->mfs;
- mme.relay = req.request_type;
- mme.header = get_key_req->header;
- mme.header.oda = get_key_req->header.osa;
- mme.header.osa = get_key_req->header.oda;
-
- cp_msg_cm_get_key_cnf_send (ctx, &mme, &cnf);
+ cp_msg_cm_get_key_cnf_send (ctx, &CP_MME_PEER (get_key_req->peer.mac,
+ get_key_req->peer.tei),
+ peks, &prun, &cnf);
}
/**
@@ -451,10 +461,10 @@ void
cp_cco_action_manage_sta_leave (cp_t *ctx, cp_mme_rx_t * leave_req,
cp_sta_t *sta)
{
+ cp_mme_peer_t *peer;
cp_net_t *net;
- cp_mme_peer_info_t peer_info;
- cc_set_tei_map_tx_t tei_map_info;
- uint reason;
+ cp_mme_tx_t *mme;
+ uint status;
dbg_assert (ctx);
@@ -464,36 +474,45 @@ cp_cco_action_manage_sta_leave (cp_t *ctx, cp_mme_rx_t * leave_req,
// The station has sent a lave request.
if (leave_req)
{
- // Is is really useful ?
- dbg_assert (leave_req->mfs->common.tei);
+ dbg_assert (leave_req->peer.tei);
/* Get the station. */
- sta = cp_net_get_sta (net, leave_req->mfs->common.tei);
-
- // Send the CNF MME.
- bitstream_access (&leave_req->bitstream, &reason, 8);
- peer_info.peer_address = leave_req->header.osa;
- peer_info.v_lan_tag = leave_req->header.v_lan_tag;
- peer_info.m_type = leave_req->header.m_type;
-
- cp_msg_cc_leave_cnf_send (ctx, peer_info, reason);
+ sta = cp_net_get_sta (net, leave_req->peer.tei);
+ peer = &CP_MME_PEER (leave_req->peer.mac, leave_req->peer.tei);
+ cp_msg_cc_leave_cnf_send (ctx, peer);
}
else
{
- peer_info.peer_address = cp_sta_get_mac_address (sta);
- peer_info.v_lan_tag = 0;
- peer_info.m_type = HPAV_MTYPE_MME;
- reason = CC_LEAVE_IND_REASON_TEI_LEASE_EXPIRED;
+ peer = &CP_MME_PEER (cp_sta_get_mac_address (sta),
+ cp_sta_get_tei (sta));
- cp_msg_cc_leave_cnf_send (ctx, peer_info, reason);
+ cp_msg_cc_leave_ind_send (ctx, peer,
+ CP_MSG_CC_LEAVE_IND_REASON_TEI_LEASE_EXPIRED,
+ cp_net_get_nid(net));
}
// Send the TEI MAP to the station.
- tei_map_info.type = CC_SET_TEI_MAP_TX_KIND_BROADCAST;
- tei_map_info.broadcast.mode = CC_SET_TEI_MAP_MODE_DELETE;
- tei_map_info.broadcast.tei = cp_sta_get_tei (sta);
- tei_map_info.broadcast.mac_address = cp_sta_get_mac_address (sta);
- cp_msg_cc_set_tei_map_ind_send (ctx, &tei_map_info);
+ peer = &CP_MME_PEER (ETH_MAC_ADDRESS_BROADCAST);
+
+ switch (cp_sta_get_state (sta))
+ {
+ case CP_STA_STATE_ASSOCIATED:
+ status = CP_MSG_CC_SET_TEI_MAP_IND_STATUS_ASSOCIATED;
+ break;
+ case CP_STA_STATE_AUTHENTICATED:
+ status = CP_MSG_CC_SET_TEI_MAP_IND_STATUS_AUTHENTICATED;
+ break;
+ default:
+ status = CP_MSG_CC_SET_TEI_MAP_IND_STATUS_DISASSOCIATED;
+ }
+
+ mme = cp_msg_cc_set_tei_map_ind_send_begin (ctx, peer,
+ CP_MSG_CC_SET_TEI_MAP_IND_MODE_DELETE,
+ 1);
+ cp_msg_cc_set_tei_map_ind_send_sta (ctx, mme, cp_sta_get_tei (sta),
+ cp_sta_get_mac_address (sta),
+ status);
+ cp_msg_cc_set_tei_map_ind_send_end (ctx, mme);
// Remove the station.
cp_net_sta_remove (net, sta);
diff --git a/cesar/cp2/cco/action/test/src/action-test.c b/cesar/cp2/cco/action/test/src/action-test.c
index 595c3c98bc..18d6d0b8a6 100755
--- a/cesar/cp2/cco/action/test/src/action-test.c
+++ b/cesar/cp2/cco/action/test/src/action-test.c
@@ -29,6 +29,7 @@
#include "cp2/cp.h"
#include "cp2/msg/msg.h"
+#include "cp2/sta/mgr/sta.h"
#include "cp2/cco/action/cco_action.h"
#include "cp2/cco/action/inc/cco_action.h"
@@ -324,7 +325,6 @@ test_case_sta_assoc_procedure (test_t test)
uint cco_cap = 2;
uint pco_cap = true;
cp_mme_rx_t mme_rx;
- mfs_rx_t mfs;
cp_net_t *net;
cp_sta_t *sta;
cl_mactotei_blk_t *table;
@@ -339,11 +339,9 @@ test_case_sta_assoc_procedure (test_t test)
test_case_begin (test, "Test 1: Receiving a CC_ASSOC.REQ join");
// Construct the MME to associate the first station.
- mme_rx.header.oda = 1;
- mme_rx.header.osa = 2;
- mme_rx.header.m_type = swap16(HPAV_MTYPE_MME);
- mme_rx.header.mmv = HPAV_MMV1;
- mme_rx.header.mmtype = CC_ASSOC_REQ;
+ mme_rx.peer.mac = 2;
+ mme_rx.peer.vlan_tag = 0;
+ mme_rx.peer.tei = 0;
// Write the request.
bitstream_init (&bitstream, buffer + 19, 10, BITSTREAM_WRITE);
@@ -353,22 +351,19 @@ test_case_sta_assoc_procedure (test_t test)
bitstream_access (&bitstream, &pco_cap, 8);
bitstream_finalise (&bitstream);
- mfs.common.tei = 0xFF;
// Initialise the MME Rx object.
mme_rx.p_mme = buffer;
mme_rx.length = 60;
- mme_rx.mfs = &mfs;
bitstream_init (&mme_rx.bitstream, buffer + 19, 60, BITSTREAM_READ);
cp_cco_action_manage_sta_assoc (&cp, &mme_rx);
// Second station to add.
// Construct the MME to associate the second station.
- mme_rx.header.oda = 1;
- mme_rx.header.osa = 3;
- mme_rx.header.m_type = swap16(HPAV_MTYPE_MME);
- mme_rx.header.mmv = HPAV_MMV1;
- mme_rx.header.mmtype = CC_ASSOC_REQ;
+ mme_rx.peer.mac = 3;
+ mme_rx.peer.vlan_tag = 0;
+ mme_rx.peer.tei = 0;
+
// Write the request.
bitstream_init (&bitstream, buffer + 19, 10, BITSTREAM_WRITE);
@@ -378,11 +373,9 @@ test_case_sta_assoc_procedure (test_t test)
bitstream_access (&bitstream, &pco_cap, 8);
bitstream_finalise (&bitstream);
- mfs.common.tei = 0xFF;
// Initialise the MME Rx object.
mme_rx.p_mme = buffer;
mme_rx.length = 60;
- mme_rx.mfs = &mfs;
bitstream_init (&mme_rx.bitstream, buffer + 19, 60, BITSTREAM_READ);
cp_cco_action_manage_sta_assoc (&cp, &mme_rx);
@@ -400,11 +393,9 @@ test_case_sta_assoc_procedure (test_t test)
// third station to add.
// Construct the MME to associate the third station.
- mme_rx.header.oda = 1;
- mme_rx.header.osa = 4;
- mme_rx.header.m_type = swap16(HPAV_MTYPE_MME);
- mme_rx.header.mmv = HPAV_MMV1;
- mme_rx.header.mmtype = CC_ASSOC_REQ;
+ mme_rx.peer.mac = 4;
+ mme_rx.peer.vlan_tag = 0;
+ mme_rx.peer.tei = 0;
// Write the request.
bitstream_init (&bitstream, buffer + 19, 10, BITSTREAM_WRITE);
@@ -414,11 +405,9 @@ test_case_sta_assoc_procedure (test_t test)
bitstream_access (&bitstream, &pco_cap, 8);
bitstream_finalise (&bitstream);
- mfs.common.tei = 0xFF;
// Initialise the MME Rx object.
mme_rx.p_mme = buffer;
mme_rx.length = 60;
- mme_rx.mfs = &mfs;
bitstream_init (&mme_rx.bitstream, buffer + 19, 60, BITSTREAM_READ);
cp_cco_action_manage_sta_assoc (&cp, &mme_rx);
@@ -426,14 +415,12 @@ test_case_sta_assoc_procedure (test_t test)
test_case_begin (test, "Test 2: Receiving a CC_ASSOC.REQ renew");
// Renew the lease.
- mme_rx.header.oda = 1;
- mme_rx.header.osa = 2;
- mme_rx.header.m_type = swap16(HPAV_MTYPE_MME);
- mme_rx.header.mmv = HPAV_MMV1;
- mme_rx.header.mmtype = CC_ASSOC_REQ;
-
+ mme_rx.peer.mac = 2;
+ mme_rx.peer.vlan_tag = 0;
+ mme_rx.peer.tei = 2;
+
// Write the request.
- req_type = CC_ASSOC_REQ_TYPE_RENEW;
+ req_type = CP_MSG_CC_ASSOC_REQ_TYPE_RENEW;
bitstream_init (&bitstream, buffer + 19, 10, BITSTREAM_WRITE);
bitstream_access (&bitstream, &req_type, 8);
bitstream_access (&bitstream, &nid, 56);
@@ -444,13 +431,11 @@ test_case_sta_assoc_procedure (test_t test)
// Initialise the MME Rx object.
mme_rx.p_mme = buffer;
mme_rx.length = 60;
- mme_rx.mfs = &mfs;
- mfs.common.tei = 2;
bitstream_init (&mme_rx.bitstream, buffer + 19, 60, BITSTREAM_READ);
net = cp_sta_mgr_get_our_avln (&cp);
sta = cp_net_get_sta (net, 2);
- sta->station_state = CP_STA_STATE_AUTHENTICATED;
+ cp_sta_set_state (sta, CP_STA_STATE_AUTHENTICATED);
blk_release (sta);
cp_cco_action_manage_sta_assoc (&cp, &mme_rx);
@@ -472,13 +457,11 @@ test_case_sta_assoc_procedure (test_t test)
cl_mactotei_use_table (cp.cl, table);
// Construct the MME to associate the first station.
- mme_rx.header.oda = 1;
- mme_rx.header.osa = 2;
- mme_rx.header.m_type = swap16(HPAV_MTYPE_MME);
- mme_rx.header.mmv = HPAV_MMV1;
- mme_rx.header.mmtype = CC_ASSOC_REQ;
+ mme_rx.peer.mac = 2;
+ mme_rx.peer.vlan_tag = 0;
+ mme_rx.peer.tei = 0;
- req_type = CC_ASSOC_REQ_TYPE_NEW;
+ req_type = CP_MSG_CC_ASSOC_REQ_TYPE_NEW;
// Write the request.
bitstream_init (&bitstream, buffer + 19, 10, BITSTREAM_WRITE);
bitstream_access (&bitstream, &req_type, 8);
@@ -487,11 +470,9 @@ test_case_sta_assoc_procedure (test_t test)
bitstream_access (&bitstream, &pco_cap, 8);
bitstream_finalise (&bitstream);
- mfs.common.tei = 0xFF;
// Initialise the MME Rx object.
mme_rx.p_mme = buffer;
mme_rx.length = 60;
- mme_rx.mfs = &mfs;
bitstream_init (&mme_rx.bitstream, buffer + 19, 60, BITSTREAM_READ);
cp_cco_action_manage_sta_assoc (&cp, &mme_rx);
@@ -571,10 +552,10 @@ test_case_sta_authentication (test_t test)
data = 0;
bitstream_access (&bitstream, &data, 16);
// Request type.
- data = CM_GET_KEY_REQ_TYPE_DIRECT;
+ data = 0;
bitstream_access (&bitstream, &data, 8);
// Request key type.
- data = CM_GET_KEY_NEK;
+ data = CP_MSG_KEY_NEK;
bitstream_access (&bitstream, &data, 8);
// NID.
data = cp_net_get_nid (net);
@@ -592,18 +573,13 @@ test_case_sta_authentication (test_t test)
mme.length = 37;
mme.p_mme = buffer;
- mme.mfs = &mfs;
- mfs.common.tei = 0xff;
+ mme.peer.tei = 0xFF;
cp_cco_action_manage_sta_auth (&cp, &mme);
mfs.common.tei = 0x1;
- sta = cp_net_sta_add (net, mfs.common.tei, 0x1 /* mac address */,
- true /* authenticated */,
- false /* cco */,
- false /* pco */,
- false /* backup_cco */,
- false /* visible */);
+ sta = cp_net_sta_add (net, mfs.common.tei, 0x1);
+ cp_sta_set_state (sta, CP_STA_STATE_AUTHENTICATED);
blk_release (sta);
cp_cco_action_manage_sta_auth (&cp, &mme);
@@ -646,44 +622,87 @@ cp_beacon_change_snid (cp_t *ctx, u8 snid)
snid_compute = snid;
}
-/** Send an association request to the CCo.
- * \param ctx the CP context.
- * \param peer_info the Peer information.
- * \param req_type the request type.
+u32
+phy_date (phy_t *phy)
+{
+ return 42;
+}
+
+/**
+ * Begin a CC_SET_TEI_MAP.IND construction.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param mode update, add or delete
+ * \param sta_nb number of stations sent
+ * \return the MME being constructed
*/
-void cp_msg_cc_assoc_req_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
- enum cc_assoc_req_request_type_t req_type)
+cp_mme_tx_t *
+cp_msg_cc_set_tei_map_ind_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer,
+ enum cp_msg_cc_set_tei_map_ind_mode_t mode, uint sta_nb)
{
+ return NULL;
}
-/** Receive an association request from a Station.
- * \param ctx the CP context.
- * \param mme the MME RX context.
+/**
*
- * This shall be called only if the station is CCo or Backup CCo.
+ * Write a station to a CC_SET_TEI_MAP.IND being constructed.
+ * \param ctx control plane context
+ * \param mme MME being constructed
+ * \param tei STA TEI
+ * \param mac STA mac address
+ * \param status STA status
+ */
+void
+cp_msg_cc_set_tei_map_ind_send_sta (
+ cp_t *ctx, cp_mme_tx_t *mme, cp_tei_t tei, mac_t mac,
+ enum cp_msg_cc_set_tei_map_ind_status_t status)
+{
+}
+
+/**
+ * Finalise and send a CC_SET_TEI_MAP.IND message.
+ * \param ctx control plane context
+ * \param mme MME being constructed
*/
-void cp_msg_cc_assoc_req_receive(cp_t *ctx, cp_mme_rx_t *mme,
- cc_assoc_req_t *assoc)
+void
+cp_msg_cc_set_tei_map_ind_send_end (cp_t *ctx, cp_mme_tx_t *mme)
+{
+}
+
+/**
+ * Receive a CC_ASSOC.REQ.
+ * \param ctx control plane context
+ * \param mme MME handle
+ * \param data received MME data
+ * \return true on success
+ */
+bool
+cp_msg_cc_assoc_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_msg_cc_assoc_req_t *data)
{
dbg_assert (ctx);
dbg_assert (mme);
- dbg_assert (assoc);
-
- bitstream_access (&mme->bitstream, &assoc->request_type, 8);
- bitstream_access (&mme->bitstream, &assoc->nid, 56);
- bitstream_access (&mme->bitstream, &assoc->cco_cap, 8);
- bitstream_access (&mme->bitstream, &assoc->proxy_cap, 8);
+ dbg_assert (data);
+
+ bitstream_access (&mme->bitstream, &data->request_type, 8);
+ bitstream_access (&mme->bitstream, &data->nid, 56);
+ bitstream_access (&mme->bitstream, &data->cco_cap, 8);
+ bitstream_access (&mme->bitstream, &data->proxy_cap, 8);
bitstream_finalise (&mme->bitstream);
-
+
+ return true;
}
-/** Send a Association CNF to answer to a Association request.
- * \param ctx the CP context.
- * \param peer_info the Peer information.
- * \param data the data to build the answer MME.
+/**
+ * Send a CC_ASSOC.CNF.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param data MME data to send
*/
-void cp_msg_cc_assoc_cnf_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
- cc_assoc_cnf_t *data)
+void
+cp_msg_cc_assoc_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
+ const cp_msg_cc_assoc_cnf_t *data)
{
cp_sta_t *sta;
cp_net_t *net;
@@ -696,34 +715,34 @@ void cp_msg_cc_assoc_cnf_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
if (data->sta_tei)
sta = cp_net_get_sta (net, data->sta_tei);
else
- sta = cp_net_get_sta_unassoc (net, peer_info.peer_address);
+ sta = cp_net_get_sta_unassoc (net, peer->mac);
test_begin (test, "Verifying CNF Data")
{
test_fail_if (sta == NULL, "Station shall exists");
- switch (sta->station_state)
+ switch (cp_sta_get_state (sta))
{
case CP_STA_STATE_ASSOCIATED:
- test_fail_if (data->result != CC_ASSOC_CNF_SUCCESS,
+ test_fail_if (data->result != CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS,
"Wrong result value");
- test_fail_if (data->lease_time != CP_CCO_ACTION_LEASE_ASSOC,
+ test_fail_if (data->lease_time_min != CP_CCO_ACTION_LEASE_ASSOC_MIN,
"Wrong TEI lease time");
break;
case CP_STA_STATE_AUTHENTICATED:
- test_fail_if (data->result != CC_ASSOC_CNF_SUCCESS,
+ test_fail_if (data->result != CP_MSG_CC_ASSOC_CNF_RESULT_SUCCESS,
"Wrong result value");
- test_fail_if (data->lease_time != CP_CCO_ACTION_LEASE_AUTH,
+ test_fail_if (data->lease_time_min != CP_CCO_ACTION_LEASE_AUTH_MIN,
"Wrong TEI lease time");
break;
default:
test_fail_if (data->result !=
- CC_ASSOC_CNF_FAILURE_TEMPORARY_RESSOURCE_EXHAUSTION,
- "Wrong result value");
+ CP_MSG_CC_ASSOC_CNF_RESULT_FAILURE_TEMPORARY_RESSOURCE_EXHAUSTION,
+ "Wrong result value");
}
test_fail_if (data->sta_tei != cp_sta_get_tei (sta),
- "Wrong TEI");
+ "Wrong TEI");
test_fail_if (data->nid != cp_net_get_nid (net),
"Wrong NID");
test_fail_if (data->snid != cp_net_get_snid (net),
@@ -734,94 +753,27 @@ void cp_msg_cc_assoc_cnf_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
blk_release(sta);
}
-/** Read and extract the data contained in the Association CNF.
- * \param ctx the CP context.
- * \param mme the MME received.
- * \param assoc the payload of the MME containing the assoc data.
- */
-void cp_msg_cc_assoc_cnf_receive(cp_t *ctx, cp_mme_rx_t *mme,
- cc_assoc_req_t *assoc)
-{
-}
-
-/** Leave CNF.
- * \param ctx the CP context.
- * \param peer_info the Peer information.
- * \param reason the reason of the CNF.
- */
-void cp_msg_cc_leave_cnf_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
- u8 reason)
-{
-}
-
/**
- * Send the TEI MAP.
- * \param ctx the Control plane context.
- * \param cc_tei_map_info the object containing the information to send to a
- * STA or for all the STAs in the AVLN.
- */
-void cp_msg_cc_set_tei_map_ind_send (cp_t *ctx,
- cc_set_tei_map_tx_t *cc_tei_map_info)
-{
- cp_sta_t *sta;
- cp_net_t *net;
- dbg_assert (ctx);
- dbg_assert (cc_tei_map_info);
-
-
- net = cp_sta_mgr_get_our_avln (ctx);
- if (cc_tei_map_info->type == CC_SET_TEI_MAP_TX_KIND_UNICAST)
- {
- sta = cp_net_get_sta (net, cc_tei_map_info->unicast.tei);
-
- test_begin (test, "Verify the TEI map data to build")
- {
- test_fail_if (sta == NULL, "Station shall exist.");
- test_fail_if (cp_sta_get_tei (sta) != cc_tei_map_info->unicast.tei,
- "Wrong station TEI");
- test_fail_if (cp_sta_get_mac_address (sta) !=
- cc_tei_map_info->unicast.peer_info.peer_address,
- "Wrong station Mac Address");
- }
- test_end;
-
- blk_release (sta);
- }
- else
- {
- sta = cp_net_get_sta (net, cc_tei_map_info->broadcast.tei);
- test_begin (test, "Verify the TEI map data to build broadcast")
- {
- test_fail_if (sta == NULL, "Station shall exist");
- test_fail_if (cp_sta_get_tei (sta) !=
- cc_tei_map_info->broadcast.tei,
- "Wrong station TEI");
- test_fail_if (cp_sta_get_mac_address (sta) !=
- cc_tei_map_info->broadcast.mac_address,
- "Wrong station Mac address");
- }
- test_end;
-
- blk_release (sta);
- }
-}
-
-/** Received a get key MME request.
- * \param ctx the CP context.
- * \param mme the MME context.
- * \param req the request message data.
+ * Receive a CM_GET_KEY.REQ.
+ * \param ctx control plane context
+ * \param mme MME handle
+ * \param data received MME data
+ * \return true on success
+ *
+ * Encryption and protocol run information is available in the MME handle.
*/
-void cp_msg_cm_get_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cm_get_key_req_t *req)
+bool
+cp_msg_cm_get_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_msg_cm_get_key_req_t *data)
{
- uint data;
uint offset;
bool vlantag_present;
+ u64 unused;
dbg_assert (ctx);
dbg_assert (mme);
- dbg_assert (req);
dbg_assert (mme->p_mme);
dbg_assert (mme->length < ETH_PACKET_MAX_SIZE);
+ dbg_assert (data);
if (read_u16_from_word (mme->p_mme + 12) == swap16(HPAV_MTYPE_MME))
vlantag_present = false;
@@ -830,58 +782,77 @@ void cp_msg_cm_get_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
// Read the MME.
bitstream_init (&mme->bitstream, mme->p_mme, mme->length, BITSTREAM_READ);
- bitstream_access (&mme->bitstream, &mme->header.oda, 48);
- bitstream_access (&mme->bitstream, &mme->header.osa, 48);
+ bitstream_access (&mme->bitstream, &mme->peer.mac, 48);
+ bitstream_access (&mme->bitstream, &unused, 48);
if (vlantag_present)
- bitstream_access (&mme->bitstream, &mme->header.v_lan_tag, 32);
- bitstream_access (&mme->bitstream, &mme->header.m_type, 16);
- bitstream_access (&mme->bitstream, &mme->header.mmv, 8);
- bitstream_access (&mme->bitstream, &mme->header.mmtype, 16);
- bitstream_access (&mme->bitstream, &data, 16);
+ bitstream_access (&mme->bitstream, &mme->peer.vlan_tag, 32);
+ bitstream_access (&mme->bitstream, &unused, 16);
+ bitstream_access (&mme->bitstream, &unused, 8);
+ bitstream_access (&mme->bitstream, &unused, 16);
+ bitstream_access (&mme->bitstream, &unused, 16);
// Read the data in the MME.
- bitstream_access (&mme->bitstream, &req->request_type, 8);
- bitstream_access (&mme->bitstream, &req->req_key_type, 8);
- bitstream_access (&mme->bitstream, &req->nid, 56);
- bitstream_access (&mme->bitstream, &req->nonce, 32);
- bitstream_access (&mme->bitstream, &req->pid, 8);
- bitstream_access (&mme->bitstream, &req->prn, 16);
- bitstream_access (&mme->bitstream, &req->pmn, 8);
+ bitstream_access (&mme->bitstream, &data->relayed, 8);
+ bitstream_access (&mme->bitstream, &data->key_type, 8);
+ bitstream_access (&mme->bitstream, &data->nid, 56);
if (vlantag_present)
offset = 41;
else
offset = 37;
- bitstream_memcpy (mme->p_mme + offset, &req->hash_key, mme->length -
- offset);
+ bitstream_memcpy (mme->p_mme + offset, &data->hash_key, mme->length -
+ offset);
+ return true;
}
-/** Send the CM_GET_KEY_CNF MME to the station which request the key.
- * \param ctx the CP context.
- * \param mme the mme context.
- * \param cnf the data to concatenate to the MME.
+/**
+ * Send a CM_GET_KEY.CNF.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param peks payload encryption key select
+ * \param prun protocol run information
+ * \param data MME data to send
*/
-void cp_msg_cm_get_key_cnf_send (cp_t *ctx, cp_mme_tx_t *mme,
- cm_get_key_cnf_t *cnf)
+void
+cp_msg_cm_get_key_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
+ cp_mme_peks_t peks,
+ const cp_secu_protocol_run_t *prun,
+ const cp_msg_cm_get_key_cnf_t *data)
{
dbg_assert (ctx);
- dbg_assert (mme);
- dbg_assert (cnf);
- dbg_assert (mme->mfs);
+ dbg_assert (data);
test_begin (test, "Verify data")
{
- test_fail_if (cnf->result != (mme->mfs->common.tei == 0xFF ?
- CM_GET_KEY_CNF_RESULT_REQUEST_REFUSED :
- CM_GET_KEY_CNF_RESULT_KEY_GRANTED),
+ test_fail_if (data->result != (peer->tei == 0xFF ?
+ CP_MSG_CM_GET_KEY_CNF_RESULT_REQUEST_REFUSED :
+ CP_MSG_CM_GET_KEY_CNF_RESULT_KEY_GRANTED),
"Wrong result type");
}
test_end;
}
-u32
-phy_date (phy_t *phy)
+/**
+ * Send a CC_LEAVE.CNF.
+ * \param ctx control plane context
+ * \param peer peer information
+ */
+void
+cp_msg_cc_leave_cnf_send (cp_t *ctx, cp_mme_peer_t *peer)
+{
+}
+
+/**
+ * Send a CC_LEAVE.IND.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param reason reason for the disassociation
+ * \param nid NID
+ */
+void
+cp_msg_cc_leave_ind_send (cp_t *ctx, cp_mme_peer_t *peer,
+ enum cp_msg_cc_leave_ind_reason_t reason,
+ cp_nid_t nid)
{
- return 42;
}
diff --git a/cesar/cp2/cco/action/test/src/garbage.c b/cesar/cp2/cco/action/test/src/garbage.c
index 3e6977c7ed..1df0c0f7f0 100644
--- a/cesar/cp2/cco/action/test/src/garbage.c
+++ b/cesar/cp2/cco/action/test/src/garbage.c
@@ -68,12 +68,12 @@ my_thread_entry (cyg_addrword_t data)
for (i = 0; i < TEST_CCO_ACTION_NB_STA; i++)
{
- sta = cp_net_sta_add (net, 0, i + 1, false, false, false, false, true);
- sta->tei_lease_rtc = i;
+ sta = cp_net_sta_add (net, 0, i + 1);
+ sta->tei_lease_ms = i;
blk_release (sta);
- sta = cp_net_sta_add (net, i + 1, i + 1, true, false, false, false,
- true);
- sta->tei_lease_rtc = i;
+ sta = cp_net_sta_add (net, i + 1, i + 1);
+ cp_sta_set_state (sta, CP_STA_STATE_AUTHENTICATED);
+ sta->tei_lease_ms = i;
blk_release (sta);
}
@@ -126,84 +126,152 @@ cp_beacon_change_snid (cp_t *ctx, u8 snid)
{
}
-/** Send an association request to the CCo.
- * \param ctx the CP context.
- * \param peer_info the Peer information.
- * \param req_type the request type.
+/**
+ * Send a CC_ASSOC.REQ.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param data MME data to send
*/
-void cp_msg_cc_assoc_req_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
- enum cc_assoc_req_request_type_t req_type)
+void
+cp_msg_cc_assoc_req_send (cp_t *ctx, cp_mme_peer_t *peer,
+ const cp_msg_cc_assoc_req_t *data)
{
}
-/** Receive an association request from a Station.
- * \param ctx the CP context.
- * \param mme the MME RX context.
- *
- * This shall be called only if the station is CCo or Backup CCo.
+/**
+ * Receive a CC_ASSOC.REQ.
+ * \param ctx control plane context
+ * \param mme MME handle
+ * \param data received MME data
+ * \return true on success
+ */
+bool
+cp_msg_cc_assoc_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_msg_cc_assoc_req_t *data)
+{
+ return true;
+}
+
+/**
+ * Send a CC_ASSOC.CNF.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param data MME data to send
+ */
+void
+cp_msg_cc_assoc_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
+ const cp_msg_cc_assoc_cnf_t *data)
+{
+}
+
+/**
+ * Receive a CC_ASSOC.CNF.
+ * \param ctx control plane context
+ * \param mme MME handle
+ * \param data received MME data
+ * \return true on success
+ */
+bool
+cp_msg_cc_assoc_cnf_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_msg_cc_assoc_cnf_t *data)
+{
+ return true;
+}
+
+/**
+ * Send a CC_LEAVE.CNF.
+ * \param ctx control plane context
+ * \param peer peer information
*/
-void cp_msg_cc_assoc_req_receive(cp_t *ctx, cp_mme_rx_t *mme,
- cc_assoc_req_t *assoc)
+void
+cp_msg_cc_leave_cnf_send (cp_t *ctx, cp_mme_peer_t *peer)
{
}
-/** Send a Association CNF to answer to a Association request.
- * \param ctx the CP context.
- * \param peer_info the Peer information.
- * \param data the data to build the answer MME.
+/**
+ * Begin a CC_SET_TEI_MAP.IND construction.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param mode update, add or delete
+ * \param sta_nb number of stations sent
+ * \return the MME being constructed
*/
-void cp_msg_cc_assoc_cnf_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
- cc_assoc_cnf_t *data)
+cp_mme_tx_t *
+cp_msg_cc_set_tei_map_ind_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer,
+ enum cp_msg_cc_set_tei_map_ind_mode_t mode, uint sta_nb)
{
+ return NULL;
}
-/** Read and extract the data contained in the Association CNF.
- * \param ctx the CP context.
- * \param mme the MME received.
- * \param assoc the payload of the MME containing the assoc data.
+/**
+ *
+ * Write a station to a CC_SET_TEI_MAP.IND being constructed.
+ * \param ctx control plane context
+ * \param mme MME being constructed
+ * \param tei STA TEI
+ * \param mac STA mac address
+ * \param status STA status
*/
-void cp_msg_cc_assoc_cnf_receive(cp_t *ctx, cp_mme_rx_t *mme,
- cc_assoc_req_t *assoc)
+void
+cp_msg_cc_set_tei_map_ind_send_sta (
+ cp_t *ctx, cp_mme_tx_t *mme, cp_tei_t tei, mac_t mac,
+ enum cp_msg_cc_set_tei_map_ind_status_t status)
{
}
-/** Leave CNF.
- * \param ctx the CP context.
- * \param peer_info the Peer information.
- * \param reason the reason of the CNF.
+/**
+ * Finalise and send a CC_SET_TEI_MAP.IND message.
+ * \param ctx control plane context
+ * \param mme MME being constructed
*/
-void cp_msg_cc_leave_cnf_send (cp_t *ctx, cp_mme_peer_info_t peer_info,
- u8 reason)
+void
+cp_msg_cc_set_tei_map_ind_send_end (cp_t *ctx, cp_mme_tx_t *mme)
{
}
/**
- * Send the TEI MAP.
- * \param ctx the Control plane context.
- * \param cc_tei_map_info the object containing the information to send to a
- * STA or for all the STAs in the AVLN.
+ * Receive a CM_GET_KEY.REQ.
+ * \param ctx control plane context
+ * \param mme MME handle
+ * \param data received MME data
+ * \return true on success
+ *
+ * Encryption and protocol run information is available in the MME handle.
*/
-void cp_msg_cc_set_tei_map_ind_send (cp_t *ctx,
- cc_set_tei_map_tx_t *cc_tei_map_info)
+bool
+cp_msg_cm_get_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_msg_cm_get_key_req_t *data)
{
+ return true;
}
-/** Received a get key MME request.
- * \param ctx the CP context.
- * \param mme the MME context.
- * \param req the request message data.
+/**
+ * Send a CM_GET_KEY.CNF.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param peks payload encryption key select
+ * \param prun protocol run information
+ * \param data MME data to send
*/
-void cp_msg_cm_get_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cm_get_key_req_t *req)
+void
+cp_msg_cm_get_key_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
+ cp_mme_peks_t peks,
+ const cp_secu_protocol_run_t *prun,
+ const cp_msg_cm_get_key_cnf_t *data)
{
}
-/** Send the CM_GET_KEY_CNF MME to the station which request the key.
- * \param ctx the CP context.
- * \param mme the mme context.
- * \param cnf the data to concatenate to the MME.
+/**
+ * Send a CC_LEAVE.IND.
+ * \param ctx control plane context
+ * \param peer peer information
+ * \param reason reason for the disassociation
+ * \param nid NID
*/
-void cp_msg_cm_get_key_cnf_send (cp_t *ctx, cp_mme_tx_t *mme,
- cm_get_key_cnf_t *cnf)
+void
+cp_msg_cc_leave_ind_send (cp_t *ctx, cp_mme_peer_t *peer,
+ enum cp_msg_cc_leave_ind_reason_t reason,
+ cp_nid_t nid)
{
}