IBR-DTNSuite
0.8
|
#include <inttypes.h>
Go to the source code of this file.
Classes | |
struct | dtn_notification |
Defines | |
#define | DTN_NOTIFIY_SHUTDOWN 1 |
#define | DTN_NOTIFIY_ACK 2 |
#define | DTN_NOTIFY_NACK 3 |
#define | DTN_NOTIFY_TOOBIG 4 |
#define | DTN_OPTION_TXCHUNKSIZE 1 |
#define | DTN_OPTION_DSTEID 2 |
#define | DTN_OPTION_FLUSH 3 |
#define | MAX_DTN_FDS 4 |
#define | dtn_flush(ep) dtn_endpoint_set_option(ep, DTN_OPTION_FLUSH) |
#define | KBYTE(x) x*1024 |
#define | MBYTE(x) x*1024*1024 |
Typedefs | |
typedef int32_t | DTN_EP |
Functions | |
void | dtn_hithere () |
DTN_EP | dtn_register_endpoint (char *ep, void(*process_bundle)(const void *data, uint32_t size), void(*status_callback)(struct dtn_notification info)) |
void | dtn_send_bundle (int32_t dtnd, char *dst_uri, char *data, uint32_t length) |
void | dtn_write (DTN_EP ep, const void *data, uint32_t length) |
int32_t | dtn_read (DTN_EP ep, void *buf, uint32_t length) |
void | dtn_close_endpoint (DTN_EP ep) |
void | dtn_endpoint_set_option (DTN_EP ep, uint16_t option,...) |
#define dtn_flush | ( | ep | ) | dtn_endpoint_set_option(ep, DTN_OPTION_FLUSH) |
#define DTN_NOTIFIY_ACK 2 |
#define DTN_NOTIFIY_SHUTDOWN 1 |
#define DTN_NOTIFY_NACK 3 |
#define DTN_NOTIFY_TOOBIG 4 |
#define DTN_OPTION_DSTEID 2 |
you have to set a destination EID before dtn_write() can be used
Definition at line 37 of file dtn_api.h.
Referenced by main().
#define DTN_OPTION_FLUSH 3 |
#define DTN_OPTION_TXCHUNKSIZE 1 |
#define MAX_DTN_FDS 4 |
typedef int32_t DTN_EP |
void dtn_close_endpoint | ( | DTN_EP | ep | ) |
Close dtn endpoint
Referenced by bundle_received().
void dtn_endpoint_set_option | ( | DTN_EP | ep, |
uint16_t | option, | ||
... | |||
) |
Set options for this dtn socket
Referenced by main().
void dtn_hithere | ( | ) |
Test stuff
Referenced by main().
Blocking read. This can only be used if the process_bundle callback was NULL in register_endpoint. Returns number of bytes read, or <0 if shit happened
Referenced by main().
DTN_EP dtn_register_endpoint | ( | char * | ep, |
void(*)(const void *data, uint32_t size) | process_bundle, | ||
void(*)(struct dtn_notification info) | status_callback | ||
) |
Register an endpoint on local device.Tries to grab dtn://<this_nodes_address>/<ep> Returns DTN endpoint descriptor on success, or a vlaue <0 if shit happens If receive and notification callbacks are given, they'll be called in case of received data (all data has to fit in RAM in this case) or notifications. Access to process_bundle und dtn_notification is serialized, no need t make them reentrant
Referenced by main().
void dtn_send_bundle | ( | int32_t | dtnd, |
char * | dst_uri, | ||
char * | data, | ||
uint32_t | length | ||
) |
stateless fire&forget send method. No acks, all data has to reside in RAM when intermixing send_bundle calls with calls to the dtn_write() API dtn_send_bundle will be transmitted out-of-band, i.e. if there is still data in
Referenced by main().