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  * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
00018  * By downloading, copying, installing or using the software you agree
00019  * to this license. If you do not agree to this license, do not
00020  * download, install, copy or use the software.
00021  * 
00022  * Intel Open Source License 
00023  * 
00024  * Copyright (c) 2004 Intel Corporation. All rights reserved. 
00025  * 
00026  * Redistribution and use in source and binary forms, with or without
00027  * modification, are permitted provided that the following conditions
00028  * are met:
00029  * 
00030  *   Redistributions of source code must retain the above copyright
00031  *   notice, this list of conditions and the following disclaimer.
00032  * 
00033  *   Redistributions in binary form must reproduce the above copyright
00034  *   notice, this list of conditions and the following disclaimer in
00035  *   the documentation and/or other materials provided with the
00036  *   distribution.
00037  * 
00038  *   Neither the name of the Intel Corporation nor the names of its
00039  *   contributors may be used to endorse or promote products derived
00040  *   from * this software without specific prior written permission.
00041  *  
00042  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00043  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00044  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00045  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00046  * INTEL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00047  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00048  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00049  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00050  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00051  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00052  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00053  * OF THE POSSIBILITY OF SUCH DAMAGE.
00054  */
00055 
00056 /**********************************
00057  * This file defines the types used in the DTN client API. The structures are
00058  * autogenerated using rpcgen, as are the marshalling and unmarshalling
00059  * XDR routines.
00060  */
00061 
00062 #include <limits.h>
00063 #ifndef ARG_MAX
00064 #define ARG_MAX _POSIX_ARG_MAX
00065 #endif
00066 
00067 #include <rpc/rpc.h>
00068 
00069 
00070 /**********************************
00071  * Constants.
00072  * (Note that we use #defines to get the comments as well)
00073  */
00074 #define DTN_MAX_ENDPOINT_ID 256 /* max endpoint_id size (bytes) */
00075 #define DTN_MAX_PATH_LEN PATH_MAX /* max path length */
00076 #define DTN_MAX_EXEC_LEN ARG_MAX /* length of string passed to exec() */
00077 #define DTN_MAX_AUTHDATA 1024 /* length of auth/security data*/
00078 #define DTN_MAX_REGION_LEN 64 /* 64 chars "should" be long enough */
00079 #define DTN_MAX_BUNDLE_MEM 50000 /* biggest in-memory bundle is ~50K*/
00080 
00090 struct dtn_endpoint_id_t {
00091         char uri[DTN_MAX_ENDPOINT_ID];
00092 };
00093 typedef struct dtn_endpoint_id_t dtn_endpoint_id_t;
00094 
00099 typedef u_int dtn_reg_id_t;
00100 
00105 typedef u_int dtn_timeval_t;
00106 
00110 #define DTN_TIMEOUT_INF ((dtn_timeval_t)-1)
00111 
00121 struct dtn_service_tag_t {
00122         char tag[DTN_MAX_ENDPOINT_ID];
00123 };
00124 typedef struct dtn_service_tag_t dtn_service_tag_t;
00125 
00130 #define DTN_REGID_NONE 0
00131 
00139 enum dtn_reg_failure_action_t {
00140         DTN_REG_DROP = 1,
00141         DTN_REG_DEFER = 2,
00142         DTN_REG_EXEC = 3,
00143 };
00144 typedef enum dtn_reg_failure_action_t dtn_reg_failure_action_t;
00145 
00150 struct dtn_reg_info_t {
00151         dtn_endpoint_id_t endpoint;
00152         dtn_reg_id_t regid;
00153         dtn_reg_failure_action_t failure_action;
00154         dtn_timeval_t expiration;
00155         bool_t init_passive;
00156         struct {
00157                 u_int script_len;
00158                 char *script_val;
00159         } script;
00160 };
00161 typedef struct dtn_reg_info_t dtn_reg_info_t;
00162 
00171 enum dtn_bundle_priority_t {
00172         COS_BULK = 0,
00173         COS_NORMAL = 1,
00174         COS_EXPEDITED = 2,
00175         COS_RESERVED = 3,
00176 };
00177 typedef enum dtn_bundle_priority_t dtn_bundle_priority_t;
00178 
00192 enum dtn_bundle_delivery_opts_t {
00193         DOPTS_NONE = 0,
00194         DOPTS_CUSTODY = 1,
00195         DOPTS_DELIVERY_RCPT = 2,
00196         DOPTS_RECEIVE_RCPT = 4,
00197         DOPTS_FORWARD_RCPT = 8,
00198         DOPTS_CUSTODY_RCPT = 16,
00199         DOPTS_DELETE_RCPT = 32,
00200 };
00201 typedef enum dtn_bundle_delivery_opts_t dtn_bundle_delivery_opts_t;
00202 
00207 struct dtn_bundle_spec_t {
00208         dtn_endpoint_id_t source;
00209         dtn_endpoint_id_t dest;
00210         dtn_endpoint_id_t replyto;
00211         dtn_bundle_priority_t priority;
00212         int dopts;
00213         dtn_timeval_t expiration;
00214 };
00215 typedef struct dtn_bundle_spec_t dtn_bundle_spec_t;
00216 
00226 enum dtn_bundle_payload_location_t {
00227         DTN_PAYLOAD_FILE = 0,
00228         DTN_PAYLOAD_MEM = 1,
00229 };
00230 typedef enum dtn_bundle_payload_location_t dtn_bundle_payload_location_t;
00231 
00232 struct dtn_bundle_payload_t {
00233         dtn_bundle_payload_location_t location;
00234         union {
00235                 struct {
00236                         u_int filename_len;
00237                         char *filename_val;
00238                 } filename;
00239                 struct {
00240                         u_int buf_len;
00241                         char *buf_val;
00242                 } buf;
00243         } dtn_bundle_payload_t_u;
00244 };
00245 typedef struct dtn_bundle_payload_t dtn_bundle_payload_t;
00246 
00251 struct dtn_bundle_id_t {
00252         dtn_endpoint_id_t source;
00253         u_int creation_secs;
00254         u_int creation_subsecs;
00255 };
00256 typedef struct dtn_bundle_id_t dtn_bundle_id_t;
00257 
00262 struct dtn_bundle_auth_t {
00263         struct {
00264                 u_int blob_len;
00265                 char *blob_val;
00266         } blob;
00267 };
00268 typedef struct dtn_bundle_auth_t dtn_bundle_auth_t;
00269 
00270 /* the xdr functions */
00271 
00272 #if defined(__STDC__) || defined(__cplusplus)
00273 extern  bool_t xdr_dtn_endpoint_id_t (XDR *, dtn_endpoint_id_t*);
00274 extern  bool_t xdr_dtn_reg_id_t (XDR *, dtn_reg_id_t*);
00275 extern  bool_t xdr_dtn_timeval_t (XDR *, dtn_timeval_t*);
00276 extern  bool_t xdr_dtn_service_tag_t (XDR *, dtn_service_tag_t*);
00277 extern  bool_t xdr_dtn_reg_failure_action_t (XDR *, dtn_reg_failure_action_t*);
00278 extern  bool_t xdr_dtn_reg_info_t (XDR *, dtn_reg_info_t*);
00279 extern  bool_t xdr_dtn_bundle_priority_t (XDR *, dtn_bundle_priority_t*);
00280 extern  bool_t xdr_dtn_bundle_delivery_opts_t (XDR *, dtn_bundle_delivery_opts_t*);
00281 extern  bool_t xdr_dtn_bundle_spec_t (XDR *, dtn_bundle_spec_t*);
00282 extern  bool_t xdr_dtn_bundle_payload_location_t (XDR *, dtn_bundle_payload_location_t*);
00283 extern  bool_t xdr_dtn_bundle_payload_t (XDR *, dtn_bundle_payload_t*);
00284 extern  bool_t xdr_dtn_bundle_id_t (XDR *, dtn_bundle_id_t*);
00285 extern  bool_t xdr_dtn_bundle_auth_t (XDR *, dtn_bundle_auth_t*);
00286 
00287 #else /* K&R C */
00288 extern bool_t xdr_dtn_endpoint_id_t ();
00289 extern bool_t xdr_dtn_reg_id_t ();
00290 extern bool_t xdr_dtn_timeval_t ();
00291 extern bool_t xdr_dtn_service_tag_t ();
00292 extern bool_t xdr_dtn_reg_failure_action_t ();
00293 extern bool_t xdr_dtn_reg_info_t ();
00294 extern bool_t xdr_dtn_bundle_priority_t ();
00295 extern bool_t xdr_dtn_bundle_delivery_opts_t ();
00296 extern bool_t xdr_dtn_bundle_spec_t ();
00297 extern bool_t xdr_dtn_bundle_payload_location_t ();
00298 extern bool_t xdr_dtn_bundle_payload_t ();
00299 extern bool_t xdr_dtn_bundle_id_t ();
00300 extern bool_t xdr_dtn_bundle_auth_t ();
00301 
00302 #endif /* K&R C */
00303 
00304 #ifdef __cplusplus
00305 }
00306 #endif
00307 
00308 #endif /* !_DTN_TYPES_H_RPCGEN */

Generated on Fri Dec 22 14:47:58 2006 for DTN Reference Implementation by  doxygen 1.5.1