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

(-)a/CHANGES.html (-41 / +41 lines)
 Lines 81-87    Link Here 
81
81
82
<li><b>Ipv4Interface::GetMtu () deleted</b>
82
<li><b>Ipv4Interface::GetMtu () deleted</b>
83
  <p>The Ipv4Interface API is private to internet-stack module; this method
83
  <p>The Ipv4Interface API is private to internet-stack module; this method
84
was just a pass-through to GetDevice ()->GetMtu ().
84
was just a pass-through to GetDevice ()-&gt;GetMtu ().
85
  </p>
85
  </p>
86
</li>
86
</li>
87
87
 Lines 141-156    Link Here 
141
<p> 
141
<p> 
142
To accommodate support for the radiotap and prism headers in PCAP traces, the interface for promiscuos mode sniff in the wifi device was changed. The new implementation was heavily inspired by the way the madwifi driver handles monitor mode. A distinction between TX and RX events is introduced, to account for the fact that different information is to be put in the radiotap/prism header (e.g., RSSI and noise make sense only for RX packets). The following are the relevant modifications to the WifiPhy class:
142
To accommodate support for the radiotap and prism headers in PCAP traces, the interface for promiscuos mode sniff in the wifi device was changed. The new implementation was heavily inspired by the way the madwifi driver handles monitor mode. A distinction between TX and RX events is introduced, to account for the fact that different information is to be put in the radiotap/prism header (e.g., RSSI and noise make sense only for RX packets). The following are the relevant modifications to the WifiPhy class:
143
<pre>
143
<pre>
144
-  void NotifyPromiscSniff (Ptr<const Packet> packet);
144
-  void NotifyPromiscSniff (Ptr&lt;const Packet&gt; packet);
145
+  void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm);
145
+  void NotifyPromiscSniffRx (Ptr&lt;const Packet&gt; packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm);
146
+  void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble);
146
+  void NotifyPromiscSniffTx (Ptr&lt;const Packet&gt; packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble);
147
-  TracedCallback<Ptr<const Packet> > m_phyPromiscSnifferTrace;
147
-  TracedCallback&lt;Ptr&lt;const Packet&gt; &gt; m_phyPromiscSnifferTrace;
148
+  TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace;
148
+  TracedCallback&lt;Ptr&lt;const Packet&gt;, uint16_t, uint32_t, bool, double, double&gt; m_phyPromiscSniffRxTrace;
149
+  TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace;
149
+  TracedCallback&lt;Ptr&lt;const Packet&gt;, uint16_t, uint32_t, bool&gt; m_phyPromiscSniffTxTrace;
150
</pre>
150
</pre>
151
The above mentioned callbacks are expected to be used to call the following method to write Wifi PCAP traces in promiscuous mode:
151
The above mentioned callbacks are expected to be used to call the following method to write Wifi PCAP traces in promiscuous mode:
152
<pre>
152
<pre>
153
+  void WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm);
153
+  void WriteWifiMonitorPacket(Ptr&lt;const Packet&gt; packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm);
154
</pre>
154
</pre>
155
In the above method, the isTx parameter is to be used to differentiate between TX and RX packets. For an example of how to implement these callbacks, see the implementation of PcapSniffTxEvent and PcapSniffRxEvent in src/helper/yans-wifi-helper.cc
155
In the above method, the isTx parameter is to be used to differentiate between TX and RX packets. For an example of how to implement these callbacks, see the implementation of PcapSniffTxEvent and PcapSniffRxEvent in src/helper/yans-wifi-helper.cc
156
</p>
156
</p>
 Lines 181-198    Link Here 
