Coda Distributed File System
wrapper.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 2017-2020 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15
16#*/
17
18#ifndef _CODATUNNEL_WRAPPER_H_
19#define _CODATUNNEL_WRAPPER_H_
20
21#include <sys/types.h>
22#include <sys/socket.h>
23
24/* Flag bits for codatunnel_sendto to hint that this is a retried UDP send
25 and also a separate bit to hint that this is an Init1 packet */
26/* Linux currently uses the following bits already 0x6005ffff, they may be
27 * going up with 'standard flags', and down with linux specific ones or
28 * something hopefully the following bit is a 'meet in the middle' case that
29 * won't be reached anytime soon although we strip the bit before passing
30 * 'flags' on to libc anyway. */
31#define CODATUNNEL_ISRETRY_HINT 0x01000000
32#define CODATUNNEL_ISINIT0_HINT 0x02000000
33#define CODATUNNEL_HINTS (CODATUNNEL_ISRETRY_HINT | CODATUNNEL_ISINIT0_HINT)
34
35/* return socket to codatunneld when tunnel is started, otherwise return -1 */
37
38void codatunnel_init0(const struct sockaddr *addr, socklen_t addrlen,
39 const char *peername);
40
41ssize_t codatunnel_sendto(int sockfd, const void *buf, size_t len, int flags,
42 const struct sockaddr *dest_addr, socklen_t addrlen);
43ssize_t codatunnel_recvfrom(int sockfd, void *buf, size_t len, int flags,
44 struct sockaddr *src_addr, socklen_t *addrlen);
45
46#endif /* _CODATUNNEL_WRAPPER_H_ */
int socklen_t
Definition: mariner.cc:73
ssize_t codatunnel_recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
Definition: codatunnel.c:172
void codatunnel_init0(const struct sockaddr *addr, socklen_t addrlen, const char *peername)
Definition: codatunnel.c:113
ssize_t codatunnel_sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
Definition: codatunnel.c:126
int codatunnel_socket()
Definition: codatunnel.c:108