summaryrefslogtreecommitdiff
path: root/cesar/cp
diff options
context:
space:
mode:
authorschodet2008-12-09 15:50:46 +0000
committerschodet2008-12-09 15:50:46 +0000
commitcd3b63db9a0bf77d337146ed12aa30239495d4e4 (patch)
treea5f8cea44070a7ad5d03b8936f028fa30910e51b /cesar/cp
parentaec3578384f10f3c5dec7351ff848ec563e750ee (diff)
* cp/sta/action:
- added CC_RELAY.REQ handling. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@3605 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp')
-rw-r--r--cesar/cp/sta/action/misc.h15
-rw-r--r--cesar/cp/sta/action/src/misc.c60
2 files changed, 55 insertions, 20 deletions
diff --git a/cesar/cp/sta/action/misc.h b/cesar/cp/sta/action/misc.h
index b660f1b0d1..6177fae69c 100644
--- a/cesar/cp/sta/action/misc.h
+++ b/cesar/cp/sta/action/misc.h
@@ -48,26 +48,11 @@ cp_sta_action_process_cc_who_ru_req (cp_t *ctx, cp_mme_rx_t *mme);
* unencrypted. If the relay request is not encrypted and contains a
* CM_ENCRYPTED_PAYLOAD.IND, the CC_RELAY.IND should be sent broadcast. This
* could be done by the cp_msg module.
- *
- * - What to do with the MAC address?
*/
void
cp_sta_action_process_cc_relay_req (cp_t *ctx, cp_mme_rx_t *mme);
/**
- * Process a CC_RELAY.IND, 11.2.37.
- * \param ctx control plane context
- * \param mme received MME handle
- *
- * Extract the payload and insert the message back.
- *
- * Relay station is trusted as long as it is authenticated. It should have
- * filtered unauthorised payload.
- */
-void
-cp_sta_action_process_cc_relay_ind (cp_t *ctx, cp_mme_rx_t *mme);
-
-/**
* Process a CM_HFID.REQ, 11.5.30.
* \param ctx control plane context
* \param mme received MME handle
diff --git a/cesar/cp/sta/action/src/misc.c b/cesar/cp/sta/action/src/misc.c
index d92fc45c01..962ca540b7 100644
--- a/cesar/cp/sta/action/src/misc.c
+++ b/cesar/cp/sta/action/src/misc.c
@@ -44,11 +44,61 @@ cp_sta_action_process_cc_who_ru_req (cp_t *ctx, cp_mme_rx_t *mme)
void
cp_sta_action_process_cc_relay_req (cp_t *ctx, cp_mme_rx_t *mme)
{
-}
-
-void
-cp_sta_action_process_cc_relay_ind (cp_t *ctx, cp_mme_rx_t *mme)
-{
+ dbg_assert (ctx);
+ dbg_assert (mme);
+ uint length;
+ uint mmtype;
+ cp_mme_peer_t peer;
+ if (cp_msg_cc_relay_req_receive (ctx, mme, length, mmtype))
+ {
+ peer = CP_MME_PEER (mme->relay.mac_fa, mme->relay.ftei);
+ switch (mmtype)
+ {
+ /* Special cases. */
+ case CM_ENCRYPTED_PAYLOAD_IND:
+ case CM_ENCRYPTED_PAYLOAD_RSP:
+ peer.tei = MAC_TEI_BCAST;
+ /* no break */
+ /* MME between unassociated STA. */
+ case CM_UNASSOCIATED_STA_IND:
+ case CC_ASSOC_REQ:
+ case CC_ASSOC_CNF:
+ case CC_WHO_RU_REQ:
+ case CC_WHO_RU_CNF:
+ case CM_HFID_REQ:
+ case CM_HFID_CNF:
+ case CM_SC_JOIN_REQ:
+ case CM_SC_JOIN_CNF:
+ case CM_STA_CAP_REQ:
+ case CM_STA_CAP_CNF:
+ case CM_MME_ERROR_IND:
+ case CC_RELAY_REQ:
+ case CC_RELAY_IND:
+ /* No special condition. */
+ break;
+ /* MME between non authenticated STA. */
+ case CC_LEAVE_REQ:
+ case CC_LEAVE_CNF:
+ case CC_LEAVE_IND:
+ case CC_LEAVE_RSP:
+ case CC_SET_TEI_MAP_REQ:
+ case CC_SET_TEI_MAP_IND:
+ case PH_PROXY_APPOINT_IND:
+ case CM_CHAN_EST_IND:
+ case CM_TM_UPDATE_IND:
+ case CM_SET_KEY_REQ:
+ case CM_SET_KEY_CNF:
+ case CM_GET_KEY_REQ:
+ case CM_GET_KEY_CNF:
+ /* Should be associated. */
+ if (!MAC_TEI_IS_STA (mme->peer.tei))
+ return;
+ break;
+ /* Other. */
+ default:
+ if ()
+ }
+ }
}
void