View | Details | Raw Unified | Return to bug 1702
Collapse All | Expand All

(-)a/RELEASE_NOTES (+1 lines)
 Lines 36-41    Link Here 
36
- Bug 1697 - ICMPv6 Redirect trigger contains multiple bugs
36
- Bug 1697 - ICMPv6 Redirect trigger contains multiple bugs
37
- Bug 1700 - Ipv6RawSocket does not honor the bound address when sending packets
37
- Bug 1700 - Ipv6RawSocket does not honor the bound address when sending packets
38
- Bug 1701 - Ipv6StaticRouting: the source address should match the destination scope
38
- Bug 1701 - Ipv6StaticRouting: the source address should match the destination scope
39
- Bug 1702 - Ipv6InterfaceContainer::SetRouter should not always add the router as the default router.
39
- Bug 1703 - Nodes don't react to a DAD
40
- Bug 1703 - Nodes don't react to a DAD
40
- Bug 1712 - The IP (v4 and v6) forwarding needs a test
41
- Bug 1712 - The IP (v4 and v6) forwarding needs a test
41
- Bug 1718 - Ipv4StaticRouting log component is misspelled
42
- Bug 1718 - Ipv4StaticRouting log component is misspelled
(-)a/examples/ipv6/fragmentation-ipv6.cc (-2 / +4 lines)
 Lines 129-138    Link Here 
129
  Ipv6AddressHelper ipv6;
129
  Ipv6AddressHelper ipv6;
130
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
130
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
131
  Ipv6InterfaceContainer i1 = ipv6.Assign (d1);
131
  Ipv6InterfaceContainer i1 = ipv6.Assign (d1);
132
  i1.SetRouter (1, true);
132
  i1.SetForwarding (1, true);
133
  i1.SetDefaultRouteInAllNodes (1);
133
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
134
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
134
  Ipv6InterfaceContainer i2 = ipv6.Assign (d2);
135
  Ipv6InterfaceContainer i2 = ipv6.Assign (d2);
135
  i2.SetRouter (0, true);
136
  i2.SetForwarding (0, true);
137
  i2.SetDefaultRouteInAllNodes (0);
136
138
137
  stackHelper.PrintRoutingTable (n0);
139
  stackHelper.PrintRoutingTable (n0);
138
140
(-)a/examples/ipv6/icmpv6-redirect.cc (-3 / +5 lines)
 Lines 148-159    Link Here 
148
148
149
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
149
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
150
  Ipv6InterfaceContainer iic1 = ipv6.Assign (ndc1);
150
  Ipv6InterfaceContainer iic1 = ipv6.Assign (ndc1);
151
  iic1.SetRouter (2, true);
151
  iic1.SetForwarding (2, true);
152
  iic1.SetRouter (1, true);
152
  iic1.SetForwarding (1, true);
153
  iic1.SetDefaultRouteInAllNodes (1);
153
154
154
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
155
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
155
  Ipv6InterfaceContainer iic2 = ipv6.Assign (ndc2);
156
  Ipv6InterfaceContainer iic2 = ipv6.Assign (ndc2);
156
  iic2.SetRouter (0, true);
157
  iic2.SetForwarding (0, true);
158
  iic2.SetDefaultRouteInAllNodes (0);
157
159
158
  stackHelper.AddHostRouteTo (r1, iic2.GetAddress (1, 1), iic1.GetAddress (2, 0), iic1.GetInterfaceIndex (1));
160
  stackHelper.AddHostRouteTo (r1, iic2.GetAddress (1, 1), iic1.GetAddress (2, 0), iic1.GetInterfaceIndex (1));
159
161
(-)a/examples/ipv6/loose-routing-ipv6.cc (-10 / +20 lines)
 Lines 106-136    Link Here 
106
106
107
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
107
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
108
  Ipv6InterfaceContainer i1 = ipv6.Assign (d1);
108
  Ipv6InterfaceContainer i1 = ipv6.Assign (d1);
109
  i1.SetRouter (1, true);
109
  i1.SetForwarding (1, true);
110
  i1.SetDefaultRouteInAllNodes (1);