181
locally originated packets, and an asynchronous, callback-based lookup
181
locally originated packets, and an asynchronous, callback-based lookup
182
for forwarded packets) is still the same.
182
for forwarded packets) is still the same.
183
<pre>
183
<pre>
184
-  typedef Callback&lt;void, bool, const Ipv4Route&, Ptr&lt;Packet&gt;, const Ipv4Header&&gt; RouteReplyCallback;
184
-  typedef Callback&lt;void, bool, const Ipv4Route&amp;, Ptr&lt;Packet&gt;, const Ipv4Header&amp;&gt; RouteReplyCallback;
185
+  typedef Callback&lt;void, Ptr&lt;Ipv4Route&gt;, Ptr&lt;const Packet&gt;, const Ipv4Header &&gt; UnicastForwardCallback;
185
+  typedef Callback&lt;void, Ptr&lt;Ipv4Route&gt;, Ptr&lt;const Packet&gt;, const Ipv4Header &amp;&gt; UnicastForwardCallback;
186
+  typedef Callback&lt;void, Ptr&lt;Ipv4MulticastRoute&gt;, Ptr&lt;const Packet&gt;, const Ipv4Header &&gt; MulticastForwardCallback;
186
+  typedef Callback&lt;void, Ptr&lt;Ipv4MulticastRoute&gt;, Ptr&lt;const Packet&gt;, const Ipv4Header &amp;&gt; MulticastForwardCallback;
187
+  typedef Callback&lt;void, Ptr&lt;const Packet&gt;, const Ipv4Header &, uint32_t &gt; LocalDeliverCallback;
187
+  typedef Callback&lt;void, Ptr&lt;const Packet&gt;, const Ipv4Header &amp;, uint32_t &gt; LocalDeliverCallback;
188
+  typedef Callback&lt;void, Ptr&lt;const Packet&gt;, const Ipv4Header &&gt; ErrorCallback;
188
+  typedef Callback&lt;void, Ptr&lt;const Packet&gt;, const Ipv4Header &amp;&gt; ErrorCallback;
189
-  virtual bool RequestInterface (Ipv4Address destination, uint32_t& interface) = 0;
189
-  virtual bool RequestInterface (Ipv4Address destination, uint32_t&amp; interface) = 0;
190
+  virtual Ptr&lt;Ipv4Route&gt; RouteOutput (Ptr&lt;Packet&gt; p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &errno) = 0;
190
+  virtual Ptr&lt;Ipv4Route&gt; RouteOutput (Ptr&lt;Packet&gt; p, const Ipv4Header &amp;header, uint32_t oif, Socket::SocketErrno &amp;errno) = 0;
191
-  virtual bool RequestRoute (uint32_t interface,
191
-  virtual bool RequestRoute (uint32_t interface,
192
-                            const Ipv4Header &ipHeader,
192
-                            const Ipv4Header &amp;ipHeader,
193
-                            Ptr&lt;Packet&gt; packet,
193
-                            Ptr&lt;Packet&gt; packet,
194
-                            RouteReplyCallback routeReply) = 0;
194
-                            RouteReplyCallback routeReply) = 0;
195
+  virtual bool RouteInput  (Ptr&lt;const Packet&gt; p, const Ipv4Header &header, Ptr&lt;const NetDevice&gt; idev,
195
+  virtual bool RouteInput  (Ptr&lt;const Packet&gt; p, const Ipv4Header &amp;header, Ptr&lt;const NetDevice&gt; idev,
196
+                             UnicastForwardCallback ucb, MulticastForwardCallback mcb,
196
+                             UnicastForwardCallback ucb, MulticastForwardCallback mcb,
197
+                             LocalDeliverCallback lcb, ErrorCallback ecb) = 0;
197
+                             LocalDeliverCallback lcb, ErrorCallback ecb) = 0;
198
</pre>
198
</pre>
 Lines 242-257    Link Here 
