Classes | Macros | Functions
dn_udp.h File Reference

UDP API file. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  udpaddr
 A type definition for parameters of udp_send and udp_recv. More...
 

Macros

#define _DN_EXP_UDP
 
#define UDP_MAX_DATA   (488)
 The maximum data size of a UDP packet. More...
 
#define UDP_MAX_PACKET   (503)
 The maximum buffer size of a UDP packet. More...
 

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. More...
 
_DN_EXP_UDP HRESULT udp_clear (int sock, uint32_t timeout)
 Clears the received buffer. More...
 
_DN_EXP_UDP HRESULT udp_close (int *sock)
 Closes the socket. More...
 
_DN_EXP_UDP HRESULT udp_open (void *param, int *sock)
 Opens UDP socket. More...
 
_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. More...
 
_DN_EXP_UDP HRESULT udp_send (int sock, const char *buf, uint32_t len_buf, void *arg)
 Sends UDP packet. More...
 
_DN_EXP_UDP HRESULT udp_set_timeout (int sock, uint32_t timeout)
 Sets timeout value to the UDP socket. More...
 

Detailed Description

UDP API file.

Defines UDP APIs.

Version
1.0
Date
2014/11/06
Author
DENSO WAVE

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.

Macro Definition Documentation

#define _DN_EXP_UDP

Definition at line 37 of file dn_udp.h.

#define UDP_MAX_DATA   (488)

The maximum data size of a UDP packet.

Definition at line 50 of file dn_udp.h.

#define UDP_MAX_PACKET   (503)

The maximum buffer size of a UDP packet.

Definition at line 44 of file dn_udp.h.

Function Documentation

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.

Parameters
[in]sock_toThe socket address of sender.
[in]sock_fromThe socket address of receiver.

Definition at line 216 of file dn_udp.c.

HRESULT udp_clear ( int  sock,
uint32_t  timeout 
)

Clears the received buffer.

Parameters
[in]sockThe socket to be cleared.
[in]timeoutTimeout value.

Definition at line 185 of file dn_udp.c.

HRESULT udp_close ( int *  sock)

Closes the socket.

Parameters
[in,out]sockThe socket to be closed.

Definition at line 80 of file dn_udp.c.

HRESULT udp_open ( void *  param,
int *  sock 
)

Opens UDP socket.

Parameters
[in]paramThe pointer of Ethernet connection parameters: CONN_PARAM_ETH.
[out]sockThe 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.

Parameters
[in]paramThe pointer of Ethernet connection parameters: CONN_PARAM_ETH.
[out]sockThe created socket.

Definition at line 52 of file dn_udp.c.

HRESULT udp_recv ( int  sock,
char *  buf,
uint32_t  len_buf,
uint32_t len_recved,
uint32_t  timeout,
void *  arg 
)

Receives UDP packet.

Parameters
[in]sockThe socket to receive.
[out]bufThe buffer to be received.
[in]len_bufThe allocated size of received buffer.
[out]len_recvedThe size of received buffer.
[in]argSpecial parameter: udpaddr.

Definition at line 135 of file dn_udp.c.

HRESULT udp_send ( int  sock,
const char *  buf,
uint32_t  len_buf,
void *  arg 
)

Sends UDP packet.

Parameters
[in]sockThe socket to send.
[in]bufThe buffer to be sent.
[in]len_bufThe size of sent buffer.
[in]argSpecial parameter: udpaddr.

Definition at line 94 of file dn_udp.c.

HRESULT udp_set_timeout ( int  sock,
uint32_t  timeout 
)

Sets timeout value to the UDP socket.

Parameters
[in]sockThe socket to be set.
[in]timeoutTimeout value.

Definition at line 173 of file dn_udp.c.



bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:20