110
111
111
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
112
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
112
  Ipv6InterfaceContainer i2 = ipv6.Assign (d2);
113
  Ipv6InterfaceContainer i2 = ipv6.Assign (d2);
113
  i2.SetRouter (1, true);
114
  i2.SetForwarding (1, true);
115
  i2.SetDefaultRouteInAllNodes (1);
114
116
115
  ipv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64));
117
  ipv6.SetBase (Ipv6Address ("2001:3::"), Ipv6Prefix (64));
116
  Ipv6InterfaceContainer i3 = ipv6.Assign (d3);
118
  Ipv6InterfaceContainer i3 = ipv6.Assign (d3);
117
  i3.SetRouter (0, true);
119
  i3.SetForwarding (0, true);
118
  i3.SetRouter (1, true);
120
  i3.SetDefaultRouteInAllNodes (0);
121
  i3.SetForwarding (1, true);
122
  i3.SetDefaultRouteInAllNodes (1);
119
123
120
  ipv6.SetBase (Ipv6Address ("2001:4::"), Ipv6Prefix (64));
124
  ipv6.SetBase (Ipv6Address ("2001:4::"), Ipv6Prefix (64));
121
  Ipv6InterfaceContainer i4 = ipv6.Assign (d4);
125
  Ipv6InterfaceContainer i4 = ipv6.Assign (d4);
122
  i4.SetRouter (0, true);
126
  i4.SetForwarding (0, true);
123
  i4.SetRouter (1, true);
127
  i4.SetDefaultRouteInAllNodes (0);
128
  i4.SetForwarding (1, true);
129
  i4.SetDefaultRouteInAllNodes (1);
124
130
125
  ipv6.SetBase (Ipv6Address ("2001:5::"), Ipv6Prefix (64));
131
  ipv6.SetBase (Ipv6Address ("2001:5::"), Ipv6Prefix (64));
126
  Ipv6InterfaceContainer i5 = ipv6.Assign (d5);
132
  Ipv6InterfaceContainer i5 = ipv6.Assign (d5);
127
  i5.SetRouter (0, true);
133
  i5.SetForwarding (0, true);
128
  i5.SetRouter (1, true);
134
  i5.SetDefaultRouteInAllNodes (0);
135
  i5.SetForwarding (1, true);
136
  i5.SetDefaultRouteInAllNodes (1);
129
137
130
  ipv6.SetBase (Ipv6Address ("2001:6::"), Ipv6Prefix (64));
138
  ipv6.SetBase (Ipv6Address ("2001:6::"), Ipv6Prefix (64));
131
  Ipv6InterfaceContainer i6 = ipv6.Assign (d6);
139
  Ipv6InterfaceContainer i6 = ipv6.Assign (d6);
132
  i6.SetRouter (0, true);
140
  i6.SetForwarding (0, true);
133
  i6.SetRouter (1, true);
141
  i6.SetDefaultRouteInAllNodes (0);
142
  i6.SetForwarding (1, true);
143
  i6.SetDefaultRouteInAllNodes (1);
134
144
135
  NS_LOG_INFO ("Create Applications.");
145
  NS_LOG_INFO ("Create Applications.");
136
146
(-)a/examples/ipv6/radvd-two-prefix.cc (-2 / +4 lines)
 Lines 145-151    Link Here 
145
  NetDeviceContainer tmp2;
145
  NetDeviceContainer tmp2;
146
  tmp2.Add (d1.Get (1)); /* R */
146
  tmp2.Add (d1.Get (1)); /* R */
147
  Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
147
  Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
148
  iicr1.SetRouter (0, true);
148
  iicr1.SetForwarding (0, true);
149
  iicr1.SetDefaultRouteInAllNodes (0);
149
  iic1.Add (iicr1);
150
  iic1.Add (iicr1);
150
151
151
  /* add another IPv6 address for second prefix advertised on first subnet */
152
  /* add another IPv6 address for second prefix advertised on first subnet */
 Lines 156-162    Link Here 
156
  NetDeviceContainer tmp3;
157
  NetDeviceContainer tmp3;
157
  tmp3.Add (d2.Get (0)); /* R */
158
  tmp3.Add (d2.Get (0)); /* R */
