Internet-Draft | NEAT Sockets API | February 2023 |
Dreibholz | Expires 28 August 2023 | [Page] |
This document describes a BSD Sockets-like API on top of the callback-based NEAT User API. This facilitates porting existing applications to use a subset of NEAT's functionality.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 28 August 2023.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The NEAT project [12], [13], [5], [3], [8] wants to achieve a complete redesign of the way in which Internet applications interact with the network. Our goal is to allow network "services" offered to applications - such as reliability, low-delay communication or security - to be dynamically tailored based on application demands, current network conditions, hardware capabilities or local policies, and also to support the integration of new network functionality in an evolutionary fashion.¶
This document describes the NEAT Sockets API on top of the callback-based NEAT User API [4]. It provides a BSD Sockets-like API that facilitates porting existing applications to use a subset of NEAT's functionality. For further information on NEAT, see also [12], [13], [14], [15], [16].¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [1].¶
nsa_init() is used to explicitly initialise the NEAT Sockets API. In the usual case, however, the NEAT Sockets API is automatically initialized when creating a NEAT socket. Explicit initialisation may only be necessary in a multi-threaded program, in order to avoid parallel initialisation calls.¶
Function Prototype:¶
int nsa_init()¶
Return Value:¶
nsa_init() returns the new NEAT socket descriptor, or -1 in case of error. The error code will be set in the errno variable.¶
nsa_cleanup() is used to free all resources allocated by NEAT. Note, that the NEAT Sockets API is automatically initialized when creating a NEAT socket.¶
Function Prototype:¶
void nsa_cleanup()¶
nsa_map_socket() is used to map a system socket descriptor into the NEAT socket descriptor space. This is useful for using NEAT API functions as wrapper to calls on non-NEAT sockets. Mapped socket descriptors can be unmapped by using nsa_unmap_socket().¶
Function Prototype:¶
int nsa_map_socket(int systemSD, int neatSD)¶
Arguments:¶
Return Value:¶
nsa_map_socket() returns the new NEAT socket descriptor, or -1 in case of error. The error code will be set in the errno variable.¶
nsa_unmap_socket() is used to unmap a system socket descriptor from the NEAT socket descriptor space.¶
Function Prototype:¶
int nsa_unmap_socket(int neatSD)¶
Arguments:¶
nsa_socket() creates a new NEAT socket. The NEAT socket can either be a wrapper around the NEAT User API (if properties are specified) or be a wrapper around a system socket (if no properties are specified).¶
Function Prototype:¶
int nsa_socket(int domain, int type, int protocol, const char* properties)¶
Arguments:¶
Return Value:¶
nsa_socket() returns the NEAT socket descriptor in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the socket() documentation for details.¶
nsa_socketpair() is a wrapper around the socketpair() call, returning NEAT socket descriptors instead. Note, that socketpair() only supports AF_UNIX sockets, i.e. this function is just a wrapper for the system function.¶
Function Prototype:¶
int nsa_socketpair(int domain, int type, int protocol, const char* properties)¶
See the socketpair() documentation for details.¶
nsa_close() closes a given NEAT socket.¶
Function Prototype:¶
int nsa_close(int sockfd)¶
Arguments:¶
nsa_close() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the close() documentation for details.¶
nsa_fcntl() manipulates a given NEAT socket.¶
Function Prototype:¶
int nsa_fcntl(int sockfd, int cmd, ...)¶
Arguments:¶
nsa_fcntl() returns a command-specific value.¶
For NEAT sockets, the following commands are specified:¶
See the fcntl() documentation for details.¶
nsa_bind() binds a given NEAT socket to a given address. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_bindn() instead. Note further, that nsa_bind() also supports a single address only (i.e. no multi-homing). nsa_bindx() SHOULD be used instead to support multi-homing.¶
Function Prototype:¶
int nsa_bind(int sockfd, const struct sockaddr* addr, socklen_t addrlen, struct neat_tlv* opt, const int optcnt)¶
Arguments:¶
nsa_bind() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the bind() documentation for details.¶
nsa_bindx() binds a given NEAT socket to a given set of addresses. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_bindn() instead.¶
Function Prototype:¶
int nsa_bindx(int sockfd, const struct sockaddr* addrs, int addrcnt, int flags, struct neat_tlv* opt, const int optcnt)¶
Arguments:¶
nsa_bindx() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the sctp_bindx() documentation for details.¶
nsa_bindn() binds a given NEAT socket to a given port. NEAT takes care of handling local addresses.¶
Function Prototype:¶
int nsa_bindn(int sockfd, uint16_t port, int flags, struct neat_tlv* opt, const int optcnt)¶
Arguments:¶
nsa_bindn() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
nsa_connect() connects a given NEAT socket to a given remote address. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_connectn() instead. Note further, that nsa_connect() also supports a single address only (i.e. no multi-homing). nsa_connectx() SHOULD be used instead to support multi-homing.¶
Function Prototype:¶
int nsa_connect(int sockfd, const struct sockaddr* addr, socklen_t addrlen, struct neat_tlv* opt, const int optcnt)¶
Arguments:¶
nsa_connect() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the connect() documentation for details.¶
nsa_connectx() connects a given NEAT socket to a given set of remote addresses. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_connectn() instead.¶
Function Prototype:¶
int nsa_connectx(int sockfd, const struct sockaddr* addrs, int addrcnt, neat_assoc_t* id, struct neat_tlv* opt, const int optcnt)¶
Arguments:¶
nsa_connectx() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the sctp_connectx() documentation for details.¶
nsa_connectn() connects a given NEAT socket to a given remote name and port. The remote name is resolved by NEAT to corresponding remote addresses.¶
Function Prototype:¶
int nsa_connectn(int sockfd, const char* name, const uint16_t port, neat_assoc_t* id, struct neat_tlv* opt, const int optcnt)¶
Arguments:¶
nsa_connectn() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
nsa_listen() marks a given NEAT socket as listening socket, i.e. accepting incoming connections.¶
Function Prototype:¶
int nsa_listen(int sockfd, int backlog)¶
Arguments:¶
nsa_listen() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the listen() documentation for details.¶
nsa_accept() extracts the first connection request in the queue of pending connections for a listening NEAT socket, creates a new connected socket, and returns a new NEAT socket descriptor referring to that socket.¶
Function Prototype:¶
int nsa_accept(int sockfd, struct sockaddr* addr, socklen_t* addrlen)¶
Arguments:¶
nsa_accept() returns the new NEAT socket descriptor in case of success, or -1 in case of error. The error code will be set in the errno variable. In case of success, the peer's primary address is stored in "addr", if there is sufficient space. The variable pointer to by "addrlen" will then contain the actual address size.¶
See the accept() documentation for details.¶
nsa_accept4() extracts the first connection request in the queue of pending connections for a listening NEAT socket, creates a new connected socket, and returns a new NEAT socket descriptor referring to that socket. If successful, and flags!=0, nsa_accept4() furthermore makes the new socket non-blocking (SOCK_NONBLOCK flag) and/or close-on-exec (SOCK_CLOEXEC flag). For flags==0, the behaviour is identical to nsa_accept().¶
Function Prototype:¶
int nsa_accept4(int sockfd, struct sockaddr* addr, socklen_t* addrlen, int flags)¶
Arguments:¶
nsa_accept4() returns the new NEAT socket descriptor in case of success, or -1 in case of error. The error code will be set in the errno variable. In case of success, the peer's primary address is stored in "addr", if there is sufficient space. The variable pointer to by "addrlen" will then contain the actual address size.¶
See the accept() documentation for details.¶
nsa_shutdown() shuts down the connection of a given NEAT socket.¶
Function Prototype:¶
int nsa_shutdown(int sockfd, int how)¶
Arguments:¶
nsa_shutdown() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the shutdown() documentation for details.¶
nsa_getsockopt() gets a socket option of a given NEAT socket.¶
Function Prototype:¶
int nsa_getsockopt(int sockfd, int level, int optname, void* optval, socklen_t* optlen)¶
Arguments:¶
nsa_getsockopt() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the getsockopt() documentation for details.¶
nsa_getsockopt() sets a socket option of a given NEAT socket.¶
Function Prototype:¶
int nsa_setsockopt(int sockfd, int level, int optname, const void* optval, socklen_t optlen)¶
Arguments:¶
nsa_setsockopt() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the setsockopt() documentation for details.¶
nsa_opt_info() gets a socket option of a given NEAT socket.¶
Function Prototype:¶
int nsa_opt_info(int sockfd, neat_assoc_t id, int opt, void* arg, socklen_t* size)¶
Arguments:¶
nsa_opt_info() returns 0 in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the sctp_opt_info() documentation for details.¶
TBD.¶
TBD.¶
nsa_write() sends data over a given connected NEAT socket. For NEAT sockets, nsa_write() is equal to nsa_send() with "flags" set to 0.¶
Function Prototype:¶
ssize_t nsa_write(int fd, const void* buf, size_t len)¶
Arguments:¶
nsa_write() returns the number of sent bytes in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the write() documentation for details.¶
nsa_writev() sends data over a given connected NEAT socket. The data is provided by an iovec structure.¶
Function Prototype:¶
ssize_t nsa_writev(int fd, const struct iovec* iov, int iovcnt)¶
Arguments:¶
nsa_writev() returns the number of sent bytes in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the writev() documentation for details.¶
nsa_pwrite() is a wrapper around the pwrite() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_pwrite(int fd, const void* buf, size_t len, off_t offset)¶
See the pwrite() documentation for details.¶
nsa_pwrite64() is a wrapper around the pwrite64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_pwrite(int fd, const void* buf, size_t len, off64_t offset)¶
See the pwrite64() documentation for details.¶
nsa_pwritev() is a wrapper around the pwritev() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_pwritev(int fd, const struct iovec* iov, int iovcnt, off_t offset)¶
See the pwritev() documentation for details.¶
nsa_pwritev64() is a wrapper around the pwritev64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_pwritev(int fd, const struct iovec* iov, int iovcnt, off64_t offset)¶
See the pwritev64() documentation for details.¶
nsa_send() sends data over a given connected NEAT socket.¶
Function Prototype:¶
ssize_t nsa_send(int sockfd, const void* buf, size_t len, int flags)¶
Arguments:¶
nsa_send() returns the number of sent bytes in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the send() documentation for details.¶
nsa_sendto() is a wrapper around the sendto() call, using NEAT socket descriptors instead. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_send() instead. On NEAT sockets, a provided destination address is ignored.¶
Function Prototype:¶
ssize_t nsa_sendto(int sockfd, const void* buf, size_t len, int flags, const struct sockaddr* to, socklen_t tolen)¶
Arguments:¶
nsa_sendto() returns the number of sent bytes in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the send() documentation for details.¶
nsa_sendmsg() sends data over a given connected NEAT socket. The data and control information is provided by a msghdr structure. On NEAT sockets, a provided destination address is ignored.¶
Function Prototype:¶
ssize_t nsa_sendmsg(int sockfd, const struct msghdr* msg, int flags)¶
Arguments:¶
nsa_sendmsg() returns the number of sent bytes in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the sendmsg() documentation for details.¶
nsa_sendv() sends data over a given connected NEAT socket. The data and control information is provided by iovec and info structures. On NEAT sockets, a provided destination address is ignored.¶
Function Prototype:¶
ssize_t nsa_sendv(int sockfd, struct iovec* iov, int iovcnt, struct sockaddr* to, int tocnt, void* info, socklen_t infolen, unsigned int infotype, int flags)¶
Arguments:¶
nsa_sendv() returns the number of sent bytes in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the sctp_sendv() documentation for details.¶
nsa_read() reads data from a given connected NEAT socket. For NEAT sockets, nsa_read() is equal to nsa_recv() with "flags" set to 0.¶
Function Prototype:¶
ssize_t nsa_read(int fd, void* buf, size_t len)¶
Arguments:¶
nsa_read() returns the number of read bytes in case of success, 0 in case of connection shutdown, or -1 in case of error. The error code will be set in the errno variable.¶
See the read() documentation for details.¶
nsa_readv() reads data from a given connected NEAT socket. The data information buffers are provided by an iovec structure.¶
Function Prototype:¶
ssize_t nsa_readv(int fd, const struct iovec* iov, int iovcnt)¶
Arguments:¶
nsa_readv() returns the number of read bytes in case of success, 0 in case of connection shutdown, or -1 in case of error. The error code will be set in the errno variable.¶
See the readv() documentation for details.¶
nsa_pread() is a wrapper around the pread() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_pread(int fd, void* buf, size_t len, off_t offset)¶
See the pread() documentation for details.¶
nsa_pread64() is a wrapper around the pread64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_pread(int fd, void* buf, size_t len, off_t offset)¶
See the pread64() documentation for details.¶
nsa_preadv() is a wrapper around the preadv() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_preadv(int fd, const struct iovec* iov, int iovcnt, off64_t offset)¶
See the preadv() documentation for details.¶
nsa_preadv64() is a wrapper around the preadv64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
ssize_t nsa_preadv(int fd, const struct iovec* iov, int iovcnt, off64_t offset)¶
See the preadv64() documentation for details.¶
nsa_recv() reads data from a given connected NEAT socket.¶
Function Prototype:¶
ssize_t nsa_recv(int sockfd, void* buf, size_t len, int flags)¶
Arguments:¶
nsa_recv() returns the number of read bytes in case of success, 0 in case of connection shutdown, or -1 in case of error. The error code will be set in the errno variable.¶
See the recv() documentation for details.¶
nsa_recvfrom() reads data from a given connected NEAT socket. The peer's sending address of the data (if possible and useful for underlying transport protocol) is obtained as well. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_recv() instead.¶
Function Prototype:¶
ssize_t nsa_recvfrom(int sockfd, void* buf, size_t len, int flags, struct sockaddr* from, socklen_t* fromlen)¶
nsa_recvfrom() returns the number of read bytes in case of success, 0 in case of connection shutdown, or -1 in case of error. The error code will be set in the errno variable. In case of success, the peer's sending address (if possible and useful for underlying transport protocol) may be stored in "from", if there is sufficient space. The variable pointer to by "fromlen" will then contain the actual address size.¶
See the recvfrom() documentation for details.¶
nsa_recvmsg() reads data from a given connected NEAT socket. The data and control information buffers are provided by a msghdr structure.¶
Function Prototype:¶
ssize_t nsa_recvmsg(int sockfd, struct msghdr* msg, int flags)¶
Arguments:¶
nsa_recvmsg() returns the number of read bytes in case of success, 0 in case of connection shutdown, or -1 in case of error. The error code will be set in the errno variable.¶
See the recvmsg() documentation for details.¶
nsa_recvv() reads data from a given connected NEAT socket. The data and control information buffers are provided by iovec and info structures.¶
Function Prototype:¶
ssize_t nsa_recvv(int sockfd, struct iovec* iov, int iovcnt, struct sockaddr* from, socklen_t* fromlen, void* info, socklen_t* infolen, unsigned int* infotype, int* msg_flags)¶
Arguments:¶
nsa_recvv() returns the number of sent received in case of success, or -1 in case of error. The error code will be set in the errno variable.¶
See the sctp_recvv() documentation for details.¶
nsa_poll() waits for activity (input/output/error/...) on a set of given NEAT sockets.¶
Function Prototype:¶
int nsa_poll(struct pollfd* ufds, const nfds_t nfds, int timeout)¶
Arguments:¶
nsa_poll() returns the number of NEAT sockets with activity in case of success, 0 in case of timeout, or -1 in case of error. The error code will be set in the errno variable.¶
See the poll() documentation for details.¶
nsa_select() is a wrapper around the select() call, using NEAT socket descriptors instead. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_poll() instead.¶
Function Prototype:¶
int nsa_select(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout)¶
See the select() documentation for details.¶
nsa_getsockname() obtains the first local address of a socket. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_getladdrs() instead to support multi-homed transport protocols!¶
Function Prototype:¶
int nsa_getsockname(int sockfd, struct sockaddr* name, socklen_t* namelen)¶
Arguments:¶
Return Value:¶
nsa_getsockname() returns 0 in case of success (with the actual address size stored into the "namelen" variable), or -1 in case of error. The error code will be set in the errno variable.¶
See the getsockname() documentation for details.¶
nsa_getpeername() obtains the first remote address of a connected socket. Note: this function is provided as legacy wrapper, and it is RECOMMENDED to use nsa_getpaddrs() instead to support multi-homed transport protocols!¶
Function Prototype:¶
int nsa_getpeername(int sockfd, struct sockaddr* name, socklen_t* namelen)¶
Arguments:¶
Return Value:¶
nsa_getpeername() returns 0 in case of success (with the actual address size stored into the "namelen" variable), or -1 in case of error. The error code will be set in the errno variable.¶
See the getpeername() documentation for details.¶
nsa_getladdrs() obtains the local addresses of a socket. The storage space for the addresses will be automatically allocated and needs to be freed by nsa_freeladdrs().¶
Function Prototype:¶
int nsa_getladdrs(int sockfd, neat_assoc_t id, struct sockaddr** addrs)¶
Arguments:¶
nsa_getladdrs() returns the number of addresses stored into a newly allocated space. The pointer to this space is stored into the variable provided by "addrs". In case of error, -1 is returned, and the error code will be set in the errno variable.¶
nsa_freeladdrs() frees addresses obtained by nsa_getladdrs().¶
Function Prototype:¶
void nsa_freeladdrs(struct sockaddr* addrs)¶
Arguments:¶
nsa_getpaddrs() obtains the remote addresses of a connected socket. The storage space for the addresses will be automatically allocated and needs to be freed by nsa_freepaddrs().¶
Function Prototype:¶
int nsa_getpaddrs(int sockfd, neat_assoc_t id, struct sockaddr** addrs)¶
Arguments:¶
nsa_getpaddrs() returns the number of addresses stored into a newly allocated space. The pointer to this space is stored into the variable provided by "addrs". In case of error, -1 is returned, and the error code will be set in the errno variable.¶
nsa_freepaddrs() frees addresses obtained by nsa_getpaddrs().¶
Function Prototype:¶
void nsa_freepaddrs(struct sockaddr* addrs)¶
Arguments:¶
This section contains miscellaneous wrapper functions, mostly around file I/O. Since Unix file descriptors are used together with socket descriptors in functions like poll(), select(), etc., it is necessary to wrap functions handling file descriptors as well.¶
nsa_open() is a wrapper around the open() call, returning a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_open(const char* pathname, int flags, mode_t mode)¶
See the open() documentation for details.¶
nsa_creat() is a wrapper around the creat() call, returning a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_creat(const char* pathname, mode_t mode)¶
See the creat() documentation for details.¶
nsa_lockf() is a wrapper around the lockf() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_lockf(int fd, int cmd, off_t len)¶
See the lockf() documentation for details.¶
nsa_lockf64() is a wrapper around the lockf64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_lockf(int fd, int cmd, off64_t len)¶
See the lockf64() documentation for details.¶
nsa_flock() is a wrapper around the flock() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_flock(int fd, int operation)¶
See the flock() documentation for details.¶
nsa_fstat() is a wrapper around the fstat() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_fstat(int fd, struct stat* buf)¶
See the fstat() documentation for details.¶
nsa_fpathconf() is a wrapper around the fpathconf() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
long nsa_fpathconf(int fd, int name)¶
See the fpathconf() documentation for details.¶
nsa_fchown() is a wrapper around the fchown() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_fchown(int fd, uid_t owner, gid_t group)¶
See the fchown() documentation for details.¶
nsa_fsync() is a wrapper around the fsync() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_fsync(int fd)¶
See the fsync() documentation for details.¶
nsa_fdatasync() is a wrapper around the fdatasync() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_fdatasync(int fd)¶
See the fdatasync() documentation for details.¶
nsa_syncfs() is a wrapper around the syncfs() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_syncfs(int fd)¶
See the syncfs() documentation for details.¶
nsa_dup2() is a wrapper around the dup2() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_dup2(int oldfd, int newfd)¶
See the dup2() documentation for details.¶
nsa_dup3() is a wrapper around the dup3() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_dup3(int oldfd, int newfd, int flags)¶
See the dup3() documentation for details.¶
nsa_dup() is a wrapper around the dup() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_dup(int oldfd)¶
See the dup() documentation for details.¶
nsa_lseek() is a wrapper around the lseek() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
off_t nsa_lseek(int fd, off_t offset, int whence)¶
See the lseek() documentation for details.¶
nsa_lseek64() is a wrapper around the lseek64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
off_t nsa_lseek(int fd, off64_t offset, int whence)¶
See the lseek64() documentation for details.¶
nsa_truncate() is a wrapper around the truncate() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_ftruncate(int fd, off_t length)¶
See the truncate() documentation for details.¶
nsa_truncate64() is a wrapper around the truncate64() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_ftruncate(int fd, off64_t length)¶
See the truncate64() documentation for details.¶
nsa_pipe() is a wrapper around the pipe() call, returning NEAT socket descriptors instead.¶
Function Prototype:¶
int nsa_pipe(int fds[2])¶
See the pipe() documentation for details.¶
nsa_ioctl() is a wrapper around the ioctl() call, using a NEAT socket descriptor instead.¶
Function Prototype:¶
int nsa_ioctl(int fd, int request, const void* argp)¶
See the ioctl() documentation for details.¶
Running code examples can be found in the NEAT Git repository, with some tutorial material in [10], [11]:¶
A large-scale and realistic Internet testbed platform with support for the multi-homing feature of the underlying SCTP and MPTCP protocols is NorNet. A description of NorNet is provided in [6], [7], some further information can be found on the project website [9].¶
Security considerations for the SCTP sockets API are described in [2].¶
This document does not require IANA actions.¶
This work was partially funded by the European Union's Horizon 2020 research and innovation programme under grant agreement No. 644334 (NEAT). The views expressed are solely those of the author(s).¶
The author would like to thank David Ros, Michael Welzl, and Xing Zhou for their support.¶