dtn_types.h

Go to the documentation of this file.
00001 /*
00002  * Please do not edit this file.
00003  * It was generated using rpcgen.
00004  */
00005 
00006 #ifndef _DTN_TYPES_H_RPCGEN
00007 #define _DTN_TYPES_H_RPCGEN
00008 
00009 #include <rpc/rpc.h>
00010 
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 /*
00017  *    Copyright 2004-2006 Intel Corporation
00018  * 
00019  *    Licensed under the Apache License, Version 2.0 (the "License");
00020  *    you may not use this file except in compliance with the License.
00021  *    You may obtain a copy of the License at
00022  * 
00023  *        http://www.apache.org/licenses/LICENSE-2.0
00024  * 
00025  *    Unless required by applicable law or agreed to in writing, software
00026  *    distributed under the License is distributed on an "AS IS" BASIS,
00027  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00028  *    See the License for the specific language governing permissions and
00029  *    limitations under the License.
00030 */
00031 
00032 /**********************************
00033  * This file defines the types used in the DTN client API. The structures are
00034  * autogenerated using rpcgen, as are the marshalling and unmarshalling
00035  * XDR routines.
00036  */
00037 
00038 #include <limits.h>
00039 #ifndef ARG_MAX
00040 #define ARG_MAX _POSIX_ARG_MAX
00041 #endif
00042 
00043 #include <rpc/rpc.h>
00044 
00045 
00046 /**********************************
00047  * Constants.
00048  * (Note that we use #defines to get the comments as well)
00049  */
00050 #define DTN_MAX_ENDPOINT_ID 256 /* max endpoint_id size (bytes) */
00051 #define DTN_MAX_PATH_LEN PATH_MAX       /* max path length */
00052 #define DTN_MAX_EXEC_LEN ARG_MAX        /* length of string passed to exec() */
00053 #define DTN_MAX_AUTHDATA 1024           /* length of auth/security data*/
00054 #define DTN_MAX_REGION_LEN 64           /* 64 chars "should" be long enough */
00055 #define DTN_MAX_BUNDLE_MEM 50000        /* biggest in-memory bundle is ~50K*/
00056 #define DTN_MAX_BLOCK_LEN 64           /* length of block data */
00057 #define DTN_MAX_BLOCKS 256             /* number of blocks in bundle */
00058 
00068 struct dtn_endpoint_id_t {
00069         char uri[DTN_MAX_ENDPOINT_ID];
00070 };
00071 typedef struct dtn_endpoint_id_t dtn_endpoint_id_t;
00072 
00077 typedef u_int dtn_reg_id_t;
00078 
00083 typedef u_int dtn_timeval_t;
00084 
00088 #define DTN_TIMEOUT_INF ((dtn_timeval_t)-1)
00089 
00090 struct dtn_timestamp_t {
00091         u_int secs;
00092         u_int seqno;
00093 };
00094 typedef struct dtn_timestamp_t dtn_timestamp_t;
00095 
00105 struct dtn_service_tag_t {
00106         char tag[DTN_MAX_ENDPOINT_ID];
00107 };
00108 typedef struct dtn_service_tag_t dtn_service_tag_t;
00109 
00114 #define DTN_REGID_NONE 0
00115 
00123 enum dtn_reg_failure_action_t {
00124         DTN_REG_DROP = 1,
00125         DTN_REG_DEFER = 2,
00126         DTN_REG_EXEC = 3,
00127 };
00128 typedef enum dtn_reg_failure_action_t dtn_reg_failure_action_t;
00129 
00134 struct dtn_reg_info_t {
00135         dtn_endpoint_id_t endpoint;
00136         dtn_reg_id_t regid;
00137         dtn_reg_failure_action_t failure_action;
00138         dtn_timeval_t expiration;
00139         bool_t init_passive;
00140         struct {
00141                 u_int script_len;
00142                 char *script_val;
00143         } script;
00144 };
00145 typedef struct dtn_reg_info_t dtn_reg_info_t;
00146 
00155 enum dtn_bundle_priority_t {
00156         COS_BULK = 0,
00157         COS_NORMAL = 1,
00158         COS_EXPEDITED = 2,
00159         COS_RESERVED = 3,
00160 };
00161 typedef enum dtn_bundle_priority_t dtn_bundle_priority_t;
00162 
00176 enum dtn_bundle_delivery_opts_t {
00177         DOPTS_NONE = 0,
00178         DOPTS_CUSTODY = 1,
00179         DOPTS_DELIVERY_RCPT = 2,
00180         DOPTS_RECEIVE_RCPT = 4,
00181         DOPTS_FORWARD_RCPT = 8,
00182         DOPTS_CUSTODY_RCPT = 16,
00183         DOPTS_DELETE_RCPT = 32,
00184 };
00185 typedef enum dtn_bundle_delivery_opts_t dtn_bundle_delivery_opts_t;
00186 
00200 enum dtn_extension_block_flags_t {
00201         BLOCK_FLAG_NONE = 0,
00202         BLOCK_FLAG_REPLICATE = 1,
00203         BLOCK_FLAG_REPORT = 2,
00204         BLOCK_FLAG_DELETE_BUNDLE = 4,
00205         BLOCK_FLAG_LAST = 8,
00206         BLOCK_FLAG_DISCARD_BLOCK = 16,
00207         BLOCK_FLAG_UNPROCESSED = 32,
00208 };
00209 typedef enum dtn_extension_block_flags_t dtn_extension_block_flags_t;
00210 
00215 struct dtn_extension_block_t {
00216         u_int type;
00217         u_int flags;
00218         struct {
00219                 u_int data_len;
00220                 char *data_val;
00221         } data;
00222 };
00223 typedef struct dtn_extension_block_t dtn_extension_block_t;
00224 
00229 struct dtn_bundle_spec_t {
00230         dtn_endpoint_id_t source;
00231         dtn_endpoint_id_t dest;
00232         dtn_endpoint_id_t replyto;
00233         dtn_bundle_priority_t priority;
00234         int dopts;
00235         dtn_timeval_t expiration;
00236         struct {
00237                 u_int blocks_len;
00238                 dtn_extension_block_t *blocks_val;
00239         } blocks;
00240 };
00241 typedef struct dtn_bundle_spec_t dtn_bundle_spec_t;
00242 
00251 struct dtn_bundle_id_t {
00252         dtn_endpoint_id_t source;
00253         dtn_timestamp_t creation_ts;
00254         u_int frag_offset;
00255         u_int orig_length;
00256 };
00257 typedef struct dtn_bundle_id_t dtn_bundle_id_t;
00262 enum dtn_status_report_reason_t {
00263         REASON_NO_ADDTL_INFO = 0x00,
00264         REASON_LIFETIME_EXPIRED = 0x01,
00265         REASON_FORWARDED_UNIDIR_LINK = 0x02,
00266         REASON_TRANSMISSION_CANCELLED = 0x03,
00267         REASON_DEPLETED_STORAGE = 0x04,
00268         REASON_ENDPOINT_ID_UNINTELLIGIBLE = 0x05,
00269         REASON_NO_ROUTE_TO_DEST = 0x06,
00270         REASON_NO_TIMELY_CONTACT = 0x07,
00271         REASON_BLOCK_UNINTELLIGIBLE = 0x08,
00272 };
00273 typedef enum dtn_status_report_reason_t dtn_status_report_reason_t;
00279 enum dtn_status_report_flags_t {
00280         STATUS_RECEIVED = 0x01,
00281         STATUS_CUSTODY_ACCEPTED = 0x02,
00282         STATUS_FORWARDED = 0x04,
00283         STATUS_DELIVERED = 0x08,
00284         STATUS_DELETED = 0x10,
00285         STATUS_ACKED_BY_APP = 0x20,
00286 };
00287 typedef enum dtn_status_report_flags_t dtn_status_report_flags_t;
00288 
00293 struct dtn_bundle_status_report_t {
00294         dtn_bundle_id_t bundle_id;
00295         dtn_status_report_reason_t reason;
00296         dtn_status_report_flags_t flags;
00297         dtn_timestamp_t receipt_ts;
00298         dtn_timestamp_t custody_tv_;
00299         dtn_timestamp_t forwarding_tv_;
00300         dtn_timestamp_t delivery_tv_;
00301         dtn_timestamp_t deletion_tv_;
00302         dtn_timestamp_t ack_by_app_tv_;
00303 };
00304 typedef struct dtn_bundle_status_report_t dtn_bundle_status_report_t;
00305 
00329 enum dtn_bundle_payload_location_t {
00330         DTN_PAYLOAD_FILE = 0,
00331         DTN_PAYLOAD_MEM = 1,
00332         DTN_PAYLOAD_TEMP_FILE = 2,
00333 };
00334 typedef enum dtn_bundle_payload_location_t dtn_bundle_payload_location_t;
00335 
00336 struct dtn_bundle_payload_t {
00337         dtn_bundle_payload_location_t location;
00338         struct {
00339                 u_int filename_len;
00340                 char *filename_val;
00341         } filename;
00342         struct {
00343                 u_int buf_len;
00344                 char *buf_val;
00345         } buf;
00346         dtn_bundle_status_report_t *status_report;
00347 };
00348 typedef struct dtn_bundle_payload_t dtn_bundle_payload_t;
00349 
00350 /* the xdr functions */
00351 
00352 #if defined(__STDC__) || defined(__cplusplus)
00353 extern  bool_t xdr_dtn_endpoint_id_t (XDR *, dtn_endpoint_id_t*);
00354 extern  bool_t xdr_dtn_reg_id_t (XDR *, dtn_reg_id_t*);
00355 extern  bool_t xdr_dtn_timeval_t (XDR *, dtn_timeval_t*);
00356 extern  bool_t xdr_dtn_timestamp_t (XDR *, dtn_timestamp_t*);
00357 extern  bool_t xdr_dtn_service_tag_t (XDR *, dtn_service_tag_t*);
00358 extern  bool_t xdr_dtn_reg_failure_action_t (XDR *, dtn_reg_failure_action_t*);
00359 extern  bool_t xdr_dtn_reg_info_t (XDR *, dtn_reg_info_t*);
00360 extern  bool_t xdr_dtn_bundle_priority_t (XDR *, dtn_bundle_priority_t*);
00361 extern  bool_t xdr_dtn_bundle_delivery_opts_t (XDR *, dtn_bundle_delivery_opts_t*);
00362 extern  bool_t xdr_dtn_extension_block_flags_t (XDR *, dtn_extension_block_flags_t*);
00363 extern  bool_t xdr_dtn_extension_block_t (XDR *, dtn_extension_block_t*);
00364 extern  bool_t xdr_dtn_bundle_spec_t (XDR *, dtn_bundle_spec_t*);
00365 extern  bool_t xdr_dtn_bundle_id_t (XDR *, dtn_bundle_id_t*);
00366 extern  bool_t xdr_dtn_status_report_reason_t (XDR *, dtn_status_report_reason_t*);
00367 extern  bool_t xdr_dtn_status_report_flags_t (XDR *, dtn_status_report_flags_t*);
00368 extern  bool_t xdr_dtn_bundle_status_report_t (XDR *, dtn_bundle_status_report_t*);
00369 extern  bool_t xdr_dtn_bundle_payload_location_t (XDR *, dtn_bundle_payload_location_t*);
00370 extern  bool_t xdr_dtn_bundle_payload_t (XDR *, dtn_bundle_payload_t*);
00371 
00372 #else /* K&R C */
00373 extern bool_t xdr_dtn_endpoint_id_t ();
00374 extern bool_t xdr_dtn_reg_id_t ();
00375 extern bool_t xdr_dtn_timeval_t ();
00376 extern bool_t xdr_dtn_timestamp_t ();
00377 extern bool_t xdr_dtn_service_tag_t ();
00378 extern bool_t xdr_dtn_reg_failure_action_t ();
00379 extern bool_t xdr_dtn_reg_info_t ();
00380 extern bool_t xdr_dtn_bundle_priority_t ();
00381 extern bool_t xdr_dtn_bundle_delivery_opts_t ();
00382 extern bool_t xdr_dtn_extension_block_flags_t ();
00383 extern bool_t xdr_dtn_extension_block_t ();
00384 extern bool_t xdr_dtn_bundle_spec_t ();
00385 extern bool_t xdr_dtn_bundle_id_t ();
00386 extern bool_t xdr_dtn_status_report_reason_t ();
00387 extern bool_t xdr_dtn_status_report_flags_t ();
00388 extern bool_t xdr_dtn_bundle_status_report_t ();
00389 extern bool_t xdr_dtn_bundle_payload_location_t ();
00390 extern bool_t xdr_dtn_bundle_payload_t ();
00391 
00392 #endif /* K&R C */
00393 
00394 #ifdef __cplusplus
00395 }
00396 #endif
00397 
00398 #endif /* !_DTN_TYPES_H_RPCGEN */

Generated on Thu Jun 7 16:56:49 2007 for DTN Reference Implementation by  doxygen 1.5.1