158
  Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
159
  Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
159
  iicr2.SetRouter (0, true);
160
  iicr2.SetForwarding (0, true);
161
  iicr2.SetDefaultRouteInAllNodes (0);
160
162
161
  NetDeviceContainer tmp4;
163
  NetDeviceContainer tmp4;
162
  tmp4.Add (d2.Get (1)); /* n1 */
164
  tmp4.Add (d2.Get (1)); /* n1 */
(-)a/examples/ipv6/radvd.cc (-2 / +4 lines)
 Lines 92-98    Link Here 
92
  NetDeviceContainer tmp2;
92
  NetDeviceContainer tmp2;
93
  tmp2.Add (d1.Get (1)); /* R */
93
  tmp2.Add (d1.Get (1)); /* R */
94
  Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
94
  Ipv6InterfaceContainer iicr1 = ipv6.Assign (tmp2); /* R interface to the first subnet is just statically assigned */
95
  iicr1.SetRouter (0, true);
95
  iicr1.SetForwarding (0, true);
96
  iicr1.SetDefaultRouteInAllNodes (0);
96
  iic1.Add (iicr1);
97
  iic1.Add (iicr1);
97
98
98
  /* second subnet R - n1 */
99
  /* second subnet R - n1 */
 Lines 100-106    Link Here 
100
  NetDeviceContainer tmp3;
101
  NetDeviceContainer tmp3;
101
  tmp3.Add (d2.Get (0)); /* R */
102
  tmp3.Add (d2.Get (0)); /* R */
102
  Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
103
  Ipv6InterfaceContainer iicr2 = ipv6.Assign (tmp3); /* R interface */
103
  iicr2.SetRouter (0, true);
104
  iicr2.SetForwarding (0, true);
105
  iicr2.SetDefaultRouteInAllNodes (0);
104
106
105
  NetDeviceContainer tmp4;
107
  NetDeviceContainer tmp4;
106
  tmp4.Add (d2.Get (1)); /* n1 */
108
  tmp4.Add (d2.Get (1)); /* n1 */
(-)a/examples/routing/simple-routing-ping6.cc (-2 / +4 lines)
 Lines 130-139    Link Here 
130
  Ipv6AddressHelper ipv6;
130
  Ipv6AddressHelper ipv6;
131
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
131
  ipv6.SetBase (Ipv6Address ("2001:1::"), Ipv6Prefix (64));
132
  Ipv6InterfaceContainer i1 = ipv6.Assign (d1);
132
  Ipv6InterfaceContainer i1 = ipv6.Assign (d1);
133
  i1.SetRouter (1, true);
133
  i1.SetForwarding (1, true);
134
  i1.SetDefaultRouteInAllNodes (1);
134
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
135
  ipv6.SetBase (Ipv6Address ("2001:2::"), Ipv6Prefix (64));
135
  Ipv6InterfaceContainer i2 = ipv6.Assign (d2);
136
  Ipv6InterfaceContainer i2 = ipv6.Assign (d2);
136
  i2.SetRouter (0, true);
137
  i2.SetForwarding (0, true);
138
  i2.SetDefaultRouteInAllNodes (0);
137
139
138
  stackHelper.PrintRoutingTable (n0);
140
  stackHelper.PrintRoutingTable (n0);
139
141
(-)a/src/fd-net-device/examples/fd-tap-ping6.cc (-2 / +4 lines)
 Lines 102-108    Link Here 
102
 
102
 
103
  ipv6.SetBase (Ipv6Address ("2001:0DB8:1::"), Ipv6Prefix (64));
103
  ipv6.SetBase (Ipv6Address ("2001:0DB8:1::"), Ipv6Prefix (64));
104
  Ipv6InterfaceContainer i1 = ipv6.Assign (devs);
104
  Ipv6InterfaceContainer i1 = ipv6.Assign (devs);
105
  i1.SetRouter (1, true);
105
  i1.SetForwarding (1, true);
106
  i1.SetDefaultRouteInAllNodes (1);
106
  
107
  
107
  ipv6.SetBase (Ipv6Address ("2001:0DB8:2::"), Ipv6Prefix (64));
