IBR-DTNSuite
0.12
Main Page
Namespaces
Classes
Files
File List
File Members
P2PDialupExtension.cpp
Go to the documentation of this file.
1
/*
2
* P2PDialupExtension.cpp
3
*
4
* Created on: 25.02.2013
5
* Author: morgenro
6
*/
7
8
#include "
net/P2PDialupExtension.h
"
9
#include "
net/P2PDialupEvent.h
"
10
#include "
core/BundleCore.h
"
11
#include "
core/NodeEvent.h
"
12
13
namespace
dtn
14
{
15
namespace
net
16
{
17
18
P2PDialupExtension::P2PDialupExtension
() {
19
// register at the bundle core
20
dtn::core::BundleCore::getInstance
().
getConnectionManager
().
add
(
this
);
21
}
22
23
P2PDialupExtension::~P2PDialupExtension
() {
24
// unregister at the bundle core
25
dtn::core::BundleCore::getInstance
().
getConnectionManager
().
remove
(
this
);
26
}
27
28
void
P2PDialupExtension::fireDiscovered
(
const
dtn::data::EID
&eid,
const
dtn::core::Node::URI
&uri)
const
29
{
30
dtn::net::ConnectionManager
&cm =
dtn::core::BundleCore::getInstance
().
getConnectionManager
();
31
dtn::core::Node
n(eid);
32
n.
add
(uri);
33
cm.
add
(n);
34
}
35
36
void
P2PDialupExtension::fireDisconnected
(
const
dtn::data::EID
&eid,
const
dtn::core::Node::URI
&uri)
const
37
{
38
dtn::net::ConnectionManager
&cm =
dtn::core::BundleCore::getInstance
().
getConnectionManager
();
39
dtn::core::Node
n(eid);
40
n.
add
(uri);
41
cm.
remove
(n);
42
}
43
44
void
P2PDialupExtension::fireConnected
(
const
dtn::data::EID
&eid,
const
dtn::core::Node::URI
&uri)
const
45
{
46
dtn::net::ConnectionManager
&cm =
dtn::core::BundleCore::getInstance
().
getConnectionManager
();
47
dtn::core::Node
n(eid);
48
n.
add
(uri);
49
cm.
add
(n);
50
}
51
52
void
P2PDialupExtension::fireInterfaceUp
(
const
ibrcommon::vinterface
&iface)
const
53
{
54
P2PDialupEvent::raise
(
P2PDialupEvent::INTERFACE_UP
, iface);
55
}
56
57
void
P2PDialupExtension::fireInterfaceDown
(
const
ibrcommon::vinterface
&iface)
const
58
{
59
P2PDialupEvent::raise
(
P2PDialupEvent::INTERFACE_DOWN
, iface);
60
}
61
}
/* namespace routing */
62
}
/* namespace dtn */
daemon
src
net
P2PDialupExtension.cpp
Generated on Thu Mar 27 2014 09:26:20 for IBR-DTNSuite by
1.8.4