summaryrefslogtreecommitdiff
path: root/cesar/cp2/cco/bw/bw_prio_heap.h
diff options
context:
space:
mode:
authorboure2008-04-29 14:15:08 +0000
committerboure2008-04-29 14:15:08 +0000
commit69f09b741865780091c7b5d2d0e4b3ac7d9c0c07 (patch)
tree91467829be1c21627dab6c36aacdfe8723915c33 /cesar/cp2/cco/bw/bw_prio_heap.h
parent565f1eb28cfb14289e99ca3bf560910866352e10 (diff)
Add Bandwidth Manager .xmi
Update Bandwidth Manager .odt && .h Update CCo action .odt && .h && .xmi git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1930 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2/cco/bw/bw_prio_heap.h')
-rw-r--r--cesar/cp2/cco/bw/bw_prio_heap.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/cesar/cp2/cco/bw/bw_prio_heap.h b/cesar/cp2/cco/bw/bw_prio_heap.h
new file mode 100644
index 0000000000..58b8869c0f
--- /dev/null
+++ b/cesar/cp2/cco/bw/bw_prio_heap.h
@@ -0,0 +1,95 @@
+#ifndef cp_cco_bw_prio_heap_h
+#define cp_cco_bw_prio_heap_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp_cco_bw_prio_heap.h
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * « long description »
+ */
+#include "inc/cp_cco_bw_prio_heap_private.h"
+
+/**
+ * Table that stores the pending connection in order of arrival. Each
+ * table has a specific priority level assigned (0 to 3). It manages the
+ * order and return the most prior connection
+ */
+struct cp_cco_bw_prio_heap_t
+{
+ /**
+ * level of priority of the heap (4 different levels)
+ */
+ u8 table_priority_level;
+
+ /**
+ * stage of the allocation. Faster to get to the next connection to
+ * allocate.
+ */
+ u32 nb_conn_allocated;
+ /**
+ * first connection of the heap
+ */
+ cp_cco_bw_prio_conn_t* first_conn;
+
+};
+typedef struct cp_cco_bw_prio_heap_t cp_cco_bw_prio_heap_t;
+
+/**
+ * connection storage regarding to its priority and time arrival.
+ */
+struct cp_cco_bw_prio_conn_t
+{
+ /**
+ * connection identifier
+ */
+ u8 cid;
+
+ /**
+ * pointer on the next connection
+ */
+ cp_cco_bw_prio_conn_t* next_conn;
+
+ /**
+ * pointer on the previous connection
+ */
+ cp_cco_bw_prio_conn_t* prev_conn;
+
+
+};
+typedef struct cp_cco_bw_prio_conn_t cp_cco_bw_prio_conn_t;
+
+
+ * gets the most prior pending connection return its CID.
+ * \param ctx the module context.
+ * \return \todo fill this
+ *
+ */
+u8
+cp_cco_bw_prio_heap_get_most_prior_conn (cp_cco_bw_prio_heap_t *ctx);
+
+/**
+ * delete a connection.
+ * \param ctx the module context.
+ * \param cid Connection identifier
+ *
+ */
+void
+cp_cco_bw_prio_heap_del_conn (cp_cco_bw_prio_heap_t *ctx, u8 cid);
+
+/**
+ * add a connection.
+ * \param ctx the module context.
+ * \param cid Connection identifier
+ *
+ */
+void
+cp_cco_bw_prio_heap_add_conn (cp_cco_bw_prio_heap_t *ctx, u8 cid);
+
+#endif /* cp_cco_bw_prio_heap_h */