00001 /* 00002 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By 00003 * downloading, copying, installing or using the software you agree to 00004 * this license. If you do not agree to this license, do not download, 00005 * install, copy or use the software. 00006 * 00007 * Intel Open Source License 00008 * 00009 * Copyright (c) 2006 Intel Corporation. All rights reserved. 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions are 00013 * met: 00014 * 00015 * Redistributions of source code must retain the above copyright 00016 * notice, this list of conditions and the following disclaimer. 00017 * 00018 * Redistributions in binary form must reproduce the above copyright 00019 * notice, this list of conditions and the following disclaimer in the 00020 * documentation and/or other materials provided with the distribution. 00021 * 00022 * Neither the name of the Intel Corporation nor the names of its 00023 * contributors may be used to endorse or promote products derived from 00024 * this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00027 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00028 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00029 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR 00030 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00031 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00032 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00033 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00034 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00035 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00036 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00037 */ 00038 #ifndef _CONNECTION_CONVERGENCE_LAYER_H_ 00039 #define _CONNECTION_CONVERGENCE_LAYER_H_ 00040 00041 #include "ConvergenceLayer.h" 00042 00043 namespace dtn { 00044 00045 class CLConnection; 00046 00096 class ConnectionConvergenceLayer : public ConvergenceLayer { 00097 public: 00101 ConnectionConvergenceLayer(const char* logpath, const char* cl_name); 00102 00104 bool init_link(Link* link, int argc, const char* argv[]); 00105 void dump_link(Link* link, oasys::StringBuffer* buf); 00106 bool reconfigure_link(Link* link, int argc, const char* argv[]); 00107 bool open_contact(const ContactRef& contact); 00108 bool close_contact(const ContactRef& contact); 00109 void send_bundle(const ContactRef& contact, Bundle* bundle); 00111 00117 class LinkParams : public CLInfo { 00118 public: 00119 u_int32_t busy_queue_depth_; 00120 bool reactive_frag_enabled_; 00121 u_int sendbuf_len_; 00122 u_int recvbuf_len_; 00123 u_int data_timeout_; 00124 00125 u_int test_read_delay_; 00126 u_int test_write_delay_; 00127 u_int test_recv_delay_; 00128 00129 protected: 00130 // The only time this constructor should be called is to 00131 // initialize the default parameters. All other cases (i.e. 00132 // derivative parameter classes) should use a copy constructor 00133 // to grab the default settings. 00134 LinkParams(bool init_defaults); 00135 }; 00136 00137 protected: 00141 virtual LinkParams* new_link_params() = 0; 00142 00147 virtual bool parse_link_params(LinkParams* params, 00148 int argc, const char** argv, 00149 const char** invalidp); 00150 00154 virtual bool parse_nexthop(Link* link, LinkParams* params) = 0; 00155 00160 virtual bool finish_init_link(Link* link, LinkParams* params); 00161 00165 virtual CLConnection* new_connection(LinkParams* params) = 0; 00166 00167 }; 00168 00169 } // namespace dtn 00170 00171 #endif /* _CONNECTION_CONVERGENCE_LAYER_H_ */