dtn_types_xdr.c File Reference

#include "dtn_types.h"
#include <limits.h>
#include <rpc/rpc.h>

Go to the source code of this file.

Defines

#define DTN_MAX_ENDPOINT_ID   256
#define DTN_MAX_PATH_LEN   PATH_MAX
#define DTN_MAX_EXEC_LEN   ARG_MAX
#define DTN_MAX_AUTHDATA   1024
#define DTN_MAX_REGION_LEN   64
#define DTN_MAX_BUNDLE_MEM   50000
#define DTN_TIMEOUT_INF   ((dtn_timeval_t)-1)
 An infinite wait is a timeout of -1.

Functions

bool_t xdr_dtn_endpoint_id_t (XDR *xdrs, dtn_endpoint_id_t *objp)
 Specification of a dtn endpoint id, i.e.
bool_t xdr_dtn_reg_id_t (XDR *xdrs, dtn_reg_id_t *objp)
 A registration cookie.
bool_t xdr_dtn_timeval_t (XDR *xdrs, dtn_timeval_t *objp)
 DTN timeouts are specified in seconds.
bool_t xdr_dtn_service_tag_t (XDR *xdrs, dtn_service_tag_t *objp)
 Specification of a service tag used in building a local endpoint identifier.
bool_t xdr_dtn_reg_failure_action_t (XDR *xdrs, dtn_reg_failure_action_t *objp)
 Registration delivery failure actions DTN_REG_DROP - drop bundle if registration not active DTN_REG_DEFER - spool bundle for later retrieval DTN_REG_EXEC - exec program on bundle arrival.
bool_t xdr_dtn_reg_info_t (XDR *xdrs, dtn_reg_info_t *objp)
 Registration state.
bool_t xdr_dtn_bundle_priority_t (XDR *xdrs, dtn_bundle_priority_t *objp)
 Bundle priority specifier.
bool_t xdr_dtn_bundle_delivery_opts_t (XDR *xdrs, dtn_bundle_delivery_opts_t *objp)
 Bundle delivery option flags.
bool_t xdr_dtn_bundle_spec_t (XDR *xdrs, dtn_bundle_spec_t *objp)
 Bundle metadata.
bool_t xdr_dtn_bundle_payload_location_t (XDR *xdrs, dtn_bundle_payload_location_t *objp)
 The payload of a bundle can be sent or received either in a file, in which case the payload structure contains the filename, or in memory where the struct has the actual data.
bool_t xdr_dtn_bundle_payload_t (XDR *xdrs, dtn_bundle_payload_t *objp)
bool_t xdr_dtn_bundle_id_t (XDR *xdrs, dtn_bundle_id_t *objp)
 Type definition for a bundle identifier as returned from dtn_send.
bool_t xdr_dtn_bundle_auth_t (XDR *xdrs, dtn_bundle_auth_t *objp)
 Bundle authentication data.


Define Documentation

#define DTN_MAX_AUTHDATA   1024

Definition at line 68 of file dtn_types_xdr.c.

#define DTN_MAX_BUNDLE_MEM   50000

Definition at line 70 of file dtn_types_xdr.c.

#define DTN_MAX_ENDPOINT_ID   256

Definition at line 65 of file dtn_types_xdr.c.

#define DTN_MAX_EXEC_LEN   ARG_MAX

Definition at line 67 of file dtn_types_xdr.c.

#define DTN_MAX_PATH_LEN   PATH_MAX

Definition at line 66 of file dtn_types_xdr.c.

#define DTN_MAX_REGION_LEN   64

Definition at line 69 of file dtn_types_xdr.c.

#define DTN_TIMEOUT_INF   ((dtn_timeval_t)-1)

An infinite wait is a timeout of -1.

Definition at line 123 of file dtn_types_xdr.c.


Function Documentation

bool_t xdr_dtn_bundle_auth_t ( XDR *  xdrs,
dtn_bundle_auth_t objp 
)

Bundle authentication data.

TBD

Definition at line 321 of file dtn_types_xdr.c.

References dtn_bundle_auth_t::blob, dtn_bundle_auth_t::blob_len, dtn_bundle_auth_t::blob_val, DTN_MAX_AUTHDATA, FALSE, and TRUE.

bool_t xdr_dtn_bundle_delivery_opts_t ( XDR *  xdrs,
dtn_bundle_delivery_opts_t objp 
)

Bundle delivery option flags.

Note that multiple options may be selected for a given bundle.

DOPTS_NONE - no custody, etc DOPTS_CUSTODY - custody xfer DOPTS_DELIVERY_RCPT - end to end delivery (i.e. return receipt) DOPTS_RECEIVE_RCPT - per hop arrival receipt DOPTS_FORWARD_RCPT - per hop departure receipt DOPTS_CUSTODY_RCPT - per custodian receipt DOPTS_DELETE_RCPT - request deletion receipt

Definition at line 224 of file dtn_types_xdr.c.

References FALSE, and TRUE.

bool_t xdr_dtn_bundle_id_t ( XDR *  xdrs,
dtn_bundle_id_t objp 
)

Type definition for a bundle identifier as returned from dtn_send.

Definition at line 303 of file dtn_types_xdr.c.

