]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan.h
Unified header for FNA
[frescor/fna.git] / src_frescan / frescan.h
1 /*!
2  * @file frescan.h
3  *
4  * @brief interface of the FRESCAN protocol
5  *
6  * @version 0.01
7  *
8  * @date 20-Feb-2008
9  *
10  * @author
11  *      Daniel Sangorrin
12  *
13  * @comments
14  *
15  * This file contains the interface to the FRESCAN protocol
16  *
17  * @license
18  *
19 //----------------------------------------------------------------------
20 //  Copyright (C) 2006 - 2009 by the FRESCOR consortium:
21 //
22 //    Universidad de Cantabria,              SPAIN
23 //    University of York,                    UK
24 //    Scuola Superiore Sant'Anna,            ITALY
25 //    Kaiserslautern University,             GERMANY
26 //    Univ. Politecnica  Valencia,           SPAIN
27 //    Czech Technical University in Prague,  CZECH REPUBLIC
28 //    ENEA                                   SWEDEN
29 //    Thales Communication S.A.              FRANCE
30 //    Visual Tools S.A.                      SPAIN
31 //    Rapita Systems Ltd                     UK
32 //    Evidence                               ITALY
33 //
34 //    See http://www.frescor.org
35 //
36 //        The FRESCOR project (FP6/2005/IST/5-034026) is funded
37 //        in part by the European Union Sixth Framework Programme
38 //        The European Union is not liable of any use that may be
39 //        made of this code.
40 //
41 //
42 //  based on previous work (FSF) done in the FIRST project
43 //
44 //   Copyright (C) 2005  Mälardalen University, SWEDEN
45 //                       Scuola Superiore S.Anna, ITALY
46 //                       Universidad de Cantabria, SPAIN
47 //                       University of York, UK
48 //
49 // This file is part of FNA (Frescor Network Adaptation)
50 //
51 // FNA is free software; you can redistribute it and/or modify it
52 // under terms of the GNU General Public License as published by the
53 // Free Software Foundation; either version 2, or (at your option) any
54 // later version.  FNA is distributed in the hope that it will be
55 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
56 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57 // General Public License for more details. You should have received a
58 // copy of the GNU General Public License along with FNA; see file
59 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
60 // Cambridge, MA 02139, USA.
61 //
62 // As a special exception, including FNA header files in a file,
63 // instantiating FNA generics or templates, or linking other files
64 // with FNA objects to produce an executable application, does not
65 // by itself cause the resulting executable application to be covered
66 // by the GNU General Public License. This exception does not
67 // however invalidate any other reasons why the executable file might be
68 // covered by the GNU Public License.
69 // -----------------------------------------------------------------------
70  *
71  */
72
73 #ifndef _FRESCAN_H_
74 #define _FRESCAN_H_
75
76 #include "frescan_types.h"
77
78 /**
79  * frescan_init - initializes the network and the internal structures
80  *
81  * @params: the initialization parameters
82  */
83
84 int frescan_init(frescan_init_params_t *params);
85
86 /**
87  * frescan_send - send a message
88  *
89  * @params: the parameters needed by the protocol to send the message
90  * @msg: the message buffer
91  * @size: the size of the message
92  *
93  * This is one of the main functions of the protocol and it provides the
94  * means to send a message through the protocol stack.
95  */
96
97 int frescan_send(const frescan_send_params_t *params,
98                  const uint8_t *msg,
99                  const size_t size);
100
101 /**
102  * frescan_recv - receive a message
103  *
104  * @params: the parameters needed by the protocol to receive the message
105  * @msg: the message buffer
106  * @size: the size of the message buffer
107  * @recv_bytes: the number of bytes received
108  * @from: the node that sent the message
109  * @prio: the priority of the message
110  *
111  * This is one of the main functions of the protocol and it provides the
112  * means to receive a message through the protocol stack.
113  */
114
115 int frescan_recv(const frescan_recv_params_t *params,
116                  uint8_t *msg,
117                  const size_t size,
118                  size_t *recv_bytes,
119                  frescan_node_t *from,
120                  frescan_prio_t *prio);
121
122 #endif // _FRESCAN_H_