52,9 → 52,9 |
/*@{*/ |
|
/** Creates a new socket. |
* @param domain The socket protocol family. Input parameter. |
* @param type Socket type. Input parameter. |
* @param protocol Socket protocol. Input parameter. |
* @param[in] domain The socket protocol family. |
* @param[in] type Socket type. |
* @param[in] protocol Socket protocol. |
* @returns The socket identifier on success. |
* @returns EPFNOTSUPPORT if the protocol family is not supported. |
* @returns ESOCKNOTSUPPORT if the socket type is not supported. |
65,9 → 65,9 |
int socket( int domain, int type, int protocol ); |
|
/** Binds the socket to a port address. |
* @param socket_id Socket identifier. Input parameter. |
* @param my_addr The port address. Input parameter. |
* @param addrlen The address length. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] my_addr The port address. |
* @param[in] addrlen The address length. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the my_addr parameter is NULL. |
77,8 → 77,8 |
int bind( int socket_id, const struct sockaddr * my_addr, socklen_t addrlen ); |
|
/** Sets the number of connections waiting to be accepted. |
* @param socket_id Socket identifier. Input parameter. |
* @param backlog The maximum number of waiting sockets to be accepted. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] backlog The maximum number of waiting sockets to be accepted. |
* @returns EOK on success. |
* @returns EINVAL if the backlog parameter is not positive (<=0). |
* @returns ENOTSOCK if the socket is not found. |
88,9 → 88,9 |
|
/** Accepts waiting socket. |
* Blocks until such a socket exists. |
* @param socket_id Socket identifier. Input parameter. |
* @param cliaddr The remote client address. Output parameter. |
* @param addrlen The address length. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[out] cliaddr The remote client address. |
* @param[in] addrlen The address length. |
* @returns EOK on success. |
* @returns EBADMEM if the cliaddr or addrlen parameter is NULL. |
* @returns EINVAL if the backlog parameter is not positive (<=0). |
100,9 → 100,9 |
int accept( int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen ); |
|
/** Connects socket to the remote server. |
* @param socket_id Socket identifier. Input parameter. |
* @param serv_addr The remote server address. Input parameter. |
* @param addrlen The address length. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] serv_addr The remote server address. |
* @param[in] addrlen The address length. |
* @returns EOK on success. |
* @returns EBADMEM if the serv_addr parameter is NULL. |
* @returns NO_DATA if the addlen parameter is zero (0). |
112,7 → 112,7 |
int connect( int socket_id, const struct sockaddr * serv_addr, socklen_t addrlen ); |
|
/** Closes the socket. |
* @param socket_id Socket identifier. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EINPROGRESS if there is another blocking function in progress. |
121,10 → 121,10 |
int closesocket( int socket_id ); |
|
/** Sends data via the socket. |
* @param socket_id Socket identifier. Input parameter. |
* @param data The data to be sent. Input parameter. |
* @param datalength The data length. Input parameter. |
* @param flags Various send flags. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] data The data to be sent. |
* @param[in] datalength The data length. |
* @param[in] flags Various send flags. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the data parameter is NULL. |
135,12 → 135,12 |
|
/** Sends data via the socket to the remote address. |
* Binds the socket to a free port if not already connected/bound. |
* @param socket_id Socket identifier. Input parameter. |
* @param data The data to be sent. Input parameter. |
* @param datalength The data length. Input parameter. |
* @param flags Various send flags. Input parameter. |
* @param toaddr The destination address. Input parameter. |
* @param addrlen The address length. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] data The data to be sent. |
* @param[in] datalength The data length. |
* @param[in] flags Various send flags. |
* @param[in] toaddr The destination address. |
* @param[in] addrlen The address length. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the data or toaddr parameter is NULL. |
150,10 → 150,10 |
int sendto( int socket_id, const void * data, size_t datalength, int flags, const struct sockaddr * toaddr, socklen_t addrlen ); |
|
/** Receives data via the socket. |
* @param socket_id Socket identifier. Input parameter. |
* @param data The data buffer to be filled. Output parameter. |
* @param datalength The data length. Input parameter. |
* @param flags Various receive flags. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[out] data The data buffer to be filled. |
* @param[in] datalength The data length. |
* @param[in] flags Various receive flags. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the data parameter is NULL. |
163,12 → 163,12 |
int recv( int socket_id, void * data, size_t datalength, int flags ); |
|
/** Receives data via the socket. |
* @param socket_id Socket identifier. Input parameter. |
* @param data The data buffer to be filled. Output parameter. |
* @param datalength The data length. Input parameter. |
* @param flags Various receive flags. Input parameter. |
* @param fromaddr The source address. Output parameter. |
* @param addrlen The address length. The maximum address length is read. The actual address length is set. Input/output parameter. |
* @param[in] socket_id Socket identifier. |
* @param[out] data The data buffer to be filled. |
* @param[in] datalength The data length. |
* @param[in] flags Various receive flags. |
* @param[out] fromaddr The source address. |
* @param[in,out] addrlen The address length. The maximum address length is read. The actual address length is set. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the data or fromaddr parameter is NULL. |
178,11 → 178,11 |
int recvfrom( int socket_id, void * data, size_t datalength, int flags, struct sockaddr * fromaddr, socklen_t * addrlen ); |
|
/** Gets socket option. |
* @param socket_id Socket identifier. Input parameter. |
* @param level The socket options level. Input parameter. |
* @param optname The socket option to be get. Input parameter. |
* @param value The value buffer to be filled. Output parameter. |
* @param optlen The value buffer length. The maximum length is read. The actual length is set. Input/output parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] level The socket options level. |
* @param[in] optname The socket option to be get. |
* @param[out] value The value buffer to be filled. |
* @param[in,out] optlen The value buffer length. The maximum length is read. The actual length is set. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the value or optlen parameter is NULL. |
192,11 → 192,11 |
int getsockopt( int socket_id, int level, int optname, void * value, size_t * optlen ); |
|
/** Sets socket option. |
* @param socket_id Socket identifier. Input parameter. |
* @param level The socket options level. Input parameter. |
* @param optname The socket option to be set. Input parameter. |
* @param value The value to be set. Input parameter. |
* @param optlen The value length. Input parameter. |
* @param[in] socket_id Socket identifier. |
* @param[in] level The socket options level. |
* @param[in] optname The socket option to be set. |
* @param[in] value The value to be set. |
* @param[in] optlen The value length. |
* @returns EOK on success. |
* @returns ENOTSOCK if the socket is not found. |
* @returns EBADMEM if the value parameter is NULL. |