/usr/include/libmongoc-1.0/mongoc-socket.h is in libmongoc-dev 1.9.2+dfsg-1build1.
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 | /*
* Copyright 2014 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MONGOC_SOCKET_H
#define MONGOC_SOCKET_H
#if !defined(MONGOC_INSIDE) && !defined(MONGOC_COMPILATION)
#error "Only <mongoc.h> can be included directly."
#endif
#include <bson.h>
#include "mongoc-macros.h"
#include "mongoc-config.h"
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <poll.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/un.h>
#endif
#include "mongoc-iovec.h"
BSON_BEGIN_DECLS
typedef MONGOC_SOCKET_ARG3 mongoc_socklen_t;
typedef struct _mongoc_socket_t mongoc_socket_t;
typedef struct {
mongoc_socket_t *socket;
int events;
int revents;
} mongoc_socket_poll_t;
MONGOC_EXPORT (mongoc_socket_t *)
mongoc_socket_accept (mongoc_socket_t *sock, int64_t expire_at);
MONGOC_EXPORT (int)
mongoc_socket_bind (mongoc_socket_t *sock,
const struct sockaddr *addr,
mongoc_socklen_t addrlen);
MONGOC_EXPORT (int)
mongoc_socket_close (mongoc_socket_t *socket);
MONGOC_EXPORT (int)
mongoc_socket_connect (mongoc_socket_t *sock,
const struct sockaddr *addr,
mongoc_socklen_t addrlen,
int64_t expire_at);
MONGOC_EXPORT (char *)
mongoc_socket_getnameinfo (mongoc_socket_t *sock);
MONGOC_EXPORT (void)
mongoc_socket_destroy (mongoc_socket_t *sock);
MONGOC_EXPORT (int)
mongoc_socket_errno (mongoc_socket_t *sock);
MONGOC_EXPORT (int)
mongoc_socket_getsockname (mongoc_socket_t *sock,
struct sockaddr *addr,
mongoc_socklen_t *addrlen);
MONGOC_EXPORT (int)
mongoc_socket_listen (mongoc_socket_t *sock, unsigned int backlog);
MONGOC_EXPORT (mongoc_socket_t *)
mongoc_socket_new (int domain, int type, int protocol);
MONGOC_EXPORT (ssize_t)
mongoc_socket_recv (mongoc_socket_t *sock,
void *buf,
size_t buflen,
int flags,
int64_t expire_at);
MONGOC_EXPORT (int)
mongoc_socket_setsockopt (mongoc_socket_t *sock,
int level,
int optname,
const void *optval,
mongoc_socklen_t optlen);
MONGOC_EXPORT (ssize_t)
mongoc_socket_send (mongoc_socket_t *sock,
const void *buf,
size_t buflen,
int64_t expire_at);
MONGOC_EXPORT (ssize_t)
mongoc_socket_sendv (mongoc_socket_t *sock,
mongoc_iovec_t *iov,
size_t iovcnt,
int64_t expire_at);
MONGOC_EXPORT (bool)
mongoc_socket_check_closed (mongoc_socket_t *sock);
MONGOC_EXPORT (void)
mongoc_socket_inet_ntop (struct addrinfo *rp, char *buf, size_t buflen);
MONGOC_EXPORT (ssize_t)
mongoc_socket_poll (mongoc_socket_poll_t *sds, size_t nsds, int32_t timeout);
BSON_END_DECLS
#endif /* MONGOC_SOCKET_H */
|