summaryrefslogtreecommitdiff
path: root/cesar/cp2/conn/inc/conn.h
blob: 4fe503e8ad57fcc3f57ae1bf0357208286cb3d74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef cp2_conn_inc_conn_h
#define cp2_conn_inc_conn_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp_conn.h
 * \brief   « brief description »
 * \ingroup « module »
 *
 * « long description »
 */
#include "cp2/cp.h"
//#include "cp2/conn/link.h"

u8
cp_conn_get_free_lid(cp_t *ctx);

/**
 * get the request id of a connection
 * \param  ctx  Control Plane context
 * \param  cid  Connection identifier
 * \return  request id
 *
 */
u8
cp_conn_get_request_id(cp_t *ctx, u16 cid);
/**
 * Return the next connection
 * \param  conn  actual conncetion
 * \return  The next connection
 *
 */
cp_conn_t*
cp_conn_get_next_conn(cp_conn_t *conn);

/**
 * Return the first connection of a heap
 * \param  heap  Heap
 * \return  The first connection of the heap
 *
 */
cp_conn_t*
cp_conn_get_first_conn(cp_t *ctx);

/**
 * Tells if the connection is the last of the heap
 * \param  conn  connection
 * \return  bool true if last connection
 *
 */
bool
cp_conn_is_last_conn(cp_t *ctx, cp_conn_t *conn);
#endif