]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan.h
add group negotiations to frescan and change all the requests and messages to map...
[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 - 2008 FRESCOR consortium partners:
21  *
22  *    Universidad de Cantabria,              SPAIN
23  *    University of York,                    UK
24  *    Scuola Superiore Sant'Anna,            ITALY
25  *    Kaiserslautern University,             GERMANY
26  *    Univ. Politécnica  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 for a link to partners' websites
35  *
36  *           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  *  This file is part of FRESCAN
42  *
43  *  FRESCAN is free software; you can  redistribute it and/or  modify
44  *  it under the terms of  the GNU General Public License as published by
45  *  the Free Software Foundation;  either  version 2, or (at  your option)
46  *  any later version.
47  *
48  *  FRESCAN  is distributed  in  the hope  that  it  will  be useful,  but
49  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
50  *  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
51  *  General Public License for more details.
52  *
53  *  You should have  received a  copy of  the  GNU  General Public License
54  *  distributed  with  FRESCAN;  see file COPYING.   If not,  write to the
55  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
56  *  02111-1307, USA.
57  *
58  * As a special exception, including FRESCAN header files in a file,
59  * instantiating FRESCAN generics or templates, or linking other files
60  * with FRESCAN objects to produce an executable application, does not
61  * by itself cause the resulting executable application to be covered
62  * by the GNU General Public License. This exception does not
63  * however invalidate any other reasons why the executable file might be
64  * covered by the GNU Public License.
65  * -----------------------------------------------------------------------
66  *
67  */
68
69 #ifndef _FRESCAN_H_
70 #define _FRESCAN_H_
71
72 #include "frescan_types.h"
73
74 /**
75  * frescan_init - initializes the network and the internal structures
76  *
77  * @params: the initialization parameters
78  */
79
80 int frescan_init(frescan_init_params_t *params);
81
82 /**
83  * frescan_send - send a message
84  *
85  * @params: the parameters needed by the protocol to send the message
86  * @msg: the message buffer
87  * @size: the size of the message
88  *
89  * This is one of the main functions of the protocol and it provides the
90  * means to send a message through the protocol stack.
91  */
92
93 int frescan_send(const frescan_send_params_t *params,
94                  const uint8_t *msg,
95                  const size_t size);
96
97 /**
98  * frescan_recv - receive a message
99  *
100  * @params: the parameters needed by the protocol to receive the message
101  * @msg: the message buffer
102  * @size: the size of the message buffer
103  * @recv_bytes: the number of bytes received
104  * @from: the node that sent the message
105  * @prio: the priority of the message
106  *
107  * This is one of the main functions of the protocol and it provides the
108  * means to receive a message through the protocol stack.
109  */
110
111 int frescan_recv(const frescan_recv_params_t *params,
112                  uint8_t *msg,
113                  const size_t size,
114                  size_t *recv_bytes,
115                  frescan_node_t *from,
116                  frescan_prio_t *prio);
117
118 #endif // _FRESCAN_H_