52 OlsrState& state = protocol->m_state;
61 NeighborTuple neighbor;
62 neighbor.status = NeighborTuple::STATUS_SYM;
63 neighbor.willingness = Willingness::DEFAULT;
64 neighbor.neighborMainAddr =
Ipv4Address(
"10.0.0.2");
65 protocol->m_state.InsertNeighborTuple(neighbor);
66 neighbor.neighborMainAddr =
Ipv4Address(
"10.0.0.3");
67 protocol->m_state.InsertNeighborTuple(neighbor);
68 TwoHopNeighborTuple tuple;
69 tuple.expirationTime =
Seconds(3600);
72 protocol->m_state.InsertTwoHopNeighborTuple(tuple);
75 protocol->m_state.InsertTwoHopNeighborTuple(tuple);
77 protocol->MprComputation();
88 protocol->m_state.InsertTwoHopNeighborTuple(tuple);
90 protocol->MprComputation();
91 MprSet mpr = state.GetMprSet();
95 "Node 1 must select node 2 as MPR");
106 tuple.twoHopNeighborAddr =
Ipv4Address(
"10.0.0.6");
107 protocol->m_state.InsertTwoHopNeighborTuple(tuple);
109 protocol->MprComputation();
110 mpr = state.GetMprSet();
114 "Node 1 must select node 2 as MPR");
117 "Node 1 must select node 3 as MPR");
129 neighbor.willingness = olsr::Willingness::ALWAYS;
130 neighbor.neighborMainAddr =
Ipv4Address(
"10.0.0.7");
131 protocol->m_state.InsertNeighborTuple(neighbor);
133 protocol->MprComputation();
134 mpr = state.GetMprSet();
138 "Node 1 must select node 7 as MPR");
151 neighbor.willingness = Willingness::NEVER;
152 neighbor.neighborMainAddr =
Ipv4Address(
"10.0.0.8");
153 protocol->m_state.InsertNeighborTuple(neighbor);
155 tuple.twoHopNeighborAddr =
Ipv4Address(
"10.0.0.9");
156 protocol->m_state.InsertTwoHopNeighborTuple(tuple);
158 protocol->MprComputation();
159 mpr = state.GetMprSet();
163 "Node 1 must NOT select node 8 as MPR");