/usr/include/x86_64-linux-gnu/qcc/posix/SocketTypes.h is in liballjoyn-common-dev-1504 15.04b-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | /**
* @file
*
* Define the abstracted socket interface for Linux.
*/
/******************************************************************************
* Copyright AllSeen Alliance. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************************/
#ifndef _OS_QCC_SOCKETTYPES_H
#define _OS_QCC_SOCKETTYPES_H
#include <qcc/platform.h>
#include <arpa/inet.h>
#include <limits.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/uio.h>
/** Windows uses SOCKET_ERROR to signify errors */
#define SOCKET_ERROR -1
namespace qcc {
/**
* GCC definition of QCC_IOVec matches the POSIX definition of struct iovec for
* direct casting.
*/
struct IOVec {
void* buf; /**< Pointer to a buffer to be included in a scatter-gather list. */
size_t len; /**< Length of the buffer. */
};
#define QCC_MAX_SG_ENTRIES (IOV_MAX) /**< Maximum number of scatter-gather list entries. */
typedef socklen_t SockAddrSize; /**< Abstraction of the socket address length type. */
/**
* Enumeration of address families.
*/
typedef enum {
QCC_AF_UNSPEC = PF_UNSPEC, /**< unspecified address family */
QCC_AF_INET = PF_INET, /**< IPv4 address family */
QCC_AF_INET6 = PF_INET6, /**< IPv6 address family */
QCC_AF_UNIX = PF_UNIX /**< UNIX file system sockets address family */
} AddressFamily;
/**
* Enumeration of socket types.
*/
typedef enum {
QCC_SOCK_STREAM = SOCK_STREAM, /**< TCP */
QCC_SOCK_DGRAM = SOCK_DGRAM, /**< UDP */
QCC_SOCK_SEQPACKET = SOCK_SEQPACKET, /**< Sequenced data transmission */
QCC_SOCK_RAW = SOCK_RAW, /**< Raw IP packet */
QCC_SOCK_RDM = SOCK_RDM /**< Reliable datagram */
} SocketType;
/**
* The abstract message header structure defined to match the Linux definition of struct msghdr.
*/
struct MsgHdr {
void* name; /**< IP Address. */
socklen_t nameLen; /**< IP Address length. */
struct IOVec* iov; /**< Array of scatter-gather entries. */
size_t iovLen; /**< Number of elements in iov. */
void* control; /**< Ancillary data buffer. */
socklen_t controlLen; /**< Ancillary data buffer length. */
int flags; /**< Flags on received message. */
};
/**
* Some of the flags used in SendTo are supported in Linux, but not in Darwin
*/
#define MSG_FLAG_UNSUPPORTED 0
/**
* Flag bit definitions for the flags passed to sendmsg-related functions.
* See platform sockets API for detailed descriptions.
*/
typedef enum {
QCC_MSG_NONE = 0, /**< No flag bits set */
#if defined(QCC_OS_DARWIN)
QCC_MSG_CONFIRM = MSG_FLAG_UNSUPPORTED,
#else
QCC_MSG_CONFIRM = MSG_CONFIRM, /**< Progress happened, don't reprobe using ARP. */
#endif
QCC_MSG_DONTROUTE = MSG_DONTROUTE, /**< Don't send to gageway, only send on directly connected networks. */
QCC_MSG_DONTWAIT = MSG_DONTWAIT, /**< Enable nonblocking operation (like O_NONBLOCK with fnctl. */
QCC_MSG_EOR = MSG_EOR, /**< End of record (SOCK_SEQPACKET sockets). */
#if defined(QCC_OS_DARWIN)
QCC_MSG_MORE = MSG_FLAG_UNSUPPORTED,
#else
QCC_MSG_MORE = MSG_MORE, /**< More data coming. See TCP_CORK. */
#endif
#if defined(QCC_OS_DARWIN)
QCC_MSG_NOSIGNAL = MSG_FLAG_UNSUPPORTED,
#else
QCC_MSG_NOSIGNAL = MSG_NOSIGNAL, /**< Request to not send SIGPIPE on stream sockets. */
#endif
QCC_MSG_OOB = MSG_OOB /**< Out of band data (SOCK_STREAM sockets). */
} SendMsgFlags;
}
#endif
|