dn_udp.h
Go to the documentation of this file.
1 #ifndef DN_UDP_H_
2 #define DN_UDP_H_
3 
36 #ifndef _DN_EXP_UDP
37 #define _DN_EXP_UDP
38 #endif /* _DN_EXP_UDP */
39 
44 #define UDP_MAX_PACKET (503)
45 
50 #define UDP_MAX_DATA (488)
51 
56 struct udpaddr
57 {
58  int flag;
59  struct sockaddr_in addr;
60 };
61 
62 #ifdef __cplusplus
63 extern "C"
64 {
65 #endif
66 
74  udp_open(void *param, int *sock);
75 
82  udp_close(int *sock);
83 
93  udp_send(int sock, const char *buf, uint32_t len_buf, void *arg);
94 
105  udp_recv(int sock, char *buf, uint32_t len_buf, uint32_t *len_recved,
106  uint32_t timeout, void *arg);
107 
115  udp_set_timeout(int sock, uint32_t timeout);
116 
124  udp_clear(int sock, uint32_t timeout);
125 
133  udp_check_sockaddr(const struct sockaddr_in *sock_to,
134  const struct sockaddr_in *sock_from);
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif /* DN_UDP_H_ */
unsigned uint32_t
Definition: stdint.h:43
int flag
Definition: dn_udp.h:58
_DN_EXP_UDP HRESULT udp_send(int sock, const char *buf, uint32_t len_buf, void *arg)
Sends UDP packet.
Definition: dn_udp.c:94
A type definition for parameters of udp_send and udp_recv.
Definition: dn_udp.h:56
_DN_EXP_UDP HRESULT udp_clear(int sock, uint32_t timeout)
Clears the received buffer.
Definition: dn_udp.c:185
_DN_EXP_UDP HRESULT udp_set_timeout(int sock, uint32_t timeout)
Sets timeout value to the UDP socket.
Definition: dn_udp.c:173
_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.
Definition: dn_udp.c:216
_DN_EXP_UDP HRESULT udp_open(void *param, int *sock)
Opens UDP socket.
Definition: dn_udp.c:52
int32_t HRESULT
Definition: dn_common.h:61
#define _DN_EXP_UDP
Definition: dn_udp.h:37
_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.
Definition: dn_udp.c:135
struct sockaddr_in addr
Definition: dn_udp.h:59
_DN_EXP_UDP HRESULT udp_close(int *sock)
Closes the socket.
Definition: dn_udp.c:80


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