ConnectionConvergenceLayer.h

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2006 Intel Corporation
00003  * 
00004  *    Licensed under the Apache License, Version 2.0 (the "License");
00005  *    you may not use this file except in compliance with the License.
00006  *    You may obtain a copy of the License at
00007  * 
00008  *        http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  *    Unless required by applicable law or agreed to in writing, software
00011  *    distributed under the License is distributed on an "AS IS" BASIS,
00012  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *    See the License for the specific language governing permissions and
00014  *    limitations under the License.
00015  */
00016 
00017 #ifndef _CONNECTION_CONVERGENCE_LAYER_H_
00018 #define _CONNECTION_CONVERGENCE_LAYER_H_
00019 
00020 #include "ConvergenceLayer.h"
00021 
00022 namespace dtn {
00023 
00024 class CLConnection;
00025 
00075 class ConnectionConvergenceLayer : public ConvergenceLayer {
00076 public:
00080     ConnectionConvergenceLayer(const char* logpath, const char* cl_name);
00081 
00083     bool init_link(Link* link, int argc, const char* argv[]);
00084     void dump_link(Link* link, oasys::StringBuffer* buf);
00085     bool reconfigure_link(Link* link, int argc, const char* argv[]);
00086     bool open_contact(const ContactRef& contact);
00087     bool close_contact(const ContactRef& contact);
00088     void send_bundle(const ContactRef& contact, Bundle* bundle);
00090 
00096     class LinkParams : public CLInfo {
00097     public:
00098         u_int32_t busy_queue_depth_;    
00099         bool reactive_frag_enabled_;    
00100         u_int sendbuf_len_;             
00101         u_int recvbuf_len_;             
00102         u_int data_timeout_;            
00103         
00104         u_int test_read_delay_;         
00105         u_int test_write_delay_;        
00106         u_int test_recv_delay_;         
00107 
00108     protected:
00109         // The only time this constructor should be called is to
00110         // initialize the default parameters. All other cases (i.e.
00111         // derivative parameter classes) should use a copy constructor
00112         // to grab the default settings.
00113         LinkParams(bool init_defaults);
00114     };
00115 
00119     virtual bool parse_nexthop(Link* link, LinkParams* params) = 0;
00120 
00121 protected:
00125     virtual LinkParams* new_link_params() = 0;
00126 
00131     virtual bool parse_link_params(LinkParams* params,
00132                                    int argc, const char** argv,
00133                                    const char** invalidp);
00134     
00139     virtual bool finish_init_link(Link* link, LinkParams* params);
00140     
00144     virtual CLConnection* new_connection(LinkParams* params) = 0;
00145 
00146 };
00147 
00148 } // namespace dtn
00149 
00150 #endif /* _CONNECTION_CONVERGENCE_LAYER_H_ */

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