2 * $Id: typedefs_defines_rtps.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_DEFINES_RTPS_H
22 #define _TYPEDEFS_DEFINES_RTPS_H
28 #define RTPS_HEADER_LENGTH 16
30 #define MAX_PATHNAME 128
31 #define MAX_TYPENAME 128
35 typedef int8_t Boolean;
37 typedef int8_t PathName[MAX_PATHNAME];
38 typedef int8_t TypeName[MAX_TYPENAME];
40 typedef int32_t TypeChecksum;
42 /*****************************************************************/
43 /* Wire Protocol Specification (WPS) */
44 /*****************************************************************/
50 for example: IP address working nodes
52 typedef u_int32_t HostId;
53 #define HID_UNKNOWN 0x00
56 Application identifier.
58 composed from: 3 bytes - instance Id
59 1 byte - appKind (1 - ManagedApplication, 2 - Manager)
61 typedef u_int32_t AppId;
62 #define AID_UNKNOWN 0x00
63 #define MANAGEDAPPLICATION 0x01
69 composed from: 3 bytes - instance Id
72 typedef u_int32_t ObjectId;
74 #define OID_UNKNOWN 0x00000000
75 #define OID_APP 0x000001C1
76 #define OID_WRITE_APPSELF 0x000008C2
77 #define OID_READ_APPSELF 0x000008C7
78 #define OID_WRITE_APP 0x000001C2
79 #define OID_READ_APP 0x000001C7
80 #define OID_WRITE_MGR 0x000007C2
81 #define OID_READ_MGR 0x000007C7
82 #define OID_WRITE_PUBL 0x000003C2
83 #define OID_READ_PUBL 0x000003C7
84 #define OID_WRITE_SUBS 0x000004C2
85 #define OID_READ_SUBS 0x000004C7
87 #define OID_APPLICATION 0x01
88 #define OID_CSTWRITER 0x02
89 #define OID_PUBLICATION 0x03
90 #define OID_SUBSCRIPTION 0x04
91 #define OID_CSTREADER 0x07
93 #define OID_USEROBJ 0x00
94 #define OID_RESUSEROBJ 0x40
95 #define OID_METAOBJ 0x80
96 #define OID_RESMETAOBJ 0xC0
109 #define VENDOR_ID_UNKNOWN(id) {id.major=0;id.minor=0;}
110 #define VENDOR_ID_RTI(id) {id.major=1;id.minor=1;}
111 #define VENDOR_ID_OCERA(id) {id.major=0;id.minor=0;}
118 #define PROTOCOL_VERSION_1_0(pv) {pv.major=1;pv.minor=0;}
126 #define SEQUENCE_NUMBER_NONE(sn) {sn.high=0;sn.low=0;}
127 #define SEQUENCE_NUMBER_UNKNOWN(sn) {sn.high=0x7fffffff;sn.low=0xffffffff;}
131 int32_t seconds; /* time in seconds */
132 u_int32_t fraction; /* time in seconds / 2^32 */
135 #define NTPTIME_ZERO(t) {t.seconds=0;t.fraction=0;}
136 #define NTPTIME_BUILD(t,s) {t.seconds=s;t.fraction=0;}
137 #define NTPTIME_INFINITE(t) {t.seconds=0xffffffff;t.fraction=0;}
139 typedef u_int32_t IPAddress;
141 #define IPADDRESS_INVALID 0
143 typedef u_int32_t Port;
145 #define PORT_INVALID 0
162 ProtocolVersion sourceVersion;
163 VendorId sourceVendorId;
168 IPAddress unicastReplyIPAddress;
169 Port unicastReplyPort;
170 IPAddress multicastReplyIPAddress;
171 Port multicastReplyPort;
172 Boolean haveTimestamp;
178 #define PID_SENTINEL 0x01
179 #define PID_EXPIRATION_TIME 0x02
180 #define PID_PERSISTENCE 0x03
181 #define PID_MINIMUM_SEPARATION 0x04
182 #define PID_TOPIC 0x05
183 #define PID_STRENGTH 0x06
184 #define PID_TYPE_NAME 0x07
185 #define PID_TYPE_CHECKSUM 0x08
186 #define RTPS_PID_TYPE2_NAME 0x09
187 #define RTPS_PID_TYPE2_CHECKSUM 0x0a
188 #define PID_MATATRAFFIC_MULTICAST_IPADDRESS 0x0b
189 #define PID_APP_IPADDRESS 0x0c
190 #define PID_METATRAFFIC_UNICAST_PORT 0x0d
191 #define PID_USERDATA_UNICAST_PORT 0x0e
192 #define PID_IS_RELIABLE 0x0f
193 #define PID_EXPECTS_ACK 0x10
194 #define PID_USERDATA_MULTICAST_IPADDRESS 0x11
195 #define PID_MANAGER_KEY 0x12
196 #define PID_SEND_QUEUE_SIZE 0x13
197 #define PID_RELIABILITY_ENABLED 0x14
198 #define PID_PROTOCOL_VERSION 0x15
199 #define PID_VENDOR_ID 0x16
200 #define PID_VARGAPPS_SEQUENCE_NUMBER_LAST 0x17
201 #define PID_RECV_QUEUE_SIZE 0x18
202 #define PID_RELIABILITY_OFFERED 0x19
203 #define PID_RELIABILITY_REQUESTED 0x1a
205 /* possible values for PID_RELIABILITY_REQUEST */
206 #define PID_VALUE_RELIABILITY_BEST_EFFORTS 0x01
207 #define PID_VALUE_RELIABILITY_STRICT 0x02
209 typedef u_int16_t ParameterId;
210 typedef u_int16_t ParameterLength;
220 NOTHNIGTOSEND = 0x01,
228 UNACKNOWLEDGED = 0x04,
231 } StateMachineChFReader;
244 } StateMachineChFWriter;
250 #endif /* _TYPEDEFS_DEFINES_RTPS_H */