Contiki 2.5
custody.h
Go to the documentation of this file.
1 /**
2  * \addtogroup agent
3  * @{
4  */
5 
6 /**
7  * \defgroup custody Custody modules
8  *
9  * @{
10  */
11 
12 /**
13  * \file
14  * \brief this file defines the interface for custody modules
15  * \author Georg von Zengen <vonzeng@ibr.cs.tu-bs.de>
16  */
17 
18 #ifndef __CUSTODY_H__
19 #define __CUSTODY_H__
20 
21 #include "mmem.h"
22 #include "contiki.h"
23 
24 /**
25  * Which custody driver are we going to use?
26  */
27 #ifdef CONF_CUSTODY
28 #define CUSTODY CONF_CUSTODY
29 #else
30 #define CUSTODY custody_basic
31 #endif
32 
33 /**
34  * The structure of a custody modul.
35 */
37  char *name;
38  /** initializes the custody modul, called by agent at startup */
39  void (* init)(void);
40  /** release the bundle */
41  uint8_t (* release)(struct mmem *bundlemem);
42  /** sends a report to the "report to"-node with the state of the bundle */
43  uint8_t (* report)(struct mmem *bundlemem, uint8_t status);
44  /** decides if this node becomes custodian or not */
45  uint8_t (* decide)(struct mmem *bundlemem, uint32_t * bundle_number);
46  /** retransmits the bundle */
47  uint8_t (* retransmit)(struct mmem *bundlemem);
48  /** deletes the bundle from the interal bundle list */
49  void (* del_from_list)(uint32_t bundle_number);
50 };
51 
52 extern const struct custody_driver CUSTODY;
53 
54 #endif
55 /** @} */
56 /** @} */
57