/* * Copyright 2004-2006 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include "dtn_api.h" #define BUFSIZE 16 const char *progname; int verbose = 0; // verbose output int quiet = 0; // quiet output char* endpoint = NULL; // endpoint for registration dtn_reg_id_t regid = DTN_REGID_NONE;// registration id int expiration = 30; // registration expiration time int count = 0; // exit after count bundles received int failure_action = DTN_REG_DEFER;// registration delivery failure action char* failure_script = ""; // script to exec int register_only = 0; // register and quit int change = 0; // change existing registration int unregister = 0; // remove existing registration int recv_timeout = -1; // timeout to dtn_recv call int no_find_reg = 0; // omit call to dtn_find_registration void usage() { fprintf(stderr, "usage: %s [opts] \n", progname); fprintf(stderr, "options:\n"); fprintf(stderr, " -v verbose\n"); fprintf(stderr, " -q quiet\n"); fprintf(stderr, " -h help\n"); fprintf(stderr, " -d endpoint id\n"); fprintf(stderr, " -r use existing registration regid\n"); fprintf(stderr, " -n exit after count bundles received\n"); fprintf(stderr, " -e