author | Tom Henderson <tomh@tomh.org> |
Thu, 28 May 2009 21:37:25 -0700 | |
changeset 4472 | e20a31541404 |
parent 4380 | bbbc2e622f50 |
child 4560 | 2f106fd728ab |
permissions | -rw-r--r-- |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
1752
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
2 |
/* |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
3 |
* Copyright (c) 2004 Francisco J. Ros |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
4 |
* Copyright (c) 2007 INESC Porto |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
5 |
* |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
6 |
* This program is free software; you can redistribute it and/or modify |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
7 |
* it under the terms of the GNU General Public License version 2 as |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
8 |
* published by the Free Software Foundation; |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
9 |
* |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
13 |
* GNU General Public License for more details. |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
14 |
* |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
16 |
* along with this program; if not, write to the Free Software |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
18 |
* |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
19 |
* Authors: Francisco J. Ros <fjrm@dif.um.es> |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
20 |
* Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
d9115729b7d6
Cleanup copyright headers and some unused includes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1750
diff
changeset
|
21 |
*/ |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
22 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
23 |
|
1731
f7ca15d60e5b
Reorganize source tree and rename classes in a more sensible way; Olsr becomes OlsrAgent, olsr::Olsr becomes OlsrAgentImpl.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1723
diff
changeset
|
24 |
#ifndef __OLSR_AGENT_IMPL_H__ |
f7ca15d60e5b
Reorganize source tree and rename classes in a more sensible way; Olsr becomes OlsrAgent, olsr::Olsr becomes OlsrAgentImpl.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1723
diff
changeset
|
25 |
#define __OLSR_AGENT_IMPL_H__ |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
26 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
27 |
#include "olsr-header.h" |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
28 |
#include "olsr-state.h" |
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
29 |
#include "olsr-repositories.h" |
1731
f7ca15d60e5b
Reorganize source tree and rename classes in a more sensible way; Olsr becomes OlsrAgent, olsr::Olsr becomes OlsrAgentImpl.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1723
diff
changeset
|
30 |
|
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
31 |
#include "ns3/object.h" |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
32 |
#include "ns3/packet.h" |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
33 |
#include "ns3/node.h" |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
34 |
#include "ns3/socket.h" |
1878
f947cd18f0bb
Create a new contrib module; move event-garbage-collector.{h,cc} to the contrib module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1869
diff
changeset
|
35 |
#include "ns3/event-garbage-collector.h" |
1765
763f8d1bb058
Adapt the OLSR agent code to use the new Timer class.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1755
diff
changeset
|
36 |
#include "ns3/timer.h" |
2484
d5b05b706999
port Olsr code to attributes/helpers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
37 |
#include "ns3/traced-callback.h" |
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
38 |
#include "ns3/ipv4.h" |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
39 |
|
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
40 |
#include <vector> |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
41 |
#include <map> |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
42 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
43 |
|
1731
f7ca15d60e5b
Reorganize source tree and rename classes in a more sensible way; Olsr becomes OlsrAgent, olsr::Olsr becomes OlsrAgentImpl.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1723
diff
changeset
|
44 |
namespace ns3 { |
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
45 |
namespace olsr { |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
46 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
47 |
|
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
48 |
/// An %OLSR's routing table entry. |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
49 |
struct RoutingTableEntry |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
50 |
{ |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
51 |
Ipv4Address destAddr; ///< Address of the destination node. |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
52 |
Ipv4Address nextAddr; ///< Address of the next hop. |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
53 |
uint32_t interface; ///< Interface index |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
54 |
uint32_t distance; ///< Distance in hops to the destination. |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
55 |
|
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
56 |
RoutingTableEntry () : // default values |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
57 |
destAddr (), nextAddr (), |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
58 |
interface (0), distance (0) {}; |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
59 |
}; |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
60 |
|
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
61 |
|
4364 | 62 |
class RoutingProtocol : public Ipv4RoutingProtocol |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
63 |
{ |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
64 |
public: |
2251
04963d8cca51
iid (void) -> GetTypeId (void)
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2250
diff
changeset
|
65 |
static TypeId GetTypeId (void); |
2249
3a1da26d61dc
replace ComponentManager::Create and ClassId with InterfaceId::CreateObjest and InterfaceId
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1878
diff
changeset
|
66 |
|
4364 | 67 |
RoutingProtocol (); |
68 |
virtual ~RoutingProtocol (); |
|
2484
d5b05b706999
port Olsr code to attributes/helpers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
69 |
|
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
70 |
void SetNode (Ptr<Node> node); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
71 |
|
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
72 |
void Start (); |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
73 |
void SetMainInterface (uint32_t interface); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
74 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
75 |
private: |
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
76 |
std::map<Ipv4Address, RoutingTableEntry> m_table; ///< Data structure for the routing table. |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
77 |
|
1768
1664a9db93b9
Make EventGarbageCollector private to the olsr module; adapt olsr to Timer API changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1765
diff
changeset
|
78 |
EventGarbageCollector m_events; |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
79 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
80 |
/// Address of the routing agent. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
81 |
Ipv4Address m_routingAgentAddr; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
82 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
83 |
/// Packets sequence number counter. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
84 |
uint16_t m_packetSequenceNumber; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
85 |
/// Messages sequence number counter. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
86 |
uint16_t m_messageSequenceNumber; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
87 |
/// Advertised Neighbor Set sequence number. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
88 |
uint16_t m_ansn; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
89 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
90 |
/// HELLO messages' emission interval. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
91 |
Time m_helloInterval; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
92 |
/// TC messages' emission interval. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
93 |
Time m_tcInterval; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
94 |
/// MID messages' emission interval. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
95 |
Time m_midInterval; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
96 |
/// Willingness for forwarding packets on behalf of other nodes. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
97 |
uint8_t m_willingness; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
98 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
99 |
/// Internal state with all needed data structs. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
100 |
OlsrState m_state; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
101 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
102 |
Ptr<Ipv4> m_ipv4; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
103 |
|
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
104 |
private: |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
105 |
|
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
106 |
void Clear (); |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
107 |
uint32_t GetSize () const { return m_table.size (); } |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
108 |
std::vector<RoutingTableEntry> GetEntries () const; |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
109 |
void RemoveEntry (const Ipv4Address &dest); |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
110 |
void AddEntry (const Ipv4Address &dest, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
111 |
const Ipv4Address &next, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
112 |
uint32_t interface, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
113 |
uint32_t distance); |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
114 |
void AddEntry (const Ipv4Address &dest, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
115 |
const Ipv4Address &next, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
116 |
const Ipv4Address &interfaceAddress, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
117 |
uint32_t distance); |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
118 |
bool Lookup (const Ipv4Address &dest, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
119 |
RoutingTableEntry &outEntry) const; |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
120 |
bool FindSendEntry (const RoutingTableEntry &entry, |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
121 |
RoutingTableEntry &outEntry) const; |
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
122 |
|
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
123 |
// From Ipv4RoutingProtocol |
4472
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4380
diff
changeset
|
124 |
virtual Ptr<Ipv4Route> RouteOutput (const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &sockerr); |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4380
diff
changeset
|
125 |
virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4380
diff
changeset
|
126 |
UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
e20a31541404
src/ and utils/ changes for IPv4 routing rework
Tom Henderson <tomh@tomh.org>
parents:
4380
diff
changeset
|
127 |
LocalDeliverCallback lcb, ErrorCallback ecb); |
4358
e63305078fe5
rework olsr
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3970
diff
changeset
|
128 |
|
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
129 |
void DoDispose (); |
1803
4078e5efdfc6
Add OLSR message tracing, as discussed on ns-developers list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1801
diff
changeset
|
130 |
|
1868
06027fd6a68c
olsr gets new packet
Craig Dowell <craigdo@ee.washington.edu>
parents:
1803
diff
changeset
|
131 |
void SendPacket (Ptr<Packet> packet, const MessageList &containedMessages); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
132 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
133 |
/// Increments packet sequence number and returns the new value. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
134 |
inline uint16_t GetPacketSequenceNumber (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
135 |
/// Increments message sequence number and returns the new value. |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
136 |
inline uint16_t GetMessageSequenceNumber (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
137 |
|
3098
d384d52f8f6e
Cut over UDP applications to use the new receive API
Tom Henderson <tomh@tomh.org>
parents:
2900
diff
changeset
|
138 |
void RecvOlsr (Ptr<Socket> socket); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
139 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
140 |
void MprComputation (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
141 |
void RoutingTableComputation (); |
1798
7bb07f0d0e9f
Make OlsrAgentImpl::GetMainAddress const
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1778
diff
changeset
|
142 |
Ipv4Address GetMainAddress (Ipv4Address iface_addr) const; |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
143 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
144 |
// Timer handlers |
1765
763f8d1bb058
Adapt the OLSR agent code to use the new Timer class.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1755
diff
changeset
|
145 |
Timer m_helloTimer; |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
146 |
void HelloTimerExpire (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
147 |
|
1765
763f8d1bb058
Adapt the OLSR agent code to use the new Timer class.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1755
diff
changeset
|
148 |
Timer m_tcTimer; |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
149 |
void TcTimerExpire (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
150 |
|
1765
763f8d1bb058
Adapt the OLSR agent code to use the new Timer class.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1755
diff
changeset
|
151 |
Timer m_midTimer; |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
152 |
void MidTimerExpire (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
153 |
|
2358
bf0230eba16e
Small OLSR memory optimisation.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2333
diff
changeset
|
154 |
void DupTupleTimerExpire (Ipv4Address address, uint16_t sequenceNumber); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
155 |
bool m_linkTupleTimerFirstTime; |
2358
bf0230eba16e
Small OLSR memory optimisation.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2333
diff
changeset
|
156 |
void LinkTupleTimerExpire (Ipv4Address neighborIfaceAddr); |
bf0230eba16e
Small OLSR memory optimisation.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2333
diff
changeset
|
157 |
void Nb2hopTupleTimerExpire (Ipv4Address neighborMainAddr, Ipv4Address twoHopNeighborAddr); |
bf0230eba16e
Small OLSR memory optimisation.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2333
diff
changeset
|
158 |
void MprSelTupleTimerExpire (Ipv4Address mainAddr); |
bf0230eba16e
Small OLSR memory optimisation.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2333
diff
changeset
|
159 |
void TopologyTupleTimerExpire (Ipv4Address destAddr, Ipv4Address lastAddr); |
bf0230eba16e
Small OLSR memory optimisation.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2333
diff
changeset
|
160 |
void IfaceAssocTupleTimerExpire (Ipv4Address ifaceAddr); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
161 |
|
2328
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
162 |
void IncrementAnsn (); |
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
163 |
|
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
164 |
/// A list of pending messages which are buffered awaiting for being sent. |
1803
4078e5efdfc6
Add OLSR message tracing, as discussed on ns-developers list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1801
diff
changeset
|
165 |
olsr::MessageList m_queuedMessages; |
1765
763f8d1bb058
Adapt the OLSR agent code to use the new Timer class.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1755
diff
changeset
|
166 |
Timer m_queuedMessagesTimer; // timer for throttling outgoing messages |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
167 |
|
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
168 |
void ForwardDefault (olsr::MessageHeader olsrMessage, |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
169 |
DuplicateTuple *duplicated, |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
170 |
const Ipv4Address &localIface, |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
171 |
const Ipv4Address &senderAddress); |
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
172 |
void QueueMessage (const olsr::MessageHeader &message, Time delay); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
173 |
void SendQueuedMessages (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
174 |
void SendHello (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
175 |
void SendTc (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
176 |
void SendMid (); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
177 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
178 |
void NeighborLoss (const LinkTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
179 |
void AddDuplicateTuple (const DuplicateTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
180 |
void RemoveDuplicateTuple (const DuplicateTuple &tuple); |
2328
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
181 |
void LinkTupleAdded (const LinkTuple &tuple, uint8_t willingness); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
182 |
void RemoveLinkTuple (const LinkTuple &tuple); |
3970
8658841e4782
Fix a couple of OLSR bugs (#415)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3853
diff
changeset
|
183 |
void LinkTupleUpdated (const LinkTuple &tuple, uint8_t willingness); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
184 |
void AddNeighborTuple (const NeighborTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
185 |
void RemoveNeighborTuple (const NeighborTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
186 |
void AddTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
187 |
void RemoveTwoHopNeighborTuple (const TwoHopNeighborTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
188 |
void AddMprSelectorTuple (const MprSelectorTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
189 |
void RemoveMprSelectorTuple (const MprSelectorTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
190 |
void AddTopologyTuple (const TopologyTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
191 |
void RemoveTopologyTuple (const TopologyTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
192 |
void AddIfaceAssocTuple (const IfaceAssocTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
193 |
void RemoveIfaceAssocTuple (const IfaceAssocTuple &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
194 |
|
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
195 |
void ProcessHello (const olsr::MessageHeader &msg, |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
196 |
const Ipv4Address &receiverIface, |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
197 |
const Ipv4Address &senderIface); |
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
198 |
void ProcessTc (const olsr::MessageHeader &msg, |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
199 |
const Ipv4Address &senderIface); |
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
200 |
void ProcessMid (const olsr::MessageHeader &msg, |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
201 |
const Ipv4Address &senderIface); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
202 |
|
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
203 |
void LinkSensing (const olsr::MessageHeader &msg, |
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
204 |
const olsr::MessageHeader::Hello &hello, |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
205 |
const Ipv4Address &receiverIface, |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
206 |
const Ipv4Address &sender_iface); |
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
207 |
void PopulateNeighborSet (const olsr::MessageHeader &msg, |
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
208 |
const olsr::MessageHeader::Hello &hello); |
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
209 |
void PopulateTwoHopNeighborSet (const olsr::MessageHeader &msg, |
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
210 |
const olsr::MessageHeader::Hello &hello); |
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
211 |
void PopulateMprSelectorSet (const olsr::MessageHeader &msg, |
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
212 |
const olsr::MessageHeader::Hello &hello); |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
213 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
214 |
int Degree (NeighborTuple const &tuple); |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
215 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
216 |
Ipv4Address m_mainAddress; |
2328
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
217 |
|
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
218 |
// One socket per interface, each bound to that interface's address |
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
219 |
// (reason: for OLSR Link Sensing we need to know on which interface |
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
220 |
// HELLO messages arrive) |
caa15068fb3b
OLSR: code cleanup, more extensive logging, many bug fixes. Should also handle multiple interfaces better, now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2251
diff
changeset
|
221 |
std::map< Ptr<Socket>, Ipv4Address > m_socketAddresses; |
1803
4078e5efdfc6
Add OLSR message tracing, as discussed on ns-developers list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1801
diff
changeset
|
222 |
|
2484
d5b05b706999
port Olsr code to attributes/helpers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
223 |
TracedCallback <const PacketHeader &, |
d5b05b706999
port Olsr code to attributes/helpers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
224 |
const MessageList &> m_rxPacketTrace; |
d5b05b706999
port Olsr code to attributes/helpers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
225 |
TracedCallback <const PacketHeader &, |
d5b05b706999
port Olsr code to attributes/helpers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2251
diff
changeset
|
226 |
const MessageList &> m_txPacketTrace; |
2503 | 227 |
TracedCallback <uint32_t> m_routingTableChanged; |
1803
4078e5efdfc6
Add OLSR message tracing, as discussed on ns-developers list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1801
diff
changeset
|
228 |
|
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
229 |
}; |
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
230 |
|
1801
522029e3b8a6
Put everything OLSR into the 'olsr' C++ namespace, for consistency.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1798
diff
changeset
|
231 |
}} // namespace ns3 |
1716
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
232 |
|
9757633a85da
Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
233 |
#endif |