IBR-DTNSuite  0.10
NativeP2pManager.h
Go to the documentation of this file.
1 /*
2  * NativeP2pManager.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 NATIVEP2PMANAGER_H_
23 #define NATIVEP2PMANAGER_H_
24 
25 #include "net/P2PDialupExtension.h"
26 #include "core/Node.h"
27 #include <ibrdtn/data/EID.h>
28 
29 namespace dtn
30 {
31  namespace net
32  {
34  {
35  // the protocol returned by getProtocol()
36  const dtn::core::Node::Protocol _protocol;
37 
38  public:
39  NativeP2pManager(const std::string &protocol);
40  virtual ~NativeP2pManager() = 0;
41 
45  virtual dtn::core::Node::Protocol getProtocol() const;
46 
50  virtual void connect(const dtn::core::Node::URI &uri);
51 
55  virtual void disconnect(const dtn::core::Node::URI &uri);
56 
57  // method for JNI
58  virtual void connect(const std::string &identifier) = 0;
59 
60  // method for JNI
61  virtual void disconnect(const std::string &identifier) = 0;
62 
63  protected:
64  // method for JNI
65  virtual void fireDiscovered(const dtn::data::EID &eid, const std::string &identifier, size_t timeout, int priority);
66 
67  // method for JNI
68  virtual void fireDisconnected(const dtn::data::EID &eid, const std::string &identifier);
69 
70  // method for JNI
71  virtual void fireConnected(const dtn::data::EID &eid, const std::string &identifier, size_t timeout, int priority);
72 
73  // method for JNI
74  virtual void fireInterfaceUp(const std::string &interface);
75 
76  // method for JNI
77  virtual void fireInterfaceDown(const std::string &interface);
78  };
79  } /* namespace net */
80 } /* namespace dtn */
81 #endif /* NATIVEP2PMANAGER_H_ */