summaryrefslogtreecommitdiff
path: root/cesar/cp/msg/src
diff options
context:
space:
mode:
authorThierry Carré2012-05-10 17:15:36 +0200
committerThierry Carré2012-05-10 17:16:26 +0200
commit8b2d7432b331ef2e7f3a2f8ffb3a6a6f1430e5a6 (patch)
tree4eec786dc73c4cb305edabc5600cf0234bf10e56 /cesar/cp/msg/src
parent4986c1b1af05da71301b8990e53e885d16ee907a (diff)
parent4847312bc9ff6cabc1a528233d8ac41f98149c64 (diff)
Merge branch 't2928' into eoc, closes #2928
Good luck to understand all modifications done on 3 months. But no functions have been modified in their behaviors. They have been only renamed or moved from file to another file.
Diffstat (limited to 'cesar/cp/msg/src')
-rw-r--r--cesar/cp/msg/src/msg.c120
-rw-r--r--cesar/cp/msg/src/msg_cc.c29
-rw-r--r--cesar/cp/msg/src/msg_cm.c78
-rw-r--r--cesar/cp/msg/src/msg_drv.c58
-rw-r--r--cesar/cp/msg/src/msg_vs.c124
-rw-r--r--cesar/cp/msg/src/msg_vs_eoc.c639
6 files changed, 153 insertions, 895 deletions
diff --git a/cesar/cp/msg/src/msg.c b/cesar/cp/msg/src/msg.c
index 003b0f7a11..d1799ab7e0 100644
--- a/cesar/cp/msg/src/msg.c
+++ b/cesar/cp/msg/src/msg.c
@@ -36,8 +36,10 @@
#include "cp/msg/inc/allowed_mme.h"
+#if CONFIG_CP_EOC
#include "config/cp/msg/eoc/multi/sta/mme.h"
#include "config/cp/msg/eoc.h"
+#endif /* CONFIG_CP_EOC */
#include <stdio.h>
@@ -96,6 +98,7 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
CP_MSG_MME_ALLOWED_ENTRY (CC_LINK_REL_IND, STA_AUTH, NEK_ENC_YES, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (CC_DETECT_REPORT_REQ, STA_AUTH, NEK_ENC_YES, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (CC_DETECT_REPORT_CNF, STA_AUTH, NEK_ENC_YES, FROM_H1_NO, NO_EVENT),
+#if CONFIG_CP_EOC
CP_MSG_MME_ALLOWED_ENTRY (CC_WHO_RU_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, CC_WHO_RU_REQ),
CP_MSG_MME_ALLOWED_ENTRY (CC_WHO_RU_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, CC_WHO_RU_CNF),
#if CONFIG_CP_MSG_EOC_MULTI_STA_MME
@@ -103,6 +106,11 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
#else
CP_MSG_MME_ALLOWED_ENTRY (CC_ASSOC_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, CC_ASSOC_REQ),
#endif /* CONFIG_CP_MSG_EOC_MULTI_STA_MME */
+#else /* CONFIG_CP_EOC */
+ CP_MSG_MME_ALLOWED_ENTRY (CC_WHO_RU_REQ, STA_ASSOC, NEK_ENC_NO, FROM_H1_YES, CC_WHO_RU_REQ),
+ CP_MSG_MME_ALLOWED_ENTRY (CC_WHO_RU_CNF, STA_ASSOC, NEK_ENC_NO, FROM_H1_NO, CC_WHO_RU_CNF),
+ CP_MSG_MME_ALLOWED_ENTRY (CC_ASSOC_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, CC_ASSOC_REQ),
+#endif /* CONFIG_CP_EOC */
CP_MSG_MME_ALLOWED_ENTRY (CC_ASSOC_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, CC_ASSOC_CNF),
CP_MSG_MME_ALLOWED_ENTRY (CC_LEAVE_REQ, STA_ASSOC, NEK_ENC_NO, FROM_H1_NO, CC_LEAVE_REQ),
CP_MSG_MME_ALLOWED_ENTRY (CC_LEAVE_CNF, STA_ASSOC, NEK_ENC_NO, FROM_H1_NO, CC_LEAVE_CNF),
@@ -149,11 +157,15 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
CP_MSG_MME_ALLOWED_ENTRY (CM_ENCRYPTED_PAYLOAD_RSP, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (CM_SET_KEY_REQ, STA_ASSOC, NEK_ENC_YES, FROM_H1_YES, CM_SET_KEY_REQ),
CP_MSG_MME_ALLOWED_ENTRY (CM_SET_KEY_CNF, STA_ASSOC, NEK_ENC_YES, FROM_H1_YES, CM_SET_KEY_CNF),
+#if CONFIG_CP_EOC
#if CONFIG_CP_MSG_EOC_MULTI_STA_MME
CP_MSG_MME_ALLOWED_ENTRY (CM_GET_KEY_REQ, STA_ASSOC, NEK_ENC_NO, FROM_H1_YES, MULTI_STA_MME),
#else
CP_MSG_MME_ALLOWED_ENTRY (CM_GET_KEY_REQ, STA_ASSOC, NEK_ENC_NO, FROM_H1_YES, CM_GET_KEY_REQ),
#endif /* CONFIG_CP_MSG_EOC_MULTI_STA_MME */
+#else /* CONFIG_CP_EOC */
+ CP_MSG_MME_ALLOWED_ENTRY (CM_GET_KEY_REQ, STA_ASSOC, NEK_ENC_NO, FROM_H1_YES, CM_GET_KEY_REQ),
+#endif /* CONFIG_CP_EOC */
CP_MSG_MME_ALLOWED_ENTRY (CM_GET_KEY_CNF, STA_ASSOC, NEK_ENC_NO, FROM_H1_YES, CM_GET_KEY_CNF),
CP_MSG_MME_ALLOWED_ENTRY (CM_SC_JOIN_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, CM_SC_JOIN_REQ),
CP_MSG_MME_ALLOWED_ENTRY (CM_SC_JOIN_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, CM_SC_JOIN_CNF),
@@ -184,7 +196,7 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
CP_MSG_MME_ALLOWED_ENTRY (CM_NW_STATS_CNF, STA_AUTH, NEK_ENC_YES, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (CM_LINK_STATS_REQ, STA_AUTH, NEK_ENC_YES, FROM_H1_YES, CM_LINK_STATS_REQ),
CP_MSG_MME_ALLOWED_ENTRY (CM_LINK_STATS_CNF, STA_AUTH, NEK_ENC_YES, FROM_H1_NO, NO_EVENT),
-// CP_MSG_MME_ALLOWED_ENTRY (VS_GET_VERSION_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, NO_EVENT),
+ // CP_MSG_MME_ALLOWED_ENTRY (VS_GET_VERSION_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, NO_EVENT),
// CP_MSG_MME_ALLOWED_ENTRY (VS_GET_VERSION_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
// CP_MSG_MME_ALLOWED_ENTRY (VS_RESET_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, NO_EVENT),
// CP_MSG_MME_ALLOWED_ENTRY (VS_RESET_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
@@ -216,7 +228,7 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
CP_MSG_MME_ALLOWED_ENTRY (VS_GET_STATS_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (VS_GET_CE_STATS_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, VS_GET_CE_STATS_REQ),
CP_MSG_MME_ALLOWED_ENTRY (VS_GET_CE_STATS_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
-#if CONFIG_CP_MSG_EOC_VS
+#if CONFIG_CP_EOC
CP_MSG_MME_ALLOWED_ENTRY (VS_EOC_GET_TOPO_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, VS_EOC_GET_TOPO_REQ),
CP_MSG_MME_ALLOWED_ENTRY (VS_EOC_GET_TOPO_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (VS_EOC_CCO_SET_WL_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, VS_EOC_CCO_SET_WL_REQ),
@@ -238,7 +250,7 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
CP_MSG_MME_ALLOWED_ENTRY (VS_EOC_DIAGNOSTIC_INFO_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (VS_EOC_GET_REAL_TIME_STATISTICS_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, VS_EOC_GET_REAL_TIME_STATISTICS_REQ),
CP_MSG_MME_ALLOWED_ENTRY (VS_EOC_GET_REAL_TIME_STATISTICS_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
-#endif /* CONFIG_CP_MSG_EOC_VS */
+#endif /* CONFIG_CP_EOC */
CP_MSG_MME_ALLOWED_ENTRY (VS_GET_PB_STATS_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, VS_GET_PB_STATS_REQ),
CP_MSG_MME_ALLOWED_ENTRY (VS_GET_PB_STATS_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (VS_GET_MACTOTEI_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, VS_GET_MACTOTEI_REQ),
@@ -288,12 +300,12 @@ cp_msg_mme_allowed_t cp_msg_mme_allowed[] =
CP_MSG_MME_ALLOWED_ENTRY (DRV_STA_SET_CONFIG_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (DRV_MCAST_SET_LIST_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, DRV_MCAST_SET_LIST_REQ),
CP_MSG_MME_ALLOWED_ENTRY (DRV_MCAST_SET_LIST_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
-#if CONFIG_CP_MSG_EOC_VS
+#if CONFIG_CP_EOC
CP_MSG_MME_ALLOWED_ENTRY (DRV_EOC_STA_SET_SLAVE_CONFIG_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, DRV_EOC_STA_SET_SLAVE_CONFIG_REQ),
CP_MSG_MME_ALLOWED_ENTRY (DRV_EOC_STA_SET_SLAVE_CONFIG_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
CP_MSG_MME_ALLOWED_ENTRY (DRV_EOC_STA_SET_EOC_CONFIG_REQ, STA_UNASSOC, NEK_ENC_NO, FROM_H1_YES, DRV_EOC_STA_SET_EOC_CONFIG_REQ),
CP_MSG_MME_ALLOWED_ENTRY (DRV_EOC_STA_SET_EOC_CONFIG_CNF, STA_UNASSOC, NEK_ENC_NO, FROM_H1_NO, NO_EVENT),
-#endif /* CONFIG_CP_MSG_EOC_VS */
+#endif /* CONFIG_CP_EOC */
};
uint cp_msg_mme_allowed_count = COUNT (cp_msg_mme_allowed);
@@ -429,6 +441,7 @@ cp_msg_peks_key_get (cp_t *ctx, cp_mme_peks_t peks)
dbg_assert_default ();
}
+#if CONFIG_CP_EOC
#if CONFIG_CP_MSG_EOC_MULTI_STA_MME
/**
* Provide the key for the peer using the PEKS to select it.
@@ -466,11 +479,8 @@ cp_msg_peer_peks_key_get (cp_t *ctx, cp_mme_peer_t peer, cp_mme_peks_t peks)
dbg_assert_default ();
}
#endif
+#endif
-/**
- * Initialise the MSG module.
- * \param ctx control plane context
- */
void
cp_msg_init (cp_t *ctx)
{
@@ -486,10 +496,6 @@ cp_msg_init (cp_t *ctx)
ctx->msg.fmsn = 1;
}
-/**
- * Uninitialise the MSG module.
- * \param ctx control plane context
- */
void
cp_msg_uninit (cp_t *ctx)
{
@@ -509,7 +515,7 @@ cp_msg_uninit (cp_t *ctx)
* one, if it is the case it will check if the TEI is broadcast, if not it
* will return false.
*/
-bool
+PRIVATE bool
cp_msg_dispatch__read_enc_header (cp_t *ctx, cp_mme_rx_t *mme)
{
/* If the MMe as been relayed the TEI shall be Broadcast one. */
@@ -533,7 +539,7 @@ cp_msg_dispatch__read_enc_header (cp_t *ctx, cp_mme_rx_t *mme)
* \param type the variable to store the FSM event type.
* \return value code.
*/
-enum cp_msg_allowed_mme_t
+static enum cp_msg_allowed_mme_t
cp_msg_dispatch__allowed_mme (cp_t *ctx, cp_mme_rx_t *mme,
enum cp_msg_mme_sta_status_t *status_min,
cp_fsm_event_type_t *type)
@@ -614,16 +620,6 @@ cp_msg_dispatch__allowed_mme_testing (cp_t *ctx, cp_mme_rx_t *mme,
return ok;
}
-/**
- * Examine message type and post an event to the FSM.
- * \param ctx control plane context
- * \param mme received MME
- *
- * This function looks up the message type and translates it to a FSM event,
- * while checking the encryption is compliant with the message type.
- *
- * It also extracts and checks payload from encrypted messages.
- */
void
cp_msg_dispatch (cp_t *ctx, cp_mme_rx_t *mme)
{
@@ -723,19 +719,6 @@ cp_msg_mme_init (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
return mme;
}
-/**
- * Initialise a MME handle for a new message to be transmitted.
- * \param ctx control plane context
- * \param peer peer information
- * \param mmtype the MME MMTYPE.
- * \return the newly created message
- *
- * This function:
- *
- * - gets a buffer for MME transmission,
- * - encapsulates the MME in a CC_RELAY.REQ if necessary,
- * - writes the MME header.
- */
cp_mme_tx_t *
cp_msg_mme_init_not_frag (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype)
{
@@ -764,19 +747,6 @@ cp_msg_mme_init_not_frag (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype)
return msg;
}
-/**
- * Initialise a MME handle for a new encrypted message to be transmitted.
- * \param ctx control plane context
- * \param peer peer information
- * \param mmtype the MME MMType.
- * \param pid protocol identifier
- * \param peks payload encryption key select
- * \param prun protocol run information
- * \return the newly created message
- *
- * This does the same as cp_msg_mme_init_not_frag(), but also encapsulate the
- * MME in a CM_ENCRYPTED_PAYLOAD.IND.
- */
cp_mme_tx_t *
cp_msg_mme_init_encrypted (cp_t *ctx, cp_mme_peer_t *peer,
cp_mmtype_t mmtype,
@@ -866,7 +836,7 @@ cp_msg_mme_init_encrypted (cp_t *ctx, cp_mme_peer_t *peer,
* \param fmi_nb the fragment number.
* \param fmi_fmsn the transaction number.
*/
-void
+PRIVATE void
cp_msg_mme_write_relay_header (cp_t *ctx, bitstream_t *bs,
cp_mme_peer_t dpeer,
cp_mme_peer_t final_peer,
@@ -926,7 +896,7 @@ cp_msg_mme_write_relay_header (cp_t *ctx, bitstream_t *bs,
* \param bs the bitstream.
* \param msg the msg MME.
*/
-void
+PRIVATE void
cp_msg_mme_write_relay (cp_t *ctx, bitstream_t *bs, cp_mme_tx_t *msg)
{
dbg_assert (ctx);
@@ -1019,20 +989,6 @@ cp_msg_mme_write_frag_header (cp_t *ctx, cp_mme_tx_t *msg, bitstream_t *bs,
bitstream_write (bs, SPC_OUI, OUI_SIZE_BITS);
}
-/**
- * Initialise a MME handle for a new message fragment to be transmitted.
- * \param ctx control plane context
- * \param peer peer information
- * \param mmtype the MME MMTYPE.
- * \param fmi_nbFrag The number of fragments.
- * \return the newly created message
- *
- * This function:
- *
- * - gets a buffer for MME transmission,
- * - encapsulates the MME in a CC_RELAY.REQ if necessary,
- * - writes the MME header.
- */
cp_mme_tx_t *
cp_msg_mme_init_frag (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
uint fmi_nbFrag)
@@ -1169,11 +1125,12 @@ cp_msg_mme_send (cp_t *ctx, cp_mme_tx_t *mme)
/* Select the key indexed by the PEKS to encrypted the embedded MME. */
if (mme->peks != CP_MME_PEKS_NONE)
{
-#if CONFIG_CP_MSG_EOC_MULTI_STA_MME
+#if CONFIG_CP_EOC && CONFIG_CP_MSG_EOC_MULTI_STA_MME
key = cp_msg_peer_peks_key_get (ctx, mme->peer, mme->peks);
#else
key = cp_msg_peks_key_get (ctx, mme->peks);
-#endif
+
+#endif /* CONFIG_CP_EOC */
/* AES encryption. */
enc_length = mme->length
+ mme->rf_len
@@ -1212,10 +1169,6 @@ cp_msg_mme_send (cp_t *ctx, cp_mme_tx_t *mme)
slab_release (mme);
}
-/** Read the MME header once the bitstream has already been initialised.
- * \param mme the MME handler.
- * \param fmi the FMI.
- */
bool
cp_msg_mme_read_header_initialised (cp_mme_rx_t *mme, uint *fmi)
{
@@ -1369,12 +1322,6 @@ cp_msg_mme_read_header_enc_check_data (cp_t *ctx, cp_mme_rx_t *mme,
return output;
}
-/**
- * Read an encrypted header and decrypt the payload.
- * \param ctx the module context.
- * \param mme the mme context.
- * \return true if decoded correctly, false otherwise.
- */
bool
cp_msg_mme_read_header_enc (cp_t *ctx, cp_mme_rx_t *mme)
{
@@ -1435,11 +1382,11 @@ cp_msg_mme_read_header_enc (cp_t *ctx, cp_mme_rx_t *mme)
/* Select the key to decrypt the embedded MME. */
if (mme->peks != CP_MME_PEKS_NONE)
{
-#if CONFIG_CP_MSG_EOC_MULTI_STA_MME
+#if CONFIG_CP_EOC && CONFIG_CP_MSG_EOC_MULTI_STA_MME
key = cp_msg_peer_peks_key_get (ctx, mme->peer, mme->peks);
#else
key = cp_msg_peks_key_get (ctx, mme->peks);
-#endif
+#endif /* CONFIG_CP_MSG_EOC_MULTI_STA_MME */
cp_secu_aes_set_decrypt_key (&aes, key);
cp_secu_aes_cbc_decrypt (ctx, &aes, mme->iv_uuid.key,
(u32 *) (mme->p_mme + payload_offset),
@@ -1521,14 +1468,6 @@ cp_msg_mme_read_header_enc (cp_t *ctx, cp_mme_rx_t *mme)
return output;
}
-/**
- * Change the current buffer of the reception message.
- * \param ctx the module context.
- * \param msg the message RX to change the buffer.
- *
- * This shall be used only on the RX MMEs which are received as fragmented
- * ones.
- */
void
cp_msg_mme_rx_change_buffer (cp_mme_rx_t *msg)
{
@@ -1547,9 +1486,6 @@ cp_msg_mme_rx_change_buffer (cp_mme_rx_t *msg)
current->length);
}
-/** Function to call when the buffer is full.
- * \param mme The Message to change the buffer.
- */
void
cp_msg_mme_tx_change_buffer (bitstream_t *bs, cp_mme_tx_t *mme)
{
diff --git a/cesar/cp/msg/src/msg_cc.c b/cesar/cp/msg/src/msg_cc.c
index ca7e16659b..cdcc5a0155 100644
--- a/cesar/cp/msg/src/msg_cc.c
+++ b/cesar/cp/msg/src/msg_cc.c
@@ -6,9 +6,9 @@
*
* }}} */
/**
- * \file cp/msg/src/msg_cc.c
+ * \file cesar/cp/msg/src/msg_cc.c
* \brief CC family MME.
- * \ingroup cp_msg
+ * \ingroup cesar_cp_msg
*/
#include "common/std.h"
#include "common/defs/homeplugAV.h"
@@ -680,10 +680,9 @@ cp_msg_cc_relay_send_begin (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
}
cp_mme_tx_t *
-cp_msg_cc_relay_req_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- const cp_secu_protocol_run_t *prun,
- cp_mme_peks_t peks,
- mac_t fda, cp_tei_t ftei)
+cp_msg_cc_relay_req_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer, const cp_secu_protocol_run_t *prun,
+ cp_mme_peks_t peks, mac_t fda, cp_tei_t ftei)
{
return cp_msg_cc_relay_send_begin (ctx, peer, CC_RELAY_REQ,
prun, peks, fda, ftei);
@@ -903,9 +902,9 @@ cp_msg_cc_discover_list_cnf_nb_net (bitstream_t *stream, uint *nb_net)
* \return the message context.
*/
cp_mme_tx_t *
-cp_msg_cc_discover_list_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- uint nb_sta, uint nb_net,
- cp_msg_cc_discover_list_ctx_t *disc_ctx)
+cp_msg_cc_discover_list_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer, uint nb_sta, uint nb_net,
+ cp_msg_cc_discover_list_ctx_t *disc_ctx)
{
cp_mme_tx_t *mme;
uint data_length;
@@ -1400,9 +1399,9 @@ cp_msg_cc_handover_info_rsp_receive (cp_t *ctx, cp_mme_rx_t *mme)
}
void
-cp_msg_cc_cco_appoint_req_send (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_cc_cco_appoint_req_rt_t req_type,
- mac_t mac_addr)
+cp_msg_cc_cco_appoint_req_send (
+ cp_t *ctx, cp_mme_peer_t *peer, cp_msg_cc_cco_appoint_req_rt_t req_type,
+ mac_t mac_addr)
{
cp_mme_tx_t *mme;
dbg_assert (ctx);
@@ -1421,9 +1420,9 @@ cp_msg_cc_cco_appoint_req_send (cp_t *ctx, cp_mme_peer_t *peer,
}
bool
-cp_msg_cc_cco_appoint_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cp_msg_cc_cco_appoint_req_rt_t *req_type,
- mac_t *mac_addr)
+cp_msg_cc_cco_appoint_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, cp_msg_cc_cco_appoint_req_rt_t *req_type,
+ mac_t *mac_addr)
{
dbg_assert (ctx);
dbg_assert (mme);
diff --git a/cesar/cp/msg/src/msg_cm.c b/cesar/cp/msg/src/msg_cm.c
index 31f7a7b666..9e7b389923 100644
--- a/cesar/cp/msg/src/msg_cm.c
+++ b/cesar/cp/msg/src/msg_cm.c
@@ -6,9 +6,9 @@
*
* }}} */
/**
- * \file cp/msg/src/msg_cm.c
+ * \file cesar/cp/msg/src/msg_cm.c
* \brief CM family MME.
- * \ingroup cp_msg
+ * \ingroup cesar_cp_msg
*/
#include "common/std.h"
#include "common/defs/homeplugAV.h"
@@ -205,10 +205,9 @@ cp_msg_cm_set_key_get_pid (cp_t *ctx, cp_mme_rx_t *mme, u8 *pid)
* \param data MME data to send
*/
void
-cp_msg_cm_set_key_req_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_set_key_req_t *data)
+cp_msg_cm_set_key_req_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_set_key_req_t *data)
{
cp_mme_tx_t *msg;
@@ -305,10 +304,9 @@ cp_msg_cm_set_key_cnf_access (bitstream_t *stream,
* \param data MME data to send
*/
void
-cp_msg_cm_set_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_set_key_cnf_t *data)
+cp_msg_cm_set_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_set_key_cnf_t *data)
{
cp_mme_tx_t *msg;
@@ -350,8 +348,8 @@ cp_msg_cm_set_key_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
* Encryption and protocol run information is available in the MME handle.
*/
bool
-cp_msg_cm_set_key_cnf_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cp_msg_cm_set_key_cnf_t *data)
+cp_msg_cm_set_key_cnf_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, cp_msg_cm_set_key_cnf_t *data)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -385,7 +383,7 @@ cp_msg_cm_get_key_req_get_pid (cp_t *ctx, cp_mme_rx_t *mme, u8 *pid)
* \param prun the protocol run context.
* \param data the structure to use to read or write the data.
*/
-void
+PRIVATE void
cp_msg_cm_get_key_req_access (bitstream_t *stream,
cp_secu_protocol_run_t *prun,
cp_msg_cm_get_key_req_t *data)
@@ -419,10 +417,9 @@ cp_msg_cm_get_key_req_access (bitstream_t *stream,
* \param data MME data to send
*/
void
-cp_msg_cm_get_key_req_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_req_t *data)
+cp_msg_cm_get_key_req_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_req_t *data)
{
cp_mme_tx_t *mme;
dbg_assert (ctx);
@@ -498,10 +495,9 @@ cp_msg_cm_get_key_cnf_get_pid (cp_t *ctx, cp_mme_rx_t *mme, u8 *pid)
* \param data MME data to send
*/
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)
+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)
{
cp_mme_tx_t *msg;
uint i;
@@ -952,8 +948,9 @@ cp_msg_cm_amp_map_req_receive_end (cp_t *ctx, cp_mme_rx_t *mme)
* \param restype the response type.
*/
void
-cp_msg_cm_amp_map_cnf_send (cp_t *ctx, cp_mme_peer_t *peer_info,
- const enum cp_msg_cm_amp_map_cnf_restype_t restype)
+cp_msg_cm_amp_map_cnf_send (
+ cp_t *ctx, cp_mme_peer_t *peer_info,
+ const enum cp_msg_cm_amp_map_cnf_restype_t restype)
{
cp_mme_tx_t *mme;
dbg_assert (ctx);
@@ -975,8 +972,9 @@ cp_msg_cm_amp_map_cnf_send (cp_t *ctx, cp_mme_peer_t *peer_info,
* \return true on success.
*/
bool
-cp_msg_cm_amp_map_cnf_receive (cp_t *ctx, cp_mme_rx_t *mme,
- enum cp_msg_cm_amp_map_cnf_restype_t *restype)
+cp_msg_cm_amp_map_cnf_receive (
+ cp_t *ctx, cp_mme_rx_t *mme,
+ enum cp_msg_cm_amp_map_cnf_restype_t *restype)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -1034,9 +1032,9 @@ cp_msg_cm_brg_info_req_receive (cp_t *ctx, cp_mme_rx_t *mme)
* \return the newly created message.
*/
cp_mme_tx_t *
-cp_msg_cm_brg_info_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer_info,
- const uint bsf, const uint nbda,
- const cp_tei_t own_tei)
+cp_msg_cm_brg_info_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer_info, const uint bsf, const uint nbda,
+ const cp_tei_t own_tei)
{
cp_mme_tx_t *mme;
@@ -1484,10 +1482,10 @@ cp_msg_cm_nw_info_cnf_receive_end (cp_t *ctx, cp_mme_rx_t *mme)
* or the set the HFID network e.g. 0x2 or 0x4.
*/
void
-cp_msg_cm_hfid_req_send (cp_t *ctx, cp_mme_peer_t *peer_info,
- enum cp_msg_cm_hfid_req_reqtype_t req_type,
- cp_nid_t nid,
- const char *hfid)
+cp_msg_cm_hfid_req_send (
+ cp_t *ctx, cp_mme_peer_t *peer_info,
+ enum cp_msg_cm_hfid_req_reqtype_t req_type, cp_nid_t nid,
+ const char *hfid)
{
cp_mme_tx_t *mme;
dbg_assert (ctx);
@@ -1540,10 +1538,10 @@ cp_msg_cm_hfid_req_send (cp_t *ctx, cp_mme_peer_t *peer_info,
* or the set the HFID network e.g. 0x2 or 0x4.
*/
bool
-cp_msg_cm_hfid_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- enum cp_msg_cm_hfid_req_reqtype_t *req_type,
- cp_nid_t *nid,
- char *hfid)
+cp_msg_cm_hfid_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme,
+ enum cp_msg_cm_hfid_req_reqtype_t *req_type, cp_nid_t *nid,
+ char *hfid)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -1830,8 +1828,8 @@ cp_msg_cm_link_stats_req_access (bitstream_t *bs,
* \return true on success
*/
bool
-cp_msg_cm_link_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cp_msg_cm_link_stats_req_t *data)
+cp_msg_cm_link_stats_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, cp_msg_cm_link_stats_req_t *data)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -1866,8 +1864,8 @@ cp_msg_cm_link_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
* \return mme the MME handler.
*/
cp_mme_tx_t *
-cp_msg_cm_link_stats_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer_info,
- u8 req_id, u8 res_type)
+cp_msg_cm_link_stats_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer_info, u8 req_id, u8 res_type)
{
cp_mme_tx_t *mme;
dbg_assert (ctx);
diff --git a/cesar/cp/msg/src/msg_drv.c b/cesar/cp/msg/src/msg_drv.c
index 2e27d43642..27f416ba60 100644
--- a/cesar/cp/msg/src/msg_drv.c
+++ b/cesar/cp/msg/src/msg_drv.c
@@ -6,9 +6,9 @@
*
* }}} */
/**
- * \file cp/msg/src/msg_drv.c
+ * \file cesar/cp/msg/src/msg_drv.c
* \brief MME Driver.
- * \ingroup cp_msg
+ * \ingroup cesar_cp_msg
*
*/
#include "common/std.h"
@@ -19,7 +19,6 @@
#include "cp/msg/inc/msg_drv.h"
#include "cp/msg/inc/msg.h"
-#include "config/cp/msg/eoc/drv/mme.h"
#include "common/defs/igmp.h"
/**
@@ -113,7 +112,7 @@ cp_msg_drv_sta_set_was_cco_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
* \param max_length the payload max length mandatory.
* \retun true if the payload is correct, false if corrupted.
*/
-bool
+static bool
cp_msg_drv_sta_string_recv (cp_t *ctx, cp_mme_rx_t *mme, char *buffer,
uint min_length, uint max_length)
{
@@ -289,33 +288,6 @@ cp_msg_drv_sta_set_avln_hfid_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
CP_HFID_SIZE);
}
-// #if CONFIG_CP_MSG_EOC_DRV_MME
-// /**
-// * Receive a DRV_STA_SET_TONEMASK.REQ.
-// * FIXME
-// * \param ctx control plane context
-// * \param mme MME handle
-// * \param tonemask received tonemask
-// * \return true on success
-// */
-// bool
-// cp_msg_drv_sta_set_tonemask_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
-// u32 *tonemask)
-// {
-// dbg_assert (ctx);
-// dbg_assert (mme);
-// dbg_assert (tonemask);
-// uint i;
-//
-// if (cp_msg_mme_read_error (ctx, mme))
-// {
-// for(i = 0; i < PHY_TONEMASK_WORDS; i++)
-// tonemask[i] = bitstream_read(&mme->bitstream, 32);
-// return true;
-// }
-// return false;
-// }
-// #else
/**
* Receive a DRV_STA_SET_TONEMASK.REQ.
* \param ctx control plane context
@@ -433,11 +405,10 @@ cp_msg_drv_sta_mac_stop_req_receive (cp_t *ctx, cp_mme_rx_t *mme)
}
bool
-cp_msg_drv_sta_set_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cp_key_t *nmk,
- cp_msg_drv_sta_set_key_type_t *type,
- cp_nid_t *nid,
- cp_security_level_t *sl)
+cp_msg_drv_sta_set_key_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, cp_key_t *nmk,
+ cp_msg_drv_sta_set_key_type_t *type, cp_nid_t *nid,
+ cp_security_level_t *sl)
{
uint i;
dbg_assert (ctx);
@@ -531,11 +502,10 @@ cp_msg_drv_sta_set_eoc_req_receive (cp_t *ctx, cp_mme_rx_t *mme, uint *exp,
}
void
-cp_msg_drv_sta_set_key_ind_send (cp_t *ctx, cp_mme_peer_t *peer,
- cp_key_t nmk,
- cp_msg_drv_sta_set_key_type_t type,
- cp_nid_t nid,
- cp_security_level_t sl)
+cp_msg_drv_sta_set_key_ind_send (
+ cp_t *ctx, cp_mme_peer_t *peer, cp_key_t nmk,
+ cp_msg_drv_sta_set_key_type_t type, cp_nid_t nid,
+ cp_security_level_t sl)
{
uint i;
cp_mme_tx_t *tx;
@@ -767,9 +737,9 @@ cp_msg_drv_get_status_ind_send (cp_t *ctx, cp_mme_peer_t *peer,
bool
cp_msg_drv_mcast_set_list_req_receive (
- cp_t *ctx, cp_mme_rx_t *mme, uint *nb_groups,
- mac_t groups[MCAST_GROUP_MAX_NB], uint nb_members[MCAST_GROUP_MAX_NB],
- mac_t members[MCAST_GROUP_MAX_NB][MCAST_MEMBER_MAX_NB])
+ cp_t *ctx, cp_mme_rx_t *mme, uint *nb_groups,
+ mac_t groups[MCAST_GROUP_MAX_NB], uint nb_members[MCAST_GROUP_MAX_NB],
+ mac_t members[MCAST_GROUP_MAX_NB][MCAST_MEMBER_MAX_NB])
{
/* Check parameters. */
dbg_assert (ctx);
diff --git a/cesar/cp/msg/src/msg_vs.c b/cesar/cp/msg/src/msg_vs.c
index ded9cf3c61..acd1593e5d 100644
--- a/cesar/cp/msg/src/msg_vs.c
+++ b/cesar/cp/msg/src/msg_vs.c
@@ -6,9 +6,9 @@
*
* }}} */
/**
- * \file cp/msg/src/msg_vs.c
+ * \file cesar/cp/msg/src/msg_vs.c
* \brief VS family MME.
- * \ingroup cp_msg
+ * \ingroup cesar_cp_msg
*/
#include "common/std.h"
#include "common/defs/homeplugAV.h"
@@ -41,11 +41,10 @@
* \return true on success.
*/
bool
-cp_msg_vs_get_tonemap_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- mac_t *mac_addr,
- cp_msg_vs_get_tonemap_tmi_t *tmi,
- u8 *int_id,
- cp_msg_vs_get_tonemap_req_dir_t *dir)
+cp_msg_vs_get_tonemap_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, mac_t *mac_addr,
+ cp_msg_vs_get_tonemap_tmi_t *tmi, u8 *int_id,
+ cp_msg_vs_get_tonemap_req_dir_t *dir)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -82,10 +81,10 @@ cp_msg_vs_get_tonemap_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
* \param tmi the requested tonemap.
*/
void
-cp_msg_vs_get_tonemap_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_vs_get_tonemap_cnf_result_t result,
- uint beacon_delta, u8 int_id,tonemaps_t *tms,
- cp_msg_vs_get_tonemap_tmi_t tmi)
+cp_msg_vs_get_tonemap_cnf_send (
+ cp_t *ctx, cp_mme_peer_t *peer, cp_msg_vs_get_tonemap_cnf_result_t result,
+ uint beacon_delta, u8 int_id,tonemaps_t *tms,
+ cp_msg_vs_get_tonemap_tmi_t tmi)
{
cp_mme_tx_t * mme;
@@ -212,11 +211,9 @@ cp_msg_vs_get_tonemap_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
}
bool
-cp_msg_vs_get_snr_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- mac_t *mac_addr,
- cp_msg_vs_get_snr_req_int_t *tm_int_i,
- u8 *int_id,
- u8 *carrier_gr)
+cp_msg_vs_get_snr_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, mac_t *mac_addr,
+ cp_msg_vs_get_snr_req_int_t *tm_int_i, u8 *int_id, u8 *carrier_gr)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -243,8 +240,8 @@ cp_msg_vs_get_snr_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
}
void
-cp_msg_vs_get_snr_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
- const cp_msg_vs_get_snr_cnf_t *data)
+cp_msg_vs_get_snr_cnf_send (
+ cp_t *ctx, cp_mme_peer_t *peer, const cp_msg_vs_get_snr_cnf_t *data)
{
uint i = 0;
cp_mme_tx_t * mme;
@@ -296,10 +293,9 @@ cp_msg_vs_get_snr_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
* \return true on success.
*/
bool
-cp_msg_vs_get_spectrum_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- mac_t *mac_addr,
- cp_msg_vs_get_spectrum_req_carrier_gr_t
- *carrier_gr)
+cp_msg_vs_get_spectrum_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, mac_t *mac_addr,
+ cp_msg_vs_get_spectrum_req_carrier_gr_t *carrier_gr)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -329,9 +325,9 @@ cp_msg_vs_get_spectrum_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
* \return the message context.
*/
cp_mme_tx_t *
-cp_msg_vs_get_spectrum_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_vs_get_spectrum_cnf_result_t
- result, u8 AvgAGC)
+cp_msg_vs_get_spectrum_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer,
+ cp_msg_vs_get_spectrum_cnf_result_t result, u8 AvgAGC)
{
cp_mme_tx_t * mme;
@@ -356,9 +352,9 @@ cp_msg_vs_get_spectrum_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
* \param spectrum the struct that contains the spectrum value.
*/
void
-cp_msg_vs_get_spectrum_cnf_send_spectrum (cp_t *ctx, cp_mme_tx_t *mme,
- cp_msg_vs_get_spectrum_cnf_spec_t
- *spectrum)
+cp_msg_vs_get_spectrum_cnf_send_spectrum (
+ cp_t *ctx, cp_mme_tx_t *mme,
+ cp_msg_vs_get_spectrum_cnf_spec_t *spectrum)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -391,8 +387,8 @@ cp_msg_vs_get_spectrum_cnf_send_end (cp_t *ctx, cp_mme_tx_t *mme)
* \return true on success.
*/
bool
-cp_msg_vs_get_link_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cp_msg_vs_get_link_stats_req_t *data)
+cp_msg_vs_get_link_stats_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, cp_msg_vs_get_link_stats_req_t *data)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -429,11 +425,9 @@ cp_msg_vs_get_link_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
* \return the message context.
*/
void
-cp_msg_vs_get_link_stats_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
- u8 ReqID,
- cp_msg_vs_get_link_stats_cnf_result_t
- result,
- u32 Bad_CRC)
+cp_msg_vs_get_link_stats_cnf_send (
+ cp_t *ctx, cp_mme_peer_t *peer, u8 ReqID,
+ cp_msg_vs_get_link_stats_cnf_result_t result, u32 Bad_CRC)
{
cp_mme_tx_t * mme;
@@ -463,9 +457,9 @@ cp_msg_vs_get_link_stats_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
* \return the message context.
*/
cp_mme_tx_t *
-cp_msg_vs_get_amp_map_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_vs_get_amp_map_cnf_result_t
- result, u16 amlen)
+cp_msg_vs_get_amp_map_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer,
+ cp_msg_vs_get_amp_map_cnf_result_t result, u16 amlen)
{
cp_mme_tx_t * mme;
@@ -490,8 +484,8 @@ cp_msg_vs_get_amp_map_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
* \param ampmap the amplitude map value.
*/
void
-cp_msg_vs_get_amp_map_cnf_send_ampmap (cp_t *ctx, cp_mme_tx_t *mme,
- u8 ampmap)
+cp_msg_vs_get_amp_map_cnf_send_ampmap (
+ cp_t *ctx, cp_mme_tx_t *mme, u8 ampmap)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -524,8 +518,8 @@ cp_msg_vs_get_amp_map_cnf_send_end (cp_t *ctx, cp_mme_tx_t *mme)
* \return true on success.
*/
bool
-cp_msg_vs_get_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- u8 *page_number, u8* level)
+cp_msg_vs_get_stats_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, u8 *page_number, u8* level)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -567,9 +561,9 @@ cp_msg_vs_get_stats_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer)
* \param page the page to send.
*/
void
-cp_msg_vs_get_stats_cnf_send (cp_t *ctx, cp_mme_tx_t *mme, u8 page,
- u8 nb_pages, lib_stats_level_t level,
- cp_msg_vs_get_stats_cnf_result_t result)
+cp_msg_vs_get_stats_cnf_send (
+ cp_t *ctx, cp_mme_tx_t *mme, u8 page, u8 nb_pages,
+ lib_stats_level_t level, cp_msg_vs_get_stats_cnf_result_t result)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -617,9 +611,10 @@ cp_msg_imac_get_discover_list_req_receive (cp_t *ctx, cp_mme_rx_t *mme)
* \return the message context.
*/
cp_mme_tx_t *
-cp_msg_imac_get_discover_list_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_imac_get_discover_list_cnf_result_t result, u8 version,
- u8 num_stations)
+cp_msg_imac_get_discover_list_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer,
+ cp_msg_imac_get_discover_list_cnf_result_t result, u8 version,
+ u8 num_stations)
{
cp_mme_tx_t * mme;
@@ -642,8 +637,9 @@ cp_msg_imac_get_discover_list_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
* \param data data to be sent.
*/
void
-cp_msg_imac_get_discover_list_cnf_send (cp_t *ctx, cp_mme_tx_t *mme,
- const cp_msg_imac_discover_list_sta_info_t *data)
+cp_msg_imac_get_discover_list_cnf_send (
+ cp_t *ctx, cp_mme_tx_t *mme,
+ const cp_msg_imac_discover_list_sta_info_t *data)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -685,11 +681,9 @@ cp_msg_vs_get_ce_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
}
void
-cp_msg_vs_get_ce_stats_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
- u8 version,
- u8 result,
- sta_t *sta,
- tonemask_info_t *ti)
+cp_msg_vs_get_ce_stats_cnf_send (
+ cp_t *ctx, cp_mme_peer_t *peer, u8 version, u8 result, sta_t *sta,
+ tonemask_info_t *ti)
{
dbg_assert (ctx);
dbg_assert (result < CP_MSG_VS_GET_CE_STATS_CNF_RESULT_NB);
@@ -831,8 +825,8 @@ cp_msg_vs_get_ce_stats_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
}
bool
-cp_msg_vs_get_pb_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- cp_tei_t *stei_filter)
+cp_msg_vs_get_pb_stats_req_receive (
+ cp_t *ctx, cp_mme_rx_t *mme, cp_tei_t *stei_filter)
{
dbg_assert (ctx);
dbg_assert (mme);
@@ -847,8 +841,8 @@ cp_msg_vs_get_pb_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
}
cp_mme_tx_t *
-cp_msg_vs_get_pb_stats_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- int nb_measures)
+cp_msg_vs_get_pb_stats_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer, int nb_measures)
{
cp_mme_tx_t* mme;
uint size;
@@ -874,8 +868,8 @@ cp_msg_vs_get_pb_stats_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
}
void
-cp_msg_vs_get_pb_stats_cnf_send_measure (cp_t *ctx, cp_mme_tx_t *mme,
- int start_to_read, int nb_entries)
+cp_msg_vs_get_pb_stats_cnf_send_measure (
+ cp_t *ctx, cp_mme_tx_t *mme, int start_to_read, int nb_entries)
{
int j;
sar_pb_stats_entry_t *entry = NULL;
@@ -922,8 +916,8 @@ cp_msg_vs_get_mactotei_req_receive (cp_t *ctx, cp_mme_rx_t *mme)
}
cp_mme_tx_t *
-cp_msg_vs_get_mactotei_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- uint nb_entry)
+cp_msg_vs_get_mactotei_cnf_send_begin (
+ cp_t *ctx, cp_mme_peer_t *peer, uint nb_entry)
{
cp_mme_tx_t* mme;
uint size = VS_GET_MACTOTEI_CNF_SIZE(nb_entry);
@@ -938,8 +932,8 @@ cp_msg_vs_get_mactotei_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
}
void
-cp_msg_vs_get_mactotei_cnf_send_entry (cp_t *ctx, cp_mme_tx_t *mme_tx,
- mac_t mac, cp_tei_t tei, u8 tag)
+cp_msg_vs_get_mactotei_cnf_send_entry (
+ cp_t *ctx, cp_mme_tx_t *mme_tx, mac_t mac, cp_tei_t tei, u8 tag)
{
dbg_assert (mme_tx);
bitstream_write_large (
diff --git a/cesar/cp/msg/src/msg_vs_eoc.c b/cesar/cp/msg/src/msg_vs_eoc.c
deleted file mode 100644
index 027d4f93cb..0000000000
--- a/cesar/cp/msg/src/msg_vs_eoc.c
+++ /dev/null
@@ -1,639 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2009 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file cp/msg/src/msg_vs_eoc.c
- * \brief VS EoC family MME.
- * \ingroup cp_msg
- */
-#include "common/std.h"
-#include "common/defs/homeplugAV.h"
-#include "common/defs/ethernet.h"
-
-#include "cp/cp.h"
-#include "cp/mme.h"
-#include "cp/msg/msg.h"
-#include "common/defs/spidcom.h"
-
-#include "cp/sta/mgr/net.h"
-#include "cp/sta/mgr/sta_mgr.h"
-
-
-#include "cp/msg/inc/msg_vs_eoc.h"
-#include "cp/msg/inc/msg.h"
-
-
-/**
- * Start sending of a VS_EOC_GET_TOPO.CNF.
- * \param ctx the control plane context.
- * \param peer the peer info.
- * \param result the result.
- * \param sta_nb the number of stations connected to CCo.
- * \return the message context.
- */
-cp_mme_tx_t *
-cp_msg_vs_eoc_get_topo_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_vs_eoc_get_topo_cnf_result_t
- result, u8 sta_nb)
-{
- cp_mme_tx_t * mme;
-
- dbg_assert (ctx);
- dbg_assert (peer);
- dbg_assert (result < CP_MSG_VS_EOC_GET_TOPO_CNF_RESULT_NB);
-
- mme = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_GET_TOPO_CNF);
- dbg_assert (mme);
-
- bitstream_write (&mme->bitstream, result, 8);
- bitstream_write (&mme->bitstream, sta_nb, 8);
-
- return mme;
-}
-
-/**
- * Fill the MME with the station parameters.
- * \param ctx the module context.
- * \param mme the MME message.
- * \param mac_addr the mac address of the station.
- * \param auth_status the authorization status of the station.
- * \param up_att the upstream attenuation.
- */
-void
-cp_msg_vs_eoc_get_topo_cnf_send_sta (cp_t *ctx, cp_mme_tx_t *mme,
- mac_t mac_addr, u8 auth_status,
- u8 up_att)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
- dbg_assert (auth_status <= 3);
-
- bitstream_write_large (&mme->bitstream, mac_addr, 48);
- bitstream_write (&mme->bitstream, auth_status, 8);
- bitstream_write (&mme->bitstream, up_att, 8);
-}
-
-/**
- * End sending of a VS_EOC_GET_TOPO.CNF.
- * \param ctx the control plane context.
- * \param mme the MME to send.
- */
-void
-cp_msg_vs_eoc_get_topo_cnf_send_end (cp_t *ctx, cp_mme_tx_t *mme)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- bitstream_write_finalise (&mme->bitstream);
-
- cp_msg_mme_send (ctx, mme);
-}
-
-bool
-cp_msg_vs_eoc_cco_set_wl_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
- uint *numStas, cp_tei_t *stas_teis, mac_t *stas_macs,
- u8 *stas_authorizations, u8 *stas_output_levels, u32 *stas_start_times,
- u32 *stas_end_times, cp_key_t *stas_daks, cp_dpw_t *stas_dpws,
- u8 *stas_actions)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
- dbg_assert (numStas);
- dbg_assert (stas_teis);
- dbg_assert (stas_macs);
- dbg_assert (stas_authorizations);
- dbg_assert (stas_output_levels);
- dbg_assert (stas_start_times);
- dbg_assert (stas_end_times);
- dbg_assert (stas_daks);
- dbg_assert (stas_dpws);
- dbg_assert (stas_actions);
-
- uint number_of_stations; /* Number of stations in the current MME */
- uint i, j;
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- number_of_stations = bitstream_read (&mme->bitstream, 8);
- *numStas = number_of_stations;
-
- for (i=0; i<number_of_stations; i++)
- {
- bitstream_access(&mme->bitstream, &stas_macs[i], 48);
- bitstream_access(&mme->bitstream, &stas_teis[i], 8);
- bitstream_access(&mme->bitstream, &stas_authorizations[i], 8);
- bitstream_access(&mme->bitstream, &stas_output_levels[i], 8);
- bitstream_access(&mme->bitstream, &stas_start_times[i], 32);
- bitstream_access(&mme->bitstream, &stas_end_times[i], 32);
- for (j=0; j<4; j++)
- bitstream_access(&mme->bitstream, &stas_daks[i].key[j], 32);
- bitstream_access_buf(&mme->bitstream, (u8 *) stas_dpws[i].dpw,
- CP_DPW_MAX_SIZE);
- stas_dpws[i].dpw[CP_DPW_MAX_SIZE] = '\0';
- bitstream_access(&mme->bitstream, &stas_actions[i], 8);
- }
-
- return true;
- }
-
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_set_wl_cnf_send (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
- cp_msg_vs_eoc_cco_set_wl_req_result_t result)
-{
- cp_mme_tx_t *msg;
-
- dbg_assert (peer);
- dbg_assert (mmtype);
-
- msg = cp_msg_mme_init_not_frag (ctx, peer, mmtype);
- dbg_check (msg);
-
- bitstream_access (&msg->bitstream, &result, 8);
-
- cp_msg_mme_send (ctx, msg);
-}
-
-
-bool
-cp_msg_vs_eoc_cco_get_wl_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *first_wl_index_nb)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *first_wl_index_nb = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_get_wl_cnf_send (cp_t *ctx,
- cp_msg_vs_eoc_cco_get_wl_req_result_t result, cp_mme_peer_t *peer,
- uint numStas, cp_tei_t *stas_teis, mac_t *stas_macs,
- u8 *stas_authorizations, u8 *stas_output_levels, u32 *stas_start_times,
- u32 *stas_end_times, cp_key_t *stas_daks, cp_dpw_t *stas_dpws,
- u8 *stas_actions, u8 first_wl_index_nb)
-{
- cp_mme_tx_t *tx;
- u8 i, j;
- u8 total_wl_index_nb;
- u8 wl_index_nb;
- dbg_assert (ctx);
- dbg_assert (stas_teis);
- dbg_assert (stas_macs);
- dbg_assert (stas_authorizations);
- dbg_assert (stas_output_levels);
- dbg_assert (stas_start_times);
- dbg_assert (stas_end_times);
- dbg_assert (stas_daks);
- dbg_assert (stas_dpws);
- dbg_assert (stas_actions);
-
- /* One MME can contain maximum of WL_MME_MAX_ENTRY_COUNT WL entries. */
- total_wl_index_nb = numStas;
-
- if (first_wl_index_nb > total_wl_index_nb)
- wl_index_nb = 0;
- else
- wl_index_nb = MIN (total_wl_index_nb - first_wl_index_nb,
- WL_MME_MAX_ENTRY_COUNT);
-
- tx = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_CCO_GET_WL_CNF);
- dbg_assert (tx);
- bitstream_write (&tx->bitstream, result, 8);
- bitstream_write (&tx->bitstream, total_wl_index_nb, 8);
- bitstream_write (&tx->bitstream, first_wl_index_nb, 8);
- bitstream_write (&tx->bitstream, wl_index_nb, 8);
- for (i = first_wl_index_nb; i < first_wl_index_nb + wl_index_nb; i++)
- {
- bitstream_write_large(&tx->bitstream, stas_macs[i], 48);
- bitstream_write(&tx->bitstream, stas_teis[i], 8);
- bitstream_write(&tx->bitstream, stas_authorizations[i], 8);
- bitstream_write(&tx->bitstream, stas_output_levels[i], 8);
- bitstream_write(&tx->bitstream, stas_start_times[i], 32);
- bitstream_write(&tx->bitstream, stas_end_times[i], 32);
- for (j=0; j<4; j++)
- bitstream_write(&tx->bitstream, stas_daks[i].key[j], 32);
- bitstream_write_buf(&tx->bitstream, (u8 *) stas_dpws[i].dpw,
- CP_DPW_MAX_SIZE);
- bitstream_write(&tx->bitstream, stas_actions[i], 8);
- }
-
- cp_msg_mme_send (ctx, tx);
-}
-
-void
-cp_msg_vs_eoc_cco_set_out_lev_ind_send(cp_t *ctx, cp_mme_peer_t *peer, uint output_level)
-{
- dbg_assert(ctx);
-
- cp_mme_tx_t *tx;
-
- tx = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_CCO_SET_OUT_LEV_IND);
- dbg_assert(tx);
-
- bitstream_write(&tx->bitstream, output_level, 8);
- bitstream_write_finalise(&tx->bitstream);
- cp_msg_mme_send (ctx, tx);
-}
-
-bool
-cp_msg_eoc_sta_vs_set_out_lev_ind_receive(cp_t *ctx, cp_mme_rx_t *mme, uint *output_level)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *output_level = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-
-bool cp_msg_vs_eoc_set_ports_req_receive(cp_t *ctx, cp_mme_rx_t *mme, uint *numStas, mac_t *stas_macs,
- u8 stas_ports_ed[][PORT_NB], u8 stas_ports_service[][PORT_NB])
-{
- dbg_assert(ctx);
- dbg_assert(mme);
- dbg_assert(numStas);
- dbg_assert(stas_macs);
- dbg_assert(stas_ports_ed);
- dbg_assert(stas_ports_service);
-
- uint number_of_stations;
- uint i,j;
-
- if(cp_msg_mme_read_error(ctx,mme))
- {
- number_of_stations = bitstream_read (&mme->bitstream, 8);
- *numStas = number_of_stations;
-
- for(i = 0; i < number_of_stations; i++)
- {
- bitstream_access(&mme->bitstream, &stas_macs[i], 48);
- for(j = 0; j < PORT_NB; j++)
- {
- bitstream_access(&mme->bitstream, &stas_ports_ed[i][j], 8);
- bitstream_access(&mme->bitstream, &stas_ports_service[i][j], 8);
- }
- }
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_set_ports_cnf_send (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
- cp_msg_vs_eoc_set_ports_req_result_t result)
-{
- cp_mme_tx_t *msg;
-
- dbg_assert (peer);
- dbg_assert (mmtype);
-
- msg = cp_msg_mme_init_not_frag (ctx, peer, mmtype);
- dbg_check (msg);
-
- bitstream_access (&msg->bitstream, &result, 8);
-
- cp_msg_mme_send (ctx, msg);
-}
-
-bool
-cp_msg_vs_eoc_cco_get_ports_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *first_mac_index_nb)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *first_mac_index_nb = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-
-void
-cp_msg_vs_eoc_cco_get_ports_cnf_send (cp_t *ctx, cp_mme_peer_t *peer, cp_msg_vs_eoc_cco_get_ports_req_result_t result,
- uint numStas, mac_t *stas_macs, bool stas_port_ed[][PORT_NB], u8 stas_port_service[][PORT_NB], u8 first_mac_index_nb)
-{
- cp_mme_tx_t *tx;
- u8 i,j;
- u8 entries_per_mme_nb;
- u8 total_macs_index_nb;
- u8 macs_index_nb;
- dbg_assert (ctx);
- dbg_assert (stas_macs);
- dbg_assert(stas_port_ed);
- dbg_assert(stas_port_service);
-
- /* One mme can contain 1492 bytes. The first 4 bytes are: result, total_macs_index_nb, first_mac_index_nb
- and macs_index_nb. There are 1488 bytes remaining. Each entry begins with 6 bytes for a mac address,
- followed by 2 bytes for each port (one for stas_port_ed and the other one for stas_port_service). */
-
- entries_per_mme_nb = 1488/(6 + 2 * PORT_NB) - 1;
- total_macs_index_nb = numStas;
-
- if (first_mac_index_nb > total_macs_index_nb)
- macs_index_nb = 0;
- else
- macs_index_nb = ((total_macs_index_nb - first_mac_index_nb) >= entries_per_mme_nb) ?
- entries_per_mme_nb : total_macs_index_nb - first_mac_index_nb;
-
- tx = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_CCO_GET_PORTS_CNF);
- dbg_assert (tx);
- bitstream_write (&tx->bitstream, result, 8);
- bitstream_write (&tx->bitstream, total_macs_index_nb, 8);
- bitstream_write (&tx->bitstream, first_mac_index_nb, 8);
- bitstream_write (&tx->bitstream, macs_index_nb, 8);
- for (i = first_mac_index_nb; i < first_mac_index_nb + macs_index_nb; i++)
- {
- bitstream_write_large(&tx->bitstream, stas_macs[i], 48);
- for(j = 0; j < PORT_NB; j++)
- {
- bitstream_write(&tx->bitstream, stas_port_ed[i][j], 8);
- bitstream_write(&tx->bitstream, stas_port_service[i][j], 8);
- }
- }
-
- cp_msg_mme_send (ctx, tx);
-}
-
-
-bool
-cp_msg_vs_eoc_cco_set_services_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *command, u8 *services_number, u8 *service_indexes,
- u8 *classifier_rules, u16 *classifier_values, u8 *acses, u8 *parameters_numbers,
- u16 parameters_lists[][SERVICE_PARAMETERS_NB])
-{
- dbg_assert(ctx);
- dbg_assert(mme);
- dbg_assert(command);
- dbg_assert(services_number);
- dbg_assert(service_indexes);
- dbg_assert(classifier_rules);
- dbg_assert(classifier_values);
- dbg_assert(acses);
- dbg_assert(parameters_numbers);
- dbg_assert(parameters_lists);
-
- u8 number_of_services;
- u8 i,j;
- u8 parameters_number_tmp;
-
- if(cp_msg_mme_read_error(ctx,mme))
- {
- *command = bitstream_read(&mme->bitstream, 8);
- number_of_services = bitstream_read (&mme->bitstream, 8);
- *services_number = number_of_services;
-
- for(i = 0; i < number_of_services; i++)
- {
- bitstream_access(&mme->bitstream, &service_indexes[i], 8);
- bitstream_access(&mme->bitstream, &classifier_rules[i], 8);
- bitstream_access(&mme->bitstream, &classifier_values[i], 16);
- bitstream_access(&mme->bitstream, &acses[i], 8);
- bitstream_access(&mme->bitstream, &parameters_numbers[i], 8);
- parameters_number_tmp = parameters_numbers[i];
- for(j = 0; j < parameters_number_tmp; j++)
- {
- bitstream_access(&mme->bitstream, &parameters_lists[i][j], 16);
- }
- }
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_set_services_cnf_send (cp_t *ctx, cp_mme_peer_t *peer, cp_mmtype_t mmtype,
- cp_msg_vs_eoc_cco_set_services_req_result_t result)
-{
- cp_mme_tx_t *msg;
-
- dbg_assert (peer);
- dbg_assert (mmtype);
-
- msg = cp_msg_mme_init_not_frag (ctx, peer, mmtype);
- dbg_check (msg);
-
- bitstream_access (&msg->bitstream, &result, 8);
-
- cp_msg_mme_send (ctx, msg);
-}
-
-
-bool
-cp_msg_vs_eoc_cco_get_services_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *first_service_index_nb)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *first_service_index_nb = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_get_services_cnf_send (cp_t *ctx, cp_mme_peer_t *peer, cp_msg_vs_eoc_cco_get_services_req_result_t result,
- u8 services_number, u8 *service_indexes, u8 *classifier_rules, u16 *classifier_values,
- u8 *acses, u8 *parameters_numbers, u16 (*parameters_lists)[SERVICE_PARAMETERS_NB], u8 first_service_index_nb)
-{
- dbg_assert(ctx);
- dbg_assert(peer);
- dbg_assert(service_indexes);
- dbg_assert(classifier_rules);
- dbg_assert(classifier_values);
- dbg_assert(acses);
- dbg_assert(parameters_numbers);
- dbg_assert(parameters_lists);
-
- cp_mme_tx_t *tx;
- u8 i, j;
- u8 total_services_index_nb;
- u8 services_index_nb;
-
- total_services_index_nb = services_number;
-
- /* One MME can contain maximum of 73 services entries. One mme can contain 1492 bytes. The first 4 bytes are:
- result, total_services_index_nb, first_service_index_nb and services_index_nb. There are 1488 bytes remaining.
- Each entry contains 20 bytes. */
-
- if (first_service_index_nb > total_services_index_nb)
- services_index_nb = 0;
- else
- services_index_nb = ((total_services_index_nb - first_service_index_nb) >= 73) ?
- 73 : total_services_index_nb - first_service_index_nb;
-
- tx = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_CCO_GET_SERVICES_CNF);
- dbg_assert (tx);
- bitstream_write (&tx->bitstream, result, 8);
- bitstream_write (&tx->bitstream, total_services_index_nb, 8);
- bitstream_write (&tx->bitstream, first_service_index_nb, 8);
- bitstream_write (&tx->bitstream, services_index_nb, 8);
-
- for (i = first_service_index_nb; i < first_service_index_nb + services_index_nb; i++)
- {
- bitstream_write(&tx->bitstream, service_indexes[i], 8);
- bitstream_write(&tx->bitstream, classifier_rules[i], 8);
- bitstream_write(&tx->bitstream, classifier_values[i], 16);
- bitstream_write(&tx->bitstream, acses[i], 8);
- bitstream_write(&tx->bitstream, parameters_numbers[i], 8);
- for(j = 0; j < parameters_numbers[i]; j++)
- {
- bitstream_write(&tx->bitstream, parameters_lists[i][j], 16);
- }
- }
-
- cp_msg_mme_send (ctx, tx);
-}
-
-bool
-cp_msg_vs_eoc_cco_get_info_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *internal_eoc_index, u8 *control)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *internal_eoc_index = bitstream_read(&mme->bitstream, 8);
- *control = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_get_info_cnf_send(cp_t *ctx, cp_mme_peer_t *peer, cp_msg_vs_eoc_get_info_req_result_t status,
- u16 tei, u8 attenuation, u8 snr, u16 phy_uplink_speed, u16 phy_downlink_speed, u8 output_power,
- u32 tx_success_counter, u32 tx_crc_error_counter, u32 tx_other_error_counter, u32 rx_success_counter,
- u32 rx_crc_error_counter, u32 rx_other_error_counter)
-{
- dbg_assert(ctx);
- dbg_assert(peer);
-
- cp_mme_tx_t *tx;
- tx = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_GET_INFO_CNF);
- dbg_assert (tx);
-
- bitstream_write (&tx->bitstream, status, 8);
- bitstream_write (&tx->bitstream, tei, 16);
- bitstream_write (&tx->bitstream, attenuation, 8);
- bitstream_write (&tx->bitstream, snr, 8);
- bitstream_write (&tx->bitstream, phy_uplink_speed, 16);
- bitstream_write (&tx->bitstream, phy_downlink_speed, 16);
- bitstream_write (&tx->bitstream, output_power, 8);
- bitstream_write (&tx->bitstream, tx_success_counter, 32);
- bitstream_write (&tx->bitstream, tx_crc_error_counter, 32);
- bitstream_write (&tx->bitstream, tx_other_error_counter, 32);
- bitstream_write (&tx->bitstream, rx_success_counter, 32);
- bitstream_write (&tx->bitstream, rx_crc_error_counter, 32);
- bitstream_write (&tx->bitstream, rx_other_error_counter, 32);
-
- cp_msg_mme_send (ctx, tx);
-}
-
-
-bool
-cp_msg_vs_eoc_cco_diagnostic_info_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *internal_eoc_index, u8 *control)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *internal_eoc_index = bitstream_read(&mme->bitstream, 8);
- *control = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_diagnostict_info_cnf_send(cp_t *ctx, cp_mme_peer_t *peer, cp_msg_vs_eoc_diagnostic_info_req_result_t status,
- u8 assoc_stat, u64 nid, u8 num_slots, mac_t he_mac_address, u16 est_avg_phy_rate, u8 num_good_assoc_auth,
- u16 num_bad_could_not_assoc, u32 num_bad_assoc_failure, u32 num_bad_could_not_auth, u32 num_leave)
-{
- dbg_assert(ctx);
- dbg_assert(peer);
-
- cp_mme_tx_t *tx;
- tx = cp_msg_mme_init_not_frag (ctx, peer, VS_EOC_DIAGNOSTIC_INFO_CNF);
- dbg_assert (tx);
-
- bitstream_write (&tx->bitstream, status, 8);
- bitstream_write (&tx->bitstream, assoc_stat, 8);
- bitstream_write_large (&tx->bitstream, nid, 56);
- bitstream_write (&tx->bitstream, num_slots, 8);
- bitstream_write_large (&tx->bitstream, he_mac_address, 48);
- bitstream_write (&tx->bitstream, est_avg_phy_rate, 16);
- bitstream_write (&tx->bitstream, num_good_assoc_auth, 8);
- bitstream_write (&tx->bitstream, num_bad_could_not_assoc, 16);
- bitstream_write (&tx->bitstream, num_bad_assoc_failure, 32);
- bitstream_write (&tx->bitstream, num_bad_could_not_auth, 32);
- bitstream_write (&tx->bitstream, num_leave, 32);
-
- cp_msg_mme_send (ctx, tx);
-}
-
-
-bool
-cp_msg_vs_eoc_cco_get_real_time_stats_req_receive (cp_t *ctx, cp_mme_rx_t *mme, u8 *control)
-{
- dbg_assert (ctx);
- dbg_assert (mme);
-
- if (cp_msg_mme_read_error (ctx, mme))
- {
- *control = bitstream_read(&mme->bitstream, 8);
- return true;
- }
- return false;
-}
-
-void
-cp_msg_vs_eoc_cco_get_real_time_stats_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
- cp_msg_vs_eoc_get_real_time_statistics_req_result_t status,
- real_time_stats_t *rt_stats)
-{
- dbg_assert(ctx);
- dbg_assert(peer);
-
- cp_mme_tx_t *tx;
- tx = cp_msg_mme_init_not_frag (ctx, peer,
- VS_EOC_GET_REAL_TIME_STATISTICS_CNF);
- dbg_assert (tx);
-
- bitstream_write (&tx->bitstream, status, 8);
- bitstream_write (&tx->bitstream, rt_stats->nb_unicast_packets_rx, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_unicast_packets_tx, 32);
- bitstream_write (&tx->bitstream, rt_stats->total_nb_bytes_rx, 32);
- bitstream_write (&tx->bitstream, rt_stats->total_nb_bytes_tx, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_broadcast_packets_rx, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_broadcast_packets_tx, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_multicast_packets_rx, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_multicast_packets_tx, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_packets_rx_crc, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_packets_rx_short, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_packets_tx_short, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_packets_tx_dropped, 32);
- bitstream_write (&tx->bitstream, rt_stats->nb_packets_rx_discarded, 32);
- bitstream_write (&tx->bitstream, rt_stats->avg_pre_fec_bit_error_rate, 32);
-
- cp_msg_mme_send (ctx, tx);
-}
-