summaryrefslogtreecommitdiff
path: root/cesar/cl/cl.h
diff options
context:
space:
mode:
authorlaranjeiro2008-10-27 14:05:55 +0000
committerlaranjeiro2008-10-27 14:05:55 +0000
commit9d1c34f849c028e03e9c0a640aa10e156caf478b (patch)
treea17644352f93f634be8642eb4cda4db48fc7c16c /cesar/cl/cl.h
parent2e5e0a0b7d49deebc21bf1185eec58e5fb5f9793 (diff)
cl: Added the MFS on the rx callback function done by the SAR.
- Update the unit test cl_mme_send to verify all the cases to send a MME. - Update the tests scripts. - Update the Makefile. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@3371 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cl/cl.h')
-rw-r--r--cesar/cl/cl.h94
1 files changed, 59 insertions, 35 deletions
diff --git a/cesar/cl/cl.h b/cesar/cl/cl.h
index 7a32c5b7ef..33b74a04fd 100644
--- a/cesar/cl/cl.h
+++ b/cesar/cl/cl.h
@@ -32,7 +32,8 @@ typedef struct cl_send_t cl_send_t;
* \param user the user data
* \param buffer the buffer use to send the data over the PLC.
*/
-typedef void (*cl_data_send_done_cb_t) (void *user, u8 *buffer);
+typedef void
+(*cl_data_send_done_cb_t) (void *user, u8 *buffer);
/**
* Callback to provide a received data to the upper layer coming from the SAR.
@@ -41,7 +42,8 @@ typedef void (*cl_data_send_done_cb_t) (void *user, u8 *buffer);
* \param buffer the buffer containing the data
* \param length the data length in the buffer.
*/
-typedef void (*cl_data_recv_cb_t) (void *user, u8 *buffer, uint length);
+typedef void
+(*cl_data_recv_cb_t) (void *user, u8 *buffer, uint length);
/**
* Provides a MME buffer to the CP.
@@ -49,7 +51,8 @@ typedef void (*cl_data_recv_cb_t) (void *user, u8 *buffer, uint length);
* \param user_data the layer data.
* \param buffer the buffer to provide.
*/
-typedef void (*cl_mme_buffer_add_cb_t) (void *user_data, u8 *buffer);
+typedef void
+(*cl_mme_buffer_add_cb_t) (void *user_data, u8 *buffer);
/**
* Call back to use when the CL needs to send a MME to the upper layer.
@@ -58,7 +61,8 @@ typedef void (*cl_mme_buffer_add_cb_t) (void *user_data, u8 *buffer);
* \param buffer the buffer containing the MME.
* \param length the length of the MME
*/
-typedef void (*cl_mme_ul_send_done_cb_t) (void *ul_data, u8 *buffer, uint length);
+typedef void
+(*cl_mme_ul_send_done_cb_t) (void *ul_data, u8 *buffer, uint length);
/**
* Call back to use once the CP had used the buffer containing a received MME.
@@ -66,7 +70,8 @@ typedef void (*cl_mme_ul_send_done_cb_t) (void *ul_data, u8 *buffer, uint length
* \param ctx the CL context
* \param mme_recv user data
*/
-typedef void (*cl_mme_recv_done_cb_t) (void *ctx, cl_mme_recv_t *mme_recv);
+typedef void
+(*cl_mme_recv_done_cb_t) (void *ctx, cl_mme_recv_t *mme_recv);
/**
* Callback definition used by the CL when the CP had processed the MME
@@ -75,7 +80,8 @@ typedef void (*cl_mme_recv_done_cb_t) (void *ctx, cl_mme_recv_t *mme_recv);
* \param user_data the upper layer user data
* \param buffer the buffer containing the MME.
*/
-typedef void (*cl_mme_ul_recv_done_cb_t) (void *user_data, u8 *buffer);
+typedef void
+(*cl_mme_ul_recv_done_cb_t) (void *user_data, u8 *buffer);
/**
* Use this callback to provide a received MME to the CP.
@@ -88,8 +94,9 @@ typedef void (*cl_mme_ul_recv_done_cb_t) (void *user_data, u8 *buffer);
* \param encryption inform if the MF has been encrypted or not when it
* arrives from the PWL.
*/
-typedef void (*cl_mme_recv_cb_t) (void *user, uint tei, u8 *buffer,
- uint length, cl_mme_recv_t *mme_recv, bool encryption);
+typedef void
+(*cl_mme_recv_cb_t) (void *user, uint tei, u8 *buffer,
+ uint length, cl_mme_recv_t *mme_recv, bool encryption);
/**
* Init the Convergence Layer and return a pointer on the CL context.
@@ -99,14 +106,16 @@ typedef void (*cl_mme_recv_cb_t) (void *user, uint tei, u8 *buffer,
* \param mac_config the mac config.
* \return the convergence layer context.
*/
-cl_t *cl_init (mac_store_t *mac_store, sar_t *sar, mac_config_t *mac_config);
+cl_t *
+cl_init (mac_store_t *mac_store, sar_t *sar, mac_config_t *mac_config);
/**
* Uninit the Convergence layer context.
*
* \param ctx the convergence layer context
*/
-void cl_uninit (cl_t *ctx);
+void
+cl_uninit (cl_t *ctx);
/**
* Initialize the CL to call the Upper layer once the CP ends processing the
@@ -117,8 +126,9 @@ void cl_uninit (cl_t *ctx);
* \param cb the upper layer callback to use to send an MME.
* \param user the user data to provide with the callback
*/
-void cl_mme_ul_init_send_done (cl_t *ctx, cl_mme_ul_recv_done_cb_t cb,
- void *user);
+void
+cl_mme_ul_init_send_done (cl_t *ctx, cl_mme_ul_recv_done_cb_t cb,
+ void *user);
/**
* Init the function call when an MME is received from the SAR or the HLE.
@@ -129,7 +139,8 @@ void cl_mme_ul_init_send_done (cl_t *ctx, cl_mme_ul_recv_done_cb_t cb,
* \param mme_recv_cb
* \param user the user data
*/
-void cl_mme_recv_init (cl_t *ctx, cl_mme_recv_cb_t mme_recv_cb, void *user);
+void
+cl_mme_recv_init (cl_t *ctx, cl_mme_recv_cb_t mme_recv_cb, void *user);
/**
* Initialize the CL to send MMEs to the Upper layer considered as data.
@@ -139,7 +150,8 @@ void cl_mme_recv_init (cl_t *ctx, cl_mme_recv_cb_t mme_recv_cb, void *user);
* \param cb the upper layer callback to use to send an MME.
* \param user the user data to provide with the callback
*/
-void cl_mme_init_ul_as_data (cl_t *ctx, cl_mme_ul_send_done_cb_t cb, void *user);
+void
+cl_mme_init_ul_as_data (cl_t *ctx, cl_mme_ul_send_done_cb_t cb, void *user);
/**
@@ -149,8 +161,9 @@ void cl_mme_init_ul_as_data (cl_t *ctx, cl_mme_ul_send_done_cb_t cb, void *user)
* \param cb the call back function
* \param user_data the user data.
*/
-void cl_mme_init_buffer_add_cb (cl_t *cl, cl_mme_buffer_add_cb_t cb,
- void *user_data);
+void
+cl_mme_init_buffer_add_cb (cl_t *cl, cl_mme_buffer_add_cb_t cb,
+ void *user_data);
/**
* Send a MME from the CP to the Upper layer or to the PWL.
@@ -176,7 +189,8 @@ cl_mme_send (cl_t *ctx, u8 *buffer, uint length, uint tei);
* \param buffer the buffer used.
* \param cl_data the data provided to the SAR on the send.
*/
-void cl_mme_sar_send_done (cl_t *ctx, u8 *buffer, void *cl_data);
+void
+cl_mme_sar_send_done (cl_t *ctx, u8 *buffer, void *cl_data);
/**
* Receives an MME from the SAR or the upper layer.
@@ -188,12 +202,13 @@ void cl_mme_sar_send_done (cl_t *ctx, u8 *buffer, void *cl_data);
* \param ctx the cl context
* \param buffer the MME buffer
* \param length the MME length
- * \param tei the station's source TEI.
+ * \param mfs the MFS used by the reassembly process.
* \param encryption if the mac frame comes from the SAR if returns the
* state of the encryption.
*/
-void cl_mme_recv (cl_t *ctx, u8 *buffer, uint length, uint tei, bool
- encryption);
+void
+cl_mme_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs,
+ bool encryption);
/**
* Receives an MME from the Upper layer.
@@ -203,9 +218,10 @@ void cl_mme_recv (cl_t *ctx, u8 *buffer, uint length, uint tei, bool
* \param buffer the MME buffer
* \param length the MME length
*/
-extern inline void cl_mme_ul_send (cl_t *ctx, u8 *buffer, uint length)
+extern inline void
+cl_mme_ul_send (cl_t *ctx, u8 *buffer, uint length)
{
- cl_mme_recv (ctx, buffer, length, MAC_TEI_FOREIGN, false);
+ cl_mme_recv (ctx, buffer, length, NULL, false);
}
/**
@@ -215,13 +231,14 @@ extern inline void cl_mme_ul_send (cl_t *ctx, u8 *buffer, uint length)
* \param ctx the cl context
* \param buffer the MME buffer
* \param length the MME length
- * \param tei the station's source TEI.
+ * \param mfs the MFS used by the reassembly process.
* \param encryption boolean informing if the MF was encrypted or not.
*/
-extern inline void cl_mme_sar_recv (cl_t *ctx, u8 *buffer, uint length,
- uint tei, bool encryption)
+extern inline void
+cl_mme_sar_recv (cl_t *ctx, u8 *buffer, uint length,
+ mfs_rx_t *mfs, bool encryption)
{
- cl_mme_recv (ctx, buffer, length, tei, encryption);
+ cl_mme_recv (ctx, buffer, length, mfs, encryption);
}
/**
@@ -231,7 +248,8 @@ extern inline void cl_mme_sar_recv (cl_t *ctx, u8 *buffer, uint length,
* \param ctx the CL context
* \param mme_recv the data provided on the previous callback.
*/
-void cl_mme_recv_done (cl_t *ctx, cl_mme_recv_t *mme_recv);
+void
+cl_mme_recv_done (cl_t *ctx, cl_mme_recv_t *mme_recv);
/**
* Initialize the callback to inform the upper layer when a data had been sent
@@ -241,7 +259,8 @@ void cl_mme_recv_done (cl_t *ctx, cl_mme_recv_t *mme_recv);
* \param cb the callback to call once the data had been sent
* \param user the user data to provide with the callback call
*/
-void cl_data_send_done_init (cl_t *cl, cl_data_send_done_cb_t cb, void *user);
+void
+cl_data_send_done_init (cl_t *cl, cl_data_send_done_cb_t cb, void *user);
/**
* The SAR inform the CL that the data previously provided had been sent over
@@ -251,7 +270,8 @@ void cl_data_send_done_init (cl_t *cl, cl_data_send_done_cb_t cb, void *user);
* \param buffer the buffer containing the MME
* \param cl_data the data provided to the SAR on the msdu add.
*/
-void cl_data_send_done (cl_t *ctx, u8 *buffer, void *cl_data);
+void
+cl_data_send_done (cl_t *ctx, u8 *buffer, void *cl_data);
/**
* Send a data from the upper layer to the SAR, this data should be sent over
@@ -261,7 +281,8 @@ void cl_data_send_done (cl_t *ctx, u8 *buffer, void *cl_data);
* \param buffer the buffer containing the data to send
* \param length the data length
*/
-void cl_data_send (cl_t *cl, u8 *buffer, uint length);
+void
+cl_data_send (cl_t *cl, u8 *buffer, uint length);
/**
* Initialize the callback to receive the data from the PLC to the upper layer.
@@ -270,7 +291,8 @@ void cl_data_send (cl_t *cl, u8 *buffer, uint length);
* \param cb the function callback to call
* \param user the user data to provide on the callback.
*/
-void cl_data_recv_init (cl_t *cl, cl_data_recv_cb_t cb, void *user);
+void
+cl_data_recv_init (cl_t *cl, cl_data_recv_cb_t cb, void *user);
/**
* Called by the SAR each time it has a data to provide to the CL.
@@ -280,8 +302,8 @@ void cl_data_recv_init (cl_t *cl, cl_data_recv_cb_t cb, void *user);
* \param length the data length in the buffer
* \param mfs the mfs used to receive the data.
*/
-void cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs);
-
+void
+cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs);
/**
* Provides a buffer to the CP.
@@ -289,7 +311,8 @@ void cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs);
* \param cl the CL context
* \param buffer the buffer to reassembly some data
*/
-void cl_mme_buffer_add (cl_t *cl, u8 *buffer);
+void
+cl_mme_buffer_add (cl_t *cl, u8 *buffer);
/**
* Provides a buffer to the SAR to reassembly data
@@ -297,6 +320,7 @@ void cl_mme_buffer_add (cl_t *cl, u8 *buffer);
* \param cl the CL context
* \param buffer the buffer to reassembly some data
*/
-void cl_data_buffer_add (cl_t *cl, u8 *buffer);
+void
+cl_data_buffer_add (cl_t *cl, u8 *buffer);
#endif /* CL_CL_H_ */