UDP API file. More...
Go to the source code of this file.
Classes | |
struct | udpaddr |
A type definition for parameters of udp_send and udp_recv. More... | |
Defines | |
#define | _DN_EXP_UDP |
#define | UDP_MAX_DATA (488) |
The maximum data size of a UDP packet. | |
#define | UDP_MAX_PACKET (503) |
The maximum buffer size of a UDP packet. | |
Functions | |
_DN_EXP_UDP HRESULT | udp_check_sockaddr (const struct sockaddr_in *sock_to, const struct sockaddr_in *sock_from) |
Checks the socket address. If sock_to and sock_from are equivalent, then returns S_OK. | |
_DN_EXP_UDP HRESULT | udp_clear (int sock, uint32_t timeout) |
Clears the received buffer. | |
_DN_EXP_UDP HRESULT | udp_close (int *sock) |
Closes the socket. | |
_DN_EXP_UDP HRESULT | udp_open (void *param, int *sock) |
Opens UDP socket. | |
_DN_EXP_UDP HRESULT | udp_recv (int sock, char *buf, uint32_t len_buf, uint32_t *len_recved, uint32_t timeout, void *arg) |
Receives UDP packet. | |
_DN_EXP_UDP HRESULT | udp_send (int sock, const char *buf, uint32_t len_buf, void *arg) |
Sends UDP packet. | |
_DN_EXP_UDP HRESULT | udp_set_timeout (int sock, uint32_t timeout) |
Sets timeout value to the UDP socket. |
UDP API file.
Defines UDP APIs.
Software License Agreement (MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file dn_udp.h.
#define _DN_EXP_UDP |
#define UDP_MAX_DATA (488) |
#define UDP_MAX_PACKET (503) |
HRESULT udp_check_sockaddr | ( | const struct sockaddr_in * | sock_to, |
const struct sockaddr_in * | sock_from | ||
) |
HRESULT udp_close | ( | int * | sock | ) |
HRESULT udp_open | ( | void * | param, |
int * | sock | ||
) |
Opens UDP socket.
[in] | param | The pointer of Ethernet connection parameters: CONN_PARAM_ETH. |
[out] | sock | The created socket. |
Software License Agreement (MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[in] | param | The pointer of Ethernet connection parameters: CONN_PARAM_ETH. |
[out] | sock | The created socket. |
HRESULT udp_set_timeout | ( | int | sock, |
uint32_t | timeout | ||
) |