TAS
TCP Acceleration as an OS Service
tas_sockets.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 University of Washington, Max Planck Institute for
3  * Software Systems, and The University of Texas at Austin
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef FLEXTCP_SOCKETS_H_
26 #define FLEXTCP_SOCKETS_H_
27 
28 #include <poll.h>
29 #include <sys/types.h>
30 #include <sys/socket.h>
31 #include <sys/epoll.h>
32 
41 int tas_init(void);
42 
43 int tas_socket(int domain, int type, int protocol);
44 
45 int tas_close(int sockfd);
46 
47 int tas_shutdown(int sockfd, int how);
48 
49 int tas_bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
50 
51 int tas_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
52 
53 int tas_listen(int sockfd, int backlog);
54 
55 int tas_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
56  int flags);
57 
58 int tas_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
59 
60 
61 int tas_fcntl(int sockfd, int cmd, ...);
62 
63 int tas_getsockopt(int sockfd, int level, int optname, void *optval,
64  socklen_t *optlen);
65 
66 int tas_setsockopt(int sockfd, int level, int optname, const void *optval,
67  socklen_t optlen);
68 
69 int tas_getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
70 
71 int tas_getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
72 
73 int tas_move_conn(int sockfd);
74 
75 
76 ssize_t tas_read(int fd, void *buf, size_t count);
77 
78 ssize_t tas_recv(int sockfd, void *buf, size_t len, int flags);
79 
80 ssize_t tas_recvfrom(int sockfd, void *buf, size_t len, int flags,
81  struct sockaddr *src_addr, socklen_t *addrlen);
82 
83 ssize_t tas_recvmsg(int sockfd, struct msghdr *msg, int flags);
84 
85 ssize_t tas_readv(int sockfd, const struct iovec *iov, int iovcnt);
86 
87 ssize_t tas_pread(int sockfd, void *buf, size_t count, off_t offset);
88 
89 ssize_t tas_write(int fd, const void *buf, size_t count);
90 
91 ssize_t tas_send(int sockfd, const void *buf, size_t len, int flags);
92 
93 ssize_t tas_sendto(int sockfd, const void *buf, size_t len, int flags,
94  const struct sockaddr *dest_addr, socklen_t addrlen);
95 
96 ssize_t tas_sendmsg(int sockfd, const struct msghdr *msg, int flags);
97 
98 ssize_t tas_writev(int sockfd, const struct iovec *iov, int iovcnt);
99 
100 ssize_t tas_pwrite(int sockfd, const void *buf, size_t count, off_t offset);
101 
102 ssize_t tas_sendfile(int sockfd, int in_fd, off_t *offset, size_t len);
103 
104 
105 int tas_epoll_create(int size);
106 
107 int tas_epoll_create1(int flags);
108 
109 int tas_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
110 
111 int tas_epoll_wait(int epfd, struct epoll_event *events, int maxevents,
112  int timeout);
113 
114 int tas_epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
115  int timeout, const sigset_t *sigmask);
116 
117 
118 int tas_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
119  struct timeval *timeout);
120 
121 int tas_pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
122  const struct timespec *timeout, const sigset_t *sigmask);
123 
124 
125 int tas_poll(struct pollfd *fds, nfds_t nfds, int timeout);
126 
127 int tas_ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *tmo_p,
128  const sigset_t *sigmask);
129 
130 
131 int tas_dup(int oldfd);
132 
133 int tas_dup2(int oldfd, int newfd);
134 
135 int tas_dup3(int oldfd, int newfd, int flags);
136 
139 #endif /* ndef FLEXTCP_SOCKETS_H_ */
int tas_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
Definition: control.c:586
static int epfd
Definition: appif.c:80