RTI Connext Micro  Version 2.4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
netio_common.h
Go to the documentation of this file.
1 /*
2  * FILE: netio_common.h - NETIO Common API
3  *
4  * Copyright 2012-2014 Real-Time Innovations, Inc.
5  *
6  * No duplications, whole or partial, manual or electronic, may be made
7  * without express written permission. Any such copies, or
8  * revisions thereof, must display this notice unaltered.
9  * This code contains trade secrets of Real-Time Innovations, Inc.
10  *
11  * Modification History
12  * --------------------
13  * 25apr2012,tk Written
14  */
15 /*ce
16  * \file
17  */
18 /*ci \defgroup NETIOCommon NETIO Common API
19  * \ingroup NETIOModule
20  * \brief NETIO APIs available to all NETIO interface
21  */
22 /*ci \defgroup NETIOUtility NETIO Utility API
23  * \ingroup NETIOCommon
24  * \brief Utility function provided by the NETIO module
25  */
26 /*ci \addtogroup NETIOUtility
27  * @{
28  */
29 #ifndef netio_common_h
30 #define netio_common_h
31 
32 #include <errno.h>
33 #include <string.h>
34 
35 #if defined(RTI_VXWORKS)
36 #include <vxWorks.h>
37 #ifndef RTI_CERT
38 #include <net/if.h>
39 #include <netinet/in.h>
40 #include <sockLib.h>
41 #include <ioctl.h>
42 #include <ioLib.h>
43 #else
44 #include <certStack/tStkIn.h>
45 #include <certStack/tStkSocket.h>
46 #include <certStack/tStkSockLib.h>
47 #include <certStack/tStkIf.h>
48 #endif
49 #ifdef RTI_RTP
50  #include <strings.h>
51 #endif /* RTI_VXWORKS */
52 #elif defined(RTI_WIN32)
53 #include <winsock2.h>
54 #include <ws2tcpip.h>
55 #ifndef EADDRINUSE
56 #define EADDRINUSE WSAEADDRINUSE
57 #endif
58 #ifndef EWOULDBLOCK
59 #define EWOULDBLOCK WSAEWOULDBLOCK
60 #endif
61 #elif defined(RTI_UNIX) || defined(RTI_DARWIN)
62 #include <sys/socket.h>
63 #include <netinet/in.h>
64 #include <arpa/inet.h>
65 #include <net/if.h>
66 #include <netdb.h>
67 #elif defined(LWIP_SYS)
68 #include "lwip/arch.h"
69 #if defined(HAVE_SOCKET_API)
70 #include "lwip/sockets.h"
71 #include "lwip/netdb.h"
72 #endif
73 #endif
74 
75 #ifndef osapi_types_h
76 #include "osapi/osapi_types.h"
77 #endif
78 #ifndef reda_buffer_h
79 #include "reda/reda_buffer.h"
80 #endif
81 #ifndef netio_dll_h
82 #include "netio/netio_dll.h"
83 #endif
84 
85 #ifdef __cplusplus
86 extern "C"
87 {
88 #endif
89 
90 /*ci
91  * \def NETIO_ntohs
92  * \brief Convert a short integer (16bit) received from an IP network to a
93  * short in host order
94  */
95 #define NETIO_ntohs ntohs
96 
97 /*ci
98  * \def NETIO_htons
99  * \brief Convert a short integer (16bit) in host order a to short integer
100  * IP network order
101  */
102 #define NETIO_htons htons
103 
104 /*ci
105  * \def NETIO_ntohl
106  * \brief Convert a long integer (32bit) received from an IP network to a
107  * long in host order
108  */
109 #define NETIO_ntohl ntohl
110 
111 /*ci
112  * \def NETIO_htonl
113  * \brief Convert a short integer (32bit) in host order a to long integer
114  * IP network order
115  */
116 #define NETIO_htonl htonl
117 
118 /*ci
119  * \def NETIO_PING_MSG
120  * \brief Internal RTPS ping message which serves prime ARP table when a
121  * destination address is addded.
122  */
123 #define NETIO_PING_MSG "RTIPING"
124 
125 /*ci
126  * \def NETIO_PING_MSG_SIZE
127  * \brief The length in bytes, excluding the NUL character, of internal
128  * ping message
129  */
130 #define NETIO_PING_MSG_SIZE (7)
131 
132 #if RTI_ENDIAN_LITTLE
133 #define NETIO_INFO_TS_PING_MSG "RTPS\2\1\1\1\0\0\0\0\0\0\0\0\0\0\0\0\x9\x3\0\0"
134 #else
135 #define NETIO_INFO_TS_PING_MSG "RTPS\2\1\1\1\0\0\0\0\0\0\0\0\0\0\0\0\x9\x2\0\0"
136 #endif
137 #define NETIO_INFO_TS_PING_MSG_SIZE (24)
138 
139 
140 #define NETIO_CONNEXT_PING_MSG_SIZE (16)
141 #define NETIO_CONNEXT_PING_MSG "RTPS\2\1\1\1NDDSPING"
142 
143 #ifdef __cplusplus
144 } /* extern "C" */
145 #endif
146 
147 #endif /* netio_common_h */
148 
149 /*ci @} */

RTI Connext Micro Version 2.4.1.0 Copyright © Thu Nov 20 2014 Real-Time Innovations, Inc