]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blob - frsh_distributed_types.h
dcd774b6b9cd73d84b9cc5b7e9b4bbe988d0f6aa
[frescor/frsh-include.git] / frsh_distributed_types.h
1 // -----------------------------------------------------------------------
2 //  Copyright (C) 2006 - 2007 FRESCOR consortium partners:
3 //
4 //    Universidad de Cantabria,              SPAIN
5 //    University of York,                    UK
6 //    Scuola Superiore Sant'Anna,            ITALY
7 //    Kaiserslautern University,             GERMANY
8 //    Univ. Politécnica  Valencia,           SPAIN
9 //    Czech Technical University in Prague,  CZECH REPUBLIC
10 //    ENEA                                   SWEDEN
11 //    Thales Communication S.A.              FRANCE
12 //    Visual Tools S.A.                      SPAIN
13 //    Rapita Systems Ltd                     UK
14 //    Evidence                               ITALY
15 //
16 //    See http://www.frescor.org for a link to partners' websites
17 //
18 //           FRESCOR project (FP6/2005/IST/5-034026) is funded
19 //        in part by the European Union Sixth Framework Programme
20 //        The European Union is not liable of any use that may be
21 //        made of this code.
22 //
23 //
24 //  based on previous work (FSF) done in the FIRST project
25 //
26 //   Copyright (C) 2005  Mälardalen University, SWEDEN
27 //                       Scuola Superiore S.Anna, ITALY
28 //                       Universidad de Cantabria, SPAIN
29 //                       University of York, UK
30 //
31 //   FSF API web pages: http://marte.unican.es/fsf/docs
32 //                      http://shark.sssup.it/contrib/first/docs/
33 //
34 //  This file is part of FRSH API
35 //
36 //  FRSH API is free software; you can  redistribute it and/or  modify
37 //  it under the terms of  the GNU General Public License as published by
38 //  the Free Software Foundation;  either  version 2, or (at  your option)
39 //  any later version.
40 //
41 //  FRSH API  is distributed  in  the hope  that  it  will  be useful,  but
42 //  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
43 //  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
44 //  General Public License for more details.
45 //
46 //  You should have  received a  copy of  the  GNU  General Public License
47 //  distributed  with  FRSH API;  see file COPYING.   If not,  write to the
48 //  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
49 //  02111-1307, USA.
50 //
51 //  As a special exception, if you include this header file into source
52 //  files to be compiled, this header file does not by itself cause
53 //  the resulting executable to be covered by the GNU General Public
54 //  License.  This exception does not however invalidate any other
55 //  reasons why the executable file might be covered by the GNU General
56 //  Public License.
57 // -----------------------------------------------------------------------
58
59 //==============================================
60 //  ******** *******    ********  **      **
61 //  **///// /**////**  **//////  /**     /**
62 //  **      /**   /** /**        /**     /**
63 //  ******* /*******  /********* /**********
64 //  **////  /**///**  ////////** /**//////**
65 //  **      /**  //**        /** /**     /**
66 //  **      /**   //** ********  /**     /**
67 //  //       //     // ////////   //      //
68 //
69 // FRSH(FRescor ScHeduler), pronounced "fresh"
70 //==============================================
71
72 #ifndef   FRSH_DISTRIBUTED_TYPES_H_
73 #define   FRSH_DISTRIBUTED_TYPES_H_
74
75 /**
76  * @file frsh_distributed_types.h
77  **/
78
79 #include "frsh_opaque_types.h"
80
81 FRSH_CPP_BEGIN_DECLS
82
83 /**
84  * @addtogroup distributed
85  *
86  * @{
87  **/
88
89 //opaque types for frsh endpoints
90 typedef FRSH_SEND_ENDPOINT_T_OPAQUE frsh_send_endpoint_t;
91 typedef FRSH_RECEIVE_ENDPOINT_T_OPAQUE frsh_receive_endpoint_t;
92
93 /**
94  * The network_address type specifies the node or multicast address in
95  * a communication-protocol-independent way. The actual address is
96  * obtained via a configuration dependent mapping function
97  **/
98 typedef unsigned int frsh_network_address_t;
99
100 /**
101  * The port type specifies the information that is
102  * necessary to get in contact with the thread in the
103  * receiving node, in a protocol-independent way.
104  * The actual port number is obtained via a configuration
105  * dependent mapping function
106  **/
107 typedef unsigned int frsh_stream_id_t;
108
109 /**
110  * Extra information protocol dependent opaque for the application.
111  * It can be used in different places: contract negotiation, extra
112  * endpoint info, extra status info...
113  **/
114 typedef struct {
115     void *body;
116     int size;
117 } frsh_protocol_info_t;
118
119 /**
120  * Protocol dependent information about the status of an endpoint
121  **/
122 typedef struct {
123    void *body;
124    int size;
125 } frsh_protocol_status_t;
126
127 /**
128  * Protocol dependent information about extra parameters for
129  * send_endpoint definition.
130  **/
131 typedef struct {
132    void *body;
133    int size;
134 } frsh_send_endpoint_protocol_info_t;
135
136 /**
137  * Protocol dependent information about extra parameters for
138  * receive_endpoint definition.
139  **/
140 typedef struct {
141    void *body;
142    int size;
143 } frsh_receive_endpoint_protocol_info_t;
144
145 /**
146  * Algorithm used when the queue is full to choose the message to reject
147  **/
148 typedef enum {
149     /** A new message is admitted rejecting the oldest message in the
150         queue to make room for the newcomer **/
151     FRSH_QRP_OLDEST,
152
153     /** Incoming messages are rejected if the queue is full **/
154     FRSH_QRP_NEWCOMER
155 } frsh_queue_rejection_policy_t;
156
157 /**
158  * Queing information for endpoints
159  **/
160 typedef struct {
161     int queue_size;  /** Size 0 means that there is no queue **/
162     frsh_queue_rejection_policy_t queue_policy;
163 } frsh_endpoint_queueing_info_t;
164
165
166 typedef enum {
167     /** Network works OK **/
168     FRSH_ENS_UP,
169
170     /** Network is down **/
171     FRSH_ENS_DOWN
172 } frsh_endpoint_network_status_t;
173
174 /*@}*/
175
176 FRSH_CPP_END_DECLS
177
178 #endif  /* !FRSH_DISTRIBUTED_TYPES_H_ */