242
- static const uint32_t Ipv4RoutingProtocol::IF_INDEX_ANY = 0xffffffff;
242
- static const uint32_t Ipv4RoutingProtocol::IF_INDEX_ANY = 0xffffffff;
243
+ static const uint32_t Ipv4RoutingProtocol::INTERFACE_ANY = 0xffffffff;
243
+ static const uint32_t Ipv4RoutingProtocol::INTERFACE_ANY = 0xffffffff;
244
244
245
- bool Ipv4RoutingProtocol::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex);
245
- bool Ipv4RoutingProtocol::RequestIfIndex (Ipv4Address destination, uint32_t&amp; ifIndex);
246
+ bool Ipv4RoutingProtocol::RequestInterface (Ipv4Address destination, uint32_t& interface);
246
+ bool Ipv4RoutingProtocol::RequestInterface (Ipv4Address destination, uint32_t&amp; interface);
247
(N.B. this particular function is planned to be renamed to RouteOutput() in the
247
(N.B. this particular function is planned to be renamed to RouteOutput() in the
248
proposed IPv4 routing refactoring)
248
proposed IPv4 routing refactoring)
249
249
250
- uint32_t Ipv4::GetIfIndexByAddress (Ipv4Address addr, Ipv4Mask mask);
250
- uint32_t Ipv4::GetIfIndexByAddress (Ipv4Address addr, Ipv4Mask mask);
251
+ int_32t Ipv4::GetInterfaceForAddress (Ipv4Address address, Ipv4Mask mask) const;
251
+ int_32t Ipv4::GetInterfaceForAddress (Ipv4Address address, Ipv4Mask mask) const;
252
252
253
- bool Ipv4::GetIfIndexForDestination (Ipv4Address dest, uint32_t &ifIndex) const;
253
- bool Ipv4::GetIfIndexForDestination (Ipv4Address dest, uint32_t &amp;ifIndex) const;
254
+ bool Ipv4::GetInterfaceForDestination (Ipv4Address dest, uint32_t &interface) const;
254
+ bool Ipv4::GetInterfaceForDestination (Ipv4Address dest, uint32_t &amp;interface) const;
255
(N.B. this function is not needed in the proposed Ipv4 routing refactoring)
255
(N.B. this function is not needed in the proposed Ipv4 routing refactoring)
256
</pre>
256
</pre>
257
257
 Lines 269-281    Link Here 
269
  <li>Regarding legacy API usage, typically where you once did the following,
269
  <li>Regarding legacy API usage, typically where you once did the following,
270
  using the public Ipv4 class interface (e.g.):
270
  using the public Ipv4 class interface (e.g.):
271
  <pre>
271
  <pre>
272
  ipv4A->SetAddress (ifIndexA, Ipv4Address ("172.16.1.1"));
272
  ipv4A-&gt;SetAddress (ifIndexA, Ipv4Address ("172.16.1.1"));
273
  ipv4A->SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255"));
273
  ipv4A-&gt;SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255"));
274
  </pre>
274
  </pre>
275
  you now do:
275
  you now do:
276
  <pre>
276
  <pre>
277
  Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255"));
277
  Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255"));
278
  ipv4A->AddAddress (ifIndexA, ipv4IfAddrA);
278
  ipv4A-&gt;AddAddress (ifIndexA, ipv4IfAddrA);
279
  </pre>
279
  </pre>
280
  <li> At the helper API level, one often gets an address from an interface
280
  <li> At the helper API level, one often gets an address from an interface
281
  container.  We preserve the legacy GetAddress (uint32_t i) but it
281
  container.  We preserve the legacy GetAddress (uint32_t i) but it
 Lines 293-308    Link Here 
293
<li><b>New WifiMacHelper objects</b>
293
<li><b>New WifiMacHelper objects</b>
294
<p>The type of wifi MAC is now set by two new specific helpers, NqosWifiMacHelper for non QoS MACs and QosWifiMacHelper for Qos MACs. They are passed as argument to WifiHelper::Install methods.</li>
294
<p>The type of wifi MAC is now set by two new specific helpers, NqosWifiMacHelper for non QoS MACs and QosWifiMacHelper for Qos MACs. They are passed as argument to WifiHelper::Install methods.</li>
295
  <pre>
295
  <pre>
296
- void WifiHelper::SetMac (std::string type, std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),...)
296
- void WifiHelper::SetMac (std::string type, std::string n0 = "", const AttributeValue &amp;v0 = EmptyAttributeValue (),...)
297
297
298
- NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phyHelper, NodeContainer c) const
298
- NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &amp;phyHelper, NodeContainer c) const
299
+ NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const
299
+ NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &amp;phyHelper, const WifiMacHelper &amp;macHelper, NodeContainer c) const
300
300
301
- NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, Ptr&lt;Node&gt; node) const
301
- NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &amp;phy, Ptr&lt;Node&gt; node) const
302
+ NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, Ptr&lt;Node&gt; node) const
302
+ NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &amp;phy, const WifiMacHelper &amp;mac, Ptr&lt;Node&gt; node) const
303
303
304
- NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, std::string nodeName) const
304
- NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &amp;phy, std::string nodeName) const
305
+ NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const
305
+ NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &amp;phy, const WifiMacHelper &amp;mac, std::string nodeName) const
306
  </pre>