References dtn_bundle_id_t::creation_secs, dtn_bundle_id_t::creation_subsecs, FALSE, dtn_bundle_id_t::source, TRUE, and xdr_dtn_endpoint_id_t().

bool_t xdr_dtn_bundle_payload_location_t ( XDR *  xdrs,
dtn_bundle_payload_location_t objp 
)

The payload of a bundle can be sent or received either in a file, in which case the payload structure contains the filename, or in memory where the struct has the actual data.

Note that there is a limit (DTN_MAX_BUNDLE_MEM) on the maximum size bundle payload that can be sent or received in memory.

Definition at line 267 of file dtn_types_xdr.c.

References FALSE, and TRUE.

bool_t xdr_dtn_bundle_payload_t ( XDR *  xdrs,
dtn_bundle_payload_t objp 
)

Definition at line 277 of file dtn_types_xdr.c.

References dtn_bundle_payload_t::buf, dtn_bundle_payload_t::dtn_bundle_payload_t_u, DTN_MAX_BUNDLE_MEM, DTN_MAX_PATH_LEN, DTN_PAYLOAD_FILE, DTN_PAYLOAD_MEM, FALSE, dtn_bundle_payload_t::filename, dtn_bundle_payload_t::location, TRUE, and xdr_dtn_bundle_payload_location_t().

bool_t xdr_dtn_bundle_priority_t ( XDR *  xdrs,
dtn_bundle_priority_t objp 
)

Bundle priority specifier.

COS_BULK - lowest priority COS_NORMAL - regular priority COS_EXPEDITED - important COS_RESERVED - TBD

Definition at line 201 of file dtn_types_xdr.c.

References FALSE, and TRUE.

bool_t xdr_dtn_bundle_spec_t ( XDR *  xdrs,
dtn_bundle_spec_t objp 
)

Bundle metadata.

Definition at line 238 of file dtn_types_xdr.c.

References dtn_bundle_spec_t::dest, dtn_bundle_spec_t::dopts, dtn_bundle_spec_t::expiration, FALSE, dtn_bundle_spec_t::priority, dtn_bundle_spec_t::replyto, dtn_bundle_spec_t::source, TRUE, xdr_dtn_bundle_priority_t(), xdr_dtn_endpoint_id_t(), and xdr_dtn_timeval_t().

bool_t xdr_dtn_endpoint_id_t ( XDR *  xdrs,
dtn_endpoint_id_t objp 
)

Specification of a dtn endpoint id, i.e.

a URI, implemented as a fixed-length char buffer. Note that for efficiency reasons, this fixed length is relatively small (256 bytes).

The alternative is to use the string XDR type but then all endpoint ids would require malloc / free which is more prone to leaks / bugs.

Definition at line 82 of file dtn_types_xdr.c.

References DTN_MAX_ENDPOINT_ID, FALSE, TRUE, and dtn_endpoint_id_t::uri.

bool_t xdr_dtn_reg_failure_action_t ( XDR *  xdrs,
dtn_reg_failure_action_t objp 
)

Registration delivery failure actions DTN_REG_DROP - drop bundle if registration not active DTN_REG_DEFER - spool bundle for later retrieval DTN_REG_EXEC - exec program on bundle arrival.

Definition at line 159 of file dtn_types_xdr.c.

References FALSE, and TRUE.

bool_t xdr_dtn_reg_id_t ( XDR *  xdrs,
dtn_reg_id_t objp 
)

A registration cookie.

Definition at line 97 of file dtn_types_xdr.c.

References FALSE, and TRUE.

bool_t xdr_dtn_reg_info_t ( XDR *  xdrs,
dtn_reg_info_t objp 
)

Registration state.

Definition at line 173 of file dtn_types_xdr.c.

References DTN_MAX_EXEC_LEN, dtn_reg_info_t::endpoint, dtn_reg_info_t::expiration, dtn_reg_info_t::failure_action, FALSE, dtn_reg_info_t::init_passive, dtn_reg_info_t::regid, dtn_reg_info_t::script, dtn_reg_info_t::script_len, dtn_reg_info_t::script_val, TRUE, xdr_dtn_endpoint_id_t(), xdr_dtn_reg_failure_action_t(), xdr_dtn_reg_id_t(), and xdr_dtn_timeval_t().

bool_t xdr_dtn_service_tag_t ( XDR *  xdrs,
dtn_service_tag_t objp 
)

Specification of a service tag used in building a local endpoint identifier.

Note that the application cannot (in general) expect to be able to use the full DTN_MAX_ENDPOINT_ID, as there is a chance of overflow when the daemon concats the tag with its own local endpoint id.

Definition at line 135 of file dtn_types_xdr.c.

References DTN_MAX_ENDPOINT_ID, FALSE, dtn_service_tag_t::tag, and TRUE.

bool_t xdr_dtn_timeval_t ( XDR *  xdrs,
dtn_timeval_t objp 
)

DTN timeouts are specified in seconds.

Definition at line 111 of file dtn_types_xdr.c.

References FALSE, and TRUE.


Generated on Fri Dec 22 14:48:01 2006 for DTN Reference Implementation by  doxygen 1.5.1