#include "olsr-agent-impl.h"
#include <vector>
#include "ns3/node.h"
#include "ns3/olsr-routing-table.h"
#include <stdint.h>
#include "ns3/header.h"
#include "ns3/ipv4-address.h"
#include "ns3/nstime.h"
#include <set>
#include "ns3/ipv4.h"
#include <map>
#include "repositories.h"
#include "ns3/object.h"
#include "ns3/packet.h"
#include "ns3/socket.h"
#include "ns3/event-garbage-collector.h"
#include "ns3/timer.h"
#include "ns3/traced-callback.h"
#include "ns3/socket-factory.h"
#include "ns3/udp-socket-factory.h"
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/random-variable.h"
#include "ns3/inet-socket-address.h"
#include "ns3/boolean.h"
#include "ns3/uinteger.h"
#include "ns3/enum.h"
#include "ns3/trace-source-accessor.h"
Go to the source code of this file.
Namespaces | |
namespace | ns3 |
Every class exported by the ns3 library is enclosed in the ns3 namespace. | |
namespace | ns3::olsr |
Defines | |
#define | NS_LOG_APPEND_CONTEXT if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; } |
#define | DELAY(time) |
Gets the delay between a given time and the current time. | |
#define | OLSR_REFRESH_INTERVAL Seconds (2) |
Period at which a node must cite every link and every neighbor. | |
#define | OLSR_NEIGHB_HOLD_TIME (Scalar (3) * OLSR_REFRESH_INTERVAL) |
Neighbor holding time. | |
#define | OLSR_TOP_HOLD_TIME (Scalar (3) * m_tcInterval) |
Top holding time. | |
#define | OLSR_DUP_HOLD_TIME Seconds (30) |
Dup holding time. | |
#define | OLSR_MID_HOLD_TIME (Scalar (3) * m_midInterval) |
MID holding time. | |
#define | OLSR_UNSPEC_LINK 0 |
Unspecified link type. | |
#define | OLSR_ASYM_LINK 1 |
Asymmetric link type. | |
#define | OLSR_SYM_LINK 2 |
Symmetric link type. | |
#define | OLSR_LOST_LINK 3 |
Lost link type. | |
#define | OLSR_NOT_NEIGH 0 |
Not neighbor type. | |
#define | OLSR_SYM_NEIGH 1 |
Symmetric neighbor type. | |
#define | OLSR_MPR_NEIGH 2 |
Asymmetric neighbor type. | |
#define | OLSR_WILL_NEVER 0 |
Willingness for forwarding packets from other nodes: never. | |
#define | OLSR_WILL_LOW 1 |
Willingness for forwarding packets from other nodes: low. | |
#define | OLSR_WILL_DEFAULT 3 |
Willingness for forwarding packets from other nodes: medium. | |
#define | OLSR_WILL_HIGH 6 |
Willingness for forwarding packets from other nodes: high. | |
#define | OLSR_WILL_ALWAYS 7 |
Willingness for forwarding packets from other nodes: always. | |
#define | OLSR_MAXJITTER (m_helloInterval.GetSeconds () / 4) |
Maximum allowed jitter. | |
#define | OLSR_MAX_SEQ_NUM 65535 |
Maximum allowed sequence number. | |
#define | JITTER (Seconds (UniformVariable::GetSingleValue (0, OLSR_MAXJITTER))) |
Random number between [0-OLSR_MAXJITTER] used to jitter OLSR packet transmission. | |
#define | OLSR_PORT_NUMBER 698 |
#define | OLSR_MAX_MSGS 64 |
Maximum number of messages per packet. | |
#define | OLSR_MAX_HELLOS 12 |
Maximum number of hellos per message (4 possible link types * 3 possible nb types). | |
#define | OLSR_MAX_ADDRS 64 |
Maximum number of addresses advertised on a message. | |
Functions | |
ns3::olsr::NS_LOG_COMPONENT_DEFINE ("OlsrAgent") | |
ns3::olsr::NS_OBJECT_ENSURE_REGISTERED (AgentImpl) |
#define DELAY | ( | time | ) |
(((time) < (Simulator::Now ())) ? Seconds (0.000001) : \ (time - Simulator::Now () + Seconds (0.000001)))
Gets the delay between a given time and the current time.
If given time is previous to the current one, then this macro returns a number close to 0. This is used for scheduling events at a certain moment.
Definition at line 56 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::DupTupleTimerExpire(), ns3::olsr::AgentImpl::IfaceAssocTupleTimerExpire(), ns3::olsr::AgentImpl::LinkSensing(), ns3::olsr::AgentImpl::LinkTupleTimerExpire(), ns3::olsr::AgentImpl::MprSelTupleTimerExpire(), ns3::olsr::AgentImpl::Nb2hopTupleTimerExpire(), ns3::olsr::AgentImpl::PopulateMprSelectorSet(), ns3::olsr::AgentImpl::PopulateTwoHopNeighborSet(), ns3::olsr::AgentImpl::ProcessMid(), ns3::olsr::AgentImpl::ProcessTc(), and ns3::olsr::AgentImpl::TopologyTupleTimerExpire().
#define JITTER (Seconds (UniformVariable::GetSingleValue (0, OLSR_MAXJITTER))) |
Random number between [0-OLSR_MAXJITTER] used to jitter OLSR packet transmission.
Definition at line 123 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::ForwardDefault(), ns3::olsr::AgentImpl::SendHello(), ns3::olsr::AgentImpl::SendMid(), and ns3::olsr::AgentImpl::SendTc().
#define NS_LOG_APPEND_CONTEXT if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; } |
Definition at line 32 of file olsr-agent-impl.cc.
#define OLSR_ASYM_LINK 1 |
Asymmetric link type.
Definition at line 86 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_DUP_HOLD_TIME Seconds (30) |
Dup holding time.
Definition at line 76 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::ForwardDefault().
#define OLSR_LOST_LINK 3 |
Lost link type.
Definition at line 90 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_MAX_ADDRS 64 |
Maximum number of addresses advertised on a message.
Definition at line 134 of file olsr-agent-impl.cc.
#define OLSR_MAX_HELLOS 12 |
Maximum number of hellos per message (4 possible link types * 3 possible nb types).
Definition at line 131 of file olsr-agent-impl.cc.
#define OLSR_MAX_MSGS 64 |
Maximum number of messages per packet.
Definition at line 128 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::SendQueuedMessages().
#define OLSR_MAX_SEQ_NUM 65535 |
Maximum allowed sequence number.
Definition at line 121 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::GetMessageSequenceNumber(), ns3::olsr::AgentImpl::GetPacketSequenceNumber(), ns3::olsr::AgentImpl::IncrementAnsn(), and ns3::olsr::AgentImpl::SetNode().
#define OLSR_MAXJITTER (m_helloInterval.GetSeconds () / 4) |
Maximum allowed jitter.
Definition at line 119 of file olsr-agent-impl.cc.
#define OLSR_MID_HOLD_TIME (Scalar (3) * m_midInterval) |
MID holding time.
Definition at line 78 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::SendMid().
#define OLSR_MPR_NEIGH 2 |
Asymmetric neighbor type.
Definition at line 99 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), ns3::olsr::AgentImpl::PopulateMprSelectorSet(), ns3::olsr::AgentImpl::PopulateTwoHopNeighborSet(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_NEIGHB_HOLD_TIME (Scalar (3) * OLSR_REFRESH_INTERVAL) |
Neighbor holding time.
Definition at line 72 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_NOT_NEIGH 0 |
Not neighbor type.
Definition at line 95 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), ns3::olsr::AgentImpl::PopulateTwoHopNeighborSet(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_PORT_NUMBER 698 |
Definition at line 126 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::RecvOlsr(), and ns3::olsr::AgentImpl::Start().
#define OLSR_REFRESH_INTERVAL Seconds (2) |
Period at which a node must cite every link and every neighbor.
We only use this value in order to define OLSR_NEIGHB_HOLD_TIME.
Definition at line 66 of file olsr-agent-impl.cc.
#define OLSR_SYM_LINK 2 |
Symmetric link type.
Definition at line 88 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_SYM_NEIGH 1 |
Symmetric neighbor type.
Definition at line 97 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing(), ns3::olsr::AgentImpl::PopulateTwoHopNeighborSet(), and ns3::olsr::AgentImpl::SendHello().
#define OLSR_TOP_HOLD_TIME (Scalar (3) * m_tcInterval) |
Top holding time.
Definition at line 74 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::SendTc().
#define OLSR_UNSPEC_LINK 0 |
Unspecified link type.
Definition at line 84 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::LinkSensing().
#define OLSR_WILL_ALWAYS 7 |
Willingness for forwarding packets from other nodes: always.
Definition at line 113 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::GetTypeId(), and ns3::olsr::AgentImpl::MprComputation().
#define OLSR_WILL_DEFAULT 3 |
Willingness for forwarding packets from other nodes: medium.
Definition at line 109 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::GetTypeId(), and ns3::olsr::AgentImpl::NeighborLoss().
#define OLSR_WILL_HIGH 6 |
Willingness for forwarding packets from other nodes: high.
Definition at line 111 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::GetTypeId().
#define OLSR_WILL_LOW 1 |
Willingness for forwarding packets from other nodes: low.
Definition at line 107 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::GetTypeId().
#define OLSR_WILL_NEVER 0 |
Willingness for forwarding packets from other nodes: never.
Definition at line 105 of file olsr-agent-impl.cc.
Referenced by ns3::olsr::AgentImpl::GetTypeId(), ns3::olsr::AgentImpl::MprComputation(), and ns3::olsr::AgentImpl::RoutingTableComputation().