306
  </pre>
307
  See src/helper/nqos-wifi-mac-helper.h and src/helper/qos-wifi-mac-helper.h for more details.
307
  See src/helper/nqos-wifi-mac-helper.h and src/helper/qos-wifi-mac-helper.h for more details.
308
  </p>
308
  </p>
 Lines 334-340    Link Here 
334
334
335
<h2>New API:</h2>
335
<h2>New API:</h2>
336
<ul>
336
<ul>
337
<li>XML support has been added to the ConfigStore in /src/contrib/config-store.cc</li>
337
<li>XML support has been added to the ConfigStore in src/contrib/config-store.cc</li>
338
338
339
<li>The ns-2 calendar queue scheduler option has been ported to src/simulator</li>
339
<li>The ns-2 calendar queue scheduler option has been ported to src/simulator</li>
340
340
 Lines 571-585    Link Here 
571
The normal and the promiscuous receive callbacks of the NetDevice API
571
The normal and the promiscuous receive callbacks of the NetDevice API
572
have been changed from:
572
have been changed from:
573
<pre>
573
<pre>
574
Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &>
574
Callback&lt;bool,Ptr&lt;NetDevice&gt;,Ptr&lt;Packet&gt;,uint16_t,const Address &amp;&gt;
575
Callback<bool,Ptr<NetDevice>, Ptr<Packet>, uint16_t,
575
Callback&lt;bool,Ptr&lt;NetDevice&gt;, Ptr&lt;Packet&gt;, uint16_t,
576
         const Address &, const Address &, enum PacketType >
576
         const Address &amp;, const Address &amp;, enum PacketType &gt;
577
</pre>
577
</pre>
578
to:
578
to:
579
<pre>
579
<pre>
580
Callback<bool,Ptr<NetDevice>,Ptr<const Packet>,uint16_t,const Address &>
580
Callback&lt;bool,Ptr&lt;NetDevice&gt;,Ptr&lt;const Packet&gt;,uint16_t,const Address &amp;&gt;
581
Callback<bool,Ptr<NetDevice>, Ptr<const Packet>, uint16_t,
581
Callback&lt;bool,Ptr&lt;NetDevice&gt;, Ptr&lt;const Packet&gt;, uint16_t,
582
         const Address &, const Address &, enum PacketType >
582
         const Address &amp;, const Address &amp;, enum PacketType &gt;
583
</pre>
583
</pre>
584
to avoid the kind of bugs reported in 
584
to avoid the kind of bugs reported in 
585
<a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=273">bug 273</a>.
585
<a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=273">bug 273</a>.
 Lines 648-654    Link Here 
648
- void SetPort (uint16_t port); 
648
- void SetPort (uint16_t port); 
649
+ UdpEchoServerHelper (uint16_t port);
649
+ UdpEchoServerHelper (uint16_t port);
650
+ 
650
+ 
651
+ void SetAttribute (std::string name, const AttributeValue &value);
651
+ void SetAttribute (std::string name, const AttributeValue &amp;value);
652
ApplicationContainer Install (NodeContainer c);
652
ApplicationContainer Install (NodeContainer c);
653
653
654
class UdpEchoClientHelper
654
class UdpEchoClientHelper
 Lines 657-664    Link Here 
657
- UdpEchoClientHelper ();
657
- UdpEchoClientHelper ();
658
+ UdpEchoClientHelper (Ipv4Address ip, uint16_t port);
658
+ UdpEchoClientHelper (Ipv4Address ip, uint16_t port);
659
- void SetRemote (Ipv4Address ip, uint16_t port);
659
- void SetRemote (Ipv4Address ip, uint16_t port);
660
- void SetAppAttribute (std::string name, const AttributeValue &value);
660
- void SetAppAttribute (std::string name, const AttributeValue &amp;value);
661
+ void SetAttribute (std::string name, const AttributeValue &value);
661
+ void SetAttribute (std::string name, const AttributeValue &amp;value);
662
ApplicationContainer Install (NodeContainer c);
662
ApplicationContainer Install (NodeContainer c);
663
</pre>
663
</pre>
664
</li>
664
</li>

Return to bug 618