| /* |
| * File: UdpTransport.h |
| * Author: jefft0 |
| * |
| * Created on July 14, 2013, 4:15 PM |
| */ |
| |
| #ifndef NDN_UDPTRANSPORT_H |
| #define NDN_UDPTRANSPORT_H |
| |
| #include "socket-transport.h" |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| struct ndn_UdpTransport { |
| struct ndn_SocketTransport base; |
| }; |
| |
| static inline void ndn_UdpTransport_init(struct ndn_UdpTransport *self) |
| { |
| ndn_SocketTransport_init(&self->base); |
| } |
| |
| static inline ndn_Error ndn_UdpTransport_connect(struct ndn_UdpTransport *self, char *host, unsigned short port) |
| { |
| return ndn_SocketTransport_connect(&self->base, SOCKET_UDP, host, port); |
| } |
| |
| static inline ndn_Error ndn_UdpTransport_send(struct ndn_UdpTransport *self, unsigned char *data, unsigned int dataLength) |
| { |
| return ndn_SocketTransport_send(&self->base, data, dataLength); |
| } |
| |
| static inline ndn_Error ndn_UdpTransport_receive |
| (struct ndn_UdpTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes) |
| { |
| return ndn_SocketTransport_receive(&self->base, buffer, bufferLength, nBytes); |
| } |
| |
| static inline ndn_Error ndn_UdpTransport_close(struct ndn_UdpTransport *self) |
| { |
| return ndn_SocketTransport_close(&self->base); |
| } |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #endif |