2 * $Id: typedefs_api.h,v 0.0.0.1 2003/08/21
4 * AUTHOR: Petr Smolik petr.smolik@wo.cz
6 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
7 * --------------------------------------------------------------------
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
21 #ifndef _TYPEDEFS_API_H
22 #define _TYPEDEFS_API_H
28 typedef struct ORTEDomain ORTEDomain; //forward declaration
29 typedef struct CSTWriter ORTEPublication; //forward declaration
30 typedef struct CSTReader ORTESubscription; //forward declaration
39 STRICT_RELIABLE = 0x02
52 typedef struct ORTEIFProp {
57 typedef struct ORTEMulticastProp {
60 Boolean loopBackEnabled;
64 typedef struct ORTECDRStream {
71 typedef void (*ORTETypeSerialize)(ORTECDRStream *cdr_stream, void *instance);
72 typedef void (*ORTETypeDeserialize)(ORTECDRStream *cdr_stream, void *instance);
75 * struct ORTETypeRegister -
77 typedef struct ORTETypeRegister {
79 ORTETypeSerialize serialize;
80 ORTETypeDeserialize deserialize;
81 unsigned int getMaxSize;
85 * struct ORTEDomainBaseProp -
87 typedef struct ORTEDomainBaseProp {
88 NtpTime expirationTime;
89 NtpTime refreshPeriod;
91 NtpTime repeatAnnounceTime;
92 NtpTime repeatActiveQueryTime;
93 NtpTime delayResponceTimeACKMin;
94 NtpTime delayResponceTimeACKMax;
95 unsigned int HBMaxRetries;
96 unsigned int ACKMaxRetries;
101 * struct ORTEDomainWireProp -
103 typedef struct ORTEDomainWireProp {
104 unsigned int metaBytesPerPacket;
105 unsigned int metaBytesPerFastPacket;
106 unsigned int metabitsPerACKBitmap;
107 unsigned int userMaxSerDeserSize;
108 } ORTEDomainWireProp;
111 * struct ORTEPublProp -
113 typedef struct ORTEPublProp {
116 TypeChecksum typeChecksum;
119 u_int32_t reliabilityOffered;
120 u_int32_t sendQueueSize;
122 //Additional properties
123 u_int32_t criticalQueueLevel;
124 NtpTime HBNornalRate;
126 unsigned int HBMaxRetries;
128 NtpTime maxBlockTime;
132 * struct ORTESubsProp -
134 typedef struct ORTESubsProp {
137 TypeChecksum typeChecksum;
138 NtpTime minimumSeparation;
139 u_int32_t recvQueueSize;
140 u_int32_t reliabilityRequested;
141 //additional parameters
147 * struct ORTEAppInfo -
149 typedef struct ORTEAppInfo {
152 IPAddress *unicastIPAddressList;
153 unsigned char unicastIPAddressCount;
154 IPAddress *metatrafficMulticastIPAddressList;
155 unsigned char metatrafficMulticastIPAddressCount;
156 Port metatrafficUnicastPort;
157 Port userdataUnicastPort;
159 ProtocolVersion protocolVersion;
163 * struct ORTEPubInfo -
165 typedef struct ORTEPubInfo {
172 * struct ORTEPubInfo -
174 typedef struct ORTESubInfo {
181 * struct ORTEPublStatus - status of a publication
182 * @reliable: count of reliable subscriptions (best effort) connected on responsible publication
183 * @unReliable: count of unreliable subscriptions (strict) connected on responsible publication
184 * @issues: number of messages in sending queue
185 * @unacknowledgedIssues: number of unacknowledged issues (only for best effort)
187 typedef struct ORTEPublStatus {
189 unsigned int bestEffort;
194 * struct ORTESubsStatus - status of a subscription
195 * @reliable: count of reliable publications (best effort) connected to responsible subscription
196 * @unReliable: count of unreliable publications (strict) connected to responsible subscription
197 * @issues: number of messages in receiving queue
199 * Current implementation has always issues=0. It means, that all messages were sent to user application
201 typedef struct ORTESubsStatus {
203 unsigned int bestEffort;
208 * struct ORTERecvInfo -
210 typedef struct ORTERecvInfo {
211 ORTERecvStatus status;
214 GUID_RTPS senderGUID;
215 NtpTime localTimeReceived;
216 NtpTime remoteTimePublished;
221 * struct ORTESendInfo -
223 typedef struct ORTESendInfo {
224 ORTESendStatus status;
227 GUID_RTPS senderGUID;
233 (*ORTERecvCallBack)(const ORTERecvInfo *info,void *instance, void *recvCallBackParam);
235 (*ORTESendCallBack)(const ORTESendInfo *info,void *instance, void *sendCallBackParam);
236 typedef ORTESubscription*
237 (*ORTESubscriptionPatternCallBack)(const char *topic, const char *nddsType, void *Param);
242 (*ORTEPatternCheck)(const char *string);
244 (*ORTEPatternMatch)(const char *topic,const char *pattern,void *param);
246 ORTEPatternCheckDefault(const char *topic);
248 ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param);
250 ORTEPatternRegister(ORTEDomain *d,ORTEPatternCheck check,
251 ORTEPatternMatch match,void *param);
255 (*ORTEOnMgrNew)(const struct ORTEAppInfo *appInfo, void *param);
257 (*ORTEOnMgrDelete)(const struct ORTEAppInfo *appInfo, void *param);
260 (*ORTEOnAppRemoteNew)(const struct ORTEAppInfo *appInfo, void *param);
261 typedef void (*ORTEOnAppDelete)
262 (const struct ORTEAppInfo *appInfo, void *param);
265 (*ORTEOnPubRemote)(const struct ORTEAppInfo *appInfo,
266 const struct ORTEPubInfo *pubInfo, void *param);
268 (*ORTEOnPubDelete)(const struct ORTEAppInfo *appInfo,
269 const struct ORTEPubInfo *pubInfo, void *param);
272 (*ORTEOnSubRemote)(const struct ORTEAppInfo *appInfo,
273 const struct ORTESubInfo *subInfo, void *param);
275 (*ORTEOnSubDelete)(const struct ORTEAppInfo *appInfo,
276 const struct ORTESubInfo *subInfo, void *param);
279 * struct ORTEDomainAppEvents - Domain events of an application
281 typedef struct ORTEDomainAppEvents {
282 ORTEOnMgrNew onMgrNew;
284 ORTEOnMgrDelete onMgrDelete;
285 void *onMgrDeleteParam;
286 ORTEOnAppRemoteNew onAppRemoteNew;
287 void *onAppRemoteNewParam;
288 ORTEOnAppDelete onAppDelete;
289 void *onAppDeleteParam;
290 ORTEOnPubRemote onPubRemoteNew;
291 void *onPubRemoteNewParam;
292 ORTEOnPubRemote onPubRemoteChanged;
293 void *onPubRemoteChangedParam;
294 ORTEOnPubDelete onPubDelete;
295 void *onPubDeleteParam;
296 ORTEOnSubRemote onSubRemoteNew;
297 void *onSubRemoteNewParam;
298 ORTEOnSubRemote onSubRemoteChanged;
299 void *onSubRemoteChangedParam;
300 ORTEOnSubDelete onSubDelete;
301 void *onSubDeleteParam;
302 } ORTEDomainAppEvents;
305 * struct ORTETaskProp -
307 typedef struct ORTETasksProp {
308 Boolean realTimeEnabled;
316 * struct ORTEDomainApp -
318 typedef struct ORTEDomainProp {
319 ORTETasksProp tasksProp;
320 ORTEIFProp IFProp[MAX_INTERFACES]; //interface properties
321 unsigned char IFCount; //count of interfaces
322 ORTEDomainBaseProp baseProp;
323 ORTEDomainWireProp wireProp;
324 ORTEMulticastProp multicast; //multicast properies
325 char *mgrs; //managers
326 IPAddress mgrAddKey; //keys
327 IPAddress appLocalManager; //applications
328 char version[60]; //string product version
337 #endif /* _TYPEDEFS_API_H */