#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_MAX_BLOCK_LEN 64 |
#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_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_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_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 DTN_MAX_AUTHDATA 1024 |
Definition at line 44 of file dtn_types_xdr.c.
#define DTN_MAX_BLOCK_LEN 64 |
Definition at line 47 of file dtn_types_xdr.c.
#define DTN_MAX_BLOCKS 256 |
Definition at line 48 of file dtn_types_xdr.c.
#define DTN_MAX_BUNDLE_MEM 50000 |
Definition at line 46 of file dtn_types_xdr.c.
#define DTN_MAX_ENDPOINT_ID 256 |
Definition at line 41 of file dtn_types_xdr.c.
#define DTN_MAX_EXEC_LEN ARG_MAX |
Definition at line 43 of file dtn_types_xdr.c.
#define DTN_MAX_PATH_LEN PATH_MAX |
Definition at line 42 of file dtn_types_xdr.c.
#define DTN_MAX_REGION_LEN 64 |
Definition at line 45 of file dtn_types_xdr.c.
#define DTN_TIMEOUT_INF ((dtn_timeval_t)-1) |
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 214 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::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 300 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::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.
Note that there is a limit (DTN_MAX_BUNDLE_MEM) on the maximum size bundle payload that can be sent or received in memory.
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 - copy contents from memory DTN_PAYLOAD_FILE - file copy the contents of the file DTN_PAYLOAD_TEMP_FILE - assume ownership of the file
Definition at line 396 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.
bool_t xdr_dtn_bundle_payload_t | ( | XDR * | xdrs, | |
dtn_bundle_payload_t * | objp | |||
) |
Definition at line 406 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, dtn_bundle_payload_t::buf_len, dtn_bundle_payload_t::buf_val, DTN_MAX_BUNDLE_MEM, DTN_MAX_PATH_LEN, FALSE, dtn_bundle_payload_t::filename, dtn_bundle_payload_t::filename_len, dtn_bundle_payload_t::filename_val, dtn_bundle_payload_t::location, dtn_bundle_payload_t::status_report, TRUE, xdr_dtn_bundle_payload_location_t(), and xdr_dtn_bundle_status_report_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 191 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.
bool_t xdr_dtn_bundle_spec_t | ( | XDR * | xdrs, | |
dtn_bundle_spec_t * | objp | |||
) |
Bundle metadata.
Definition at line 269 of file dtn_types_xdr.c.
References dtn_bundle_spec_t::blocks, dtn_bundle_spec_t::blocks_len, dtn_bundle_spec_t::blocks_val, dtn_bundle_payload_t::buf, dtn_bundle_spec_t::dest, dtn_bundle_spec_t::dopts, DTN_MAX_BLOCKS, 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(), xdr_dtn_extension_block_t(), and xdr_dtn_timeval_t().
bool_t xdr_dtn_bundle_status_report_t | ( | XDR * | xdrs, | |
dtn_bundle_status_report_t * | objp | |||
) |
Type definition for a bundle status report.
Definition at line 347 of file dtn_types_xdr.c.
References dtn_bundle_status_report_t::ack_by_app_tv_, dtn_bundle_payload_t::buf, dtn_bundle_status_report_t::bundle_id, dtn_bundle_status_report_t::custody_tv_, dtn_bundle_status_report_t::deletion_tv_, dtn_bundle_status_report_t::delivery_tv_, FALSE, dtn_bundle_status_report_t::flags, dtn_bundle_status_report_t::forwarding_tv_, dtn_bundle_status_report_t::reason, dtn_bundle_status_report_t::receipt_ts, TRUE, xdr_dtn_bundle_id_t(), xdr_dtn_status_report_flags_t(), xdr_dtn_status_report_reason_t(), and xdr_dtn_timestamp_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 60 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::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 237 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.
bool_t xdr_dtn_extension_block_t | ( | XDR * | xdrs, | |
dtn_extension_block_t * | objp | |||
) |
Extension block.
Definition at line 251 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, dtn_extension_block_t::data, dtn_extension_block_t::data_len, dtn_extension_block_t::data_val, DTN_MAX_BLOCK_LEN, FALSE, dtn_extension_block_t::flags, TRUE, and dtn_extension_block_t::type.
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 149 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.
bool_t xdr_dtn_reg_id_t | ( | XDR * | xdrs, | |
dtn_reg_id_t * | objp | |||
) |
A registration cookie.
Definition at line 75 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.
bool_t xdr_dtn_reg_info_t | ( | XDR * | xdrs, | |
dtn_reg_info_t * | objp | |||
) |
Registration state.
Definition at line 163 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, 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 125 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::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 333 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::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 319 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.
bool_t xdr_dtn_timestamp_t | ( | XDR * | xdrs, | |
dtn_timestamp_t * | objp | |||
) |
Definition at line 104 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::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 89 of file dtn_types_xdr.c.
References dtn_bundle_payload_t::buf, FALSE, and TRUE.