dtn_types_xdr.c File Reference

#include "dtn_types.h"
#include <limits.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_MAX_BLOCK_LEN   1024
#define DTN_MAX_BLOCKS   256
#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_timestamp_t (XDR *xdrs, dtn_timestamp_t *objp)
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_flags_t (XDR *xdrs, dtn_reg_flags_t *objp)
 Value for an unspecified registration cookie (i.e.
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_extension_block_flags_t (XDR *xdrs, dtn_extension_block_flags_t *objp)
 Extension block flags.
bool_t xdr_dtn_extension_block_t (XDR *xdrs, dtn_extension_block_t *objp)
 Extension block.
bool_t xdr_dtn_sequence_id_t (XDR *xdrs, dtn_sequence_id_t *objp)
 A Sequence ID is a vector of (EID, counter) values in the following text format:
bool_t xdr_dtn_bundle_spec_t (XDR *xdrs, dtn_bundle_spec_t *objp)
 Bundle metadata.
bool_t xdr_dtn_bundle_id_t (XDR *xdrs, dtn_bundle_id_t *objp)
 Type definition for a unique bundle identifier.
bool_t xdr_dtn_status_report_reason_t (XDR *xdrs, dtn_status_report_reason_t *objp)
 Bundle Status Report "Reason Code" flags.
bool_t xdr_dtn_status_report_flags_t (XDR *xdrs, dtn_status_report_flags_t *objp)
 Bundle Status Report status flags that indicate which timestamps in the status report structure are valid.
bool_t xdr_dtn_bundle_status_report_t (XDR *xdrs, dtn_bundle_status_report_t *objp)
 Type definition for a bundle status report.
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 contains the data in-band, in the 'buf' field.
bool_t xdr_dtn_bundle_payload_t (XDR *xdrs, dtn_bundle_payload_t *objp)

Define Documentation

#define DTN_MAX_AUTHDATA   1024

Definition at line 41 of file dtn_types_xdr.c.

#define DTN_MAX_BLOCK_LEN   1024

Definition at line 44 of file dtn_types_xdr.c.

#define DTN_MAX_BLOCKS   256

Definition at line 45 of file dtn_types_xdr.c.

#define DTN_MAX_BUNDLE_MEM   50000

Definition at line 43 of file dtn_types_xdr.c.

#define DTN_MAX_ENDPOINT_ID   256

Definition at line 38 of file dtn_types_xdr.c.

#define DTN_MAX_EXEC_LEN   ARG_MAX

Definition at line 40 of file dtn_types_xdr.c.

#define DTN_MAX_PATH_LEN   PATH_MAX

Definition at line 39 of file dtn_types_xdr.c.

#define DTN_MAX_REGION_LEN   64

Definition at line 42 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 98 of file dtn_types_xdr.c.


Function Documentation

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 DOPTS_SINGLETON_DEST - destination is a singleton DOPTS_MULTINODE_DEST - destination is not a singleton DOPTS_DO_NOT_FRAGMENT - set the do not fragment bit

Definition at line 221 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_bundle_id_t ( XDR *  xdrs,
dtn_bundle_id_t objp 
)

Type definition for a unique bundle identifier.

Returned from dtn_send after the daemon has assigned the creation_secs and creation_subsecs, in which case orig_length and frag_offset are always zero, and also in status report data in which case they may be set if the bundle is fragmented.

Definition at line 337 of file dtn_types_xdr.c.

References buf, dtn_bundle_id_t::creation_ts, FALSE, dtn_bundle_id_t::frag_offset, dtn_bundle_id_t::orig_length, dtn_bundle_id_t::source, TRUE, xdr_dtn_endpoint_id_t(), and xdr_dtn_timestamp_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 contains the data in-band, in the 'buf' field.

When sending a bundle, if the location specifies that the payload is in a temp file, then the daemon assumes ownership of the file and should have sufficient permissions to move or rename it.

When receiving a bundle that is a status report, then the status_report pointer will be non-NULL and will point to a dtn_bundle_status_report_t structure which contains the parsed fields of the status report.

DTN_PAYLOAD_MEM - payload contents in memory DTN_PAYLOAD_FILE - payload contents in file DTN_PAYLOAD_TEMP_FILE - in file, assume ownership (send only)

Definition at line 430 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_bundle_payload_t ( XDR *  xdrs,
dtn_bundle_payload_t objp 
)
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 195 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_bundle_spec_t ( XDR *  xdrs,
dtn_bundle_spec_t objp 
)
bool_t xdr_dtn_bundle_status_report_t ( XDR *  xdrs,
dtn_bundle_status_report_t objp 
)
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 57 of file dtn_types_xdr.c.

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

bool_t xdr_dtn_extension_block_flags_t ( XDR *  xdrs,
dtn_extension_block_flags_t objp 
)

Extension block flags.

Note that multiple flags may be selected for a given block.

BLOCK_FLAG_NONE - no flags BLOCK_FLAG_REPLICATE - block must be replicated in every fragment BLOCK_FLAG_REPORT - transmit report if block can't be processed BLOCK_FLAG_DELETE_BUNDLE - delete bundle if block can't be processed BLOCK_FLAG_LAST - last block BLOCK_FLAG_DISCARD_BLOCK - discard block if it can't be processed BLOCK_FLAG_UNPROCESSED - block was forwarded without being processed

Definition at line 244 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_extension_block_t ( XDR *  xdrs,
dtn_extension_block_t objp 
)
bool_t xdr_dtn_reg_flags_t ( XDR *  xdrs,
dtn_reg_flags_t objp 
)

Value for an unspecified registration cookie (i.e.

indication that the daemon should allocate a new unique id). Registration flags are a bitmask of the following: Delivery failure actions (exactly one must be selected): 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

Session flags: DTN_SESSION_CUSTODY - app assumes custody for the session DTN_SESSION_PUBLISH - creates a publication point DTN_SESSION_SUBSCRIBE - create subscription for the session

Definition at line 153 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_reg_id_t ( XDR *  xdrs,
dtn_reg_id_t objp 
)

A registration cookie.

Definition at line 72 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_reg_info_t ( XDR *  xdrs,
dtn_reg_info_t objp 
)
bool_t xdr_dtn_sequence_id_t ( XDR *  xdrs,
dtn_sequence_id_t objp 
)

A Sequence ID is a vector of (EID, counter) values in the following text format:

< (EID1 counter1) (EID2 counter2) ... >

Definition at line 279 of file dtn_types_xdr.c.

References buf, dtn_sequence_id_t::data, dtn_sequence_id_t::data_len, dtn_sequence_id_t::data_val, DTN_MAX_BLOCK_LEN, FALSE, and TRUE.

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 122 of file dtn_types_xdr.c.

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

bool_t xdr_dtn_status_report_flags_t ( XDR *  xdrs,
dtn_status_report_flags_t objp 
)

Bundle Status Report status flags that indicate which timestamps in the status report structure are valid.

Definition at line 370 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_status_report_reason_t ( XDR *  xdrs,
dtn_status_report_reason_t objp 
)

Bundle Status Report "Reason Code" flags.

Definition at line 356 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

bool_t xdr_dtn_timestamp_t ( XDR *  xdrs,
dtn_timestamp_t objp 
)

Definition at line 101 of file dtn_types_xdr.c.

References buf, FALSE, dtn_timestamp_t::secs, dtn_timestamp_t::seqno, and TRUE.

bool_t xdr_dtn_timeval_t ( XDR *  xdrs,
dtn_timeval_t objp 
)

DTN timeouts are specified in seconds.

Definition at line 86 of file dtn_types_xdr.c.

References buf, FALSE, and TRUE.

Generated on Sun Nov 21 11:40:49 2010 for DTN Reference Implementation by  doxygen 1.6.3