diff options
-rw-r--r-- | nuttx/include/sys/socket.h | 38 | ||||
-rw-r--r-- | nuttx/net/uip/uip-udpconn.c | 2 |
2 files changed, 39 insertions, 1 deletions
diff --git a/nuttx/include/sys/socket.h b/nuttx/include/sys/socket.h index e1204e68a..776c0f403 100644 --- a/nuttx/include/sys/socket.h +++ b/nuttx/include/sys/socket.h @@ -115,6 +115,40 @@ #define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE. */ #define MSG_MORE 0x8000 /* Sender will send more. */ +/* Socket options */ + +#define SO_DEBUG 1 /* Enables recording of debugging information (get/set). + * arg: integer contain boolean value */ +#define SO_ACCEPTCONN 2 /* Reports whether socket listening is enabled (get only). + * arg: returns integer contain boolean value */ +#define SO_BROADCAST 3 /* Permits sending of broadcast messages (get/set). + * arg: integer contain boolean value */ +#define SO_REUSEADDR 4 /* Allow reuse of local addresses (get/set) + * arg: integer contain boolean value */ +#define SO_KEEPALIVE 5 /* Keeps connections active by enabling the periodic transmission + * of messages (get/set). arg: int */ +#define SO_LINGER 6 /* Lingers on a close() if data is present (get/set) + * arg: struct linger */ +#define SO_OOBINLINE 7 /* Leaves received out-of-band data (data marked urgent) inline + * (get/set) arg: integer contain boolean value */ +#define SO_SNDBUF 8 /* Sets send buffer size. arg: integer value (get/set). */ +#define SO_RCVBUF 9 /* Sets receive buffer size. arg: integer value (get/set). */ +#define SO_ERROR 10 /* Reports and clears error statust (get only). arg: returns + * an integer value +#define SO_TYPE 11 /* Reports the socket type (get only). return: int */ +#define SO_DONTROUTE 12 /* equests that outgoing messages bypass standard routing + * arg: integer contain boolean value */ +#define SO_RCVLOWAT 13 /* Sets the minimum number of bytes to process for socket input + * (get/set). arg: integer value */ +#define SO_RCVTIMEO 14 /* Sets the timeout value that specifies the maximum amount of time + * an input function waits until it completes (get/set). + * arg: struct timeval */ +#define SO_SNDLOWAT 15 /* Sets the minimum number of bytes to process for socket output + * (get/set). arg: integer value */ +#define SO_SNDTIMEO 16 /* Sets the timeout value specifying the amount of time that an + * output function blocks because flow control prevents data from + * being sent(get/set). arg: struct timeval */ + /**************************************************************************** * Type Definitions ****************************************************************************/ @@ -149,6 +183,10 @@ EXTERN ssize_t recv(int sockfd, void *buf, size_t len, int flags); EXTERN ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); +EXTERN int setsockopt(int sockfd, int level, int option, + const void *value, socklen_t value_len); +EXTERN int setsockopt(int sockfd, int level, int option, + const void *value, socklen_t value_len); #undef EXTERN #if defined(__cplusplus) diff --git a/nuttx/net/uip/uip-udpconn.c b/nuttx/net/uip/uip-udpconn.c index 24739bee1..6ed0f6eb9 100644 --- a/nuttx/net/uip/uip-udpconn.c +++ b/nuttx/net/uip/uip-udpconn.c @@ -370,7 +370,7 @@ int uip_udpconnect(struct uip_udp_conn *conn, const struct sockaddr_in *addr) dq_addlast(&conn->node, &g_active_udp_connections); irqrestore(flags); - return conn; + return OK; } #endif /* CONFIG_NET && CONFIG_NET_UDP */ |