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 _BUNDLE_ROUTEENTRY_H_ 00018 #define _BUNDLE_ROUTEENTRY_H_ 00019 00020 #include <oasys/debug/Formatter.h> 00021 #include <oasys/serialize/Serialize.h> 00022 00023 #include "bundling/CustodyTimer.h" 00024 #include "bundling/ForwardingInfo.h" 00025 #include "naming/EndpointID.h" 00026 00027 namespace dtn { 00028 00029 class Link; 00030 class RouteEntryInfo; 00031 00053 class RouteEntry : public oasys::Formatter, 00054 public oasys::SerializableObject { 00055 public: 00059 RouteEntry(const EndpointIDPattern& dest_pattern, Link* link); 00060 00064 ~RouteEntry(); 00065 00069 int parse_options(int argc, const char** argv, 00070 const char** invalidp = NULL); 00071 00075 int format(char* buf, size_t sz) const; 00076 00080 static void dump_header(oasys::StringBuffer* buf); 00081 00087 void dump(oasys::StringBuffer* buf, EndpointIDVector* long_eids) const; 00088 00092 virtual void serialize( oasys::SerializeAction *a ); 00093 00095 EndpointIDPattern dest_pattern_; 00096 00098 EndpointIDPattern source_pattern_; 00099 00101 u_int bundle_cos_; 00102 00104 u_int route_priority_; 00105 00107 Link* next_hop_; 00108 00110 int action_; 00111 00113 CustodyTimerSpec custody_timeout_; 00114 00117 RouteEntryInfo* info_; 00118 00119 // XXX/demmer confidence? latency? capacity? 00120 // XXX/demmer bit to distinguish 00121 // XXX/demmer make this serializable? 00122 }; 00123 00128 class RouteEntryVec : public std::vector<RouteEntry*> { 00129 public: 00135 void sort_by_priority(); 00136 }; 00137 00141 class RouteEntryInfo { 00142 public: 00143 virtual ~RouteEntryInfo() {} 00144 }; 00145 00146 } // namespace dtn 00147 00148 #endif /* _BUNDLE_ROUTEENTRY_H_ */