2 * $Id: typedefs_defines_rtps.h,v 0.0.0.1 2003/08/21
4 * -------------------------------------------------------------------
6 * Open Real-Time Ethernet
8 * Copyright (C) 2001-2006
9 * Department of Control Engineering FEE CTU Prague, Czech Republic
10 * http://dce.felk.cvut.cz
11 * http://www.ocera.org
13 * Author: Petr Smolik petr@smoliku.cz
15 * Project Responsible: Zdenek Hanzalek
16 * --------------------------------------------------------------------
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
30 #ifndef _TYPEDEFS_DEFINES_RTPS_H
31 #define _TYPEDEFS_DEFINES_RTPS_H
37 #define RTPS_HEADER_LENGTH 16
39 #define MAX_PATHNAME 128
40 #define MAX_TYPENAME 128
44 typedef int8_t Boolean;
46 typedef int8_t PathName[MAX_PATHNAME];
47 typedef int8_t TypeName[MAX_TYPENAME];
49 typedef int32_t TypeChecksum;
51 /*****************************************************************/
52 /* Wire Protocol Specification (WPS) */
53 /*****************************************************************/
59 for example: IP address working nodes
61 typedef uint32_t HostId;
62 #define HID_UNKNOWN 0x00
65 Application identifier.
67 composed from: 3 bytes - instance Id
68 1 byte - appKind (1 - ManagedApplication, 2 - Manager)
70 typedef uint32_t AppId;
71 #define AID_UNKNOWN 0x00
72 #define MANAGEDAPPLICATION 0x01
78 composed from: 3 bytes - instance Id
81 typedef uint32_t ObjectId;
83 #define OID_UNKNOWN 0x00000000
84 #define OID_APP 0x000001C1
85 #define OID_WRITE_APPSELF 0x000008C2
86 #define OID_READ_APPSELF 0x000008C7
87 #define OID_WRITE_APP 0x000001C2
88 #define OID_READ_APP 0x000001C7
89 #define OID_WRITE_MGR 0x000007C2
90 #define OID_READ_MGR 0x000007C7
91 #define OID_WRITE_PUBL 0x000003C2
92 #define OID_READ_PUBL 0x000003C7
93 #define OID_WRITE_SUBS 0x000004C2
94 #define OID_READ_SUBS 0x000004C7
96 #define OID_APPLICATION 0x01
97 #define OID_CSTWRITER 0x02
98 #define OID_PUBLICATION 0x03
99 #define OID_SUBSCRIPTION 0x04
100 #define OID_CSTREADER 0x07
102 #define OID_USEROBJ 0x00
103 #define OID_RESUSEROBJ 0x40
104 #define OID_METAOBJ 0x80
105 #define OID_RESMETAOBJ 0xC0
118 #define VENDOR_ID_UNKNOWN(id) {id.major = 0; id.minor = 0; }
119 #define VENDOR_ID_RTI(id) {id.major = 1; id.minor = 1; }
120 #define VENDOR_ID_OCERA(id) {id.major = 0; id.minor = 0; }
127 #define PROTOCOL_VERSION_1_0(pv) {pv.major = 1; pv.minor = 0; }
135 #define SEQUENCE_NUMBER_NONE(sn) {sn.high = 0; sn.low = 0; }
136 #define SEQUENCE_NUMBER_UNKNOWN(sn) {sn.high = 0x7fffffff; sn.low = 0xffffffff; }
140 int32_t seconds; /* time in seconds */
141 uint32_t fraction; /* time in seconds / 2^32 */
144 #define NTPTIME_ZERO(t) {t.seconds = 0; t.fraction = 0; }
145 #define NTPTIME_BUILD(t, s) {t.seconds = s; t.fraction = 0; }
146 #define NTPTIME_INFINITE(t) {t.seconds = 0xffffffff; t.fraction = 0; }
148 typedef uint32_t IPAddress;
150 #define IPADDRESS_INVALID 0
152 typedef uint32_t Port;
154 #define PORT_INVALID 0
171 ProtocolVersion sourceVersion;
172 VendorId sourceVendorId;
177 IPAddress unicastReplyIPAddress;
178 Port unicastReplyPort;
179 IPAddress multicastReplyIPAddress;
180 Port multicastReplyPort;
181 Boolean haveTimestamp;
187 #define PID_SENTINEL 0x01
188 #define PID_EXPIRATION_TIME 0x02
189 #define PID_PERSISTENCE 0x03
190 #define PID_MINIMUM_SEPARATION 0x04
191 #define PID_TOPIC 0x05
192 #define PID_STRENGTH 0x06
193 #define PID_TYPE_NAME 0x07
194 #define PID_TYPE_CHECKSUM 0x08
195 #define RTPS_PID_TYPE2_NAME 0x09
196 #define RTPS_PID_TYPE2_CHECKSUM 0x0a
197 #define PID_MATATRAFFIC_MULTICAST_IPADDRESS 0x0b
198 #define PID_APP_IPADDRESS 0x0c
199 #define PID_METATRAFFIC_UNICAST_PORT 0x0d
200 #define PID_USERDATA_UNICAST_PORT 0x0e
201 #define PID_IS_RELIABLE 0x0f
202 #define PID_EXPECTS_ACK 0x10
203 #define PID_USERDATA_MULTICAST_IPADDRESS 0x11
204 #define PID_MANAGER_KEY 0x12
205 #define PID_SEND_QUEUE_SIZE 0x13
206 #define PID_RELIABILITY_ENABLED 0x14
207 #define PID_PROTOCOL_VERSION 0x15
208 #define PID_VENDOR_ID 0x16
209 #define PID_VARGAPPS_SEQUENCE_NUMBER_LAST 0x17
210 #define PID_RECV_QUEUE_SIZE 0x18
211 #define PID_RELIABILITY_OFFERED 0x19
212 #define PID_RELIABILITY_REQUESTED 0x1a
214 /* possible values for PID_RELIABILITY_REQUEST */
215 #define PID_VALUE_RELIABILITY_BEST_EFFORTS 0x01
216 #define PID_VALUE_RELIABILITY_STRICT 0x02
218 typedef uint16_t ParameterId;
219 typedef uint16_t ParameterLength;
229 NOTHNIGTOSEND = 0x01,
237 UNACKNOWLEDGED = 0x04,
240 } StateMachineChFReader;
253 } StateMachineChFWriter;
259 #endif /* _TYPEDEFS_DEFINES_RTPS_H */