IBR-DTN  1.0.0
RoutingExtension.h
Go to the documentation of this file.
1 /*
2  * RoutingExtension.h
3  *
4  * Copyright (C) 2013 IBR, TU Braunschweig
5  *
6  * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 
22 #ifndef ROUTINGEXTENSION_H_
23 #define ROUTINGEXTENSION_H_
24 
25 #include "storage/BundleResult.h"
27 #include "routing/NodeHandshake.h"
28 #include "core/Event.h"
29 #include "core/Node.h"
30 #include <ibrdtn/data/BundleID.h>
31 #include <ibrdtn/data/EID.h>
32 
33 namespace dtn
34 {
35  namespace routing
36  {
37  class BaseRouter;
38 
40  : public dtn::storage::BundleResult, public std::list<std::pair<dtn::data::MetaBundle, dtn::core::Node::Protocol> >
41  {
42  public:
43  RoutingResult();
44  virtual ~RoutingResult();
45 
46  virtual void put(const dtn::data::MetaBundle &bundle) throw ();
47  virtual void put(const dtn::data::MetaBundle &bundle, const dtn::core::Node::Protocol p) throw ();
48  };
49 
51  {
52  static const std::string TAG;
53 
54  public:
56  virtual ~RoutingExtension() = 0;
57 
58  virtual void componentUp() throw () = 0;
59  virtual void componentDown() throw () = 0;
60 
64  virtual const std::string getTag() const throw () { return "default"; }
65 
70  virtual void eventDataChanged(const dtn::data::EID &peer) throw () { };
71 
75  virtual void eventTransferCompleted(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta) throw () { };
76 
80  virtual void eventBundleQueued(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta) throw () { };
81 
88  virtual void requestHandshake(const dtn::data::EID&, NodeHandshake&) const { };
89 
97  virtual void responseHandshake(const dtn::data::EID&, const NodeHandshake&, NodeHandshake&) { };
98 
104  virtual void processHandshake(const dtn::data::EID&, NodeHandshake&) { };
105 
106  protected:
113  void transferTo(const dtn::data::EID &destination, const dtn::data::MetaBundle &meta, const dtn::core::Node::Protocol);
114 
116  };
117  } /* namespace routing */
118 } /* namespace dtn */
119 #endif /* ROUTINGEXTENSION_H_ */
virtual const std::string getTag() const
virtual void put(const dtn::data::MetaBundle &bundle)
virtual void eventDataChanged(const dtn::data::EID &peer)
virtual void processHandshake(const dtn::data::EID &, NodeHandshake &)
virtual void eventBundleQueued(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta)
void transferTo(const dtn::data::EID &destination, const dtn::data::MetaBundle &meta, const dtn::core::Node::Protocol)
virtual void responseHandshake(const dtn::data::EID &, const NodeHandshake &, NodeHandshake &)
virtual void requestHandshake(const dtn::data::EID &, NodeHandshake &) const
virtual void componentDown()=0
virtual void eventTransferCompleted(const dtn::data::EID &peer, const dtn::data::MetaBundle &meta)