blob: 924e4a70d8129697fbb3716fb87ef2000c042ba1 [file] [log] [blame]
Jeff Thompsonbc53c522013-07-17 17:11:48 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
4 */
5
6#ifndef NDN_UDPTRANSPORT_H
7#define NDN_UDPTRANSPORT_H
8
9#include "../errors.h"
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15struct ndn_UdpTransport {
16 int socketDescriptor; /**< -1 if not connected */
17};
18
19static inline void ndn_UdpTransport_init(struct ndn_UdpTransport *self)
20{
21 self->socketDescriptor = -1;
22}
23
24ndn_Error ndn_UdpTransport_connect(struct ndn_UdpTransport *self, char *host, unsigned short port);
25
26ndn_Error ndn_UdpTransport_send(struct ndn_UdpTransport *self, unsigned char *data, unsigned int dataLength);
27
28ndn_Error ndn_UdpTransport_receive
29 (struct ndn_UdpTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes);
30
31#ifdef __cplusplus
32}
33#endif
34
35#endif