summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/cp2/conn/conn.h336
-rw-r--r--cesar/cp2/conn/conn_mgr.h107
-rw-r--r--cesar/cp2/conn/link.h327
-rw-r--r--cesar/cp2/inc/context.h4
4 files changed, 483 insertions, 291 deletions
diff --git a/cesar/cp2/conn/conn.h b/cesar/cp2/conn/conn.h
index fda8f9934e..445a68b21e 100644
--- a/cesar/cp2/conn/conn.h
+++ b/cesar/cp2/conn/conn.h
@@ -14,283 +14,11 @@
*
* « long description »
*/
-/**
- * cinfo structure
- */
-struct cp_cinfo_t
-{
- /**
- * Validity : 0x00 not valid ; 0x01 valid
- */
- u8 valid_cinfo;
-
- /**
- * type of connection requested
- */
- u8 mac_service_t;
-
- /**
- * CAP
- */
- u8 user_priority;
-
- /**
- * Transfer of the ATS to the HLE : 0x00 not 0x01 passed
- */
- u8 ats;
-
- /**
- * 0x00 no smoothing 0x01 smoothing if possible
- */
- u8 smoothing;
-
-
-};
-typedef struct cp_cinfo_t cp_cinfo_t;
-
-/**
- * ble interval values
- */
-struct cp_ble_interval_t
-{
- /**
- * ble value
- */
- u8 ble;
-
- /**
- * end time
- */
- u16 et;
-
-
-};
-typedef struct cp_ble_interval_t cp_ble_interval_t;
-
-/**
- * table used for 2 purposes. To know if a field has been informed and
- * how to access the data into the structure with only the FID.
- */
-struct cp_cspec_field_status_t
-{
- /**
- * Field identifier
- */
- u8 fid;
-
- /**
- * presence status
- */
- bool presence;
-
- /**
- * memory access too the value of a field.
- */
- u32 fid_position;
-
-
-};
-typedef struct cp_cspec_field_status_t cp_cspec_field_status_t;
-
-
-/**
- * Connection Specification
- */
-struct cp_cspec_t
-{
- /**
- * Delay Bound
- */
- u32 delay;
-
- /**
- * jitter bound
- */
- u32 jitter;
-
- /**
- * Average MPDU size
- */
- u16 av_MPDU_size;
-
- /**
- * Maximum MPDU size
- */
- u16 max_MPDU_size;
-
- /**
- * Average data rate
- */
- u16 av_data_rate;
-
- /**
- * Minimum data rate
- */
- u16 min_data_rate;
-
- /**
- * Maximum data rate
- */
- u16 max_data_rate;
-
- /**
- * Maximum inter-TXOP time
- */
- u16 max_inter_TXOP;
-
- /**
- * Minimum inter TXOP time
- */
- u16 min_inter_TXOP;
-
- /**
- * Maximum burst time
- */
- u16 max_burst;
-
- /**
- * Exception Policy
- */
- u8 exception;
-
- /**
- * Inatictivity interval
- */
- u32 inactivity;
-
- /**
- * MSDU error rate
- */
- u16 MSDU_error_rate;
-
- /**
- * Convergence Layer SAP Type
- */
- u8 CLST;
-
- /**
- * ATS tolerance
- */
- u16 ATS;
-
- /**
- * Smallest Tolerable Average Data rate
- */
- u16 min_tol_data;
-
- /**
- * Original average Data rate
- */
- u16 ori_av_data_rate;
-
- /**
- * RX window size
- */
- u16 rx_window;
-
- /**
- * Smoothing buffer size
- */
- u32 smoothing:24;
-
- /**
- * Bidirectional burst
- */
- u8 bidir_burst;
-
- /**
- * Number of TXOPs per beacon
- */
- u8 nb_TXOP;
-
- /**
- * Average number of PBs per TXOP
- */
- u16 av_nb_pb;
-
- /**
- * Maximum number of PBs per TXOP
- */
- u16 max_nb_pb;
-
- /**
- * Pending PB threshold
- */
- u16 ppb_threshold;
-
- /**
- * Surplus of Bandwidth
- */
- u16 surplus_bw;
-
- /**
- * table used for 2 purposes. To know if a field has been informed
- * and how to access the data into the structure with only the FID.
- */
- cp_cspec_field_status_t* presence_table[25];
-
-
-};
-typedef struct cp_cspec_t cp_cspec_t;
-
-/**
- * Structure of a link.
- */
-struct cp_link_t
-{
- /**
- * global link identifier
- */
- u8 lid;
-
- /**
- * connection information
- */
- cp_cinfo_t* cinfo;
-
- /**
- * forward BLE
- */
- cp_ble_interval_t *ble;
-
- /**
- * expiration date of the connection used by the garbadge collector
- */
- u16 expiration;
-
- /**
- * PCO status of the connection : 0 not PCO 1 PCO
- */
- bool pco_status;
-
- /**
- * MAC addr of the Destination STAs
- */
- u64 oda:48;
-
- /**
- * MAC addr of the Source STA
- */
- u64 osa:48;
-
- /**
- \todo fill the comment.
- */
- cp_cspec_t* cspec;
-
- /**
- * 0 forward link - 1 reverse link
- */
- bool side;
-
-
-};
-typedef struct cp_link_t cp_link_t;
+#include "cp2/conn/link.h"
/*
* Different state of a connection
* */
-
enum cp_conn_state_t{
IN,
OUT,
@@ -301,10 +29,10 @@ enum cp_conn_state_t{
REL_CSPEC
};
typedef enum cp_conn_state_t cp_conn_state_t;
+
/**
* Structure of a connection. Add, delete, return a link.
*/
-
struct cp_conn_t
{
/**
@@ -315,12 +43,12 @@ struct cp_conn_t
/**
* Forward link id (global or local)
*/
- cp_link_t* flid;
+ cp_link_t flid;
/**
* Reverse link id (local or global)
*/
- cp_link_t* rlid;
+ cp_link_t rlid;
/**
* connection state
@@ -332,32 +60,58 @@ struct cp_conn_t
typedef struct cp_conn_t cp_conn_t;
/**
- * del a connection regarding to its CID.
- * \param ctx the module context.
- * \param lid Connection identifier
+ * Check the validity of a connection
+ * \param ctx Control plane context
+ * \param conn Connection too validate
+ * \return the result of the test
+ *
+ */
+u8
+cp_conn_check_conn_validity (cp_t *ctx, cp_conn_t* conn);
+
+/**
+ * add a connection into the connection list
+ * \param ctx Control plane context.
+ * \param new_conn Connection to add into the list
*
*/
void
-cp_conn_del_link (cp_conn_t *ctx, u8 lid);
+cp_conn_add_conn (cp_t *ctx, cp_conn_t* new_conn);
/**
- * function that add a connection to the list using the first connection
- * to get to the last and add it to the end.
- * \param ctx the module context.
- * \param new_link null
+ * delete a connection from the connection list
+ * \param ctx Control Plane context.
+ * \param cid Connection identifier of the connection to delete
*
*/
void
-cp_conn_add_link (cp_conn_t *ctx, cp_link_t* new_link);
+cp_conn_del_conn (cp_t *ctx, u8 cid);
+
+/**
+ * Give access to a connection
+ * \param ctx Control plane context.
+ * \param cid connection identifier of the targeted connection
+ * \return the target connection
+ *
+ */
+cp_conn_t*
+cp_conn_get_conn (cp_t *ctx, u8 cid);
/**
- * return a connection regarding to its CID.
- * \param ctx the module context.
- * \param lid connection identifier
- * \return \todo fill this
+ * Modify the caracteristics of a connection
+ * \param ctx control plane context.
+ * \param modified_conn Modified connection
*
*/
-cp_link_t*
-cp_conn_get_link (cp_conn_t *ctx, u8 lid);
+void
+cp_conn_mod_conn (cp_t *ctx, cp_conn_t* modified_conn);
+
+/**
+ * Garbage collector
+ * \param ctx Control Plane context.
+ *
+ */
+void
+cp_conn_garbage_conn (cp_conn_t *ctx);
#endif /* cp_conn_h */
diff --git a/cesar/cp2/conn/conn_mgr.h b/cesar/cp2/conn/conn_mgr.h
new file mode 100644
index 0000000000..d46592ca40
--- /dev/null
+++ b/cesar/cp2/conn/conn_mgr.h
@@ -0,0 +1,107 @@
+#ifndef cp_conn_mgr_h
+#define cp_conn_mgr_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp_conn_mgr.h
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+
+/**
+ * connection list manager. add, delete, return, modify and check the
+ * validity of the connections.
+ */
+struct cp_conn_mgr_t
+{
+ list_t conns;
+};
+typedef struct cp_conn_mgr_t cp_conn_mgr_t;
+
+/**
+ * Process a CM_CONN_NEW_REQ MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_new_req(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_NEW_CNF MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_new_cnf(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_REL_IND MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_rel_ind(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_REL_RSP MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_rel_rsp(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_MOD_REQ MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_mod_req(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_MOD_CNF MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_mod_cnf(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_INFO_REQ MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_info_req(cp_t *ctx, cp_mme_rx_t *mme);
+
+/**
+ * Process a CM_CONN_INFO_CNF MME
+ * \param ctx Control Plane context
+ * \param mme incoming MME
+ *
+ * « details »
+ */
+void
+cp_conn_mgr_process_cm_conn_info_cnf(cp_t *ctx, cp_mme_rx_t *mme);
+#endif /* cp_conn_mgr_h */
diff --git a/cesar/cp2/conn/link.h b/cesar/cp2/conn/link.h
new file mode 100644
index 0000000000..2a1966b9cf
--- /dev/null
+++ b/cesar/cp2/conn/link.h
@@ -0,0 +1,327 @@
+#ifndef cp_link_h
+#define cp_link_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file link.h
+ * \brief link management
+ * \ingroup cp2/conn
+ *
+ * « long description »
+ */
+
+/**
+ * cinfo structure
+ */
+struct cp_link_cinfo_t
+{
+ /**
+ * Validity : 0x00 not valid ; 0x01 valid
+ */
+ u8 valid_cinfo;
+
+ /**
+ * type of connection requested
+ */
+ u8 mac_service_t;
+
+ /**
+ * CAP
+ */
+ u8 user_priority;
+
+ /**
+ * Transfer of the ATS to the HLE : 0x00 not 0x01 passed
+ */
+ u8 ats;
+
+ /**
+ * 0x00 no smoothing 0x01 smoothing if possible
+ */
+ u8 smoothing;
+
+
+};
+typedef struct cp_link_cinfo_t cp_link_cinfo_t;
+
+/**
+ * ble interval values
+ */
+struct cp_link_ble_interval_t
+{
+ /**
+ * ble value
+ */
+ u8 ble;
+
+ /**
+ * end time
+ */
+ u16 et;
+
+
+};
+typedef struct cp_link_ble_interval_t cp_link_ble_interval_t;
+
+enum cp_link_presence_t
+{
+ CP_LINK_PRESENCE_FILLED,
+ CP_LINK_PRESENCE_NOT_FILLED
+};
+typedef cp_link_presence_t cp_link_presence_t;
+/**
+ * table used for 2 purposes. To know if a field has been informed and
+ * how to access the data into the structure with only the FID.
+ */
+struct cp_link_cspec_field_status_t
+{
+ /**
+ * Field identifier
+ */
+ u8 fid;
+
+ /**
+ * presence status
+ */
+ cp_link_presence_t presence;
+
+ /**
+ * memory access too the value of a field.
+ */
+ u32 fid_position;
+
+
+};
+typedef struct cp_link_cspec_field_status_t cp_link_cspec_field_status_t;
+
+
+/**
+ * Connection Specification
+ */
+struct cp_link_cspec_t
+{
+ /**
+ * Delay Bound
+ */
+ u32 delay;
+
+ /**
+ * jitter bound
+ */
+ u32 jitter;
+
+ /**
+ * Average MPDU size
+ */
+ u16 av_MPDU_size;
+
+ /**
+ * Maximum MPDU size
+ */
+ u16 max_MPDU_size;
+
+ /**
+ * Average data rate
+ */
+ u16 av_data_rate;
+
+ /**
+ * Minimum data rate
+ */
+ u16 min_data_rate;
+
+ /**
+ * Maximum data rate
+ */
+ u16 max_data_rate;
+
+ /**
+ * Maximum inter-TXOP time
+ */
+ u16 max_inter_TXOP;
+
+ /**
+ * Minimum inter TXOP time
+ */
+ u16 min_inter_TXOP;
+
+ /**
+ * Maximum burst time
+ */
+ u16 max_burst;
+
+ /**
+ * Exception Policy
+ */
+ u8 exception;
+
+ /**
+ * Inatictivity interval
+ */
+ u32 inactivity;
+
+ /**
+ * MSDU error rate
+ */
+ u16 MSDU_error_rate;
+
+ /**
+ * Convergence Layer SAP Type
+ */
+ u8 CLST;
+
+ /**
+ * ATS tolerance
+ */
+ u16 ATS;
+
+ /**
+ * Smallest Tolerable Average Data rate
+ */
+ u16 min_tol_data;
+
+ /**
+ * Original average Data rate
+ */
+ u16 ori_av_data_rate;
+
+ /**
+ * RX window size
+ */
+ u16 rx_window;
+
+ /**
+ * Smoothing buffer size
+ */
+ u32 smoothing:24;
+
+ /**
+ * Bidirectional burst
+ */
+ u8 bidir_burst;
+
+ /**
+ * Number of TXOPs per beacon
+ */
+ u8 nb_TXOP;
+
+ /**
+ * Average number of PBs per TXOP
+ */
+ u16 av_nb_pb;
+
+ /**
+ * Maximum number of PBs per TXOP
+ */
+ u16 max_nb_pb;
+
+ /**
+ * Pending PB threshold
+ */
+ u16 ppb_threshold;
+
+ /**
+ * Surplus of Bandwidth
+ */
+ u16 surplus_bw;
+
+ /**
+ * table used for 2 purposes. To know if a field has been informed
+ * and how to access the data into the structure with only the FID.
+ */
+ cp_link_cspec_field_status_t* presence_table[25];
+
+
+};
+typedef struct cp_link_cspec_t cp_link_cspec_t;
+
+/**
+ * Structure of a link.
+ */
+struct cp_link_t
+{
+ /**
+ * global link identifier
+ */
+ u8 lid;
+
+ /**
+ * connection information
+ */
+ cp_link_cinfo_t* cinfo;
+
+ /**
+ * forward BLE
+ */
+ cp_link_ble_interval_t *ble;
+
+ /**
+ * expiration date of the connection used by the garbadge collector
+ */
+ u16 expiration;
+
+ /**
+ * PCO status of the connection : 0 not PCO 1 PCO
+ */
+ bool pco_status;
+
+ /**
+ * MAC addr of the Destination STAs
+ */
+ u64 oda:48;
+
+ /**
+ * MAC addr of the Source STA
+ */
+ u64 osa:48;
+
+ /**
+ \todo fill the comment.
+ */
+ cp_link_cspec_t* cspec;
+
+ /**
+ * 0 forward link - 1 reverse link
+ */
+ bool side;
+
+
+};
+typedef struct cp_link_t cp_link_t;
+
+
+/**
+ * del a connection regarding to its CID.
+ * \param ctx conn context.
+ * \param lid Connection identifier
+ *
+ */
+void
+cp_conn_del_link (cp_conn_t *ctx, u8 lid);
+
+/**
+ * function that add a connection to the list using the first connection
+ * to get to the last and add it to the end.
+ * \param ctx Conn context.
+ * \param new_link null
+ *
+ */
+void
+cp_conn_add_link (cp_conn_t *ctx, cp_conn_link_t* new_link);
+
+/**
+ * return a link regarding to its LID.
+ * \param ctx conn context.
+ * \param lid connection identifier
+ * \return \todo fill this
+ *
+ */
+cp_link_t*
+cp_link_get_link (cp_conn_t *ctx, u8 lid);
+
+#endif /* cp_link_h */
diff --git a/cesar/cp2/inc/context.h b/cesar/cp2/inc/context.h
index eb3083d287..ac333cef88 100644
--- a/cesar/cp2/inc/context.h
+++ b/cesar/cp2/inc/context.h
@@ -28,6 +28,7 @@
#include "cp2/beacon/beacon.h"
#include "cp2/cco/bw/bw.h"
#include "cp2/cco/region/region.h"
+#include "cp2/conn/conn_list.h"
/* Private interfaces. */
#include "cp2/sta/mgr/inc/sta_mgr.h"
@@ -56,6 +57,9 @@ struct cp_t
/** Bandwidth Manager context. */
cp_cco_bw_t bw;
+ /** Connection manager context. */
+ cp_conn_mgr_t conn_mgr;
+
/** The mac config context. */
mac_config_t *mac_config;