IBR-DTNSuite  0.12
LinkMonitor.h
Go to the documentation of this file.
1 /*
2  * LinkMonitor.h
3  *
4  * Copyright (C) 2013 IBR, TU Braunschweig
5  *
6  * Written-by: David Goltzsche <goltzsch@ibr.cs.tu-bs.de>
7  * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Created on: Sep 9, 2013
22  */
23 
24 #ifndef LINKREQUESTER_H_
25 #define LINKREQUESTER_H_
26 
30 #include "ibrcommon/net/vaddress.h"
32 
33 #include <set>
34 #include <map>
35 
36 namespace ibrcommon
37 {
39  {
40  static const std::string TAG;
41 
42  public:
44  virtual ~LinkMonitor();
45 
46  void add(const ibrcommon::vinterface &iface) throw ();
47  void remove() throw ();
48 
49  protected:
50  void run() throw ();
51  void __cancellation() throw ();
52 
53  private:
55  bool _running;
56  LinkManager &_lmgr;
57 
58  typedef std::set<vaddress> addr_set;
59  typedef std::map< vinterface, addr_set > iface_map;
60  iface_map _addr_map;
61  };
62 }
63 #endif /* LINKREQUESTER_H_ */