61 #ifndef __INCLUDE_SYS_SOCKET_H 64 #define __INCLUDE_SYS_SOCKET_H 70 #include <tinyara/config.h> 71 #include <sys/sock_internal.h> 72 #include <sys/types.h> 74 #ifdef CONFIG_CUSTOM_SOCKETS 75 #include <net/lwip/sockets.h> 76 #include <net/lwip/api.h> 84 #if defined(__cplusplus) 85 #define EXTERN extern "C" 100 int socket(
int domain,
int type,
int protocol);
111 int bind(
int sockfd, FAR
const struct sockaddr *addr, socklen_t addrlen);
122 int connect(
int sockfd, FAR
const struct sockaddr *addr, socklen_t addrlen);
132 int listen(
int sockfd,
int backlog);
143 int accept(
int sockfd,
struct sockaddr *addr, socklen_t *addrlen);
155 ssize_t
send(
int sockfd, FAR
const void *buf,
size_t len,
int flags);
168 ssize_t
sendto(
int sockfd, FAR
const void *buf,
size_t len,
int flags, FAR
const struct sockaddr *to, socklen_t tolen);
180 ssize_t
recv(
int sockfd, FAR
void *buf,
size_t len,
int flags);
194 ssize_t
recvfrom(
int sockfd, FAR
void *buf,
size_t len,
int flags, FAR
struct sockaddr *from, FAR socklen_t *fromlen);
225 int setsockopt(
int sockfd,
int level,
int option, FAR
const void *value, socklen_t value_len);
238 int getsockopt(
int sockfd,
int level,
int option, FAR
void *value, FAR socklen_t *value_len);
248 int getsockname(
int sockfd, FAR
struct sockaddr *addr, FAR socklen_t *addrlen);
259 int getpeername(
int s,
struct sockaddr *name, socklen_t *namelen);
262 #if defined(__cplusplus) int getsockname(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
get the socket name
int shutdown(int sockfd, int how)
shut down socket send and receive operations
int listen(int sockfd, int backlog)
listen for socket connections and limit the queue of incoming connections
int getpeername(int s, struct sockaddr *name, socklen_t *namelen)
get the name of the peer socket
ssize_t sendto(int sockfd, FAR const void *buf, size_t len, int flags, FAR const struct sockaddr *to, socklen_t tolen)
send a message on a socket
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
requests a connection to be made on a socket
ssize_t recvfrom(int sockfd, FAR void *buf, size_t len, int flags, FAR struct sockaddr *from, FAR socklen_t *fromlen)
receive a message from a socket
int socket(int domain, int type, int protocol)
creates an unbound socket in a communications domain.
int bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
assigns an address to an unnamed socket.
int getsockopt(int sockfd, int level, int option, FAR void *value, FAR socklen_t *value_len)
get the socket options
ssize_t send(int sockfd, FAR const void *buf, size_t len, int flags)
send a message on a socket
int closesocket(int s)
close a socket
int setsockopt(int sockfd, int level, int option, FAR const void *value, socklen_t value_len)
set the socket options
int connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen)
requests a connection to be made on a socket
ssize_t recv(int sockfd, FAR void *buf, size_t len, int flags)
send a message on a socket