A Port of TI's Webserver for the CC3000

Dependencies:   mbed

Committer:
dflet
Date:
Mon Sep 16 18:37:14 2013 +0000
Revision:
2:e6a185df9e4c
Parent:
0:6ad60d78b315
ADC and Leds now work on board and config.html page.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:6ad60d78b315 1 /*****************************************************************************
dflet 0:6ad60d78b315 2 *
dflet 0:6ad60d78b315 3 * socket.h - CC3000 Host Driver Implementation.
dflet 0:6ad60d78b315 4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
dflet 0:6ad60d78b315 5 *
dflet 0:6ad60d78b315 6 * Redistribution and use in source and binary forms, with or without
dflet 0:6ad60d78b315 7 * modification, are permitted provided that the following conditions
dflet 0:6ad60d78b315 8 * are met:
dflet 0:6ad60d78b315 9 *
dflet 0:6ad60d78b315 10 * Redistributions of source code must retain the above copyright
dflet 0:6ad60d78b315 11 * notice, this list of conditions and the following disclaimer.
dflet 0:6ad60d78b315 12 *
dflet 0:6ad60d78b315 13 * Redistributions in binary form must reproduce the above copyright
dflet 0:6ad60d78b315 14 * notice, this list of conditions and the following disclaimer in the
dflet 0:6ad60d78b315 15 * documentation and/or other materials provided with the
dflet 0:6ad60d78b315 16 * distribution.
dflet 0:6ad60d78b315 17 *
dflet 0:6ad60d78b315 18 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 0:6ad60d78b315 19 * its contributors may be used to endorse or promote products derived
dflet 0:6ad60d78b315 20 * from this software without specific prior written permission.
dflet 0:6ad60d78b315 21 *
dflet 0:6ad60d78b315 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 0:6ad60d78b315 23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 0:6ad60d78b315 24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 0:6ad60d78b315 25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 0:6ad60d78b315 26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 0:6ad60d78b315 27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 0:6ad60d78b315 28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 0:6ad60d78b315 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 0:6ad60d78b315 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 0:6ad60d78b315 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 0:6ad60d78b315 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 0:6ad60d78b315 33 *
dflet 0:6ad60d78b315 34 *****************************************************************************/
dflet 0:6ad60d78b315 35 #ifndef __SOCKET_H__
dflet 0:6ad60d78b315 36 #define __SOCKET_H__
dflet 0:6ad60d78b315 37
dflet 0:6ad60d78b315 38
dflet 0:6ad60d78b315 39 //*****************************************************************************
dflet 0:6ad60d78b315 40 //
dflet 0:6ad60d78b315 41 //! \addtogroup socket_api
dflet 0:6ad60d78b315 42 //! @{
dflet 0:6ad60d78b315 43 //
dflet 0:6ad60d78b315 44 //*****************************************************************************
dflet 0:6ad60d78b315 45
dflet 0:6ad60d78b315 46
dflet 0:6ad60d78b315 47 //*****************************************************************************
dflet 0:6ad60d78b315 48 //
dflet 0:6ad60d78b315 49 // If building with a C++ compiler, make all of the definitions in this header
dflet 0:6ad60d78b315 50 // have a C binding.
dflet 0:6ad60d78b315 51 //
dflet 0:6ad60d78b315 52 //*****************************************************************************
dflet 0:6ad60d78b315 53 #ifdef __cplusplus
dflet 0:6ad60d78b315 54 extern "C" {
dflet 0:6ad60d78b315 55 #endif
dflet 0:6ad60d78b315 56
dflet 0:6ad60d78b315 57 #define HOSTNAME_MAX_LENGTH (230) // 230 bytes + header shouldn't exceed 8 bit value
dflet 0:6ad60d78b315 58
dflet 0:6ad60d78b315 59 //--------- Address Families --------
dflet 0:6ad60d78b315 60
dflet 0:6ad60d78b315 61 #define AF_INET 2
dflet 0:6ad60d78b315 62 #define AF_INET6 23
dflet 0:6ad60d78b315 63
dflet 0:6ad60d78b315 64 //------------ Socket Types ------------
dflet 0:6ad60d78b315 65
dflet 0:6ad60d78b315 66 #define SOCK_STREAM 1
dflet 0:6ad60d78b315 67 #define SOCK_DGRAM 2
dflet 0:6ad60d78b315 68 #define SOCK_RAW 3 // Raw sockets allow new IPv4 protocols to be implemented in user space. A raw socket receives or sends the raw datagram not including link level headers
dflet 0:6ad60d78b315 69 #define SOCK_RDM 4
dflet 0:6ad60d78b315 70 #define SOCK_SEQPACKET 5
dflet 0:6ad60d78b315 71
dflet 0:6ad60d78b315 72 //----------- Socket Protocol ----------
dflet 0:6ad60d78b315 73
dflet 0:6ad60d78b315 74 #define IPPROTO_IP 0 // dummy for IP
dflet 0:6ad60d78b315 75 #define IPPROTO_ICMP 1 // control message protocol
dflet 0:6ad60d78b315 76 #define IPPROTO_IPV4 IPPROTO_IP // IP inside IP
dflet 0:6ad60d78b315 77 #define IPPROTO_TCP 6 // tcp
dflet 0:6ad60d78b315 78 #define IPPROTO_UDP 17 // user datagram protocol
dflet 0:6ad60d78b315 79 #define IPPROTO_IPV6 41 // IPv6 in IPv6
dflet 0:6ad60d78b315 80 #define IPPROTO_NONE 59 // No next header
dflet 0:6ad60d78b315 81 #define IPPROTO_RAW 255 // raw IP packet
dflet 0:6ad60d78b315 82 #define IPPROTO_MAX 256
dflet 0:6ad60d78b315 83
dflet 0:6ad60d78b315 84 //----------- Socket retunr codes -----------
dflet 0:6ad60d78b315 85
dflet 0:6ad60d78b315 86 #define SOC_ERROR (-1) // error
dflet 0:6ad60d78b315 87 #define SOC_IN_PROGRESS (-2) // socket in progress
dflet 0:6ad60d78b315 88
dflet 0:6ad60d78b315 89 //----------- Socket Options -----------
dflet 0:6ad60d78b315 90 #define SOL_SOCKET 0xffff // socket level
dflet 0:6ad60d78b315 91 #define SOCKOPT_RECV_NONBLOCK 0 // recv non block mode, set SOCK_ON or SOCK_OFF (default block mode)
dflet 0:6ad60d78b315 92 #define SOCKOPT_RECV_TIMEOUT 1 // optname to configure recv and recvfromtimeout
dflet 0:6ad60d78b315 93 #define SOCKOPT_ACCEPT_NONBLOCK 2 // accept non block mode, set SOCK_ON or SOCK_OFF (default block mode)
dflet 0:6ad60d78b315 94 #define SOCK_ON 0 // socket non-blocking mode is enabled
dflet 0:6ad60d78b315 95 #define SOCK_OFF 1 // socket blocking mode is enabled
dflet 0:6ad60d78b315 96
dflet 0:6ad60d78b315 97 #define TCP_NODELAY 0x0001
dflet 0:6ad60d78b315 98 #define TCP_BSDURGENT 0x7000
dflet 0:6ad60d78b315 99
dflet 0:6ad60d78b315 100 #define MAX_PACKET_SIZE 1500
dflet 0:6ad60d78b315 101 #define MAX_LISTEN_QUEUE 4
dflet 0:6ad60d78b315 102
dflet 0:6ad60d78b315 103 #define IOCTL_SOCKET_EVENTMASK
dflet 0:6ad60d78b315 104
dflet 0:6ad60d78b315 105 #define ENOBUFS 55 // No buffer space available
dflet 0:6ad60d78b315 106
dflet 0:6ad60d78b315 107 #define __FD_SETSIZE 32
dflet 0:6ad60d78b315 108
dflet 0:6ad60d78b315 109 #define ASIC_ADDR_LEN 8
dflet 0:6ad60d78b315 110
dflet 0:6ad60d78b315 111 #define NO_QUERY_RECIVED -3
dflet 0:6ad60d78b315 112
dflet 0:6ad60d78b315 113
dflet 0:6ad60d78b315 114 typedef struct _in_addr_t
dflet 0:6ad60d78b315 115 {
dflet 0:6ad60d78b315 116 unsigned long s_addr; // load with inet_aton()
dflet 0:6ad60d78b315 117 } in_addr;
dflet 0:6ad60d78b315 118
dflet 0:6ad60d78b315 119 typedef struct _sockaddr_t
dflet 0:6ad60d78b315 120 {
dflet 0:6ad60d78b315 121 unsigned short int sa_family;
dflet 0:6ad60d78b315 122 unsigned char sa_data[14];
dflet 0:6ad60d78b315 123 } sockaddr;
dflet 0:6ad60d78b315 124
dflet 0:6ad60d78b315 125 typedef struct _sockaddr_in_t
dflet 0:6ad60d78b315 126 {
dflet 0:6ad60d78b315 127 short sin_family; // e.g. AF_INET
dflet 0:6ad60d78b315 128 unsigned short sin_port; // e.g. htons(3490)
dflet 0:6ad60d78b315 129 in_addr sin_addr; // see struct in_addr, below
dflet 0:6ad60d78b315 130 char sin_zero[8]; // zero this if you want to
dflet 0:6ad60d78b315 131 } sockaddr_in;
dflet 0:6ad60d78b315 132
dflet 0:6ad60d78b315 133 typedef unsigned long socklen_t;
dflet 0:6ad60d78b315 134
dflet 0:6ad60d78b315 135 // The fd_set member is required to be an array of longs.
dflet 0:6ad60d78b315 136 typedef long int __fd_mask;
dflet 0:6ad60d78b315 137
dflet 0:6ad60d78b315 138 // It's easier to assume 8-bit bytes than to get CHAR_BIT.
dflet 0:6ad60d78b315 139 #define __NFDBITS (8 * sizeof (__fd_mask))
dflet 0:6ad60d78b315 140 #define __FDELT(d) ((d) / __NFDBITS)
dflet 0:6ad60d78b315 141 #define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
dflet 0:6ad60d78b315 142
dflet 0:6ad60d78b315 143 // fd_set for select and pselect.
dflet 0:6ad60d78b315 144 typedef struct
dflet 0:6ad60d78b315 145 {
dflet 0:6ad60d78b315 146 __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
dflet 0:6ad60d78b315 147 #define __FDS_BITS(set) ((set)->fds_bits)
dflet 0:6ad60d78b315 148 } fd_set;
dflet 0:6ad60d78b315 149
dflet 0:6ad60d78b315 150 // We don't use `memset' because this would require a prototype and
dflet 0:6ad60d78b315 151 // the array isn't too big.
dflet 0:6ad60d78b315 152 #define __FD_ZERO(set) \
dflet 0:6ad60d78b315 153 do { \
dflet 0:6ad60d78b315 154 unsigned int __i; \
dflet 0:6ad60d78b315 155 fd_set *__arr = (set); \
dflet 0:6ad60d78b315 156 for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
dflet 0:6ad60d78b315 157 __FDS_BITS (__arr)[__i] = 0; \
dflet 0:6ad60d78b315 158 } while (0)
dflet 0:6ad60d78b315 159 #define __FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d))
dflet 0:6ad60d78b315 160 #define __FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d))
dflet 0:6ad60d78b315 161 #define __FD_ISSET(d, set) (__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d))
dflet 0:6ad60d78b315 162
dflet 0:6ad60d78b315 163 // Access macros for 'fd_set'.
dflet 0:6ad60d78b315 164 #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
dflet 0:6ad60d78b315 165 #define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
dflet 0:6ad60d78b315 166 #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
dflet 0:6ad60d78b315 167 #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
dflet 0:6ad60d78b315 168
dflet 0:6ad60d78b315 169 //Use in case of Big Endian only
dflet 0:6ad60d78b315 170
dflet 0:6ad60d78b315 171 #define htonl(A) ((((unsigned long)(A) & 0xff000000) >> 24) | \
dflet 0:6ad60d78b315 172 (((unsigned long)(A) & 0x00ff0000) >> 8) | \
dflet 0:6ad60d78b315 173 (((unsigned long)(A) & 0x0000ff00) << 8) | \
dflet 0:6ad60d78b315 174 (((unsigned long)(A) & 0x000000ff) << 24))
dflet 0:6ad60d78b315 175
dflet 0:6ad60d78b315 176 #define ntohl htonl
dflet 0:6ad60d78b315 177
dflet 0:6ad60d78b315 178 //Use in case of Big Endian only
dflet 0:6ad60d78b315 179 #define htons(A) ((((unsigned long)(A) & 0xff00) >> 8) | \
dflet 0:6ad60d78b315 180 (((unsigned long)(A) & 0x00ff) << 8))
dflet 0:6ad60d78b315 181
dflet 0:6ad60d78b315 182
dflet 0:6ad60d78b315 183 #define ntohs htons
dflet 0:6ad60d78b315 184
dflet 0:6ad60d78b315 185 // mDNS port - 5353 mDNS multicast address - 224.0.0.251
dflet 0:6ad60d78b315 186 #define SET_mDNS_ADD(sockaddr) sockaddr.sa_data[0] = 0x14; \
dflet 0:6ad60d78b315 187 sockaddr.sa_data[1] = 0xe9; \
dflet 0:6ad60d78b315 188 sockaddr.sa_data[2] = 0xe0; \
dflet 0:6ad60d78b315 189 sockaddr.sa_data[3] = 0x0; \
dflet 0:6ad60d78b315 190 sockaddr.sa_data[4] = 0x0; \
dflet 0:6ad60d78b315 191 sockaddr.sa_data[5] = 0xfb;
dflet 0:6ad60d78b315 192
dflet 0:6ad60d78b315 193
dflet 0:6ad60d78b315 194 //*****************************************************************************
dflet 0:6ad60d78b315 195 //
dflet 0:6ad60d78b315 196 // Prototypes for the APIs.
dflet 0:6ad60d78b315 197 //
dflet 0:6ad60d78b315 198 //*****************************************************************************
dflet 0:6ad60d78b315 199
dflet 0:6ad60d78b315 200 //*****************************************************************************
dflet 0:6ad60d78b315 201 //
dflet 0:6ad60d78b315 202 //! socket
dflet 0:6ad60d78b315 203 //!
dflet 0:6ad60d78b315 204 //! @param domain selects the protocol family which will be used for
dflet 0:6ad60d78b315 205 //! communication. On this version only AF_INET is supported
dflet 0:6ad60d78b315 206 //! @param type specifies the communication semantics. On this version
dflet 0:6ad60d78b315 207 //! only SOCK_STREAM, SOCK_DGRAM, SOCK_RAW are supported
dflet 0:6ad60d78b315 208 //! @param protocol specifies a particular protocol to be used with the
dflet 0:6ad60d78b315 209 //! socket IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW are
dflet 0:6ad60d78b315 210 //! supported.
dflet 0:6ad60d78b315 211 //!
dflet 0:6ad60d78b315 212 //! @return On success, socket handle that is used for consequent socket
dflet 0:6ad60d78b315 213 //! operations. On error, -1 is returned.
dflet 0:6ad60d78b315 214 //!
dflet 0:6ad60d78b315 215 //! @brief create an endpoint for communication
dflet 0:6ad60d78b315 216 //! The socket function creates a socket that is bound to a specific
dflet 0:6ad60d78b315 217 //! transport service provider. This function is called by the
dflet 0:6ad60d78b315 218 //! application layer to obtain a socket handle.
dflet 0:6ad60d78b315 219 //
dflet 0:6ad60d78b315 220 //*****************************************************************************
dflet 0:6ad60d78b315 221 extern int socket(long domain, long type, long protocol);
dflet 0:6ad60d78b315 222
dflet 0:6ad60d78b315 223 //*****************************************************************************
dflet 0:6ad60d78b315 224 //
dflet 0:6ad60d78b315 225 //! closesocket
dflet 0:6ad60d78b315 226 //!
dflet 0:6ad60d78b315 227 //! @param sd socket handle.
dflet 0:6ad60d78b315 228 //!
dflet 0:6ad60d78b315 229 //! @return On success, zero is returned. On error, -1 is returned.
dflet 0:6ad60d78b315 230 //!
dflet 0:6ad60d78b315 231 //! @brief The socket function closes a created socket.
dflet 0:6ad60d78b315 232 //
dflet 0:6ad60d78b315 233 //*****************************************************************************
dflet 0:6ad60d78b315 234 extern long closesocket(long sd);
dflet 0:6ad60d78b315 235
dflet 0:6ad60d78b315 236 //*****************************************************************************
dflet 0:6ad60d78b315 237 //
dflet 0:6ad60d78b315 238 //! accept
dflet 0:6ad60d78b315 239 //!
dflet 0:6ad60d78b315 240 //! @param[in] sd socket descriptor (handle)
dflet 0:6ad60d78b315 241 //! @param[out] addr the argument addr is a pointer to a sockaddr structure
dflet 0:6ad60d78b315 242 //! This structure is filled in with the address of the
dflet 0:6ad60d78b315 243 //! peer socket, as known to the communications layer.
dflet 0:6ad60d78b315 244 //! determined. The exact format of the address returned
dflet 0:6ad60d78b315 245 //! addr is by the socket's address sockaddr.
dflet 0:6ad60d78b315 246 //! On this version only AF_INET is supported.
dflet 0:6ad60d78b315 247 //! This argument returns in network order.
dflet 0:6ad60d78b315 248 //! @param[out] addrlen the addrlen argument is a value-result argument:
dflet 0:6ad60d78b315 249 //! it should initially contain the size of the structure
dflet 0:6ad60d78b315 250 //! pointed to by addr.
dflet 0:6ad60d78b315 251 //!
dflet 0:6ad60d78b315 252 //! @return For socket in blocking mode:
dflet 0:6ad60d78b315 253 //! On success, socket handle. on failure negative
dflet 0:6ad60d78b315 254 //! For socket in non-blocking mode:
dflet 0:6ad60d78b315 255 //! - On connection establishment, socket handle
dflet 0:6ad60d78b315 256 //! - On connection pending, SOC_IN_PROGRESS (-2)
dflet 0:6ad60d78b315 257 //! - On failure, SOC_ERROR (-1)
dflet 0:6ad60d78b315 258 //!
dflet 0:6ad60d78b315 259 //! @brief accept a connection on a socket:
dflet 0:6ad60d78b315 260 //! This function is used with connection-based socket types
dflet 0:6ad60d78b315 261 //! (SOCK_STREAM). It extracts the first connection request on the
dflet 0:6ad60d78b315 262 //! queue of pending connections, creates a new connected socket, and
dflet 0:6ad60d78b315 263 //! returns a new file descriptor referring to that socket.
dflet 0:6ad60d78b315 264 //! The newly created socket is not in the listening state.
dflet 0:6ad60d78b315 265 //! The original socket sd is unaffected by this call.
dflet 0:6ad60d78b315 266 //! The argument sd is a socket that has been created with socket(),
dflet 0:6ad60d78b315 267 //! bound to a local address with bind(), and is listening for
dflet 0:6ad60d78b315 268 //! connections after a listen(). The argument addr is a pointer
dflet 0:6ad60d78b315 269 //! to a sockaddr structure. This structure is filled in with the
dflet 0:6ad60d78b315 270 //! address of the peer socket, as known to the communications layer.
dflet 0:6ad60d78b315 271 //! The exact format of the address returned addr is determined by the
dflet 0:6ad60d78b315 272 //! socket's address family. The addrlen argument is a value-result
dflet 0:6ad60d78b315 273 //! argument: it should initially contain the size of the structure
dflet 0:6ad60d78b315 274 //! pointed to by addr, on return it will contain the actual
dflet 0:6ad60d78b315 275 //! length (in bytes) of the address returned.
dflet 0:6ad60d78b315 276 //!
dflet 0:6ad60d78b315 277 //! @sa socket ; bind ; listen
dflet 0:6ad60d78b315 278 //
dflet 0:6ad60d78b315 279 //*****************************************************************************
dflet 0:6ad60d78b315 280 extern long accept(long sd, sockaddr *addr, socklen_t *addrlen);
dflet 0:6ad60d78b315 281
dflet 0:6ad60d78b315 282 //*****************************************************************************
dflet 0:6ad60d78b315 283 //
dflet 0:6ad60d78b315 284 //! bind
dflet 0:6ad60d78b315 285 //!
dflet 0:6ad60d78b315 286 //! @param[in] sd socket descriptor (handle)
dflet 0:6ad60d78b315 287 //! @param[out] addr specifies the destination address. On this version
dflet 0:6ad60d78b315 288 //! only AF_INET is supported.
dflet 0:6ad60d78b315 289 //! @param[out] addrlen contains the size of the structure pointed to by addr.
dflet 0:6ad60d78b315 290 //!
dflet 0:6ad60d78b315 291 //! @return On success, zero is returned. On error, -1 is returned.
dflet 0:6ad60d78b315 292 //!
dflet 0:6ad60d78b315 293 //! @brief assign a name to a socket
dflet 0:6ad60d78b315 294 //! This function gives the socket the local address addr.
dflet 0:6ad60d78b315 295 //! addr is addrlen bytes long. Traditionally, this is called when a
dflet 0:6ad60d78b315 296 //! socket is created with socket, it exists in a name space (address
dflet 0:6ad60d78b315 297 //! family) but has no name assigned.
dflet 0:6ad60d78b315 298 //! It is necessary to assign a local address before a SOCK_STREAM
dflet 0:6ad60d78b315 299 //! socket may receive connections.
dflet 0:6ad60d78b315 300 //!
dflet 0:6ad60d78b315 301 //! @sa socket ; accept ; listen
dflet 0:6ad60d78b315 302 //
dflet 0:6ad60d78b315 303 //*****************************************************************************
dflet 0:6ad60d78b315 304 extern long bind(long sd, const sockaddr *addr, long addrlen);
dflet 0:6ad60d78b315 305
dflet 0:6ad60d78b315 306 //*****************************************************************************
dflet 0:6ad60d78b315 307 //
dflet 0:6ad60d78b315 308 //! listen
dflet 0:6ad60d78b315 309 //!
dflet 0:6ad60d78b315 310 //! @param[in] sd socket descriptor (handle)
dflet 0:6ad60d78b315 311 //! @param[in] backlog specifies the listen queue depth. On this version
dflet 0:6ad60d78b315 312 //! backlog is not supported.
dflet 0:6ad60d78b315 313 //! @return On success, zero is returned. On error, -1 is returned.
dflet 0:6ad60d78b315 314 //!
dflet 0:6ad60d78b315 315 //! @brief listen for connections on a socket
dflet 0:6ad60d78b315 316 //! The willingness to accept incoming connections and a queue
dflet 0:6ad60d78b315 317 //! limit for incoming connections are specified with listen(),
dflet 0:6ad60d78b315 318 //! and then the connections are accepted with accept.
dflet 0:6ad60d78b315 319 //! The listen() call applies only to sockets of type SOCK_STREAM
dflet 0:6ad60d78b315 320 //! The backlog parameter defines the maximum length the queue of
dflet 0:6ad60d78b315 321 //! pending connections may grow to.
dflet 0:6ad60d78b315 322 //!
dflet 0:6ad60d78b315 323 //! @sa socket ; accept ; bind
dflet 0:6ad60d78b315 324 //!
dflet 0:6ad60d78b315 325 //! @note On this version, backlog is not supported
dflet 0:6ad60d78b315 326 //
dflet 0:6ad60d78b315 327 //*****************************************************************************
dflet 0:6ad60d78b315 328 extern long listen(long sd, long backlog);
dflet 0:6ad60d78b315 329
dflet 0:6ad60d78b315 330 //*****************************************************************************
dflet 0:6ad60d78b315 331 //
dflet 0:6ad60d78b315 332 //! gethostbyname
dflet 0:6ad60d78b315 333 //!
dflet 0:6ad60d78b315 334 //! @param[in] hostname host name
dflet 0:6ad60d78b315 335 //! @param[in] usNameLen name length
dflet 0:6ad60d78b315 336 //! @param[out] out_ip_addr This parameter is filled in with host IP address.
dflet 0:6ad60d78b315 337 //! In case that host name is not resolved,
dflet 0:6ad60d78b315 338 //! out_ip_addr is zero.
dflet 0:6ad60d78b315 339 //! @return On success, positive is returned. On error, negative is returned
dflet 0:6ad60d78b315 340 //!
dflet 0:6ad60d78b315 341 //! @brief Get host IP by name. Obtain the IP Address of machine on network,
dflet 0:6ad60d78b315 342 //! by its name.
dflet 0:6ad60d78b315 343 //!
dflet 0:6ad60d78b315 344 //! @note On this version, only blocking mode is supported. Also note that
dflet 0:6ad60d78b315 345 //! the function requires DNS server to be configured prior to its usage.
dflet 0:6ad60d78b315 346 //
dflet 0:6ad60d78b315 347 //*****************************************************************************
dflet 0:6ad60d78b315 348 #ifndef CC3000_TINY_DRIVER
dflet 0:6ad60d78b315 349 extern int gethostbyname(char * hostname, unsigned short usNameLen, unsigned long* out_ip_addr);
dflet 0:6ad60d78b315 350 #endif
dflet 0:6ad60d78b315 351
dflet 0:6ad60d78b315 352
dflet 0:6ad60d78b315 353 //*****************************************************************************
dflet 0:6ad60d78b315 354 //
dflet 0:6ad60d78b315 355 //! connect
dflet 0:6ad60d78b315 356 //!
dflet 0:6ad60d78b315 357 //! @param[in] sd socket descriptor (handle)
dflet 0:6ad60d78b315 358 //! @param[in] addr specifies the destination addr. On this version
dflet 0:6ad60d78b315 359 //! only AF_INET is supported.
dflet 0:6ad60d78b315 360 //! @param[out] addrlen contains the size of the structure pointed to by addr
dflet 0:6ad60d78b315 361 //! @return On success, zero is returned. On error, -1 is returned
dflet 0:6ad60d78b315 362 //!
dflet 0:6ad60d78b315 363 //! @brief initiate a connection on a socket
dflet 0:6ad60d78b315 364 //! Function connects the socket referred to by the socket descriptor
dflet 0:6ad60d78b315 365 //! sd, to the address specified by addr. The addrlen argument
dflet 0:6ad60d78b315 366 //! specifies the size of addr. The format of the address in addr is
dflet 0:6ad60d78b315 367 //! determined by the address space of the socket. If it is of type
dflet 0:6ad60d78b315 368 //! SOCK_DGRAM, this call specifies the peer with which the socket is
dflet 0:6ad60d78b315 369 //! to be associated; this address is that to which datagrams are to be
dflet 0:6ad60d78b315 370 //! sent, and the only address from which datagrams are to be received.
dflet 0:6ad60d78b315 371 //! If the socket is of type SOCK_STREAM, this call attempts to make a
dflet 0:6ad60d78b315 372 //! connection to another socket. The other socket is specified by
dflet 0:6ad60d78b315 373 //! address, which is an address in the communications space of the
dflet 0:6ad60d78b315 374 //! socket. Note that the function implements only blocking behavior
dflet 0:6ad60d78b315 375 //! thus the caller will be waiting either for the connection
dflet 0:6ad60d78b315 376 //! establishment or for the connection establishment failure.
dflet 0:6ad60d78b315 377 //!
dflet 0:6ad60d78b315 378 //! @sa socket
dflet 0:6ad60d78b315 379 //
dflet 0:6ad60d78b315 380 //*****************************************************************************
dflet 0:6ad60d78b315 381 extern long connect(long sd, const sockaddr *addr, long addrlen);
dflet 0:6ad60d78b315 382
dflet 0:6ad60d78b315 383 //*****************************************************************************
dflet 0:6ad60d78b315 384 //
dflet 0:6ad60d78b315 385 //! select
dflet 0:6ad60d78b315 386 //!
dflet 0:6ad60d78b315 387 //! @param[in] nfds the highest-numbered file descriptor in any of the
dflet 0:6ad60d78b315 388 //! three sets, plus 1.
dflet 0:6ad60d78b315 389 //! @param[out] writesds socket descriptors list for write monitoring
dflet 0:6ad60d78b315 390 //! @param[out] readsds socket descriptors list for read monitoring
dflet 0:6ad60d78b315 391 //! @param[out] exceptsds socket descriptors list for exception monitoring
dflet 0:6ad60d78b315 392 //! @param[in] timeout is an upper bound on the amount of time elapsed
dflet 0:6ad60d78b315 393 //! before select() returns. Null means infinity
dflet 0:6ad60d78b315 394 //! timeout. The minimum timeout is 5 milliseconds,
dflet 0:6ad60d78b315 395 //! less than 5 milliseconds will be set
dflet 0:6ad60d78b315 396 //! automatically to 5 milliseconds.
dflet 0:6ad60d78b315 397 //! @return On success, select() returns the number of file descriptors
dflet 0:6ad60d78b315 398 //! contained in the three returned descriptor sets (that is, the
dflet 0:6ad60d78b315 399 //! total number of bits that are set in readfds, writefds,
dflet 0:6ad60d78b315 400 //! exceptfds) which may be zero if the timeout expires before
dflet 0:6ad60d78b315 401 //! anything interesting happens.
dflet 0:6ad60d78b315 402 //! On error, -1 is returned.
dflet 0:6ad60d78b315 403 //! *readsds - return the sockets on which Read request will
dflet 0:6ad60d78b315 404 //! return without delay with valid data.
dflet 0:6ad60d78b315 405 //! *writesds - return the sockets on which Write request
dflet 0:6ad60d78b315 406 //! will return without delay.
dflet 0:6ad60d78b315 407 //! *exceptsds - return the sockets which closed recently.
dflet 0:6ad60d78b315 408 //!
dflet 0:6ad60d78b315 409 //! @brief Monitor socket activity
dflet 0:6ad60d78b315 410 //! Select allow a program to monitor multiple file descriptors,
dflet 0:6ad60d78b315 411 //! waiting until one or more of the file descriptors become
dflet 0:6ad60d78b315 412 //! "ready" for some class of I/O operation
dflet 0:6ad60d78b315 413 //!
dflet 0:6ad60d78b315 414 //! @Note If the timeout value set to less than 5ms it will automatically set
dflet 0:6ad60d78b315 415 //! to 5ms to prevent overload of the system
dflet 0:6ad60d78b315 416 //!
dflet 0:6ad60d78b315 417 //! @sa socket
dflet 0:6ad60d78b315 418 //
dflet 0:6ad60d78b315 419 //*****************************************************************************
dflet 0:6ad60d78b315 420 extern int select(long nfds, fd_set *readsds, fd_set *writesds,
dflet 0:6ad60d78b315 421 fd_set *exceptsds, struct timeval *timeout);
dflet 0:6ad60d78b315 422
dflet 0:6ad60d78b315 423 //*****************************************************************************
dflet 0:6ad60d78b315 424 //
dflet 0:6ad60d78b315 425 //! setsockopt
dflet 0:6ad60d78b315 426 //!
dflet 0:6ad60d78b315 427 //! @param[in] sd socket handle
dflet 0:6ad60d78b315 428 //! @param[in] level defines the protocol level for this option
dflet 0:6ad60d78b315 429 //! @param[in] optname defines the option name to Interrogate
dflet 0:6ad60d78b315 430 //! @param[in] optval specifies a value for the option
dflet 0:6ad60d78b315 431 //! @param[in] optlen specifies the length of the option value
dflet 0:6ad60d78b315 432 //! @return On success, zero is returned. On error, -1 is returned
dflet 0:6ad60d78b315 433 //!
dflet 0:6ad60d78b315 434 //! @brief set socket options
dflet 0:6ad60d78b315 435 //! This function manipulate the options associated with a socket.
dflet 0:6ad60d78b315 436 //! Options may exist at multiple protocol levels; they are always
dflet 0:6ad60d78b315 437 //! present at the uppermost socket level.
dflet 0:6ad60d78b315 438 //! When manipulating socket options the level at which the option
dflet 0:6ad60d78b315 439 //! resides and the name of the option must be specified.
dflet 0:6ad60d78b315 440 //! To manipulate options at the socket level, level is specified as
dflet 0:6ad60d78b315 441 //! SOL_SOCKET. To manipulate options at any other level the protocol
dflet 0:6ad60d78b315 442 //! number of the appropriate protocol controlling the option is
dflet 0:6ad60d78b315 443 //! supplied. For example, to indicate that an option is to be
dflet 0:6ad60d78b315 444 //! interpreted by the TCP protocol, level should be set to the
dflet 0:6ad60d78b315 445 //! protocol number of TCP;
dflet 0:6ad60d78b315 446 //! The parameters optval and optlen are used to access optval -
dflet 0:6ad60d78b315 447 //! use for setsockopt(). For getsockopt() they identify a buffer
dflet 0:6ad60d78b315 448 //! in which the value for the requested option(s) are to
dflet 0:6ad60d78b315 449 //! be returned. For getsockopt(), optlen is a value-result
dflet 0:6ad60d78b315 450 //! parameter, initially containing the size of the buffer
dflet 0:6ad60d78b315 451 //! pointed to by option_value, and modified on return to
dflet 0:6ad60d78b315 452 //! indicate the actual size of the value returned. If no option
dflet 0:6ad60d78b315 453 //! value is to be supplied or returned, option_value may be NULL.
dflet 0:6ad60d78b315 454 //!
dflet 0:6ad60d78b315 455 //! @Note On this version the following two socket options are enabled:
dflet 0:6ad60d78b315 456 //! The only protocol level supported in this version
dflet 0:6ad60d78b315 457 //! is SOL_SOCKET (level).
dflet 0:6ad60d78b315 458 //! 1. SOCKOPT_RECV_TIMEOUT (optname)
dflet 0:6ad60d78b315 459 //! SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
dflet 0:6ad60d78b315 460 //! in milliseconds.
dflet 0:6ad60d78b315 461 //! In that case optval should be pointer to unsigned long.
dflet 0:6ad60d78b315 462 //! 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
dflet 0:6ad60d78b315 463 //! or off.
dflet 0:6ad60d78b315 464 //! In that case optval should be SOCK_ON or SOCK_OFF (optval).
dflet 0:6ad60d78b315 465 //!
dflet 0:6ad60d78b315 466 //! @sa getsockopt
dflet 0:6ad60d78b315 467 //
dflet 0:6ad60d78b315 468 //*****************************************************************************
dflet 0:6ad60d78b315 469 #ifndef CC3000_TINY_DRIVER
dflet 0:6ad60d78b315 470 extern int setsockopt(long sd, long level, long optname, const void *optval,
dflet 0:6ad60d78b315 471 socklen_t optlen);
dflet 0:6ad60d78b315 472 #endif
dflet 0:6ad60d78b315 473 //*****************************************************************************
dflet 0:6ad60d78b315 474 //
dflet 0:6ad60d78b315 475 //! getsockopt
dflet 0:6ad60d78b315 476 //!
dflet 0:6ad60d78b315 477 //! @param[in] sd socket handle
dflet 0:6ad60d78b315 478 //! @param[in] level defines the protocol level for this option
dflet 0:6ad60d78b315 479 //! @param[in] optname defines the option name to Interrogate
dflet 0:6ad60d78b315 480 //! @param[out] optval specifies a value for the option
dflet 0:6ad60d78b315 481 //! @param[out] optlen specifies the length of the option value
dflet 0:6ad60d78b315 482 //! @return On success, zero is returned. On error, -1 is returned
dflet 0:6ad60d78b315 483 //!
dflet 0:6ad60d78b315 484 //! @brief set socket options
dflet 0:6ad60d78b315 485 //! This function manipulate the options associated with a socket.
dflet 0:6ad60d78b315 486 //! Options may exist at multiple protocol levels; they are always
dflet 0:6ad60d78b315 487 //! present at the uppermost socket level.
dflet 0:6ad60d78b315 488 //! When manipulating socket options the level at which the option
dflet 0:6ad60d78b315 489 //! resides and the name of the option must be specified.
dflet 0:6ad60d78b315 490 //! To manipulate options at the socket level, level is specified as
dflet 0:6ad60d78b315 491 //! SOL_SOCKET. To manipulate options at any other level the protocol
dflet 0:6ad60d78b315 492 //! number of the appropriate protocol controlling the option is
dflet 0:6ad60d78b315 493 //! supplied. For example, to indicate that an option is to be
dflet 0:6ad60d78b315 494 //! interpreted by the TCP protocol, level should be set to the
dflet 0:6ad60d78b315 495 //! protocol number of TCP;
dflet 0:6ad60d78b315 496 //! The parameters optval and optlen are used to access optval -
dflet 0:6ad60d78b315 497 //! use for setsockopt(). For getsockopt() they identify a buffer
dflet 0:6ad60d78b315 498 //! in which the value for the requested option(s) are to
dflet 0:6ad60d78b315 499 //! be returned. For getsockopt(), optlen is a value-result
dflet 0:6ad60d78b315 500 //! parameter, initially containing the size of the buffer
dflet 0:6ad60d78b315 501 //! pointed to by option_value, and modified on return to
dflet 0:6ad60d78b315 502 //! indicate the actual size of the value returned. If no option
dflet 0:6ad60d78b315 503 //! value is to be supplied or returned, option_value may be NULL.
dflet 0:6ad60d78b315 504 //!
dflet 0:6ad60d78b315 505 //! @Note On this version the following two socket options are enabled:
dflet 0:6ad60d78b315 506 //! The only protocol level supported in this version
dflet 0:6ad60d78b315 507 //! is SOL_SOCKET (level).
dflet 0:6ad60d78b315 508 //! 1. SOCKOPT_RECV_TIMEOUT (optname)
dflet 0:6ad60d78b315 509 //! SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
dflet 0:6ad60d78b315 510 //! in milliseconds.
dflet 0:6ad60d78b315 511 //! In that case optval should be pointer to unsigned long.
dflet 0:6ad60d78b315 512 //! 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
dflet 0:6ad60d78b315 513 //! or off.
dflet 0:6ad60d78b315 514 //! In that case optval should be SOCK_ON or SOCK_OFF (optval).
dflet 0:6ad60d78b315 515 //!
dflet 0:6ad60d78b315 516 //! @sa setsockopt
dflet 0:6ad60d78b315 517 //
dflet 0:6ad60d78b315 518 //*****************************************************************************
dflet 0:6ad60d78b315 519 extern int getsockopt(long sd, long level, long optname, void *optval,
dflet 0:6ad60d78b315 520 socklen_t *optlen);
dflet 0:6ad60d78b315 521
dflet 0:6ad60d78b315 522 //*****************************************************************************
dflet 0:6ad60d78b315 523 //
dflet 0:6ad60d78b315 524 //! recv
dflet 0:6ad60d78b315 525 //!
dflet 0:6ad60d78b315 526 //! @param[in] sd socket handle
dflet 0:6ad60d78b315 527 //! @param[out] buf Points to the buffer where the message should be stored
dflet 0:6ad60d78b315 528 //! @param[in] len Specifies the length in bytes of the buffer pointed to
dflet 0:6ad60d78b315 529 //! by the buffer argument.
dflet 0:6ad60d78b315 530 //! @param[in] flags Specifies the type of message reception.
dflet 0:6ad60d78b315 531 //! On this version, this parameter is not supported.
dflet 0:6ad60d78b315 532 //!
dflet 0:6ad60d78b315 533 //! @return Return the number of bytes received, or -1 if an error
dflet 0:6ad60d78b315 534 //! occurred
dflet 0:6ad60d78b315 535 //!
dflet 0:6ad60d78b315 536 //! @brief function receives a message from a connection-mode socket
dflet 0:6ad60d78b315 537 //!
dflet 0:6ad60d78b315 538 //! @sa recvfrom
dflet 0:6ad60d78b315 539 //!
dflet 0:6ad60d78b315 540 //! @Note On this version, only blocking mode is supported.
dflet 0:6ad60d78b315 541 //
dflet 0:6ad60d78b315 542 //*****************************************************************************
dflet 0:6ad60d78b315 543 extern int recv(long sd, void *buf, long len, long flags);
dflet 0:6ad60d78b315 544
dflet 0:6ad60d78b315 545 //*****************************************************************************
dflet 0:6ad60d78b315 546 //
dflet 0:6ad60d78b315 547 //! recvfrom
dflet 0:6ad60d78b315 548 //!
dflet 0:6ad60d78b315 549 //! @param[in] sd socket handle
dflet 0:6ad60d78b315 550 //! @param[out] buf Points to the buffer where the message should be stored
dflet 0:6ad60d78b315 551 //! @param[in] len Specifies the length in bytes of the buffer pointed to
dflet 0:6ad60d78b315 552 //! by the buffer argument.
dflet 0:6ad60d78b315 553 //! @param[in] flags Specifies the type of message reception.
dflet 0:6ad60d78b315 554 //! On this version, this parameter is not supported.
dflet 0:6ad60d78b315 555 //! @param[in] from pointer to an address structure indicating the source
dflet 0:6ad60d78b315 556 //! address: sockaddr. On this version only AF_INET is
dflet 0:6ad60d78b315 557 //! supported.
dflet 0:6ad60d78b315 558 //! @param[in] fromlen source address structure size
dflet 0:6ad60d78b315 559 //!
dflet 0:6ad60d78b315 560 //! @return Return the number of bytes received, or -1 if an error
dflet 0:6ad60d78b315 561 //! occurred
dflet 0:6ad60d78b315 562 //!
dflet 0:6ad60d78b315 563 //! @brief read data from socket
dflet 0:6ad60d78b315 564 //! function receives a message from a connection-mode or
dflet 0:6ad60d78b315 565 //! connectionless-mode socket. Note that raw sockets are not
dflet 0:6ad60d78b315 566 //! supported.
dflet 0:6ad60d78b315 567 //!
dflet 0:6ad60d78b315 568 //! @sa recv
dflet 0:6ad60d78b315 569 //!
dflet 0:6ad60d78b315 570 //! @Note On this version, only blocking mode is supported.
dflet 0:6ad60d78b315 571 //
dflet 0:6ad60d78b315 572 //*****************************************************************************
dflet 0:6ad60d78b315 573 extern int recvfrom(long sd, void *buf, long len, long flags, sockaddr *from,
dflet 0:6ad60d78b315 574 socklen_t *fromlen);
dflet 0:6ad60d78b315 575
dflet 0:6ad60d78b315 576 //*****************************************************************************
dflet 0:6ad60d78b315 577 //
dflet 0:6ad60d78b315 578 //! send
dflet 0:6ad60d78b315 579 //!
dflet 0:6ad60d78b315 580 //! @param sd socket handle
dflet 0:6ad60d78b315 581 //! @param buf Points to a buffer containing the message to be sent
dflet 0:6ad60d78b315 582 //! @param len message size in bytes
dflet 0:6ad60d78b315 583 //! @param flags On this version, this parameter is not supported
dflet 0:6ad60d78b315 584 //!
dflet 0:6ad60d78b315 585 //! @return Return the number of bytes transmitted, or -1 if an
dflet 0:6ad60d78b315 586 //! error occurred
dflet 0:6ad60d78b315 587 //!
dflet 0:6ad60d78b315 588 //! @brief Write data to TCP socket
dflet 0:6ad60d78b315 589 //! This function is used to transmit a message to another
dflet 0:6ad60d78b315 590 //! socket.
dflet 0:6ad60d78b315 591 //!
dflet 0:6ad60d78b315 592 //! @Note On this version, only blocking mode is supported.
dflet 0:6ad60d78b315 593 //!
dflet 0:6ad60d78b315 594 //! @sa sendto
dflet 0:6ad60d78b315 595 //
dflet 0:6ad60d78b315 596 //*****************************************************************************
dflet 0:6ad60d78b315 597
dflet 0:6ad60d78b315 598 extern int send(long sd, const void *buf, long len, long flags);
dflet 0:6ad60d78b315 599
dflet 0:6ad60d78b315 600 //*****************************************************************************
dflet 0:6ad60d78b315 601 //
dflet 0:6ad60d78b315 602 //! sendto
dflet 0:6ad60d78b315 603 //!
dflet 0:6ad60d78b315 604 //! @param sd socket handle
dflet 0:6ad60d78b315 605 //! @param buf Points to a buffer containing the message to be sent
dflet 0:6ad60d78b315 606 //! @param len message size in bytes
dflet 0:6ad60d78b315 607 //! @param flags On this version, this parameter is not supported
dflet 0:6ad60d78b315 608 //! @param to pointer to an address structure indicating the destination
dflet 0:6ad60d78b315 609 //! address: sockaddr. On this version only AF_INET is
dflet 0:6ad60d78b315 610 //! supported.
dflet 0:6ad60d78b315 611 //! @param tolen destination address structure size
dflet 0:6ad60d78b315 612 //!
dflet 0:6ad60d78b315 613 //! @return Return the number of bytes transmitted, or -1 if an
dflet 0:6ad60d78b315 614 //! error occurred
dflet 0:6ad60d78b315 615 //!
dflet 0:6ad60d78b315 616 //! @brief Write data to TCP socket
dflet 0:6ad60d78b315 617 //! This function is used to transmit a message to another
dflet 0:6ad60d78b315 618 //! socket.
dflet 0:6ad60d78b315 619 //!
dflet 0:6ad60d78b315 620 //! @Note On this version, only blocking mode is supported.
dflet 0:6ad60d78b315 621 //!
dflet 0:6ad60d78b315 622 //! @sa send
dflet 0:6ad60d78b315 623 //
dflet 0:6ad60d78b315 624 //*****************************************************************************
dflet 0:6ad60d78b315 625
dflet 0:6ad60d78b315 626 extern int sendto(long sd, const void *buf, long len, long flags,
dflet 0:6ad60d78b315 627 const sockaddr *to, socklen_t tolen);
dflet 0:6ad60d78b315 628
dflet 0:6ad60d78b315 629 //*****************************************************************************
dflet 0:6ad60d78b315 630 //
dflet 0:6ad60d78b315 631 //! mdnsAdvertiser
dflet 0:6ad60d78b315 632 //!
dflet 0:6ad60d78b315 633 //! @param[in] mdnsEnabled flag to enable/disable the mDNS feature
dflet 0:6ad60d78b315 634 //! @param[in] deviceServiceName Service name as part of the published
dflet 0:6ad60d78b315 635 //! canonical domain name
dflet 0:6ad60d78b315 636 //! @param[in] deviceServiceNameLength Length of the service name
dflet 0:6ad60d78b315 637 //!
dflet 0:6ad60d78b315 638 //!
dflet 0:6ad60d78b315 639 //! @return On success, zero is returned, return SOC_ERROR if socket was not
dflet 0:6ad60d78b315 640 //! opened successfully, or if an error occurred.
dflet 0:6ad60d78b315 641 //!
dflet 0:6ad60d78b315 642 //! @brief Set CC3000 in mDNS advertiser mode in order to advertise itself.
dflet 0:6ad60d78b315 643 //
dflet 0:6ad60d78b315 644 //*****************************************************************************
dflet 0:6ad60d78b315 645 extern int mdnsAdvertiser(unsigned short mdnsEnabled, char * deviceServiceName, unsigned short deviceServiceNameLength);
dflet 0:6ad60d78b315 646
dflet 0:6ad60d78b315 647 //*****************************************************************************
dflet 0:6ad60d78b315 648 //
dflet 0:6ad60d78b315 649 // Close the Doxygen group.
dflet 0:6ad60d78b315 650 //! @}
dflet 0:6ad60d78b315 651 //
dflet 0:6ad60d78b315 652 //*****************************************************************************
dflet 0:6ad60d78b315 653
dflet 0:6ad60d78b315 654
dflet 0:6ad60d78b315 655 //*****************************************************************************
dflet 0:6ad60d78b315 656 //
dflet 0:6ad60d78b315 657 // Mark the end of the C bindings section for C++ compilers.
dflet 0:6ad60d78b315 658 //
dflet 0:6ad60d78b315 659 //*****************************************************************************
dflet 0:6ad60d78b315 660 #ifdef __cplusplus
dflet 0:6ad60d78b315 661 }
dflet 0:6ad60d78b315 662 #endif // __cplusplus
dflet 0:6ad60d78b315 663
dflet 0:6ad60d78b315 664 #endif // __SOCKET_H__
dflet 0:6ad60d78b315 665