108
  ipv6.SetBase (Ipv6Address ("2001:0DB8:2::"), Ipv6Prefix (64));
108
  Ipv6Address tapAddr = ipv6.NewAddress ();
109
  Ipv6Address tapAddr = ipv6.NewAddress ();
 Lines 124-130    Link Here 
124
  Ptr<FdNetDevice> fdevice = device->GetObject<FdNetDevice> ();
125
  Ptr<FdNetDevice> fdevice = device->GetObject<FdNetDevice> ();
125
  fdevice-> SetIsMulticast (true);
126
  fdevice-> SetIsMulticast (true);
126
  Ipv6InterfaceContainer i2 = ipv6.Assign (fdevs);
127
  Ipv6InterfaceContainer i2 = ipv6.Assign (fdevs);
127
  i2.SetRouter (0, true);
128
  i2.SetForwarding (0, true);
129
  i2.SetDefaultRouteInAllNodes (0);
128
130
129
  //
131
  //
130
  // Create the Ping6 application.
132
  // Create the Ping6 application.
(-)a/src/internet/helper/ipv6-interface-container.cc (+27 lines)
 Lines 105-110    Link Here 
105
    }
105
    }
106
}
106
}
107
107
108
void Ipv6InterfaceContainer::SetForwarding (uint32_t i, bool router)
109
{
110
  Ptr<Ipv6> ipv6 = m_interfaces[i].first;
111
  ipv6->SetForwarding (m_interfaces[i].second, router);
112
}
113
114
void Ipv6InterfaceContainer::SetDefaultRouteInAllNodes (uint32_t router)
115
{
116
  Ptr<Ipv6> ipv6 = m_interfaces[router].first;
117
  uint32_t other;
118
  /* assume first global address is index 1 (0 is link-local) */
119
  Ipv6Address routerAddress = ipv6->GetAddress (m_interfaces[router].second, 0).GetAddress ();
120
121
  for (other = 0; other < m_interfaces.size (); other++)
122
    {
123
      if (other != router)
124
        {
125
          Ptr<Ipv6StaticRouting> routing = 0;
126
          Ipv6StaticRoutingHelper routingHelper;
127
128
          ipv6 = m_interfaces[other].first;
129
          routing = routingHelper.GetStaticRouting (ipv6);
130
          routing->SetDefaultRoute (routerAddress, m_interfaces[other].second);
131
        }
132
    }
133
}
134
108
void Ipv6InterfaceContainer::SetDefaultRoute (uint32_t i, uint32_t router)
135
void Ipv6InterfaceContainer::SetDefaultRoute (uint32_t i, uint32_t router)
109
{
136
{
110
  Ptr<Ipv6> ipv6 = m_interfaces[i].first;
137
  Ptr<Ipv6> ipv6 = m_interfaces[i].first;
(-)a/src/internet/helper/ipv6-interface-container.h (-1 / +15 lines)
 Lines 27-32    Link Here 
27
27
28
#include "ns3/ipv6.h"
28
#include "ns3/ipv6.h"
29
#include "ns3/ipv6-address.h"
29
#include "ns3/ipv6-address.h"
30
#include "ns3/deprecated.h"
30
31
31
namespace ns3
32
namespace ns3
32
{
33
{
 Lines 149-155    Link Here 
149
   * \param i index
150
   * \param i index
150
   * \param router true : is a router, false : is an host
151
   * \param router true : is a router, false : is an host
151
   */
152
   */
152
  void SetRouter (uint32_t i, bool router);
153
  void SetRouter (uint32_t i, bool router) NS_DEPRECATED;
154
155
  /**
156
   * \brief Set the state of the stack (act as a router or not) for the specified index.
157
   * \param i index
158
   * \param state true : is a router, false : is an host
159
   */
160
  void SetForwarding (uint32_t i, bool state);
161
162
  /**
163
   * \brief Set the default route for all the devices.
164
   * \param router the default router index
165
   */
166
  void SetDefaultRouteInAllNodes (uint32_t router);
153
167
154
  /**
168
  /**
155
   * \brief Set the default route for the specified index.
169
   * \brief Set the default route for the specified index.

Return to bug 1702