Merge with ns-3-dev
authorKirill Andreev <andreev@iitp.ru>
Tue, 18 Aug 2009 12:01:35 +0400
changeset 5671 b1fce73037f8
parent 5670 e9c6779c0d59 (current diff)
parent 4725 4e068296f09f (diff)
child 5678 1aca9b0ebe8b
Merge with ns-3-dev
examples/wscript
src/devices/wifi/adhoc-wifi-mac.cc
src/devices/wifi/adhoc-wifi-mac.h
src/internet-stack/arp-l3-protocol.cc
src/mobility/vector.cc
src/mobility/vector.h
--- a/AUTHORS	Tue Aug 18 11:47:17 2009 +0400
+++ b/AUTHORS	Tue Aug 18 12:01:35 2009 +0400
@@ -1,30 +1,31 @@
+Kirill V. Andreev (kirillano@yandex.ru)
 Nicola Baldo (nbaldo@cttc.es)
 Mirko Banchi (mk.banchi@gmail.com)
+Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
 Raj Bhattacharjea (raj.b@gatech.edu)
+Timo Bingmann (timo.bingmann@student.kit.edu)
 Gustavo Carneiro (gjc@inescporto.pt, gjcarneiro@gmail.com)
+Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
+Luis Cortes (cortes@gatech.edu)
 Craig Dowell (craigdo@ee.washington.edu)
+David Gross (gdavid.devel@gmail.com)
 Tom Henderson (tomhend@u.washington.edu)
+Andrey Hippo (ahippo@yandex.ru)
+Sam Jansen (sam.jansen@gmail.com)
+Liu Jian (liujatp@gmail.com)
 Joe Kopena (tjkopena@cs.drexel.edu)
+Aleksey Kovalenko (kovalenko@iitp.ru)
 Mathieu Lacage (mathieu.lacage@sophia.inria.fr)
 Emmanuelle Laprise (emmmanuelle.laprise@bluekazoo.ca)
 Federico Maguolo (maguolof@dei.unipd.it)
+Francesco Malandrino (francesco.malandrino@gmail.com)
+Faker Moatamri (faker.moatamri@sophia.inria.fr)
+Duy Nguyen (duy@soe.ucsc.edu)
+Guangyu Pei (guangyu.pei@boeing.com)
 George F. Riley (riley@ece.gatech.edu)
+Providence Salumu Munga (Providence.Salumu@gmail.com, Providence.Salumu_Munga@it-sudparis.eu)
+Kulin Shah (m.kulin@gmail.com)
+Mauro Tortonesi (mauro.tortonesi@unife.it)
+Sebastien Vincent (vincent@lsiit.u-strasbg.fr)
 Guillaume Vu-Brugier (gvubrugier@gmail.com)
 Florian Westphal (fw@strlen.de)
-Sebastien Vincent (vincent@lsiit.u-strasbg.fr)
-David Gross (gdavid.devel@gmail.com)
-Mehdi Benamor (mehdi.benamor@telecom-bretagne.eu)
-Angelos Chatzipapas (chatzipa@ceid.upatras.gr)
-Luis Cortes (cortes@gatech.edu)
-Kulin Shah (m.kulin@gmail.com)
-Sam Jansen (sam.jansen@gmail.com)
-Timo Bingmann (timo.bingmann@student.kit.edu)
-Kirill V. Andreev (kirillano@yandex.ru)
-Providence Salumu Munga (Providence.Salumu@gmail.com, Providence.Salumu_Munga@it-sudparis.eu)
-Mauro Tortonesi (mauro.tortonesi@unife.it)
-Aleksey Kovalenko (kovalenko@iitp.ru)
-Liu Jian (liujatp@gmail.com)
-Andrey Hippo (ahippo@yandex.ru)
-Francesco Malandrino (francesco.malandrino@gmail.com)
-Faker Moatamri (faker.moatamri@sophia.inria.fr)
-Guangyu Pei (guangyu.pei@boeing.com)
--- a/RELEASE_NOTES	Tue Aug 18 11:47:17 2009 +0400
+++ b/RELEASE_NOTES	Tue Aug 18 12:01:35 2009 +0400
@@ -6,6 +6,50 @@
 All of the ns-3 documentation is accessible from the ns-3 website: 
 http://www.nsnam.org including tutorials: http://www.nsnam.org/tutorials.html
 
+Release 3.6
+===========
+
+Availability
+------------
+This release is immediately available from:
+http://www.nsnam.org/releases/ns-allinone-3.6.tar.bz2
+
+Supported platforms
+-------------------
+ns-3.6 has been tested on the following platforms:
+  - linux x86 gcc 4.2, 4.1, and, 3.4.6.
+  - linux x86_64 gcc 4.4.0, 4.3.2, 4.2.3, 4.2.1, 4.1.3, 3.4.6
+  - MacOS X ppc and x86 (gcc 4.0.x and 4.2.x)
+  - cygwin gcc 3.4.4 (debug only), gcc 4.3.2 (debug and optimized)
+  - mingw gcc 3.4.5 (debug only)
+
+Not all ns-3 options are available on all platforms; consult the
+wiki for more information:
+http://www.nsnam.org/wiki/index.php/Installation
+
+New user-visible features
+-------------------------
+
+  - Add an implementation of the minstrel rate control algorithm 
+    (Duy Nguyen for gsoc)
+
+ 
+API changes from ns-3.5
+-----------------------
+API changes for this release are documented in the file CHANGES.html.  
+XXX
+
+Known issues
+------------
+ns-3 build is known to fail on the following platforms:
+  - gcc 3.3 and earlier
+  - optimized builds on gcc 3.4.4 and 3.4.5
+  - optimized builds on linux x86 gcc 4.0.x
+
+Future releases
+---------------
+XXX
+
 Release 3.5
 ===========
 
--- a/bindings/python/callbacks_list.py	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/callbacks_list.py	Tue Aug 18 12:01:35 2009 +0400
@@ -2,6 +2,7 @@
     ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['bool', 'ns3::Ptr<ns3::Packet>', 'ns3::Address const&', 'ns3::Address const&', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
+    ['void', 'ns3::Ptr<ns3::Packet>', 'ns3::WifiMacHeader const*', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
     ['void', 'ns3::Ptr<ns3::Socket>', 'ns3::Address const&', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
--- a/bindings/python/ns3_module_common.py	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/ns3_module_common.py	Tue Aug 18 12:01:35 2009 +0400
@@ -43,6 +43,10 @@
     module.add_class('Tag', parent=root_module['ns3::ObjectBase'])
     ## tag-buffer.h: ns3::TagBuffer [class]
     module.add_class('TagBuffer')
+    ## ascii-writer.h: ns3::AsciiWriter [class]
+    module.add_class('AsciiWriter', parent=root_module['ns3::RefCountBase'])
+    ## ascii-writer.h: ns3::AsciiWriter::Type [enumeration]
+    module.add_enum('Type', ['ENQUEUE', 'DEQUEUE', 'DROP', 'TX', 'RX'], outer_class=root_module['ns3::AsciiWriter'])
     ## chunk.h: ns3::Chunk [class]
     module.add_class('Chunk', parent=root_module['ns3::ObjectBase'])
     ## data-rate.h: ns3::DataRateChecker [class]
@@ -52,7 +56,7 @@
     ## header.h: ns3::Header [class]
     module.add_class('Header', parent=root_module['ns3::Chunk'])
     ## pcap-writer.h: ns3::PcapWriter [class]
-    module.add_class('PcapWriter', parent=root_module['ns3::RefCountBase'])
+    module.add_class('PcapWriter', parent=root_module['ns3::Object'])
     ## trailer.h: ns3::Trailer [class]
     module.add_class('Trailer', parent=root_module['ns3::Chunk'])
     ## error-model.h: ns3::ErrorModel [class]
@@ -131,6 +135,7 @@
     register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
     register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
     register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
+    register_Ns3AsciiWriter_methods(root_module, root_module['ns3::AsciiWriter'])
     register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk'])
     register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
     register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
@@ -949,6 +954,20 @@
                    [param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
     return
 
+def register_Ns3AsciiWriter_methods(root_module, cls):
+    ## ascii-writer.h: ns3::AsciiWriter::AsciiWriter(ns3::AsciiWriter const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::AsciiWriter const &', 'arg0')])
+    ## ascii-writer.h: static ns3::Ptr<ns3::AsciiWriter> ns3::AsciiWriter::Get(std::ostream & os) [member function]
+    cls.add_method('Get', 
+                   'ns3::Ptr< ns3::AsciiWriter >', 
+                   [param('std::ostream &', 'os')], 
+                   is_static=True)
+    ## ascii-writer.h: void ns3::AsciiWriter::WritePacket(ns3::AsciiWriter::Type type, std::string message, ns3::Ptr<ns3::Packet const> p) [member function]
+    cls.add_method('WritePacket', 
+                   'void', 
+                   [param('ns3::AsciiWriter::Type', 'type'), param('std::string', 'message'), param('ns3::Ptr< ns3::Packet const >', 'p')])
+    return
+
 def register_Ns3Chunk_methods(root_module, cls):
     ## chunk.h: ns3::Chunk::Chunk(ns3::Chunk const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::Chunk const &', 'arg0')])
@@ -1047,6 +1066,11 @@
 def register_Ns3PcapWriter_methods(root_module, cls):
     ## pcap-writer.h: ns3::PcapWriter::PcapWriter(ns3::PcapWriter const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::PcapWriter const &', 'arg0')])
+    ## pcap-writer.h: static ns3::TypeId ns3::PcapWriter::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
     ## pcap-writer.h: ns3::PcapWriter::PcapWriter() [constructor]
     cls.add_constructor([])
     ## pcap-writer.h: void ns3::PcapWriter::Open(std::string const & name) [member function]
@@ -1081,10 +1105,14 @@
     cls.add_method('WritePacket', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet')])
-    ## pcap-writer.h: void ns3::PcapWriter::WriteWifiMonitorPacket(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm) [member function]
+    ## pcap-writer.h: void ns3::PcapWriter::WriteWifiMonitorPacket(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm) [member function]
     cls.add_method('WriteWifiMonitorPacket', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('bool', 'isTx'), param('double', 'signalDbm'), param('double', 'noiseDbm')])
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('bool', 'isTx'), param('double', 'signalDbm'), param('double', 'noiseDbm')])
+    ## pcap-writer.h: void ns3::PcapWriter::SetCaptureSize(uint32_t size) [member function]
+    cls.add_method('SetCaptureSize', 
+                   'void', 
+                   [param('uint32_t', 'size')])
     return
 
 def register_Ns3Trailer_methods(root_module, cls):
--- a/bindings/python/ns3_module_core.py	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/ns3_module_core.py	Tue Aug 18 12:01:35 2009 +0400
@@ -83,6 +83,10 @@
     module.add_class('UniformVariable', parent=root_module['ns3::RandomVariable'])
     ## attribute-list.h: ns3::UnsafeAttributeList [class]
     module.add_class('UnsafeAttributeList')
+    ## vector.h: ns3::Vector2D [class]
+    module.add_class('Vector2D')
+    ## vector.h: ns3::Vector3D [class]
+    module.add_class('Vector3D')
     ## random-variable.h: ns3::WeibullVariable [class]
     module.add_class('WeibullVariable', parent=root_module['ns3::RandomVariable'])
     ## random-variable.h: ns3::ZipfVariable [class]
@@ -165,6 +169,14 @@
     module.add_class('TypeIdValue', parent=root_module['ns3::AttributeValue'])
     ## uinteger.h: ns3::UintegerValue [class]
     module.add_class('UintegerValue', parent=root_module['ns3::AttributeValue'])
+    ## vector.h: ns3::Vector2DChecker [class]
+    module.add_class('Vector2DChecker', parent=root_module['ns3::AttributeChecker'])
+    ## vector.h: ns3::Vector2DValue [class]
+    module.add_class('Vector2DValue', parent=root_module['ns3::AttributeValue'])
+    ## vector.h: ns3::Vector3DChecker [class]
+    module.add_class('Vector3DChecker', parent=root_module['ns3::AttributeChecker'])
+    ## vector.h: ns3::Vector3DValue [class]
+    module.add_class('Vector3DValue', parent=root_module['ns3::AttributeValue'])
     ## traced-value.h: ns3::TracedValue<unsigned int> [class]
     module.add_class('TracedValue', template_parameters=['unsigned int'])
     ## traced-value.h: ns3::TracedValue<unsigned int> [class]
@@ -175,6 +187,12 @@
     root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::BooleanValue'])
     ## traced-value.h: ns3::TracedValue<unsigned int> [class]
     root_module['ns3::TracedValue< unsigned int >'].implicitly_converts_to(root_module['ns3::EnumValue'])
+    typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector')
+    module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
+    typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue')
+    module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
+    typehandlers.add_type_alias('ns3::Vector3DChecker', 'ns3::VectorChecker')
+    module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker')
     
     ## Register a nested module for the namespace Config
     
@@ -261,6 +279,8 @@
     register_Ns3TypeIdAttributeInfo_methods(root_module, root_module['ns3::TypeId::AttributeInfo'])
     register_Ns3UniformVariable_methods(root_module, root_module['ns3::UniformVariable'])
     register_Ns3UnsafeAttributeList_methods(root_module, root_module['ns3::UnsafeAttributeList'])
+    register_Ns3Vector2D_methods(root_module, root_module['ns3::Vector2D'])
+    register_Ns3Vector3D_methods(root_module, root_module['ns3::Vector3D'])
     register_Ns3WeibullVariable_methods(root_module, root_module['ns3::WeibullVariable'])
     register_Ns3ZipfVariable_methods(root_module, root_module['ns3::ZipfVariable'])
     register_Ns3Empty_methods(root_module, root_module['ns3::empty'])
@@ -302,6 +322,10 @@
     register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
     register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue'])
     register_Ns3UintegerValue_methods(root_module, root_module['ns3::UintegerValue'])
+    register_Ns3Vector2DChecker_methods(root_module, root_module['ns3::Vector2DChecker'])
+    register_Ns3Vector2DValue_methods(root_module, root_module['ns3::Vector2DValue'])
+    register_Ns3Vector3DChecker_methods(root_module, root_module['ns3::Vector3DChecker'])
+    register_Ns3Vector3DValue_methods(root_module, root_module['ns3::Vector3DValue'])
     register_Ns3TracedValue__Unsigned_int_methods(root_module, root_module['ns3::TracedValue< unsigned int >'])
     register_Ns3ConfigMatchContainer_methods(root_module, root_module['ns3::Config::MatchContainer'])
     return
@@ -1180,6 +1204,36 @@
                    is_const=True)
     return
 
+def register_Ns3Vector2D_methods(root_module, cls):
+    cls.add_output_stream_operator()
+    ## vector.h: ns3::Vector2D::Vector2D(ns3::Vector2D const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Vector2D const &', 'arg0')])
+    ## vector.h: ns3::Vector2D::Vector2D(double _x, double _y) [constructor]
+    cls.add_constructor([param('double', '_x'), param('double', '_y')])
+    ## vector.h: ns3::Vector2D::Vector2D() [constructor]
+    cls.add_constructor([])
+    ## vector.h: ns3::Vector2D::x [variable]
+    cls.add_instance_attribute('x', 'double', is_const=False)
+    ## vector.h: ns3::Vector2D::y [variable]
+    cls.add_instance_attribute('y', 'double', is_const=False)
+    return
+
+def register_Ns3Vector3D_methods(root_module, cls):
+    cls.add_output_stream_operator()
+    ## vector.h: ns3::Vector3D::Vector3D(ns3::Vector3D const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Vector3D const &', 'arg0')])
+    ## vector.h: ns3::Vector3D::Vector3D(double _x, double _y, double _z) [constructor]
+    cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')])
+    ## vector.h: ns3::Vector3D::Vector3D() [constructor]
+    cls.add_constructor([])
+    ## vector.h: ns3::Vector3D::x [variable]
+    cls.add_instance_attribute('x', 'double', is_const=False)
+    ## vector.h: ns3::Vector3D::y [variable]
+    cls.add_instance_attribute('y', 'double', is_const=False)
+    ## vector.h: ns3::Vector3D::z [variable]
+    cls.add_instance_attribute('z', 'double', is_const=False)
+    return
+
 def register_Ns3WeibullVariable_methods(root_module, cls):
     ## random-variable.h: ns3::WeibullVariable::WeibullVariable(ns3::WeibullVariable const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::WeibullVariable const &', 'arg0')])
@@ -2046,6 +2100,86 @@
                    is_virtual=True)
     return
 
+def register_Ns3Vector2DChecker_methods(root_module, cls):
+    ## vector.h: ns3::Vector2DChecker::Vector2DChecker(ns3::Vector2DChecker const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Vector2DChecker const &', 'arg0')])
+    ## vector.h: ns3::Vector2DChecker::Vector2DChecker() [constructor]
+    cls.add_constructor([])
+    return
+
+def register_Ns3Vector2DValue_methods(root_module, cls):
+    ## vector.h: ns3::Vector2DValue::Vector2DValue(ns3::Vector2DValue const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Vector2DValue const &', 'arg0')])
+    ## vector.h: ns3::Vector2DValue::Vector2DValue() [constructor]
+    cls.add_constructor([])
+    ## vector.h: ns3::Vector2DValue::Vector2DValue(ns3::Vector2D const & value) [constructor]
+    cls.add_constructor([param('ns3::Vector2D const &', 'value')])
+    ## vector.h: void ns3::Vector2DValue::Set(ns3::Vector2D const & value) [member function]
+    cls.add_method('Set', 
+                   'void', 
+                   [param('ns3::Vector2D const &', 'value')])
+    ## vector.h: ns3::Vector2D ns3::Vector2DValue::Get() const [member function]
+    cls.add_method('Get', 
+                   'ns3::Vector2D', 
+                   [], 
+                   is_const=True)
+    ## vector.h: ns3::Ptr<ns3::AttributeValue> ns3::Vector2DValue::Copy() const [member function]
+    cls.add_method('Copy', 
+                   'ns3::Ptr< ns3::AttributeValue >', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## vector.h: std::string ns3::Vector2DValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
+    cls.add_method('SerializeToString', 
+                   'std::string', 
+                   [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], 
+                   is_const=True, is_virtual=True)
+    ## vector.h: bool ns3::Vector2DValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
+    cls.add_method('DeserializeFromString', 
+                   'bool', 
+                   [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], 
+                   is_virtual=True)
+    return
+
+def register_Ns3Vector3DChecker_methods(root_module, cls):
+    ## vector.h: ns3::Vector3DChecker::Vector3DChecker(ns3::Vector3DChecker const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Vector3DChecker const &', 'arg0')])
+    ## vector.h: ns3::Vector3DChecker::Vector3DChecker() [constructor]
+    cls.add_constructor([])
+    return
+
+def register_Ns3Vector3DValue_methods(root_module, cls):
+    ## vector.h: ns3::Vector3DValue::Vector3DValue(ns3::Vector3DValue const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::Vector3DValue const &', 'arg0')])
+    ## vector.h: ns3::Vector3DValue::Vector3DValue() [constructor]
+    cls.add_constructor([])
+    ## vector.h: ns3::Vector3DValue::Vector3DValue(ns3::Vector3D const & value) [constructor]
+    cls.add_constructor([param('ns3::Vector3D const &', 'value')])
+    ## vector.h: void ns3::Vector3DValue::Set(ns3::Vector3D const & value) [member function]
+    cls.add_method('Set', 
+                   'void', 
+                   [param('ns3::Vector3D const &', 'value')])
+    ## vector.h: ns3::Vector3D ns3::Vector3DValue::Get() const [member function]
+    cls.add_method('Get', 
+                   'ns3::Vector3D', 
+                   [], 
+                   is_const=True)
+    ## vector.h: ns3::Ptr<ns3::AttributeValue> ns3::Vector3DValue::Copy() const [member function]
+    cls.add_method('Copy', 
+                   'ns3::Ptr< ns3::AttributeValue >', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## vector.h: std::string ns3::Vector3DValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
+    cls.add_method('SerializeToString', 
+                   'std::string', 
+                   [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], 
+                   is_const=True, is_virtual=True)
+    ## vector.h: bool ns3::Vector3DValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
+    cls.add_method('DeserializeFromString', 
+                   'bool', 
+                   [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], 
+                   is_virtual=True)
+    return
+
 def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls):
     ## traced-value.h: ns3::TracedValue<unsigned int>::TracedValue() [constructor]
     cls.add_constructor([])
@@ -2153,6 +2287,14 @@
     module.add_function('BreakpointFallback', 
                         'void', 
                         [])
+    ## vector.h: extern double ns3::CalculateDistance(ns3::Vector2D const & a, ns3::Vector2D const & b) [free function]
+    module.add_function('CalculateDistance', 
+                        'double', 
+                        [param('ns3::Vector2D const &', 'a'), param('ns3::Vector2D const &', 'b')])
+    ## vector.h: extern double ns3::CalculateDistance(ns3::Vector3D const & a, ns3::Vector3D const & b) [free function]
+    module.add_function('CalculateDistance', 
+                        'double', 
+                        [param('ns3::Vector3D const &', 'a'), param('ns3::Vector3D const &', 'b')])
     ## ptr.h: extern ns3::Ptr<ns3::ObjectVectorValue> ns3::Create() [free function]
     module.add_function('Create', 
                         'ns3::Ptr< ns3::ObjectVectorValue >', 
@@ -2207,6 +2349,18 @@
     module.add_function('MakeTypeIdChecker', 
                         'ns3::Ptr< ns3::AttributeChecker const >', 
                         [])
+    ## vector.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeVector2DChecker() [free function]
+    module.add_function('MakeVector2DChecker', 
+                        'ns3::Ptr< ns3::AttributeChecker const >', 
+                        [])
+    ## vector.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeVector3DChecker() [free function]
+    module.add_function('MakeVector3DChecker', 
+                        'ns3::Ptr< ns3::AttributeChecker const >', 
+                        [])
+    ## vector.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeVectorChecker() [free function]
+    module.add_function('MakeVectorChecker', 
+                        'ns3::Ptr< ns3::AttributeChecker const >', 
+                        [])
     ## type-name.h: extern std::string ns3::TypeNameGet() [free function]
     module.add_function('TypeNameGet', 
                         'std::string', 
--- a/bindings/python/ns3_module_helper.py	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/ns3_module_helper.py	Tue Aug 18 12:01:35 2009 +0400
@@ -1121,6 +1121,10 @@
                    'ns3::NetDeviceContainer', 
                    [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::WifiMacHelper const &', 'mac'), param('std::string', 'nodeName')], 
                    is_const=True)
+    ## wifi-helper.h: void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('SetStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')])
     ## wifi-helper.h: static void ns3::WifiHelper::EnableLogComponents() [member function]
     cls.add_method('EnableLogComponents', 
                    'void', 
@@ -1310,10 +1314,6 @@
     cls.add_method('SetType', 
                    'void', 
                    [param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n5', default_value='""'), param('ns3::AttributeValue const &', 'v5', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n6', default_value='""'), param('ns3::AttributeValue const &', 'v6', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n7', default_value='""'), param('ns3::AttributeValue const &', 'v7', default_value='ns3::EmptyAttributeValue()')])
-    ## nqos-wifi-mac-helper.h: void ns3::NqosWifiMacHelper::SetDcaParameters(std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue()) [member function]
-    cls.add_method('SetDcaParameters', 
-                   'void', 
-                   [param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()')])
     ## nqos-wifi-mac-helper.h: ns3::Ptr<ns3::WifiMac> ns3::NqosWifiMacHelper::Create() const [member function]
     cls.add_method('Create', 
                    'ns3::Ptr< ns3::WifiMac >', 
@@ -1339,10 +1339,6 @@
     cls.add_method('SetMsduAggregatorForAc', 
                    'void', 
                    [param('ns3::AccessClass', 'accessClass'), param('std::string', 'type'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()')])
-    ## qos-wifi-mac-helper.h: void ns3::QosWifiMacHelper::SetEdcaParametersForAc(ns3::AccessClass accessClass, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue()) [member function]
-    cls.add_method('SetEdcaParametersForAc', 
-                   'void', 
-                   [param('ns3::AccessClass', 'accessClass'), param('std::string', 'n0', default_value='""'), param('ns3::AttributeValue const &', 'v0', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()')])
     ## qos-wifi-mac-helper.h: ns3::Ptr<ns3::WifiMac> ns3::QosWifiMacHelper::Create() const [member function]
     cls.add_method('Create', 
                    'ns3::Ptr< ns3::WifiMac >', 
--- a/bindings/python/ns3_module_mobility.py	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/ns3_module_mobility.py	Tue Aug 18 12:01:35 2009 +0400
@@ -9,8 +9,6 @@
     module.add_class('Rectangle')
     ## rectangle.h: ns3::Rectangle::Side [enumeration]
     module.add_enum('Side', ['RIGHT', 'LEFT', 'TOP', 'BOTTOM'], outer_class=root_module['ns3::Rectangle'])
-    ## vector.h: ns3::Vector [class]
-    module.add_class('Vector')
     ## position-allocator.h: ns3::PositionAllocator [class]
     module.add_class('PositionAllocator', parent=root_module['ns3::Object'])
     ## position-allocator.h: ns3::RandomDiscPositionAllocator [class]
@@ -21,10 +19,6 @@
     module.add_class('RectangleChecker', parent=root_module['ns3::AttributeChecker'])
     ## rectangle.h: ns3::RectangleValue [class]
     module.add_class('RectangleValue', parent=root_module['ns3::AttributeValue'])
-    ## vector.h: ns3::VectorChecker [class]
-    module.add_class('VectorChecker', parent=root_module['ns3::AttributeChecker'])
-    ## vector.h: ns3::VectorValue [class]
-    module.add_class('VectorValue', parent=root_module['ns3::AttributeValue'])
     ## position-allocator.h: ns3::GridPositionAllocator [class]
     module.add_class('GridPositionAllocator', parent=root_module['ns3::PositionAllocator'])
     ## position-allocator.h: ns3::GridPositionAllocator::LayoutType [enumeration]
@@ -103,14 +97,11 @@
 def register_methods(root_module):
     register_Ns3ConstantVelocityHelper_methods(root_module, root_module['ns3::ConstantVelocityHelper'])
     register_Ns3Rectangle_methods(root_module, root_module['ns3::Rectangle'])
-    register_Ns3Vector_methods(root_module, root_module['ns3::Vector'])
     register_Ns3PositionAllocator_methods(root_module, root_module['ns3::PositionAllocator'])
     register_Ns3RandomDiscPositionAllocator_methods(root_module, root_module['ns3::RandomDiscPositionAllocator'])
     register_Ns3RandomRectanglePositionAllocator_methods(root_module, root_module['ns3::RandomRectanglePositionAllocator'])
     register_Ns3RectangleChecker_methods(root_module, root_module['ns3::RectangleChecker'])
     register_Ns3RectangleValue_methods(root_module, root_module['ns3::RectangleValue'])
-    register_Ns3VectorChecker_methods(root_module, root_module['ns3::VectorChecker'])
-    register_Ns3VectorValue_methods(root_module, root_module['ns3::VectorValue'])
     register_Ns3GridPositionAllocator_methods(root_module, root_module['ns3::GridPositionAllocator'])
     register_Ns3ListPositionAllocator_methods(root_module, root_module['ns3::ListPositionAllocator'])
     register_Ns3MobilityModel_methods(root_module, root_module['ns3::MobilityModel'])
@@ -203,22 +194,6 @@
     cls.add_instance_attribute('yMin', 'double', is_const=False)
     return
 
-def register_Ns3Vector_methods(root_module, cls):
-    cls.add_output_stream_operator()
-    ## vector.h: ns3::Vector::Vector(ns3::Vector const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::Vector const &', 'arg0')])
-    ## vector.h: ns3::Vector::Vector(double _x, double _y, double _z) [constructor]
-    cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')])
-    ## vector.h: ns3::Vector::Vector() [constructor]
-    cls.add_constructor([])
-    ## vector.h: ns3::Vector::x [variable]
-    cls.add_instance_attribute('x', 'double', is_const=False)
-    ## vector.h: ns3::Vector::y [variable]
-    cls.add_instance_attribute('y', 'double', is_const=False)
-    ## vector.h: ns3::Vector::z [variable]
-    cls.add_instance_attribute('z', 'double', is_const=False)
-    return
-
 def register_Ns3PositionAllocator_methods(root_module, cls):
     ## position-allocator.h: ns3::PositionAllocator::PositionAllocator(ns3::PositionAllocator const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::PositionAllocator const &', 'arg0')])
@@ -334,46 +309,6 @@
                    is_virtual=True)
     return
 
-def register_Ns3VectorChecker_methods(root_module, cls):
-    ## vector.h: ns3::VectorChecker::VectorChecker(ns3::VectorChecker const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::VectorChecker const &', 'arg0')])
-    ## vector.h: ns3::VectorChecker::VectorChecker() [constructor]
-    cls.add_constructor([])
-    return
-
-def register_Ns3VectorValue_methods(root_module, cls):
-    ## vector.h: ns3::VectorValue::VectorValue(ns3::VectorValue const & arg0) [copy constructor]
-    cls.add_constructor([param('ns3::VectorValue const &', 'arg0')])
-    ## vector.h: ns3::VectorValue::VectorValue() [constructor]
-    cls.add_constructor([])
-    ## vector.h: ns3::VectorValue::VectorValue(ns3::Vector const & value) [constructor]
-    cls.add_constructor([param('ns3::Vector const &', 'value')])
-    ## vector.h: void ns3::VectorValue::Set(ns3::Vector const & value) [member function]
-    cls.add_method('Set', 
-                   'void', 
-                   [param('ns3::Vector const &', 'value')])
-    ## vector.h: ns3::Vector ns3::VectorValue::Get() const [member function]
-    cls.add_method('Get', 
-                   'ns3::Vector', 
-                   [], 
-                   is_const=True)
-    ## vector.h: ns3::Ptr<ns3::AttributeValue> ns3::VectorValue::Copy() const [member function]
-    cls.add_method('Copy', 
-                   'ns3::Ptr< ns3::AttributeValue >', 
-                   [], 
-                   is_const=True, is_virtual=True)
-    ## vector.h: std::string ns3::VectorValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function]
-    cls.add_method('SerializeToString', 
-                   'std::string', 
-                   [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], 
-                   is_const=True, is_virtual=True)
-    ## vector.h: bool ns3::VectorValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function]
-    cls.add_method('DeserializeFromString', 
-                   'bool', 
-                   [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], 
-                   is_virtual=True)
-    return
-
 def register_Ns3GridPositionAllocator_methods(root_module, cls):
     ## position-allocator.h: ns3::GridPositionAllocator::GridPositionAllocator(ns3::GridPositionAllocator const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::GridPositionAllocator const &', 'arg0')])
@@ -744,18 +679,10 @@
 
 def register_functions(root_module):
     module = root_module
-    ## vector.h: extern double ns3::CalculateDistance(ns3::Vector const & a, ns3::Vector const & b) [free function]
-    module.add_function('CalculateDistance', 
-                        'double', 
-                        [param('ns3::Vector const &', 'a'), param('ns3::Vector const &', 'b')])
     ## rectangle.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeRectangleChecker() [free function]
     module.add_function('MakeRectangleChecker', 
                         'ns3::Ptr< ns3::AttributeChecker const >', 
                         [])
-    ## vector.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeVectorChecker() [free function]
-    module.add_function('MakeVectorChecker', 
-                        'ns3::Ptr< ns3::AttributeChecker const >', 
-                        [])
     register_functions_ns3_Config(module.get_submodule('Config'), root_module)
     register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
     register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module)
--- a/bindings/python/ns3_module_wifi.py	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/ns3_module_wifi.py	Tue Aug 18 12:01:35 2009 +0400
@@ -4,21 +4,39 @@
     root_module = module.get_root()
     
     ## wifi-mac-header.h: ns3::WifiMacType [enumeration]
-    module.add_enum('WifiMacType', ['WIFI_MAC_CTL_RTS', 'WIFI_MAC_CTL_CTS', 'WIFI_MAC_CTL_ACK', 'WIFI_MAC_CTL_BACKREQ', 'WIFI_MAC_CTL_BACKRESP', 'WIFI_MAC_MGT_BEACON', 'WIFI_MAC_MGT_ASSOCIATION_REQUEST', 'WIFI_MAC_MGT_ASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_DISASSOCIATION', 'WIFI_MAC_MGT_REASSOCIATION_REQUEST', 'WIFI_MAC_MGT_REASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_PROBE_REQUEST', 'WIFI_MAC_MGT_PROBE_RESPONSE', 'WIFI_MAC_MGT_AUTHENTICATION', 'WIFI_MAC_MGT_DEAUTHENTICATION', 'WIFI_MAC_DATA', 'WIFI_MAC_DATA_CFACK', 'WIFI_MAC_DATA_CFPOLL', 'WIFI_MAC_DATA_CFACK_CFPOLL', 'WIFI_MAC_DATA_NULL', 'WIFI_MAC_DATA_NULL_CFACK', 'WIFI_MAC_DATA_NULL_CFPOLL', 'WIFI_MAC_DATA_NULL_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA', 'WIFI_MAC_QOSDATA_CFACK', 'WIFI_MAC_QOSDATA_CFPOLL', 'WIFI_MAC_QOSDATA_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA_NULL', 'WIFI_MAC_QOSDATA_NULL_CFPOLL', 'WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL'])
+    module.add_enum('WifiMacType', ['WIFI_MAC_CTL_RTS', 'WIFI_MAC_CTL_CTS', 'WIFI_MAC_CTL_ACK', 'WIFI_MAC_CTL_BACKREQ', 'WIFI_MAC_CTL_BACKRESP', 'WIFI_MAC_MGT_BEACON', 'WIFI_MAC_MGT_ASSOCIATION_REQUEST', 'WIFI_MAC_MGT_ASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_DISASSOCIATION', 'WIFI_MAC_MGT_REASSOCIATION_REQUEST', 'WIFI_MAC_MGT_REASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_PROBE_REQUEST', 'WIFI_MAC_MGT_PROBE_RESPONSE', 'WIFI_MAC_MGT_AUTHENTICATION', 'WIFI_MAC_MGT_DEAUTHENTICATION', 'WIFI_MAC_MGT_ACTION', 'WIFI_MAC_MGT_ACTION_NO_ACK', 'WIFI_MAC_MGT_MULTIHOP_ACTION', 'WIFI_MAC_DATA', 'WIFI_MAC_DATA_CFACK', 'WIFI_MAC_DATA_CFPOLL', 'WIFI_MAC_DATA_CFACK_CFPOLL', 'WIFI_MAC_DATA_NULL', 'WIFI_MAC_DATA_NULL_CFACK', 'WIFI_MAC_DATA_NULL_CFPOLL', 'WIFI_MAC_DATA_NULL_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA', 'WIFI_MAC_QOSDATA_CFACK', 'WIFI_MAC_QOSDATA_CFPOLL', 'WIFI_MAC_QOSDATA_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA_NULL', 'WIFI_MAC_QOSDATA_NULL_CFPOLL', 'WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL'])
     ## wifi-preamble.h: ns3::WifiPreamble [enumeration]
     module.add_enum('WifiPreamble', ['WIFI_PREAMBLE_LONG', 'WIFI_PREAMBLE_SHORT'])
     ## wifi-phy-standard.h: ns3::WifiPhyStandard [enumeration]
-    module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211_10Mhz', 'WIFI_PHY_STANDARD_80211_5Mhz', 'WIFI_PHY_STANDARD_holland'])
+    module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211_10Mhz', 'WIFI_PHY_STANDARD_80211_5Mhz', 'WIFI_PHY_STANDARD_holland', 'WIFI_PHY_UNKNOWN'])
     ## qos-utils.h: ns3::AccessClass [enumeration]
     module.add_enum('AccessClass', ['AC_VO', 'AC_VI', 'AC_BE', 'AC_BK', 'AC_UNDEF'])
     ## edca-txop-n.h: ns3::TypeOfStation [enumeration]
     module.add_enum('TypeOfStation', ['STA', 'AP', 'ADHOC_STA'])
+    ## capability-information.h: ns3::CapabilityInformation [class]
+    module.add_class('CapabilityInformation')
+    ## dcf-manager.h: ns3::DcfManager [class]
+    module.add_class('DcfManager')
+    ## dcf-manager.h: ns3::DcfState [class]
+    module.add_class('DcfState', allow_subclassing=True)
     ## interference-helper.h: ns3::InterferenceHelper [class]
     module.add_class('InterferenceHelper', allow_subclassing=False)
     ## interference-helper.h: ns3::InterferenceHelper::SnrPer [struct]
     module.add_class('SnrPer', outer_class=root_module['ns3::InterferenceHelper'])
+    ## mac-low.h: ns3::MacLowDcfListener [class]
+    module.add_class('MacLowDcfListener', allow_subclassing=True)
+    ## mac-low.h: ns3::MacLowTransmissionListener [class]
+    module.add_class('MacLowTransmissionListener', allow_subclassing=True)
+    ## mac-low.h: ns3::MacLowTransmissionParameters [class]
+    module.add_class('MacLowTransmissionParameters')
+    ## mac-rx-middle.h: ns3::MacRxMiddle [class]
+    module.add_class('MacRxMiddle')
+    ## minstrel-wifi-manager.h: ns3::RateInfo [struct]
+    module.add_class('RateInfo')
     ## ssid.h: ns3::Ssid [class]
     module.add_class('Ssid')
+    ## status-code.h: ns3::StatusCode [class]
+    module.add_class('StatusCode')
     ## supported-rates.h: ns3::SupportedRates [class]
     module.add_class('SupportedRates')
     ## rraa-wifi-manager.h: ns3::ThresholdsItem [struct]
@@ -26,7 +44,7 @@
     ## wifi-mode.h: ns3::WifiMode [class]
     module.add_class('WifiMode')
     ## wifi-mode.h: ns3::WifiMode::ModulationType [enumeration]
-    module.add_enum('ModulationType', ['BPSK', 'DBPSK', 'DQPSK', 'QAM'], outer_class=root_module['ns3::WifiMode'])
+    module.add_enum('ModulationType', ['BPSK', 'DBPSK', 'DQPSK', 'QAM', 'UNKNOWN'], outer_class=root_module['ns3::WifiMode'])
     ## wifi-mode.h: ns3::WifiModeFactory [class]
     module.add_class('WifiModeFactory')
     ## wifi-phy.h: ns3::WifiPhyListener [class]
@@ -41,6 +59,16 @@
     module.add_class('ConstantRateWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation [class]
     module.add_class('IdealWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
+    ## mgt-headers.h: ns3::MgtAssocRequestHeader [class]
+    module.add_class('MgtAssocRequestHeader', parent=root_module['ns3::Header'])
+    ## mgt-headers.h: ns3::MgtAssocResponseHeader [class]
+    module.add_class('MgtAssocResponseHeader', parent=root_module['ns3::Header'])
+    ## mgt-headers.h: ns3::MgtProbeRequestHeader [class]
+    module.add_class('MgtProbeRequestHeader', parent=root_module['ns3::Header'])
+    ## mgt-headers.h: ns3::MgtProbeResponseHeader [class]
+    module.add_class('MgtProbeResponseHeader', parent=root_module['ns3::Header'])
+    ## minstrel-wifi-manager.h: ns3::MinstrelWifiRemoteStation [class]
+    module.add_class('MinstrelWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation [class]
     module.add_class('OnoeWifiRemoteStation', parent=root_module['ns3::WifiRemoteStation'])
     ## propagation-delay-model.h: ns3::PropagationDelayModel [class]
@@ -111,6 +139,12 @@
     module.add_class('JakesPropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
     ## propagation-loss-model.h: ns3::LogDistancePropagationLossModel [class]
     module.add_class('LogDistancePropagationLossModel', parent=root_module['ns3::PropagationLossModel'])
+    ## mac-low.h: ns3::MacLow [class]
+    module.add_class('MacLow', parent=root_module['ns3::Object'])
+    ## mgt-headers.h: ns3::MgtBeaconHeader [class]
+    module.add_class('MgtBeaconHeader', parent=root_module['ns3::MgtProbeResponseHeader'])
+    ## minstrel-wifi-manager.h: ns3::MinstrelWifiManager [class]
+    module.add_class('MinstrelWifiManager', parent=root_module['ns3::WifiRemoteStationManager'])
     ## msdu-aggregator.h: ns3::MsduAggregator [class]
     module.add_class('MsduAggregator', parent=root_module['ns3::Object'])
     ## propagation-loss-model.h: ns3::NakagamiPropagationLossModel [class]
@@ -139,6 +173,8 @@
     module.add_class('YansWifiChannel', parent=root_module['ns3::WifiChannel'])
     ## aarf-wifi-manager.h: ns3::AarfWifiManager [class]
     module.add_class('AarfWifiManager', parent=root_module['ns3::ArfWifiManager'])
+    typehandlers.add_type_alias('std::vector< ns3::RateInfo, std::allocator< ns3::RateInfo > >', 'ns3::MinstrelRate')
+    typehandlers.add_type_alias('std::vector< std::vector< unsigned int, std::allocator< unsigned int > >, std::allocator< std::vector< unsigned int, std::allocator< unsigned int > > > >', 'ns3::SampleRate')
     typehandlers.add_type_alias('std::vector< ns3::ThresholdsItem, std::allocator< ns3::ThresholdsItem > >', 'ns3::Thresholds')
     
     ## Register a nested module for the namespace Config
@@ -192,9 +228,18 @@
     
 
 def register_methods(root_module):
+    register_Ns3CapabilityInformation_methods(root_module, root_module['ns3::CapabilityInformation'])
+    register_Ns3DcfManager_methods(root_module, root_module['ns3::DcfManager'])
+    register_Ns3DcfState_methods(root_module, root_module['ns3::DcfState'])
     register_Ns3InterferenceHelper_methods(root_module, root_module['ns3::InterferenceHelper'])
     register_Ns3InterferenceHelperSnrPer_methods(root_module, root_module['ns3::InterferenceHelper::SnrPer'])
+    register_Ns3MacLowDcfListener_methods(root_module, root_module['ns3::MacLowDcfListener'])
+    register_Ns3MacLowTransmissionListener_methods(root_module, root_module['ns3::MacLowTransmissionListener'])
+    register_Ns3MacLowTransmissionParameters_methods(root_module, root_module['ns3::MacLowTransmissionParameters'])
+    register_Ns3MacRxMiddle_methods(root_module, root_module['ns3::MacRxMiddle'])
+    register_Ns3RateInfo_methods(root_module, root_module['ns3::RateInfo'])
     register_Ns3Ssid_methods(root_module, root_module['ns3::Ssid'])
+    register_Ns3StatusCode_methods(root_module, root_module['ns3::StatusCode'])
     register_Ns3SupportedRates_methods(root_module, root_module['ns3::SupportedRates'])
     register_Ns3ThresholdsItem_methods(root_module, root_module['ns3::ThresholdsItem'])
     register_Ns3WifiMode_methods(root_module, root_module['ns3::WifiMode'])
@@ -205,6 +250,11 @@
     register_Ns3ArfWifiRemoteStation_methods(root_module, root_module['ns3::ArfWifiRemoteStation'])
     register_Ns3ConstantRateWifiRemoteStation_methods(root_module, root_module['ns3::ConstantRateWifiRemoteStation'])
     register_Ns3IdealWifiRemoteStation_methods(root_module, root_module['ns3::IdealWifiRemoteStation'])
+    register_Ns3MgtAssocRequestHeader_methods(root_module, root_module['ns3::MgtAssocRequestHeader'])
+    register_Ns3MgtAssocResponseHeader_methods(root_module, root_module['ns3::MgtAssocResponseHeader'])
+    register_Ns3MgtProbeRequestHeader_methods(root_module, root_module['ns3::MgtProbeRequestHeader'])
+    register_Ns3MgtProbeResponseHeader_methods(root_module, root_module['ns3::MgtProbeResponseHeader'])
+    register_Ns3MinstrelWifiRemoteStation_methods(root_module, root_module['ns3::MinstrelWifiRemoteStation'])
     register_Ns3OnoeWifiRemoteStation_methods(root_module, root_module['ns3::OnoeWifiRemoteStation'])
     register_Ns3PropagationDelayModel_methods(root_module, root_module['ns3::PropagationDelayModel'])
     register_Ns3PropagationLossModel_methods(root_module, root_module['ns3::PropagationLossModel'])
@@ -237,6 +287,9 @@
     register_Ns3IdealWifiManager_methods(root_module, root_module['ns3::IdealWifiManager'])
     register_Ns3JakesPropagationLossModel_methods(root_module, root_module['ns3::JakesPropagationLossModel'])
     register_Ns3LogDistancePropagationLossModel_methods(root_module, root_module['ns3::LogDistancePropagationLossModel'])
+    register_Ns3MacLow_methods(root_module, root_module['ns3::MacLow'])
+    register_Ns3MgtBeaconHeader_methods(root_module, root_module['ns3::MgtBeaconHeader'])
+    register_Ns3MinstrelWifiManager_methods(root_module, root_module['ns3::MinstrelWifiManager'])
     register_Ns3MsduAggregator_methods(root_module, root_module['ns3::MsduAggregator'])
     register_Ns3NakagamiPropagationLossModel_methods(root_module, root_module['ns3::NakagamiPropagationLossModel'])
     register_Ns3NqapWifiMac_methods(root_module, root_module['ns3::NqapWifiMac'])
@@ -253,6 +306,200 @@
     register_Ns3AarfWifiManager_methods(root_module, root_module['ns3::AarfWifiManager'])
     return
 
+def register_Ns3CapabilityInformation_methods(root_module, cls):
+    ## capability-information.h: ns3::CapabilityInformation::CapabilityInformation(ns3::CapabilityInformation const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::CapabilityInformation const &', 'arg0')])
+    ## capability-information.h: ns3::CapabilityInformation::CapabilityInformation() [constructor]
+    cls.add_constructor([])
+    ## capability-information.h: void ns3::CapabilityInformation::SetEss() [member function]
+    cls.add_method('SetEss', 
+                   'void', 
+                   [])
+    ## capability-information.h: void ns3::CapabilityInformation::SetIbss() [member function]
+    cls.add_method('SetIbss', 
+                   'void', 
+                   [])
+    ## capability-information.h: bool ns3::CapabilityInformation::IsEss() const [member function]
+    cls.add_method('IsEss', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## capability-information.h: bool ns3::CapabilityInformation::IsIbss() const [member function]
+    cls.add_method('IsIbss', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## capability-information.h: uint32_t ns3::CapabilityInformation::GetSerializedSize() const [member function]
+    cls.add_method('GetSerializedSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## capability-information.h: ns3::Buffer::Iterator ns3::CapabilityInformation::Serialize(ns3::Buffer::Iterator start) const [member function]
+    cls.add_method('Serialize', 
+                   'ns3::Buffer::Iterator', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_const=True)
+    ## capability-information.h: ns3::Buffer::Iterator ns3::CapabilityInformation::Deserialize(ns3::Buffer::Iterator start) [member function]
+    cls.add_method('Deserialize', 
+                   'ns3::Buffer::Iterator', 
+                   [param('ns3::Buffer::Iterator', 'start')])
+    return
+
+def register_Ns3DcfManager_methods(root_module, cls):
+    ## dcf-manager.h: ns3::DcfManager::DcfManager(ns3::DcfManager const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DcfManager const &', 'arg0')])
+    ## dcf-manager.h: ns3::DcfManager::DcfManager() [constructor]
+    cls.add_constructor([])
+    ## dcf-manager.h: void ns3::DcfManager::SetupPhyListener(ns3::Ptr<ns3::WifiPhy> phy) [member function]
+    cls.add_method('SetupPhyListener', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::WifiPhy >', 'phy')])
+    ## dcf-manager.h: void ns3::DcfManager::SetupLowListener(ns3::Ptr<ns3::MacLow> low) [member function]
+    cls.add_method('SetupLowListener', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::MacLow >', 'low')])
+    ## dcf-manager.h: void ns3::DcfManager::SetSlot(ns3::Time slotTime) [member function]
+    cls.add_method('SetSlot', 
+                   'void', 
+                   [param('ns3::Time', 'slotTime')])
+    ## dcf-manager.h: void ns3::DcfManager::SetSifs(ns3::Time sifs) [member function]
+    cls.add_method('SetSifs', 
+                   'void', 
+                   [param('ns3::Time', 'sifs')])
+    ## dcf-manager.h: void ns3::DcfManager::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function]
+    cls.add_method('SetEifsNoDifs', 
+                   'void', 
+                   [param('ns3::Time', 'eifsNoDifs')])
+    ## dcf-manager.h: ns3::Time ns3::DcfManager::GetEifsNoDifs() const [member function]
+    cls.add_method('GetEifsNoDifs', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## dcf-manager.h: void ns3::DcfManager::Add(ns3::DcfState * dcf) [member function]
+    cls.add_method('Add', 
+                   'void', 
+                   [param('ns3::DcfState *', 'dcf')])
+    ## dcf-manager.h: void ns3::DcfManager::RequestAccess(ns3::DcfState * state) [member function]
+    cls.add_method('RequestAccess', 
+                   'void', 
+                   [param('ns3::DcfState *', 'state')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyRxStartNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyRxStartNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyRxEndOkNow() [member function]
+    cls.add_method('NotifyRxEndOkNow', 
+                   'void', 
+                   [])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyRxEndErrorNow() [member function]
+    cls.add_method('NotifyRxEndErrorNow', 
+                   'void', 
+                   [])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyTxStartNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyTxStartNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyMaybeCcaBusyStartNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyMaybeCcaBusyStartNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyNavResetNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyNavResetNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyNavStartNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyNavStartNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyAckTimeoutStartNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyAckTimeoutStartNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyAckTimeoutResetNow() [member function]
+    cls.add_method('NotifyAckTimeoutResetNow', 
+                   'void', 
+                   [])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyCtsTimeoutStartNow(ns3::Time duration) [member function]
+    cls.add_method('NotifyCtsTimeoutStartNow', 
+                   'void', 
+                   [param('ns3::Time', 'duration')])
+    ## dcf-manager.h: void ns3::DcfManager::NotifyCtsTimeoutResetNow() [member function]
+    cls.add_method('NotifyCtsTimeoutResetNow', 
+                   'void', 
+                   [])
+    return
+
+def register_Ns3DcfState_methods(root_module, cls):
+    ## dcf-manager.h: ns3::DcfState::DcfState(ns3::DcfState const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::DcfState const &', 'arg0')])
+    ## dcf-manager.h: ns3::DcfState::DcfState() [constructor]
+    cls.add_constructor([])
+    ## dcf-manager.h: void ns3::DcfState::SetAifsn(uint32_t aifsn) [member function]
+    cls.add_method('SetAifsn', 
+                   'void', 
+                   [param('uint32_t', 'aifsn')])
+    ## dcf-manager.h: void ns3::DcfState::SetCwMin(uint32_t minCw) [member function]
+    cls.add_method('SetCwMin', 
+                   'void', 
+                   [param('uint32_t', 'minCw')])
+    ## dcf-manager.h: void ns3::DcfState::SetCwMax(uint32_t maxCw) [member function]
+    cls.add_method('SetCwMax', 
+                   'void', 
+                   [param('uint32_t', 'maxCw')])
+    ## dcf-manager.h: uint32_t ns3::DcfState::GetAifsn() const [member function]
+    cls.add_method('GetAifsn', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## dcf-manager.h: uint32_t ns3::DcfState::GetCwMin() const [member function]
+    cls.add_method('GetCwMin', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## dcf-manager.h: uint32_t ns3::DcfState::GetCwMax() const [member function]
+    cls.add_method('GetCwMax', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## dcf-manager.h: void ns3::DcfState::ResetCw() [member function]
+    cls.add_method('ResetCw', 
+                   'void', 
+                   [])
+    ## dcf-manager.h: void ns3::DcfState::UpdateFailedCw() [member function]
+    cls.add_method('UpdateFailedCw', 
+                   'void', 
+                   [])
+    ## dcf-manager.h: void ns3::DcfState::StartBackoffNow(uint32_t nSlots) [member function]
+    cls.add_method('StartBackoffNow', 
+                   'void', 
+                   [param('uint32_t', 'nSlots')])
+    ## dcf-manager.h: uint32_t ns3::DcfState::GetCw() const [member function]
+    cls.add_method('GetCw', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## dcf-manager.h: bool ns3::DcfState::IsAccessRequested() const [member function]
+    cls.add_method('IsAccessRequested', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## dcf-manager.h: void ns3::DcfState::DoNotifyAccessGranted() [member function]
+    cls.add_method('DoNotifyAccessGranted', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, visibility='private', is_virtual=True)
+    ## dcf-manager.h: void ns3::DcfState::DoNotifyInternalCollision() [member function]
+    cls.add_method('DoNotifyInternalCollision', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, visibility='private', is_virtual=True)
+    ## dcf-manager.h: void ns3::DcfState::DoNotifyCollision() [member function]
+    cls.add_method('DoNotifyCollision', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, visibility='private', is_virtual=True)
+    return
+
 def register_Ns3InterferenceHelper_methods(root_module, cls):
     ## interference-helper.h: ns3::InterferenceHelper::InterferenceHelper() [constructor]
     cls.add_constructor([])
@@ -324,6 +571,219 @@
     cls.add_instance_attribute('snr', 'double', is_const=False)
     return
 
+def register_Ns3MacLowDcfListener_methods(root_module, cls):
+    ## mac-low.h: ns3::MacLowDcfListener::MacLowDcfListener(ns3::MacLowDcfListener const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MacLowDcfListener const &', 'arg0')])
+    ## mac-low.h: ns3::MacLowDcfListener::MacLowDcfListener() [constructor]
+    cls.add_constructor([])
+    ## mac-low.h: void ns3::MacLowDcfListener::NavStart(ns3::Time duration) [member function]
+    cls.add_method('NavStart', 
+                   'void', 
+                   [param('ns3::Time', 'duration')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowDcfListener::NavReset(ns3::Time duration) [member function]
+    cls.add_method('NavReset', 
+                   'void', 
+                   [param('ns3::Time', 'duration')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowDcfListener::AckTimeoutStart(ns3::Time duration) [member function]
+    cls.add_method('AckTimeoutStart', 
+                   'void', 
+                   [param('ns3::Time', 'duration')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowDcfListener::AckTimeoutReset() [member function]
+    cls.add_method('AckTimeoutReset', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowDcfListener::CtsTimeoutStart(ns3::Time duration) [member function]
+    cls.add_method('CtsTimeoutStart', 
+                   'void', 
+                   [param('ns3::Time', 'duration')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowDcfListener::CtsTimeoutReset() [member function]
+    cls.add_method('CtsTimeoutReset', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
+    return
+
+def register_Ns3MacLowTransmissionListener_methods(root_module, cls):
+    ## mac-low.h: ns3::MacLowTransmissionListener::MacLowTransmissionListener(ns3::MacLowTransmissionListener const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MacLowTransmissionListener const &', 'arg0')])
+    ## mac-low.h: ns3::MacLowTransmissionListener::MacLowTransmissionListener() [constructor]
+    cls.add_constructor([])
+    ## mac-low.h: void ns3::MacLowTransmissionListener::GotCts(double snr, ns3::WifiMode txMode) [member function]
+    cls.add_method('GotCts', 
+                   'void', 
+                   [param('double', 'snr'), param('ns3::WifiMode', 'txMode')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowTransmissionListener::MissedCts() [member function]
+    cls.add_method('MissedCts', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowTransmissionListener::GotAck(double snr, ns3::WifiMode txMode) [member function]
+    cls.add_method('GotAck', 
+                   'void', 
+                   [param('double', 'snr'), param('ns3::WifiMode', 'txMode')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowTransmissionListener::MissedAck() [member function]
+    cls.add_method('MissedAck', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowTransmissionListener::StartNext() [member function]
+    cls.add_method('StartNext', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## mac-low.h: void ns3::MacLowTransmissionListener::Cancel() [member function]
+    cls.add_method('Cancel', 
+                   'void', 
+                   [], 
+                   is_pure_virtual=True, is_virtual=True)
+    return
+
+def register_Ns3MacLowTransmissionParameters_methods(root_module, cls):
+    cls.add_output_stream_operator()
+    ## mac-low.h: ns3::MacLowTransmissionParameters::MacLowTransmissionParameters(ns3::MacLowTransmissionParameters const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MacLowTransmissionParameters const &', 'arg0')])
+    ## mac-low.h: ns3::MacLowTransmissionParameters::MacLowTransmissionParameters() [constructor]
+    cls.add_constructor([])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableAck() [member function]
+    cls.add_method('DisableAck', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableNextData() [member function]
+    cls.add_method('DisableNextData', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableOverrideDurationId() [member function]
+    cls.add_method('DisableOverrideDurationId', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::DisableRts() [member function]
+    cls.add_method('DisableRts', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableAck() [member function]
+    cls.add_method('EnableAck', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableFastAck() [member function]
+    cls.add_method('EnableFastAck', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableNextData(uint32_t size) [member function]
+    cls.add_method('EnableNextData', 
+                   'void', 
+                   [param('uint32_t', 'size')])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableOverrideDurationId(ns3::Time durationId) [member function]
+    cls.add_method('EnableOverrideDurationId', 
+                   'void', 
+                   [param('ns3::Time', 'durationId')])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableRts() [member function]
+    cls.add_method('EnableRts', 
+                   'void', 
+                   [])
+    ## mac-low.h: void ns3::MacLowTransmissionParameters::EnableSuperFastAck() [member function]
+    cls.add_method('EnableSuperFastAck', 
+                   'void', 
+                   [])
+    ## mac-low.h: ns3::Time ns3::MacLowTransmissionParameters::GetDurationId() const [member function]
+    cls.add_method('GetDurationId', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: uint32_t ns3::MacLowTransmissionParameters::GetNextPacketSize() const [member function]
+    cls.add_method('GetNextPacketSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::HasDurationId() const [member function]
+    cls.add_method('HasDurationId', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::HasNextPacket() const [member function]
+    cls.add_method('HasNextPacket', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustSendRts() const [member function]
+    cls.add_method('MustSendRts', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitAck() const [member function]
+    cls.add_method('MustWaitAck', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitFastAck() const [member function]
+    cls.add_method('MustWaitFastAck', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitNormalAck() const [member function]
+    cls.add_method('MustWaitNormalAck', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: bool ns3::MacLowTransmissionParameters::MustWaitSuperFastAck() const [member function]
+    cls.add_method('MustWaitSuperFastAck', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    return
+
+def register_Ns3MacRxMiddle_methods(root_module, cls):
+    ## mac-rx-middle.h: ns3::MacRxMiddle::MacRxMiddle(ns3::MacRxMiddle const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MacRxMiddle const &', 'arg0')])
+    ## mac-rx-middle.h: ns3::MacRxMiddle::MacRxMiddle() [constructor]
+    cls.add_constructor([])
+    ## mac-rx-middle.h: void ns3::MacRxMiddle::SetForwardCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::WifiMacHeader const*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
+    cls.add_method('SetForwardCallback', 
+                   'void', 
+                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::WifiMacHeader const *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
+    ## mac-rx-middle.h: void ns3::MacRxMiddle::Receive(ns3::Ptr<ns3::Packet> packet, ns3::WifiMacHeader const * hdr) [member function]
+    cls.add_method('Receive', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::WifiMacHeader const *', 'hdr')])
+    return
+
+def register_Ns3RateInfo_methods(root_module, cls):
+    ## minstrel-wifi-manager.h: ns3::RateInfo::perfectTxTime [variable]
+    cls.add_instance_attribute('perfectTxTime', 'ns3::Time', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::retryCount [variable]
+    cls.add_instance_attribute('retryCount', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::adjustedRetryCount [variable]
+    cls.add_instance_attribute('adjustedRetryCount', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::numRateAttempt [variable]
+    cls.add_instance_attribute('numRateAttempt', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::numRateSuccess [variable]
+    cls.add_instance_attribute('numRateSuccess', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::prob [variable]
+    cls.add_instance_attribute('prob', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::ewmaProb [variable]
+    cls.add_instance_attribute('ewmaProb', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::prevNumRateAttempt [variable]
+    cls.add_instance_attribute('prevNumRateAttempt', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::prevNumRateSuccess [variable]
+    cls.add_instance_attribute('prevNumRateSuccess', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::successHist [variable]
+    cls.add_instance_attribute('successHist', 'uint64_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::attemptHist [variable]
+    cls.add_instance_attribute('attemptHist', 'uint64_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::throughput [variable]
+    cls.add_instance_attribute('throughput', 'uint32_t', is_const=False)
+    ## minstrel-wifi-manager.h: ns3::RateInfo::RateInfo(ns3::RateInfo const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::RateInfo const &', 'arg0')])
+    ## minstrel-wifi-manager.h: ns3::RateInfo::RateInfo() [constructor]
+    cls.add_constructor([])
+    return
+
 def register_Ns3Ssid_methods(root_module, cls):
     cls.add_output_stream_operator()
     ## ssid.h: ns3::Ssid::Ssid(ns3::Ssid const & arg0) [copy constructor]
@@ -370,6 +830,41 @@
                    is_const=True)
     return
 
+def register_Ns3StatusCode_methods(root_module, cls):
+    cls.add_output_stream_operator()
+    ## status-code.h: ns3::StatusCode::StatusCode(ns3::StatusCode const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::StatusCode const &', 'arg0')])
+    ## status-code.h: ns3::StatusCode::StatusCode() [constructor]
+    cls.add_constructor([])
+    ## status-code.h: ns3::Buffer::Iterator ns3::StatusCode::Deserialize(ns3::Buffer::Iterator start) [member function]
+    cls.add_method('Deserialize', 
+                   'ns3::Buffer::Iterator', 
+                   [param('ns3::Buffer::Iterator', 'start')])
+    ## status-code.h: uint32_t ns3::StatusCode::GetSerializedSize() const [member function]
+    cls.add_method('GetSerializedSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True)
+    ## status-code.h: bool ns3::StatusCode::IsSuccess() const [member function]
+    cls.add_method('IsSuccess', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## status-code.h: ns3::Buffer::Iterator ns3::StatusCode::Serialize(ns3::Buffer::Iterator start) const [member function]
+    cls.add_method('Serialize', 
+                   'ns3::Buffer::Iterator', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_const=True)
+    ## status-code.h: void ns3::StatusCode::SetFailure() [member function]
+    cls.add_method('SetFailure', 
+                   'void', 
+                   [])
+    ## status-code.h: void ns3::StatusCode::SetSuccess() [member function]
+    cls.add_method('SetSuccess', 
+                   'void', 
+                   [])
+    return
+
 def register_Ns3SupportedRates_methods(root_module, cls):
     cls.add_output_stream_operator()
     ## supported-rates.h: ns3::SupportedRates::SupportedRates(ns3::SupportedRates const & arg0) [copy constructor]
@@ -690,6 +1185,11 @@
     cls.add_method('GetAckMode', 
                    'ns3::WifiMode', 
                    [param('ns3::WifiMode', 'dataMode')])
+    ## wifi-remote-station-manager.h: double ns3::WifiRemoteStation::GetAvgSlrc() const [member function]
+    cls.add_method('GetAvgSlrc', 
+                   'double', 
+                   [], 
+                   is_const=True)
     ## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetNSupportedModes() const [member function]
     cls.add_method('GetNSupportedModes', 
                    'uint32_t', 
@@ -1020,6 +1520,303 @@
                    visibility='private', is_virtual=True)
     return
 
+def register_Ns3MgtAssocRequestHeader_methods(root_module, cls):
+    ## mgt-headers.h: ns3::MgtAssocRequestHeader::MgtAssocRequestHeader(ns3::MgtAssocRequestHeader const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MgtAssocRequestHeader const &', 'arg0')])
+    ## mgt-headers.h: ns3::MgtAssocRequestHeader::MgtAssocRequestHeader() [constructor]
+    cls.add_constructor([])
+    ## mgt-headers.h: void ns3::MgtAssocRequestHeader::SetSsid(ns3::Ssid ssid) [member function]
+    cls.add_method('SetSsid', 
+                   'void', 
+                   [param('ns3::Ssid', 'ssid')])
+    ## mgt-headers.h: void ns3::MgtAssocRequestHeader::SetSupportedRates(ns3::SupportedRates rates) [member function]
+    cls.add_method('SetSupportedRates', 
+                   'void', 
+                   [param('ns3::SupportedRates', 'rates')])
+    ## mgt-headers.h: void ns3::MgtAssocRequestHeader::SetListenInterval(uint16_t interval) [member function]
+    cls.add_method('SetListenInterval', 
+                   'void', 
+                   [param('uint16_t', 'interval')])
+    ## mgt-headers.h: ns3::Ssid ns3::MgtAssocRequestHeader::GetSsid() const [member function]
+    cls.add_method('GetSsid', 
+                   'ns3::Ssid', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: ns3::SupportedRates ns3::MgtAssocRequestHeader::GetSupportedRates() const [member function]
+    cls.add_method('GetSupportedRates', 
+                   'ns3::SupportedRates', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: uint16_t ns3::MgtAssocRequestHeader::GetListenInterval() const [member function]
+    cls.add_method('GetListenInterval', 
+                   'uint16_t', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: static ns3::TypeId ns3::MgtAssocRequestHeader::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## mgt-headers.h: ns3::TypeId ns3::MgtAssocRequestHeader::GetInstanceTypeId() const [member function]
+    cls.add_method('GetInstanceTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtAssocRequestHeader::Print(std::ostream & os) const [member function]
+    cls.add_method('Print', 
+                   'void', 
+                   [param('std::ostream &', 'os')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtAssocRequestHeader::GetSerializedSize() const [member function]
+    cls.add_method('GetSerializedSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtAssocRequestHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
+    cls.add_method('Serialize', 
+                   'void', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtAssocRequestHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
+    cls.add_method('Deserialize', 
+                   'uint32_t', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_virtual=True)
+    return
+
+def register_Ns3MgtAssocResponseHeader_methods(root_module, cls):
+    ## mgt-headers.h: ns3::MgtAssocResponseHeader::MgtAssocResponseHeader(ns3::MgtAssocResponseHeader const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MgtAssocResponseHeader const &', 'arg0')])
+    ## mgt-headers.h: ns3::MgtAssocResponseHeader::MgtAssocResponseHeader() [constructor]
+    cls.add_constructor([])
+    ## mgt-headers.h: ns3::StatusCode ns3::MgtAssocResponseHeader::GetStatusCode() [member function]
+    cls.add_method('GetStatusCode', 
+                   'ns3::StatusCode', 
+                   [])
+    ## mgt-headers.h: ns3::SupportedRates ns3::MgtAssocResponseHeader::GetSupportedRates() [member function]
+    cls.add_method('GetSupportedRates', 
+                   'ns3::SupportedRates', 
+                   [])
+    ## mgt-headers.h: void ns3::MgtAssocResponseHeader::SetSupportedRates(ns3::SupportedRates rates) [member function]
+    cls.add_method('SetSupportedRates', 
+                   'void', 
+                   [param('ns3::SupportedRates', 'rates')])
+    ## mgt-headers.h: void ns3::MgtAssocResponseHeader::SetStatusCode(ns3::StatusCode code) [member function]
+    cls.add_method('SetStatusCode', 
+                   'void', 
+                   [param('ns3::StatusCode', 'code')])
+    ## mgt-headers.h: static ns3::TypeId ns3::MgtAssocResponseHeader::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## mgt-headers.h: ns3::TypeId ns3::MgtAssocResponseHeader::GetInstanceTypeId() const [member function]
+    cls.add_method('GetInstanceTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtAssocResponseHeader::Print(std::ostream & os) const [member function]
+    cls.add_method('Print', 
+                   'void', 
+                   [param('std::ostream &', 'os')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtAssocResponseHeader::GetSerializedSize() const [member function]
+    cls.add_method('GetSerializedSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtAssocResponseHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
+    cls.add_method('Serialize', 
+                   'void', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtAssocResponseHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
+    cls.add_method('Deserialize', 
+                   'uint32_t', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_virtual=True)
+    return
+
+def register_Ns3MgtProbeRequestHeader_methods(root_module, cls):
+    ## mgt-headers.h: ns3::MgtProbeRequestHeader::MgtProbeRequestHeader(ns3::MgtProbeRequestHeader const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MgtProbeRequestHeader const &', 'arg0')])
+    ## mgt-headers.h: ns3::MgtProbeRequestHeader::MgtProbeRequestHeader() [constructor]
+    cls.add_constructor([])
+    ## mgt-headers.h: void ns3::MgtProbeRequestHeader::SetSsid(ns3::Ssid ssid) [member function]
+    cls.add_method('SetSsid', 
+                   'void', 
+                   [param('ns3::Ssid', 'ssid')])
+    ## mgt-headers.h: void ns3::MgtProbeRequestHeader::SetSupportedRates(ns3::SupportedRates rates) [member function]
+    cls.add_method('SetSupportedRates', 
+                   'void', 
+                   [param('ns3::SupportedRates', 'rates')])
+    ## mgt-headers.h: ns3::Ssid ns3::MgtProbeRequestHeader::GetSsid() const [member function]
+    cls.add_method('GetSsid', 
+                   'ns3::Ssid', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: ns3::SupportedRates ns3::MgtProbeRequestHeader::GetSupportedRates() const [member function]
+    cls.add_method('GetSupportedRates', 
+                   'ns3::SupportedRates', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: static ns3::TypeId ns3::MgtProbeRequestHeader::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## mgt-headers.h: ns3::TypeId ns3::MgtProbeRequestHeader::GetInstanceTypeId() const [member function]
+    cls.add_method('GetInstanceTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtProbeRequestHeader::Print(std::ostream & os) const [member function]
+    cls.add_method('Print', 
+                   'void', 
+                   [param('std::ostream &', 'os')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtProbeRequestHeader::GetSerializedSize() const [member function]
+    cls.add_method('GetSerializedSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtProbeRequestHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
+    cls.add_method('Serialize', 
+                   'void', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtProbeRequestHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
+    cls.add_method('Deserialize', 
+                   'uint32_t', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_virtual=True)
+    return
+
+def register_Ns3MgtProbeResponseHeader_methods(root_module, cls):
+    ## mgt-headers.h: ns3::MgtProbeResponseHeader::MgtProbeResponseHeader(ns3::MgtProbeResponseHeader const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MgtProbeResponseHeader const &', 'arg0')])
+    ## mgt-headers.h: ns3::MgtProbeResponseHeader::MgtProbeResponseHeader() [constructor]
+    cls.add_constructor([])
+    ## mgt-headers.h: ns3::Ssid ns3::MgtProbeResponseHeader::GetSsid() const [member function]
+    cls.add_method('GetSsid', 
+                   'ns3::Ssid', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: uint64_t ns3::MgtProbeResponseHeader::GetBeaconIntervalUs() const [member function]
+    cls.add_method('GetBeaconIntervalUs', 
+                   'uint64_t', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: ns3::SupportedRates ns3::MgtProbeResponseHeader::GetSupportedRates() const [member function]
+    cls.add_method('GetSupportedRates', 
+                   'ns3::SupportedRates', 
+                   [], 
+                   is_const=True)
+    ## mgt-headers.h: void ns3::MgtProbeResponseHeader::SetSsid(ns3::Ssid ssid) [member function]
+    cls.add_method('SetSsid', 
+                   'void', 
+                   [param('ns3::Ssid', 'ssid')])
+    ## mgt-headers.h: void ns3::MgtProbeResponseHeader::SetBeaconIntervalUs(uint64_t us) [member function]
+    cls.add_method('SetBeaconIntervalUs', 
+                   'void', 
+                   [param('uint64_t', 'us')])
+    ## mgt-headers.h: void ns3::MgtProbeResponseHeader::SetSupportedRates(ns3::SupportedRates rates) [member function]
+    cls.add_method('SetSupportedRates', 
+                   'void', 
+                   [param('ns3::SupportedRates', 'rates')])
+    ## mgt-headers.h: uint64_t ns3::MgtProbeResponseHeader::GetTimestamp() [member function]
+    cls.add_method('GetTimestamp', 
+                   'uint64_t', 
+                   [])
+    ## mgt-headers.h: static ns3::TypeId ns3::MgtProbeResponseHeader::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## mgt-headers.h: ns3::TypeId ns3::MgtProbeResponseHeader::GetInstanceTypeId() const [member function]
+    cls.add_method('GetInstanceTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtProbeResponseHeader::Print(std::ostream & os) const [member function]
+    cls.add_method('Print', 
+                   'void', 
+                   [param('std::ostream &', 'os')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtProbeResponseHeader::GetSerializedSize() const [member function]
+    cls.add_method('GetSerializedSize', 
+                   'uint32_t', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: void ns3::MgtProbeResponseHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
+    cls.add_method('Serialize', 
+                   'void', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_const=True, is_virtual=True)
+    ## mgt-headers.h: uint32_t ns3::MgtProbeResponseHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
+    cls.add_method('Deserialize', 
+                   'uint32_t', 
+                   [param('ns3::Buffer::Iterator', 'start')], 
+                   is_virtual=True)
+    return
+
+def register_Ns3MinstrelWifiRemoteStation_methods(root_module, cls):
+    ## minstrel-wifi-manager.h: ns3::MinstrelWifiRemoteStation::MinstrelWifiRemoteStation(ns3::MinstrelWifiRemoteStation const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MinstrelWifiRemoteStation const &', 'arg0')])
+    ## minstrel-wifi-manager.h: ns3::MinstrelWifiRemoteStation::MinstrelWifiRemoteStation(ns3::Ptr<ns3::MinstrelWifiManager> stations) [constructor]
+    cls.add_constructor([param('ns3::Ptr< ns3::MinstrelWifiManager >', 'stations')])
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function]
+    cls.add_method('DoReportRxOk', 
+                   'void', 
+                   [param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportRtsFailed() [member function]
+    cls.add_method('DoReportRtsFailed', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportDataFailed() [member function]
+    cls.add_method('DoReportDataFailed', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportRtsOk(double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function]
+    cls.add_method('DoReportRtsOk', 
+                   'void', 
+                   [param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportDataOk(double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function]
+    cls.add_method('DoReportDataOk', 
+                   'void', 
+                   [param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportFinalRtsFailed() [member function]
+    cls.add_method('DoReportFinalRtsFailed', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiRemoteStation::DoReportFinalDataFailed() [member function]
+    cls.add_method('DoReportFinalDataFailed', 
+                   'void', 
+                   [], 
+                   visibility='protected', is_virtual=True)
+    ## minstrel-wifi-manager.h: ns3::Ptr<ns3::WifiRemoteStationManager> ns3::MinstrelWifiRemoteStation::GetManager() const [member function]
+    cls.add_method('GetManager', 
+                   'ns3::Ptr< ns3::WifiRemoteStationManager >', 
+                   [], 
+                   is_const=True, visibility='private', is_virtual=True)
+    ## minstrel-wifi-manager.h: ns3::WifiMode ns3::MinstrelWifiRemoteStation::DoGetDataMode(uint32_t size) [member function]
+    cls.add_method('DoGetDataMode', 
+                   'ns3::WifiMode', 
+                   [param('uint32_t', 'size')], 
+                   visibility='private', is_virtual=True)
+    ## minstrel-wifi-manager.h: ns3::WifiMode ns3::MinstrelWifiRemoteStation::DoGetRtsMode() [member function]
+    cls.add_method('DoGetRtsMode', 
+                   'ns3::WifiMode', 
+                   [], 
+                   visibility='private', is_virtual=True)
+    return
+
 def register_Ns3OnoeWifiRemoteStation_methods(root_module, cls):
     ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation::OnoeWifiRemoteStation(ns3::OnoeWifiRemoteStation const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::OnoeWifiRemoteStation const &', 'arg0')])
@@ -1133,6 +1930,8 @@
                    is_const=True, is_virtual=True)
     ## qos-tag.h: ns3::QosTag::QosTag() [constructor]
     cls.add_constructor([])
+    ## qos-tag.h: ns3::QosTag::QosTag(uint8_t tid) [constructor]
+    cls.add_constructor([param('uint8_t', 'tid')])
     ## qos-tag.h: void ns3::QosTag::Serialize(ns3::TagBuffer i) const [member function]
     cls.add_method('Serialize', 
                    'void', 
@@ -1487,10 +2286,15 @@
     cls.add_method('NotifyRxDrop', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet')])
-    ## wifi-mac.h: void ns3::WifiMac::SetStandard(ns3::WifiPhyStandard standard) [member function]
-    cls.add_method('SetStandard', 
+    ## wifi-mac.h: void ns3::WifiMac::ConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('ConfigureStandard', 
                    'void', 
                    [param('ns3::WifiPhyStandard', 'standard')])
+    ## wifi-mac.h: void ns3::WifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   is_pure_virtual=True, visibility='private', is_virtual=True)
     return
 
 def register_Ns3WifiMacHeader_methods(root_module, cls):
@@ -1552,6 +2356,14 @@
     cls.add_method('SetTypeData', 
                    'void', 
                    [])
+    ## wifi-mac-header.h: void ns3::WifiMacHeader::SetAction() [member function]
+    cls.add_method('SetAction', 
+                   'void', 
+                   [])
+    ## wifi-mac-header.h: void ns3::WifiMacHeader::SetMultihopAction() [member function]
+    cls.add_method('SetMultihopAction', 
+                   'void', 
+                   [])
     ## wifi-mac-header.h: void ns3::WifiMacHeader::SetDsFrom() [member function]
     cls.add_method('SetDsFrom', 
                    'void', 
@@ -1777,6 +2589,16 @@
                    'bool', 
                    [], 
                    is_const=True)
+    ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsAction() const [member function]
+    cls.add_method('IsAction', 
+                   'bool', 
+                   [], 
+                   is_const=True)
+    ## wifi-mac-header.h: bool ns3::WifiMacHeader::IsMultihopAction() const [member function]
+    cls.add_method('IsMultihopAction', 
+                   'bool', 
+                   [], 
+                   is_const=True)
     ## wifi-mac-header.h: uint16_t ns3::WifiMacHeader::GetRawDuration() const [member function]
     cls.add_method('GetRawDuration', 
                    'uint16_t', 
@@ -2009,6 +2831,21 @@
                    'double', 
                    [param('ns3::WifiMode', 'txMode'), param('double', 'ber')], 
                    is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## wifi-phy.h: void ns3::WifiPhy::SetChannelNumber(uint16_t id) [member function]
+    cls.add_method('SetChannelNumber', 
+                   'void', 
+                   [param('uint16_t', 'id')], 
+                   is_pure_virtual=True, is_virtual=True)
+    ## wifi-phy.h: uint16_t ns3::WifiPhy::GetChannelNumber() const [member function]
+    cls.add_method('GetChannelNumber', 
+                   'uint16_t', 
+                   [], 
+                   is_pure_virtual=True, is_const=True, is_virtual=True)
+    ## wifi-phy.h: void ns3::WifiPhy::ConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('ConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   is_pure_virtual=True, is_virtual=True)
     ## wifi-phy.h: ns3::Ptr<ns3::WifiChannel> ns3::WifiPhy::GetChannel() const [member function]
     cls.add_method('GetChannel', 
                    'ns3::Ptr< ns3::WifiChannel >', 
@@ -2178,14 +3015,14 @@
     cls.add_method('NotifyRxDrop', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet const >', 'packet')])
-    ## wifi-phy.h: void ns3::WifiPhy::NotifyPromiscSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function]
+    ## wifi-phy.h: void ns3::WifiPhy::NotifyPromiscSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function]
     cls.add_method('NotifyPromiscSniffRx', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('double', 'signalDbm'), param('double', 'noiseDbm')])
-    ## wifi-phy.h: void ns3::WifiPhy::NotifyPromiscSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble) [member function]
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('double', 'signalDbm'), param('double', 'noiseDbm')])
+    ## wifi-phy.h: void ns3::WifiPhy::NotifyPromiscSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble) [member function]
     cls.add_method('NotifyPromiscSniffTx', 
                    'void', 
-                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble')])
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble')])
     return
 
 def register_Ns3WifiRemoteStationManager_methods(root_module, cls):
@@ -2314,14 +3151,25 @@
     cls.add_method('SetChannel', 
                    'void', 
                    [param('ns3::Ptr< ns3::YansWifiChannel >', 'channel')])
+    ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetChannelNumber(uint16_t id) [member function]
+    cls.add_method('SetChannelNumber', 
+                   'void', 
+                   [param('uint16_t', 'id')], 
+                   is_virtual=True)
+    ## yans-wifi-phy.h: uint16_t ns3::YansWifiPhy::GetChannelNumber() const [member function]
+    cls.add_method('GetChannelNumber', 
+                   'uint16_t', 
+                   [], 
+                   is_const=True, is_virtual=True)
+    ## yans-wifi-phy.h: double ns3::YansWifiPhy::GetChannelFrequencyMhz() const [member function]
+    cls.add_method('GetChannelFrequencyMhz', 
+                   'double', 
+                   [], 
+                   is_const=True)
     ## yans-wifi-phy.h: void ns3::YansWifiPhy::StartReceivePacket(ns3::Ptr<ns3::Packet> packet, double rxPowerDbm, ns3::WifiMode mode, ns3::WifiPreamble preamble) [member function]
     cls.add_method('StartReceivePacket', 
                    'void', 
                    [param('ns3::Ptr< ns3::Packet >', 'packet'), param('double', 'rxPowerDbm'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble')])
-    ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetStandard(ns3::WifiPhyStandard standard) [member function]
-    cls.add_method('SetStandard', 
-                   'void', 
-                   [param('ns3::WifiPhyStandard', 'standard')])
     ## yans-wifi-phy.h: void ns3::YansWifiPhy::SetRxNoiseFigure(double noiseFigureDb) [member function]
     cls.add_method('SetRxNoiseFigure', 
                    'void', 
@@ -2505,6 +3353,11 @@
                    'ns3::Ptr< ns3::WifiChannel >', 
                    [], 
                    is_const=True, is_virtual=True)
+    ## yans-wifi-phy.h: void ns3::YansWifiPhy::ConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('ConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   is_virtual=True)
     ## yans-wifi-phy.h: void ns3::YansWifiPhy::DoDispose() [member function]
     cls.add_method('DoDispose', 
                    'void', 
@@ -2672,6 +3525,11 @@
                    'void', 
                    [], 
                    visibility='private', is_virtual=True)
+    ## adhoc-wifi-mac.h: void ns3::AdhocWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   visibility='private', is_virtual=True)
     return
 
 def register_Ns3AmrrWifiManager_methods(root_module, cls):
@@ -3274,6 +4132,152 @@
                    is_const=True, visibility='private', is_virtual=True)
     return
 
+def register_Ns3MacLow_methods(root_module, cls):
+    ## mac-low.h: ns3::MacLow::MacLow(ns3::MacLow const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MacLow const &', 'arg0')])
+    ## mac-low.h: ns3::MacLow::MacLow() [constructor]
+    cls.add_constructor([])
+    ## mac-low.h: void ns3::MacLow::SetPhy(ns3::Ptr<ns3::WifiPhy> phy) [member function]
+    cls.add_method('SetPhy', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::WifiPhy >', 'phy')])
+    ## mac-low.h: void ns3::MacLow::SetWifiRemoteStationManager(ns3::Ptr<ns3::WifiRemoteStationManager> manager) [member function]
+    cls.add_method('SetWifiRemoteStationManager', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'manager')])
+    ## mac-low.h: void ns3::MacLow::SetAddress(ns3::Mac48Address ad) [member function]
+    cls.add_method('SetAddress', 
+                   'void', 
+                   [param('ns3::Mac48Address', 'ad')])
+    ## mac-low.h: void ns3::MacLow::SetAckTimeout(ns3::Time ackTimeout) [member function]
+    cls.add_method('SetAckTimeout', 
+                   'void', 
+                   [param('ns3::Time', 'ackTimeout')])
+    ## mac-low.h: void ns3::MacLow::SetCtsTimeout(ns3::Time ctsTimeout) [member function]
+    cls.add_method('SetCtsTimeout', 
+                   'void', 
+                   [param('ns3::Time', 'ctsTimeout')])
+    ## mac-low.h: void ns3::MacLow::SetSifs(ns3::Time sifs) [member function]
+    cls.add_method('SetSifs', 
+                   'void', 
+                   [param('ns3::Time', 'sifs')])
+    ## mac-low.h: void ns3::MacLow::SetSlotTime(ns3::Time slotTime) [member function]
+    cls.add_method('SetSlotTime', 
+                   'void', 
+                   [param('ns3::Time', 'slotTime')])
+    ## mac-low.h: void ns3::MacLow::SetPifs(ns3::Time pifs) [member function]
+    cls.add_method('SetPifs', 
+                   'void', 
+                   [param('ns3::Time', 'pifs')])
+    ## mac-low.h: void ns3::MacLow::SetBssid(ns3::Mac48Address ad) [member function]
+    cls.add_method('SetBssid', 
+                   'void', 
+                   [param('ns3::Mac48Address', 'ad')])
+    ## mac-low.h: ns3::Mac48Address ns3::MacLow::GetAddress() const [member function]
+    cls.add_method('GetAddress', 
+                   'ns3::Mac48Address', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: ns3::Time ns3::MacLow::GetAckTimeout() const [member function]
+    cls.add_method('GetAckTimeout', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: ns3::Time ns3::MacLow::GetCtsTimeout() const [member function]
+    cls.add_method('GetCtsTimeout', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: ns3::Time ns3::MacLow::GetSifs() const [member function]
+    cls.add_method('GetSifs', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: ns3::Time ns3::MacLow::GetSlotTime() const [member function]
+    cls.add_method('GetSlotTime', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: ns3::Time ns3::MacLow::GetPifs() const [member function]
+    cls.add_method('GetPifs', 
+                   'ns3::Time', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: ns3::Mac48Address ns3::MacLow::GetBssid() const [member function]
+    cls.add_method('GetBssid', 
+                   'ns3::Mac48Address', 
+                   [], 
+                   is_const=True)
+    ## mac-low.h: void ns3::MacLow::SetRxCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::WifiMacHeader const*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
+    cls.add_method('SetRxCallback', 
+                   'void', 
+                   [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::WifiMacHeader const *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
+    ## mac-low.h: void ns3::MacLow::RegisterDcfListener(ns3::MacLowDcfListener * listener) [member function]
+    cls.add_method('RegisterDcfListener', 
+                   'void', 
+                   [param('ns3::MacLowDcfListener *', 'listener')])
+    ## mac-low.h: ns3::Time ns3::MacLow::CalculateTransmissionTime(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMacHeader const * hdr, ns3::MacLowTransmissionParameters const & parameters) const [member function]
+    cls.add_method('CalculateTransmissionTime', 
+                   'ns3::Time', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const *', 'hdr'), param('ns3::MacLowTransmissionParameters const &', 'parameters')], 
+                   is_const=True)
+    ## mac-low.h: void ns3::MacLow::StartTransmission(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMacHeader const * hdr, ns3::MacLowTransmissionParameters parameters, ns3::MacLowTransmissionListener * listener) [member function]
+    cls.add_method('StartTransmission', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMacHeader const *', 'hdr'), param('ns3::MacLowTransmissionParameters', 'parameters'), param('ns3::MacLowTransmissionListener *', 'listener')])
+    ## mac-low.h: void ns3::MacLow::ReceiveOk(ns3::Ptr<ns3::Packet> packet, double rxSnr, ns3::WifiMode txMode, ns3::WifiPreamble preamble) [member function]
+    cls.add_method('ReceiveOk', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet >', 'packet'), param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode'), param('ns3::WifiPreamble', 'preamble')])
+    ## mac-low.h: void ns3::MacLow::ReceiveError(ns3::Ptr<ns3::Packet const> packet, double rxSnr) [member function]
+    cls.add_method('ReceiveError', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('double', 'rxSnr')])
+    ## mac-low.h: void ns3::MacLow::DoDispose() [member function]
+    cls.add_method('DoDispose', 
+                   'void', 
+                   [], 
+                   visibility='private', is_virtual=True)
+    return
+
+def register_Ns3MgtBeaconHeader_methods(root_module, cls):
+    ## mgt-headers.h: ns3::MgtBeaconHeader::MgtBeaconHeader(ns3::MgtBeaconHeader const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MgtBeaconHeader const &', 'arg0')])
+    ## mgt-headers.h: ns3::MgtBeaconHeader::MgtBeaconHeader() [constructor]
+    cls.add_constructor([])
+    return
+
+def register_Ns3MinstrelWifiManager_methods(root_module, cls):
+    ## minstrel-wifi-manager.h: ns3::MinstrelWifiManager::MinstrelWifiManager(ns3::MinstrelWifiManager const & arg0) [copy constructor]
+    cls.add_constructor([param('ns3::MinstrelWifiManager const &', 'arg0')])
+    ## minstrel-wifi-manager.h: static ns3::TypeId ns3::MinstrelWifiManager::GetTypeId() [member function]
+    cls.add_method('GetTypeId', 
+                   'ns3::TypeId', 
+                   [], 
+                   is_static=True)
+    ## minstrel-wifi-manager.h: ns3::MinstrelWifiManager::MinstrelWifiManager() [constructor]
+    cls.add_constructor([])
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiManager::SetupPhy(ns3::Ptr<ns3::WifiPhy> phy) [member function]
+    cls.add_method('SetupPhy', 
+                   'void', 
+                   [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], 
+                   is_virtual=True)
+    ## minstrel-wifi-manager.h: ns3::Time ns3::MinstrelWifiManager::GetCalcTxTime(ns3::WifiMode mode) const [member function]
+    cls.add_method('GetCalcTxTime', 
+                   'ns3::Time', 
+                   [param('ns3::WifiMode', 'mode')], 
+                   is_const=True)
+    ## minstrel-wifi-manager.h: void ns3::MinstrelWifiManager::AddCalcTxTime(ns3::WifiMode mode, ns3::Time t) [member function]
+    cls.add_method('AddCalcTxTime', 
+                   'void', 
+                   [param('ns3::WifiMode', 'mode'), param('ns3::Time', 't')])
+    ## minstrel-wifi-manager.h: ns3::WifiRemoteStation * ns3::MinstrelWifiManager::CreateStation() [member function]
+    cls.add_method('CreateStation', 
+                   'ns3::WifiRemoteStation *', 
+                   [], 
+                   visibility='private', is_virtual=True)
+    return
+
 def register_Ns3MsduAggregator_methods(root_module, cls):
     ## msdu-aggregator.h: ns3::MsduAggregator::MsduAggregator(ns3::MsduAggregator const & arg0) [copy constructor]
     cls.add_constructor([param('ns3::MsduAggregator const &', 'arg0')])
@@ -3462,6 +4466,11 @@
                    'void', 
                    [], 
                    visibility='private', is_virtual=True)
+    ## nqap-wifi-mac.h: void ns3::NqapWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   visibility='private', is_virtual=True)
     return
 
 def register_Ns3NqstaWifiMac_methods(root_module, cls):
@@ -3618,6 +4627,11 @@
                    'void', 
                    [], 
                    visibility='private', is_virtual=True)
+    ## nqsta-wifi-mac.h: void ns3::NqstaWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   visibility='private', is_virtual=True)
     return
 
 def register_Ns3OnoeWifiManager_methods(root_module, cls):
@@ -3775,6 +4789,11 @@
                    'void', 
                    [], 
                    visibility='private', is_virtual=True)
+    ## qadhoc-wifi-mac.h: void ns3::QadhocWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   visibility='private', is_virtual=True)
     return
 
 def register_Ns3QapWifiMac_methods(root_module, cls):
@@ -3928,6 +4947,11 @@
                    'void', 
                    [], 
                    visibility='private', is_virtual=True)
+    ## qap-wifi-mac.h: void ns3::QapWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   visibility='private', is_virtual=True)
     return
 
 def register_Ns3QstaWifiMac_methods(root_module, cls):
@@ -4084,6 +5108,11 @@
                    'void', 
                    [], 
                    visibility='private', is_virtual=True)
+    ## qsta-wifi-mac.h: void ns3::QstaWifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function]
+    cls.add_method('FinishConfigureStandard', 
+                   'void', 
+                   [param('ns3::WifiPhyStandard', 'standard')], 
+                   visibility='private', is_virtual=True)
     return
 
 def register_Ns3RraaWifiManager_methods(root_module, cls):
--- a/bindings/python/ns3module_helpers.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/bindings/python/ns3module_helpers.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -1,5 +1,5 @@
+#include "ns3module.h"
 #include "ns3/ref-count-base.h"
-#include "ns3module.h"
 
 
 namespace ns3{
--- a/doc/manual/attributes.texi	Tue Aug 18 11:47:17 2009 +0400
+++ b/doc/manual/attributes.texi	Tue Aug 18 12:01:35 2009 +0400
@@ -489,6 +489,24 @@
 @item ATTRIBUTE_HELPER_CPP
 @end itemize
 
+@subsection Initialization order
+
+In general, the attribute code to assign values to the underlying
+class member variables is executed after an object is constructed.
+But what if you need the values assigned before the constructor
+body executes, because you need them in the logic of the constructor?
+There is a way to do this, used for example in the class 
+@code{ns3::ConfigStore}:  call @code{ObjectBase::ConstructSelf()}
+as follows:
+
+@verbatim
+ConfigStore::ConfigStore ()
+{
+  ObjectBase::ConstructSelf (AttributeList ());
+  // continue on with constructor.
+}
+@end verbatim
+
 @node Extending attributes
 @section Extending attributes
 
@@ -645,11 +663,11 @@
 found in @code{src/contrib} and not in the main tree.  If you like this feature
 and would like to provide feedback on it, please email us.
 
-Values for ns-3 attributes can be stored in an ascii text file and
+Values for ns-3 attributes can be stored in an ascii or XML text file and
 loaded into a future simulation.  This feature is known as the
 ns-3 ConfigStore.  
 The ConfigStore code is in @code{src/contrib/}.  It is not yet main-tree
-code, because we are seeking some user feedback. 
+code, because we are seeking some user feedback and experience with this. 
 
 We can explore this system by using an example.  Copy the @code{csma-bridge.cc}
 file to the scratch directory:
@@ -658,8 +676,8 @@
   ./waf
 @end verbatim
 
-Let's edit it to add the ConfigStore feature.  First, add an include statement,
-and then add these lines:
+Let's edit it to add the ConfigStore feature.  First, add an include statement 
+to include the contrib module, and then add these lines:
 
 @verbatim
 #include "contrib-module.h"
@@ -670,20 +688,43 @@
 
   // Invoke just before entering Simulator::Run ()
   ConfigStore config;
-  config.Configure ();
+  config.ConfigureDefaults ();
+  config.ConfigureAttributes ();
 
   Simulator::Run ();
 }
 @end verbatim
 
-There is an attribute that governs whether the Configure() call either
-stores a simulation configuration in a file and exits, or whether
-it loads a simulation configuration file annd proceeds.  First,
-the @code{LoadFilename} attribute is checked, and if non-empty,
-the program loads the configuration from the filename provided.
-If LoadFilename is empty, and if the @code{StoreFilename} attribute is 
-populated, the configuration will be written to the output filename
-specified.
+There are three attributes that govern the behavior of the ConfigStore:
+"Mode", "Filename", and "FileFormat".  The Mode (default "None") configures
+whether ns-3 should load configuration from a previously saved file
+(specify "Mode=Load") or save it to a file (specify "Mode=Save").
+The Filename (default "") is where the ConfigStore should store its
+output data.  The FileFormat (default "RawText") governs whether
+the ConfigStore format is Xml or RawText format.
+
+So, using the above modified program, try executing the following
+waf command and 
+@verbatim
+./waf --command-template="%s --ns3::ConfigStore::Filename=csma-bridge-config.xml --ns3::ConfigStore::Mode=Save --ns3::ConfigStore::FileFormat=Xml" --run scratch/csma-bridge
+@end verbatim
+After running, you can open the csma-bridge-config.xml file and it will
+display the configuration that was applied to your simulation; e.g.
+@verbatim
+<?xml version="1.0" encoding="UTF-8"?>
+<ns3>
+ <default name="ns3::V4Ping::Remote" value="102.102.102.102"/>
+ <default name="ns3::MsduStandardAggregator::MaxAmsduSize" value="7935"/>
+ <default name="ns3::EdcaTxopN::MinCw" value="31"/>
+ <default name="ns3::EdcaTxopN::MaxCw" value="1023"/>
+ <default name="ns3::EdcaTxopN::Aifsn" value="3"/>
+ <default name="ns3::QstaWifiMac::ProbeRequestTimeout" value="50000000ns"/>
+ <default name="ns3::QstaWifiMac::AssocRequestTimeout" value="500000000ns"/>
+ <default name="ns3::QstaWifiMac::MaxMissedBeacons" value="10"/>
+ <default name="ns3::QstaWifiMac::ActiveProbing" value="false"/>
+...
+@end verbatim
+This file can be archived with your simulation script and output data.
 
 While it is possible to generate a sample config file and lightly
 edit it to change a couple of values, there are cases where this
@@ -697,55 +738,46 @@
 elements to a new configuration file which can then safely
 be edited and loaded in a subsequent simulation run. 
 
-So, let's do that as an example.  We'lll run the program once
-to create a configure file, and look at it. 
-If you are running bash shell, the below command should work (which illustrates
-how to set an attribute from the command line):
-@verbatim
-./build/debug/scratch/csma-bridge --ns3::ConfigStore::StoreFilename=test.config
-@end verbatim
-or, if the above does not work (the above requires rpath support), try this:
-@verbatim
-./waf --command-template="%s --ns3::ConfigStore::StoreFilename=test.config" --run scratch/csma-bridge
-@end verbatim
+When the ConfigStore object is instantiated, its attributes Filename,
+Mode, and FileFormat must be set, either via command-line or via
+program statements.  
 
-Running the program should yield a "test.config" output configuration file 
-that looks like this:
+As a more complicated example, let's assume that we want to 
+read in a configuration of defaults from an input file named
+"input-defaults.xml", and write out the resulting attributes to a
+separate file called "output-attributes.xml".  (Note-- to get this
+input xml file to begin with, it is sometimes helpful to run the
+program to generate an output xml file first, then hand-edit that
+file and re-input it for the next simulation run).
 @verbatim
-/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Addre
-ss 00:00:00:00:00:01
-/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Frame
-Size 1518
-/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/SendE
-nable true
-/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Recei
-veEnable true
-/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/TxQue
-ue/$ns3::DropTailQueue/MaxPackets 100
-/$ns3::NodeListPriv/NodeList/0/$ns3::Node/DeviceList/0/$ns3::CsmaNetDevice/Mtu 1
-500
+#include "contrib-module.h"
 ...
-@end verbatim
+int main (...)
+{
 
-The above lists, for each object in the script topology, the value of each 
-registered attribute.  The syntax of this file is that the unique name
-of the attribute (in the attribute namespace) is specified on each line,
-followed by a value.  
+  Config::SetDefault ("ns3::ConfigStore::Filename", StringValue ("input-defaults.xml"));
+  Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Load"));
+  Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("Xml"));
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+  
+  //
+  // Allow the user to override any of the defaults and the above Bind() at
+  // run-time, via command-line arguments
+  //
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
 
-This file is intended to be a convenient record of the parameters that were 
-used in a given simulation run, and can be stored with simulation
-output files.  Additionally, 
-this file can also be used to parameterize a simulation, instead of
-editing the script or passing in command line arguments.   For instance,
-a person wanting to run the simulation can examine and tweak the values
-in a pre-existing configuration file, and pass the file to the
-program.   In this case, the relevant commands are:
-@verbatim
-./build/debug/scratch/csma-bridge --ns3::ConfigStore::LoadFilename=test.config
-@end verbatim
-or, if the above does not work (the above requires rpath support), try this:
-@verbatim
-./waf --command-template="%s --ns3::ConfigStore::LoadFilename=test.config" --run scratch/csma-bridge
+  // setup topology
+  ...
+
+  // Invoke just before entering Simulator::Run ()
+  Config::SetDefault ("ns3::ConfigStore::Filename", StringValue ("output-attributes.xml"));
+  Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Save"));
+  ConfigStore outputConfig;
+  outputConfig.ConfigureAttributes ();
+  Simulator::Run ();
+}
 @end verbatim
 
 @subsection GTK-based ConfigStore
@@ -772,11 +804,13 @@
 In the above example, it was not enabled, so it cannot be used until a
 suitable version is installed and ./waf configure; ./waf is rerun.
 
-Usage is almost the same as the non-GTK-based version:
+Usage is almost the same as the non-GTK-based version, but there
+are no ConfigStore attributes involved:
 @verbatim
   // Invoke just before entering Simulator::Run ()
   GtkConfigStore config;
-  config.Configure ();
+  config.ConfigureDefaults ();
+  config.ConfigureAttributes ();
 @end verbatim
 
 Now, when you run the script, a GUI should pop up, allowing you to open
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/multi-rate-first.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,317 @@
+/**
+ *
+ * Instructions:
+ * ./waf --run multi-rate-first > m.data
+ * gnuplot m.data
+ * eog *.png
+ *
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/common-module.h"
+#include "ns3/node-module.h"
+#include "ns3/helper-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/contrib-module.h"
+
+#include <iostream>
+
+NS_LOG_COMPONENT_DEFINE ("Main");
+
+using namespace ns3;
+
+class Experiment
+{
+public:
+  Experiment ();
+  Experiment (std::string name);
+  Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
+                        const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility, int positionStep);
+private:
+  void ReceivePacket (Ptr<Socket> socket);
+  void SetPosition (Ptr<Node> node, Vector position);
+  Vector GetPosition (Ptr<Node> node);
+  void AdvancePosition (Ptr<Node> node);
+  void BackTrackPosition (Ptr<Node> node);
+  void StationaryPosition (Ptr<Node> node);
+  Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
+
+  uint32_t m_bytesTotal;
+  Gnuplot2dDataset m_output;
+};
+
+Experiment::Experiment ()
+{}
+
+Experiment::Experiment (std::string name)
+  : m_output (name)
+{
+  m_output.SetStyle (Gnuplot2dDataset::LINES);
+}
+
+void
+Experiment::SetPosition (Ptr<Node> node, Vector position)
+{
+  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
+  mobility->SetPosition (position);
+}
+
+Vector
+Experiment::GetPosition (Ptr<Node> node)
+{
+  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
+  return mobility->GetPosition ();
+}
+
+void 
+Experiment::AdvancePosition (Ptr<Node> node) 
+{
+  Vector pos = GetPosition (node);
+  double mbs = ((m_bytesTotal * 8.0) / 1000000);
+  m_bytesTotal = 0;
+  m_output.Add ((Simulator::Now()).GetSeconds(), mbs);
+  pos.x += 1.0;
+	
+  if (pos.x >= 210.0) 
+    {
+      return;
+    }
+  SetPosition (node, pos);
+
+  //std::cout << "x="<<pos.x << std::endl;
+  Simulator::Schedule (Seconds (1.0), &Experiment::AdvancePosition, this, node);
+}
+void 
+Experiment::BackTrackPosition (Ptr<Node> node) 
+{
+  Vector pos = GetPosition (node);
+  double mbs = ((m_bytesTotal * 8.0) / 1000000);
+  m_bytesTotal = 0;
+  m_output.Add ((Simulator::Now()).GetSeconds(), mbs);
+  pos.x -= 1.0;
+	
+  if (pos.x < 0) 
+    {
+      return;
+    }
+  SetPosition (node, pos);
+
+  //std::cout << "x="<<pos.x << std::endl;
+  Simulator::Schedule (Seconds (1.0), &Experiment::BackTrackPosition, this, node);
+}
+
+void
+Experiment::StationaryPosition (Ptr<Node> node)
+{
+  double mbs = ((m_bytesTotal * 8.0) / 1000000);
+  m_bytesTotal = 0;
+  m_output.Add ((Simulator::Now()).GetSeconds(), mbs);
+
+}
+
+void
+Experiment::ReceivePacket (Ptr<Socket> socket)
+{
+  Ptr<Packet> packet;
+  while (packet = socket->Recv ())
+    {
+      m_bytesTotal += packet->GetSize ();
+    }
+}
+
+Ptr<Socket>
+Experiment::SetupPacketReceive (Ptr<Node> node)
+{
+  TypeId tid = TypeId::LookupByName ("ns3::PacketSocketFactory");
+  Ptr<Socket> sink = Socket::CreateSocket (node, tid);
+  sink->Bind ();
+  sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this));
+
+  return sink;
+
+}
+
+Gnuplot2dDataset
+Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
+                 const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility, int positionStep)
+{
+  m_bytesTotal = 0;
+
+  NodeContainer c;
+  c.Create (2);
+
+  PacketSocketHelper packetSocket;
+  packetSocket.Install (c);
+
+  YansWifiPhyHelper phy = wifiPhy;
+  phy.SetChannel (wifiChannel.Create ());
+
+  NqosWifiMacHelper mac = wifiMac;
+  NetDeviceContainer devices = wifi.Install (phy, mac, c);
+
+  mobility.Install (c);
+
+  PacketSocketAddress socket;
+  socket.SetSingleDevice(devices.Get (0)->GetIfIndex ());
+  socket.SetPhysicalAddress (devices.Get (1)->GetAddress ());
+  socket.SetProtocol (1);
+
+  OnOffHelper onoff ("ns3::PacketSocketFactory", Address (socket));
+  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (250)));
+  onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
+  onoff.SetAttribute ("DataRate", DataRateValue (DataRate (60000000)));
+  onoff.SetAttribute ("PacketSize", UintegerValue (2000));
+
+  ApplicationContainer apps = onoff.Install (c.Get (0));
+  apps.Start (Seconds (0.5));
+  apps.Stop (Seconds (250.0));
+
+
+  Ptr<Socket> recvSink = SetupPacketReceive (c.Get (1));
+
+  if(positionStep == 1)
+    {
+      Simulator::Schedule (Seconds (1.5), &Experiment::AdvancePosition, this, c.Get (1));
+    }
+  else if(positionStep == -1)
+    {
+      Simulator::Schedule (Seconds (1.5), &Experiment::BackTrackPosition, this, c.Get (1));
+    }
+  else if(positionStep == 0)
+    {
+      for(int i = 1; i <= 210; i++) 
+        {
+          Simulator::Schedule (Seconds (i), &Experiment::StationaryPosition, this, c.Get (1));
+        }
+    }
+  Simulator::Run ();
+  Simulator::Destroy ();
+
+  return m_output;
+}
+
+int main (int argc, char *argv[])
+{
+  // disable fragmentation
+  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
+  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
+
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  Gnuplot gnuplot = Gnuplot ("multi-rate-first.png");
+  Experiment experiment;
+  WifiHelper wifi = WifiHelper::Default ();
+  NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
+  YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
+  YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
+  Gnuplot2dDataset dataset;
+  int myPositionStep = 0; 
+
+/*
+
+  // Scenario 1: moving away from one another
+  // Initially set them 5 meters apart 
+  // Set  positionStep parameter of Experiment::Run to 1  
+  // Set RateErrorModel of Experiment::Run to 0
+  myPositionStep = 1;
+
+  MobilityHelper mobility;
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
+  positionAlloc->Add (Vector (5.0, 0.0, 0.0));
+  mobility.SetPositionAllocator (positionAlloc);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+
+  wifiMac.SetType ("ns3::AdhocWifiMac");
+
+  gnuplot = Gnuplot ("multi-rate-first.png");
+  wifi.SetStandard (WIFI_PHY_STANDARD_holland);
+
+  NS_LOG_DEBUG ("minstrel");
+  experiment = Experiment ("minstrel");
+  wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager");
+  dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep);
+  gnuplot.AddDataset (dataset);
+
+  NS_LOG_DEBUG ("ideal");
+  experiment = Experiment ("ideal");
+  wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
+  dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep);
+  gnuplot.AddDataset (dataset);
+
+  gnuplot.GenerateOutput (std::cout);
+  */
+
+
+  // Scenario 2: two nodes out of range, moving into transmission range range
+  // Initially set them 230 meters apart 
+  // Set positionStep parameter of Experiment::Rung to -1
+  // set RateErrorModel of Experiment::Run to 0
+
+  myPositionStep = -1;
+
+  MobilityHelper mobility;
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
+  positionAlloc->Add (Vector (230.0, 0.0, 0.0));
+  mobility.SetPositionAllocator (positionAlloc);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+
+  wifiMac.SetType ("ns3::AdhocWifiMac");
+
+  gnuplot = Gnuplot ("multi-rate-first.png");
+  wifi.SetStandard (WIFI_PHY_STANDARD_holland);
+
+  NS_LOG_DEBUG ("minstrel");
+  experiment = Experiment ("minstrel");
+  wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager");
+  dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep);
+  gnuplot.AddDataset (dataset);
+
+  NS_LOG_DEBUG ("ideal");
+  experiment = Experiment ("ideal");
+  wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
+  dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep);
+  gnuplot.AddDataset (dataset);
+
+  gnuplot.GenerateOutput (std::cout);
+
+
+
+/*
+  // Scenario 3:
+  // Initially set them 25 meters apart, stationary
+  // Set positionStep parameter of Experiment::Rung to 0 
+  // This is a sanity check
+
+  myPositionStep = 0;
+  MobilityHelper mobility;
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
+  positionAlloc->Add (Vector (25.0, 0.0, 0.0));
+  mobility.SetPositionAllocator (positionAlloc);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+
+  wifiMac.SetType ("ns3::AdhocWifiMac");
+
+  gnuplot = Gnuplot ("multi-rate-first.png");
+  wifi.SetStandard (WIFI_PHY_STANDARD_holland);
+
+  NS_LOG_DEBUG ("minstrel");
+  experiment = Experiment ("minstrel");
+  wifi.SetRemoteStationManager ("ns3::MinstrelWifiManager");
+  dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep);
+  gnuplot.AddDataset (dataset);
+
+  NS_LOG_DEBUG ("ideal");
+  experiment = Experiment ("ideal");
+  wifi.SetRemoteStationManager ("ns3::IdealWifiManager");
+  dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel, mobility, myPositionStep);
+  gnuplot.AddDataset (dataset);
+
+  gnuplot.GenerateOutput (std::cout);
+  */
+
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/multi-rate-second.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,256 @@
+/* 
+ * Instructions:
+ * ./waf --run multi-rate-second
+ * gnuplot multi-rate-second.plt 
+ *
+ * Output: multi-rate-second.eps 
+ *
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/common-module.h"
+#include "ns3/node-module.h"
+#include "ns3/helper-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/contrib-module.h"
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <string>
+
+NS_LOG_COMPONENT_DEFINE ("Main");
+
+using namespace ns3;
+
+class Experiment
+{
+public:
+  Experiment ();
+  Experiment (std::string name);
+  Gnuplot2dDataset Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
+                        const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel);
+private:
+  void ReceivePacket (Ptr<Socket> socket);
+  void SetPosition (Ptr<Node> node, Vector position);
+  Vector GetPosition (Ptr<Node> node);
+  Ptr<Socket> SetupPacketReceive (Ptr<Node> node);
+  void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
+                        uint32_t pktCount, Time pktInterval , Ptr<Node> node);
+
+  uint32_t m_pktsTotal;
+  Gnuplot2dDataset m_output;
+  bool advanceStep; 
+};
+
+Experiment::Experiment ()
+{
+  advanceStep= true;
+}
+
+Experiment::Experiment (std::string name)
+  : m_output (name)
+{
+  m_output.SetStyle (Gnuplot2dDataset::LINES);
+}
+
+void
+Experiment::SetPosition (Ptr<Node> node, Vector position)
+{
+  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
+  mobility->SetPosition (position);
+}
+
+Vector
+Experiment::GetPosition (Ptr<Node> node)
+{
+  Ptr<MobilityModel> mobility = node->GetObject<MobilityModel> ();
+  return mobility->GetPosition ();
+}
+
+void
+Experiment::ReceivePacket (Ptr<Socket> socket)
+{
+  Ptr<Packet> packet;
+  while (packet = socket->Recv ())
+    {
+      m_pktsTotal ++;
+    }
+}
+
+Ptr<Socket>
+Experiment::SetupPacketReceive (Ptr<Node> node)
+{
+  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
+  Ptr<Socket> sink = Socket::CreateSocket (node, tid);
+  InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
+  sink->Bind (local);
+  sink->SetRecvCallback (MakeCallback (&Experiment::ReceivePacket, this));
+  return sink;
+}
+
+void
+Experiment::GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
+                             uint32_t pktCount, Time pktInterval, Ptr<Node> node )
+{
+  Vector pos = GetPosition(node);
+
+  ///to offset the start time
+  double offSetTime = 100;
+
+  if (pktCount > 0)
+    {
+      ///To simulate nodes moving in and out of transmission constantly
+      if(pos.x <= 305 && advanceStep)
+        {
+          ///keep moving away
+          pos.x += .1;
+          SetPosition(node, pos);
+        }
+      else
+        {
+          if(pos.x < 150)
+	    {
+              advanceStep=true;
+            }
+          else
+            {
+              advanceStep = false;
+            }			
+
+          ///moving back in
+          pos.x -= .1;
+          SetPosition(node, pos);
+        }
+      socket->Send (Create<Packet> (pktSize));
+      Simulator::Schedule (pktInterval, &Experiment::GenerateTraffic, this, 
+                           socket, pktSize,pktCount-1, pktInterval, node);
+    }
+  else
+    {
+      m_output.Add((Simulator::Now()).GetSeconds() - offSetTime , m_pktsTotal); 
+    }
+}
+
+Gnuplot2dDataset
+Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy,
+                 const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel)
+{
+  m_pktsTotal = 0;
+
+  NodeContainer c;
+  c.Create (2);
+
+  YansWifiPhyHelper phy = wifiPhy;
+  phy.SetChannel (wifiChannel.Create ());
+
+  NqosWifiMacHelper mac = wifiMac;
+  NetDeviceContainer devices = wifi.Install (phy, mac, c);
+
+  MobilityHelper mobility;
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
+  positionAlloc->Add (Vector (5.0, 0.0, 0.0));
+  mobility.SetPositionAllocator (positionAlloc);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.Install (c);
+
+  InternetStackHelper internet;
+  internet.Install (c);
+
+  Ipv4AddressHelper ipv4;
+  NS_LOG_INFO ("Assign IP Addresses.");
+  ipv4.SetBase ("10.1.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer wifiNodesInterface = ipv4.Assign (devices);
+
+
+  Ptr<Socket> recvSink = SetupPacketReceive (c.Get (0));
+
+  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
+  Ptr<Socket> source = Socket::CreateSocket (c.Get (1), tid);
+  InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), 80);
+  source->Connect (remote);
+  uint32_t packetSize = 1014;
+  uint32_t maxPacketCount = 1000;
+  Time interPacketInterval = Seconds (.1);
+
+  Ptr<Node> n1 = c.Get(0);
+  Ptr<Ipv4> ipv41 = n1->GetObject<Ipv4> ();
+
+
+
+  for (int i= 1; i <= 100; i++) 
+    {
+
+      Simulator::Schedule (Seconds (i), &Experiment::GenerateTraffic,
+                           this, source, packetSize, maxPacketCount,interPacketInterval, c.Get(1));
+
+      if( i % 5 == 0 )
+        {
+          ///bring a network interface down 
+          Simulator::Schedule (Seconds (i+.5), &Ipv4::SetDown, ipv41, 1); 
+          i++;
+          Simulator::Schedule (Seconds (i), &Experiment::GenerateTraffic,
+                               this, source, packetSize, maxPacketCount,interPacketInterval, c.Get(1));
+	
+          ///bring a network interface up
+          Simulator::Schedule (Seconds (i+.2), &Ipv4::SetUp, ipv41, 1); 
+          i++;
+          Simulator::Schedule (Seconds (i), &Experiment::GenerateTraffic,
+                               this, source, packetSize, maxPacketCount,interPacketInterval, c.Get(1));
+        }
+    }
+
+  Simulator::Run ();
+  Simulator::Destroy ();
+
+  return m_output;
+}
+
+int main (int argc, char *argv[])
+{
+  std::vector <std::string> ratesControl;
+  ratesControl.push_back ("Ideal");
+  ratesControl.push_back ("Minstrel");
+
+  std::vector <std::string> wifiManager;
+  wifiManager.push_back("ns3::IdealWifiManager");
+  wifiManager.push_back("ns3::MinstrelWifiManager");
+
+  // disable fragmentation
+  Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2200"));
+  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
+
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  Gnuplot gnuplot = Gnuplot ("multi-rate-second.eps");
+  
+  for (uint32_t i = 0; i < ratesControl.size(); i++)
+  {
+    Gnuplot2dDataset dataset (ratesControl[i]);
+    dataset.SetStyle (Gnuplot2dDataset::LINES);
+    Experiment experiment;
+
+
+    WifiHelper wifi = WifiHelper::Default ();
+    NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
+    YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
+    YansWifiChannelHelper wifiChannel  = YansWifiChannelHelper::Default ();
+
+    wifiMac.SetType ("ns3::AdhocWifiMac");
+
+    NS_LOG_DEBUG (ratesControl[i]);
+
+    experiment = Experiment (ratesControl[i]);
+    dataset = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel);
+    gnuplot.AddDataset (dataset);
+
+  }
+  gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\"");
+  gnuplot.SetLegend ("Time (Seconds)", "Number of packets received");
+  gnuplot.SetExtra  ("set xrange [0:100]");
+  gnuplot.GenerateOutput (std::cout);
+
+  return 0;
+}
--- a/examples/wifi-adhoc.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/examples/wifi-adhoc.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -174,6 +174,7 @@
 
   Experiment experiment;
   WifiHelper wifi = WifiHelper::Default ();
+  wifi.SetStandard (WIFI_PHY_STANDARD_80211a);
   NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
   YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
@@ -241,7 +242,7 @@
 
 
   gnuplot = Gnuplot ("rate-control.png");
-  Config::SetDefault ("ns3::YansWifiPhy::Standard", StringValue ("holland"));
+  wifi.SetStandard (WIFI_PHY_STANDARD_holland);
 
 
   NS_LOG_DEBUG ("arf");
--- a/examples/wifi-clear-channel-cmu.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/examples/wifi-clear-channel-cmu.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -191,6 +191,7 @@
      dataset.SetStyle (Gnuplot2dDataset::LINES);
  
      WifiHelper wifi;
+     wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
      NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
      Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", 
                          StringValue (modes[i]));
@@ -207,7 +208,6 @@
  
      NS_LOG_DEBUG (modes[i]);
      experiment = Experiment (modes[i]);
-     wifiPhy.Set ("Standard", StringValue ("802.11b") );
      wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-110.0) );
      wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-110.0) );
      wifiPhy.Set ("TxPowerStart", DoubleValue (15.0) );
--- a/examples/wscript	Tue Aug 18 11:47:17 2009 +0400
+++ b/examples/wscript	Tue Aug 18 12:01:35 2009 +0400
@@ -154,7 +154,7 @@
     obj = bld.create_ns3_program('csma-ping',
         ['csma', 'internet-stack', 'v4ping'])
     obj.source = 'csma-ping.cc'
-#
+
 #    obj = bld.create_ns3_program('test-ipv6',
 #      ['point-to-point', 'internet-stack'])
 #    obj.source = 'test-ipv6.cc'
@@ -175,3 +175,11 @@
 #    obj = bld.create_ns3_program('simple-wifi-frame-aggregation',
 #                                 ['core', 'simulator', 'mobility', 'wifi'])
 #    obj.source = 'simple-wifi-frame-aggregation.cc'
+#
+#    obj = bld.create_ns3_program('multi-rate-first',
+#                                 ['core', 'simulator', 'mobility', 'wifi'])
+#    obj.source = 'multi-rate-first.cc'
+#
+#    obj = bld.create_ns3_program('multi-rate-second',
+#                                 ['core', 'simulator', 'mobility', 'wifi'])
+#    obj.source = 'multi-rate-second.cc'
--- a/src/applications/udp-echo/udp-echo-client.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/applications/udp-echo/udp-echo-client.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -24,6 +24,7 @@
 #include "ns3/socket-factory.h"
 #include "ns3/packet.h"
 #include "ns3/uinteger.h"
+#include "ns3/trace-source-accessor.h"
 #include "udp-echo-client.h"
 
 namespace ns3 {
@@ -62,6 +63,8 @@
                    MakeUintegerAccessor (&UdpEchoClient::SetDataSize,
                                          &UdpEchoClient::GetDataSize),
                    MakeUintegerChecker<uint32_t> ())
+    .AddTraceSource ("Tx", "A new packet is created and is sent",
+                     MakeTraceSourceAccessor (&UdpEchoClient::m_txTrace))
     ;
   return tid;
 }
@@ -246,6 +249,7 @@
 
   NS_ASSERT (m_sendEvent.IsExpired ());
 
+  Ptr<Packet> p;
   if (m_dataSize)
     {
       //
@@ -256,8 +260,7 @@
       //
       NS_ASSERT_MSG (m_dataSize == m_size, "UdpEchoClient::Send(): m_size and m_dataSize inconsistent");
       NS_ASSERT_MSG (m_data, "UdpEchoClient::Send(): m_dataSize but no m_data");
-      Ptr<Packet> p = Create<Packet> (m_data, m_dataSize);
-      m_socket->Send (p);
+      p = Create<Packet> (m_data, m_dataSize);
     }
   else
     {
@@ -268,9 +271,12 @@
       // this case, we don't worry about it either.  But we do allow m_size
       // to have a value different from the (zero) m_dataSize.
       //
-      Ptr<Packet> p = Create<Packet> (m_size);
-      m_socket->Send (p);
+      p = Create<Packet> (m_size);
     }
+  // call to the trace sinks before the packet is actually sent,
+  // so that tags added to the packet can be sent as well
+  m_txTrace (p);
+  m_socket->Send (p);
 
   ++m_sent;
 
--- a/src/applications/udp-echo/udp-echo-client.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/applications/udp-echo/udp-echo-client.h	Tue Aug 18 12:01:35 2009 +0400
@@ -23,6 +23,7 @@
 #include "ns3/event-id.h"
 #include "ns3/ptr.h"
 #include "ns3/ipv4-address.h"
+#include "ns3/traced-callback.h"
 
 namespace ns3 {
 
@@ -140,7 +141,8 @@
   Ipv4Address m_peerAddress;
   uint16_t m_peerPort;
   EventId m_sendEvent;
-
+  /// Callbacks for tracing the packet Tx events
+  TracedCallback<Ptr<const Packet> > m_txTrace;
 };
 
 } // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/common/ascii-writer.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,89 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2009 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Guillaume Seguin <guillaume@segu.in>
+ */
+#include "ascii-writer.h"
+
+#include "ns3/log.h"
+#include "ns3/simulator.h"
+#include "ns3/simulation-singleton.h"
+#include "ns3/packet.h"
+
+#include <fstream>
+#include <map>
+
+
+NS_LOG_COMPONENT_DEFINE ("AsciiWriter");
+
+namespace ns3 {
+
+typedef std::map<std::ostream*, Ptr<AsciiWriter> > AsciiWritersMap;
+
+Ptr<AsciiWriter>
+AsciiWriter::Get (std::ostream &os)
+{
+  AsciiWritersMap *map = SimulationSingleton<AsciiWritersMap>::Get ();
+  Ptr<AsciiWriter> writer = (*map)[&os];
+  if (writer == 0)
+    {
+      // don't call Create<> because constructor is private
+      writer = Ptr<AsciiWriter> (new AsciiWriter (&os), false);
+      (*map)[&os] = writer;
+    }
+  return writer;
+}
+
+AsciiWriter::AsciiWriter (std::ostream *os)
+  : m_writer (os)
+{
+  NS_LOG_FUNCTION (this);
+}
+
+AsciiWriter::~AsciiWriter (void)
+{
+  NS_LOG_FUNCTION (this);
+}
+
+void
+AsciiWriter::WritePacket (enum Type type, std::string message, Ptr<const Packet> packet)
+{
+  std::string typeString;
+  switch (type)
+    {
+    case ENQUEUE:
+      typeString = "+";
+      break;
+    case DEQUEUE:
+      typeString = "-";
+      break;
+    case RX:
+      typeString = "r";
+      break;
+    case TX:
+      typeString = "t";
+      break;
+    case DROP:
+      typeString = "d";
+      break;
+    }
+  NS_LOG_FUNCTION (this << typeString << message);
+  *m_writer << typeString << " " << Simulator::Now ().GetSeconds () << " "
+            << message << " " << *packet << std::endl;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/common/ascii-writer.h	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,67 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2009 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Guillaume Seguin <guilla...@segu.in>
+ */
+
+#ifndef ASCII_WRITER_H
+#define ASCII_WRITER_H
+
+#include <stdint.h>
+#include <ostream>
+#include "ns3/ref-count-base.h"
+#include "ns3/ptr.h"
+
+namespace ns3 {
+
+class Packet;
+
+/**
+ * \ingroup common
+ *
+ * \brief Ascii output
+ */
+class AsciiWriter : public RefCountBase
+{
+public:
+  static Ptr<AsciiWriter> Get (std::ostream &os);
+
+  enum Type {
+    ENQUEUE,
+    DEQUEUE,
+    DROP,
+    TX,
+    RX
+  };
+
+  ~AsciiWriter (void);
+
+  /**
+   * Writes a message in the output file, checking if the files will
+   * need to be reordered.
+   */
+  void WritePacket (enum Type type, std::string message, Ptr<const Packet> p);
+
+private:
+  AsciiWriter (std::ostream *os);
+
+  std::ostream *m_writer;
+};
+
+} // namespace ns3
+
+#endif /* ASCII_WRITER_H */
--- a/src/common/buffer.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/common/buffer.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -20,6 +20,7 @@
 #include "buffer.h"
 #include "ns3/assert.h"
 #include "ns3/log.h"
+#include "ns3/fatal-error.h"
 #include <iostream>
 
 NS_LOG_COMPONENT_DEFINE ("Buffer");
@@ -646,25 +647,25 @@
 void
 Buffer::CopyData(std::ostream *os, uint32_t size) const
 {
-  if (size == GetSize ())
+  if (size > 0)
     {
-      // fast path
-      os->write((const char*)(m_data->m_data + m_start), m_zeroAreaStart-m_start);
-      char zero = 0;
-      for (uint32_t i = 0; i < m_zeroAreaEnd - m_zeroAreaStart; ++i)
-        {
-          os->write (&zero, 1);
-        }
-      os->write ((const char*)(m_data->m_data + m_zeroAreaStart), m_end - m_zeroAreaEnd);
-    }
-  else
-    {
-      // slow path
-      Buffer::Iterator i = Begin ();
-      while (!i.IsEnd () && size > 0)
-        {
-          char byte = i.ReadU8 ();
-          os->write (&byte, 1);
+      uint32_t tmpsize = std::min (m_zeroAreaStart-m_start, size);
+      os->write((const char*)(m_data->m_data + m_start), tmpsize);
+      if (size > tmpsize) 
+        { 
+          size -= m_zeroAreaStart-m_start;
+          tmpsize = std::min (m_zeroAreaEnd - m_zeroAreaStart, size);
+          char zero = 0;
+          for (uint32_t i = 0; i < tmpsize; ++i)
+            {
+              os->write (&zero, 1);
+            }
+          if (size > tmpsize)
+            {
+              size -= tmpsize;
+              tmpsize = std::min (m_end - m_zeroAreaEnd, size);
+              os->write ((const char*)(m_data->m_data + m_zeroAreaStart), tmpsize); 
+            }
         }
     }
 }
--- a/src/common/buffer.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/common/buffer.h	Tue Aug 18 12:01:35 2009 +0400
@@ -487,6 +487,12 @@
   int32_t GetCurrentStartOffset (void) const;
   int32_t GetCurrentEndOffset (void) const;
 
+  /** 
+   * Copy the specified amount of data from the buffer to the given output stream.
+   * 
+   * @param os the output stream
+   * @param size the maximum amount of bytes to copy. If zero, nothing is copied.
+   */
   void CopyData (std::ostream *os, uint32_t size) const;
 
   Buffer (Buffer const &o);
--- a/src/common/pcap-writer.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/common/pcap-writer.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -29,6 +29,7 @@
 #include "ns3/assert.h"
 #include "ns3/abort.h"
 #include "ns3/simulator.h"
+#include "ns3/uinteger.h"
 #include "pcap-writer.h"
 #include "packet.h"
 
@@ -36,6 +37,8 @@
 
 namespace ns3 {
 
+NS_OBJECT_ENSURE_REGISTERED (PcapWriter);
+
 enum {
   PCAP_ETHERNET = 1,
   PCAP_PPP      = 9,
@@ -45,6 +48,21 @@
   PCAP_80211_RADIOTAP  = 127,
 };
 
+TypeId 
+PcapWriter::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::PcapWriter")
+    .SetParent<Object> ()
+    .AddConstructor<PcapWriter> ()
+    .AddAttribute ("CaptureSize",
+                   "Number of bytes to capture at the start of each packet written in the pcap file. Zero means capture all bytes.",
+                   UintegerValue (0),
+                   MakeUintegerAccessor (&PcapWriter::m_captureSize),
+                   MakeUintegerChecker<uint32_t> ())
+    ;
+  return tid;
+}
+
 PcapWriter::PcapWriter ()
 {
   NS_LOG_FUNCTION (this);
@@ -162,14 +180,23 @@
       uint64_t us = current % 1000000;
       Write32 (s & 0xffffffff);
       Write32 (us & 0xffffffff);
-      Write32 (packet->GetSize ());
-      Write32 (packet->GetSize ());
-      packet->CopyData (m_writer, packet->GetSize ());
+      uint32_t thisCaptureSize;
+      if (m_captureSize == 0)
+        {
+          thisCaptureSize = packet->GetSize ();
+        }
+      else
+        {
+          thisCaptureSize = std::min (m_captureSize, packet->GetSize ());         
+        }          
+      Write32 (thisCaptureSize); 
+      Write32 (packet->GetSize ()); // actual packet size
+      packet->CopyData (m_writer, thisCaptureSize);
     }
 }
 
 
-void PcapWriter::WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, 
+void PcapWriter::WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber,                                        
                                         uint32_t rate, bool isShortPreamble, bool isTx, 
                                         double signalDbm, double noiseDbm)
 {  
@@ -203,7 +230,10 @@
   // real devices (e.g. madwifi) handle this case, especially for TX
   // packets (radiotap specs says TSFT is not used for TX packets,
   // but madwifi actually uses it).
-  uint64_t tsft = current;      
+  uint64_t tsft = current;    
+
+  
+  uint32_t wifiMonitorHeaderSize;  
     
   if (m_pcapMode == PCAP_80211_PRISM)
     {
@@ -226,10 +256,17 @@
 #define PRISM_ITEM_LENGTH       4
 
 
-
-      uint32_t size = packet->GetSize () + PRISM_MSG_LENGTH;
-      Write32 (size); // total packet size
-      Write32 (size); // captured size
+      wifiMonitorHeaderSize = PRISM_MSG_LENGTH;
+      if (m_captureSize == 0)
+        {
+          Write32 (packet->GetSize () + wifiMonitorHeaderSize); // captured size == actual packet size
+        }
+      else
+        {
+          uint32_t thisCaptureSize = std::min (m_captureSize, packet->GetSize () + wifiMonitorHeaderSize);         
+          Write32 (thisCaptureSize); 
+        }
+      Write32 (packet->GetSize () + wifiMonitorHeaderSize); // actual packet size
 
       Write32(PRISM_MSG_CODE);
       Write32(PRISM_MSG_LENGTH);
@@ -251,10 +288,8 @@
 
       Write32(PRISM_DID_CHANNEL);
       Write16(PRISM_STATUS_PRESENT);
-      Write16(PRISM_ITEM_LENGTH); 
-      // convert from frequency to channel number. This conversion is
-      // correct only for IEEE 802.11b/g channels 1-13.
-      Write32((2437 - 2407) / 5);
+      Write16(PRISM_ITEM_LENGTH);             
+      Write32((uint32_t) channelNumber);
 
       Write32(PRISM_DID_RSSI);
       Write16(PRISM_STATUS_PRESENT);
@@ -335,32 +370,44 @@
 #define	RADIOTAP_FLAG_DATAPAD	   0x20	
 #define	RADIOTAP_FLAG_BADFCS	   0x40	
 
-#define	RADIOTAP_CHANNEL_TURBO	  0x0010
-#define	RADIOTAP_CHANNEL_CCK	  0x0020
-#define	RADIOTAP_CHANNEL_OFDM	  0x0040
-#define	RADIOTAP_CHANNEL_2GHZ	  0x0080
-#define	RADIOTAP_CHANNEL_5GHZ	  0x0100
-#define	RADIOTAP_CHANNEL_PASSIVE  0x0200
-#define	RADIOTAP_CHANNEL_DYN	  0x0400
-#define	RADIOTAP_CHANNEL_GFSK	  0x0800
+#define	RADIOTAP_CHANNEL_TURBO	         0x0010
+#define	RADIOTAP_CHANNEL_CCK	         0x0020
+#define	RADIOTAP_CHANNEL_OFDM	         0x0040
+#define	RADIOTAP_CHANNEL_2GHZ	         0x0080
+#define	RADIOTAP_CHANNEL_5GHZ	         0x0100
+#define	RADIOTAP_CHANNEL_PASSIVE         0x0200
+#define	RADIOTAP_CHANNEL_DYN_CCK_OFDM    0x0400
+#define	RADIOTAP_CHANNEL_GFSK	         0x0800
+#define	RADIOTAP_CHANNEL_GSM             0x1000
+#define	RADIOTAP_CHANNEL_STATIC_TURBO    0x2000
+#define	RADIOTAP_CHANNEL_HALF_RATE       0x4000
+#define	RADIOTAP_CHANNEL_QUARTER_RATE    0x8000
 
 #define RADIOTAP_RX_PRESENT (RADIOTAP_TSFT | RADIOTAP_FLAGS | RADIOTAP_RATE | RADIOTAP_CHANNEL | RADIOTAP_DBM_ANTSIGNAL | RADIOTAP_DBM_ANTNOISE)
 #define RADIOTAP_RX_LENGTH (8+8+1+1+2+2+1+1)
 
 #define RADIOTAP_TX_PRESENT (RADIOTAP_TSFT | RADIOTAP_FLAGS  | RADIOTAP_RATE | RADIOTAP_CHANNEL)
 #define RADIOTAP_TX_LENGTH (8+8+1+1+2+2)
-
-      uint32_t size;
+      
       if (isTx)
         {
-          size = packet->GetSize () + RADIOTAP_TX_LENGTH;
+          wifiMonitorHeaderSize = RADIOTAP_TX_LENGTH;
         }
       else
         {
-          size = packet->GetSize () + RADIOTAP_RX_LENGTH;
+          wifiMonitorHeaderSize = RADIOTAP_RX_LENGTH;
+        }      
+
+      if (m_captureSize == 0)
+        {
+          Write32 (packet->GetSize () + wifiMonitorHeaderSize); // captured size == actual packet size
         }
-      Write32 (size); // total packet size
-      Write32 (size); // captured size
+      else
+        {
+          uint32_t thisCaptureSize = std::min (m_captureSize, packet->GetSize () + wifiMonitorHeaderSize);         
+          Write32 (thisCaptureSize); 
+        }
+      Write32 (packet->GetSize () + wifiMonitorHeaderSize); // actual packet size
 
       Write8(0); // radiotap version
       Write8(0); // padding
@@ -388,12 +435,24 @@
 
       Write8(rate); 
 
-      Write16((uint16_t) 2437); 
-
-      // we might want to make this setting depend on the WifiMode and
-      // on the ChannelFrequency at some time in the future. But for now
-      // I think a fixed setting is more than enough for most purposes.
-      Write16(RADIOTAP_CHANNEL_OFDM | RADIOTAP_CHANNEL_2GHZ); 
+      Write16(channelFreqMhz); 
+      
+      uint16_t channelFlags;
+      if (channelFreqMhz < 2500)
+        {
+          // TODO: when 802.11g WifiModes will be implemented
+          // we will need to check dinamically whether channelFlags
+          // needs to be set to RADIOTAP_CHANNEL_CCK,
+          // RADIOTAP_CHANNEL_DYN or RADIOTAP_CHANNEL_OFDM.          
+          channelFlags = RADIOTAP_CHANNEL_2GHZ | RADIOTAP_CHANNEL_CCK;
+        }
+      else
+        {
+          // TODO: we should handle correctly the case of half rate
+          // (10 MHz channel) and quarter rate (5 Mhz channel). 
+          channelFlags = RADIOTAP_CHANNEL_5GHZ | RADIOTAP_CHANNEL_OFDM;
+        }                
+      Write16(channelFlags); 
     
       if (!isTx)
         {
@@ -412,11 +471,23 @@
     }    
 
   // finally, write rest of packet
-  packet->CopyData (m_writer, packet->GetSize ());
+  if (m_captureSize == 0)
+    {
+      packet->CopyData (m_writer, packet->GetSize ());
+    }
+  else
+    {
+      packet->CopyData (m_writer, m_captureSize - wifiMonitorHeaderSize);      
+    }
+
 }
     
   
-
+void 
+PcapWriter::SetCaptureSize (uint32_t size)
+{
+  m_captureSize = size;
+}
 
 int8_t 
 PcapWriter::RoundToInt8 (double value)
--- a/src/common/pcap-writer.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/common/pcap-writer.h	Tue Aug 18 12:01:35 2009 +0400
@@ -22,7 +22,7 @@
 #define PCAP_WRITER_H
 
 #include <stdint.h>
-#include "ns3/ref-count-base.h"
+#include "ns3/object.h"
 
 namespace ns3 {
 
@@ -36,9 +36,10 @@
  * Log Packets to a file in pcap format which can be
  * read by pcap readers.
  */
-class PcapWriter : public RefCountBase
+class PcapWriter : public Object
 {
 public:
+  static TypeId GetTypeId (void);
   PcapWriter ();
   ~PcapWriter ();
 
@@ -116,6 +117,8 @@
    * transmitted. This is because it is possible to have the receiver
    * tuned on a given channel and still to be able to receive packets
    * on a nearby channel.
+   * @param channelNumber the channel number, as defined by the
+   * IEEE 802.11 standard. 
    * @param rate the PHY data rate in units of 500kbps (i.e., the same
    * units used both for the radiotap and for the prism header) 
    * @param isShortPreamble true if short preamble is used, false otherwise
@@ -124,11 +127,17 @@
    * @param signalDbm signal power in dBm
    * @param noiseDbm  noise power in dBm
    */
-  void WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, 
+  void WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz,  uint16_t channelNumber,
                               uint32_t rate, bool isShortPreamble, bool isTx, 
                               double signalDbm, double noiseDbm);
 
-
+  /** 
+   * Set the maximum number of bytes to be captured for each packet. 
+   * 
+   * @param size the maximum number of bytes to be captured. If zero
+   * (default), the whole packet will be captured. 
+   */
+  void SetCaptureSize (uint32_t size);
 
 
 private:
@@ -141,6 +150,8 @@
   int8_t RoundToInt8 (double value);
   std::ofstream *m_writer;
   uint32_t m_pcapMode;
+  uint32_t m_captureSize;
+  
 };
 
 } // namespace ns3
--- a/src/common/wscript	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/common/wscript	Tue Aug 18 12:01:35 2009 +0400
@@ -17,6 +17,7 @@
         'byte-tag-list.cc',
         'tag-buffer.cc',
         'packet-tag-list.cc',
+        'ascii-writer.cc',
         ]
 
     headers = bld.new_task_gen('ns3header')
@@ -35,4 +36,5 @@
         'byte-tag-list.h',
         'tag-buffer.h',
         'packet-tag-list.h',
+        'ascii-writer.h',
         ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/vector.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,108 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "vector.h"
+#include "ns3/fatal-error.h"
+#include <cmath>
+#include <sstream>
+
+namespace ns3 {
+
+ATTRIBUTE_HELPER_CPP (Vector3D);
+ATTRIBUTE_HELPER_CPP (Vector2D);
+  // compatibility for mobility code
+Ptr<const AttributeChecker> MakeVectorChecker (void)
+{
+  return MakeVector3DChecker ();
+}
+
+
+Vector3D::Vector3D (double _x, double _y, double _z)
+  : x (_x),
+    y (_y),
+    z (_z)
+{}
+
+Vector3D::Vector3D ()
+  : x (0.0),
+    y (0.0),
+    z (0.0)
+{}
+
+Vector2D::Vector2D (double _x, double _y)
+  : x (_x),
+    y (_y)
+{}
+
+Vector2D::Vector2D ()
+  : x (0.0),
+    y (0.0)
+{}
+
+double 
+CalculateDistance (const Vector3D &a, const Vector3D &b)
+{
+  double dx = b.x - a.x;
+  double dy = b.y - a.y;
+  double dz = b.z - a.z;
+  double distance = std::sqrt (dx * dx + dy * dy + dz * dz);
+  return distance;
+}
+double 
+CalculateDistance (const Vector2D &a, const Vector2D &b)
+{
+  double dx = b.x - a.x;
+  double dy = b.y - a.y;
+  double distance = std::sqrt (dx * dx + dy * dy);
+  return distance;
+}
+
+std::ostream &operator << (std::ostream &os, const Vector3D &vector)
+{
+  os << vector.x << ":" << vector.y << ":" << vector.z;
+  return os;
+}
+std::istream &operator >> (std::istream &is, Vector3D &vector)
+{
+  char c1, c2;
+  is >> vector.x >> c1 >> vector.y >> c2 >> vector.z;
+  if (c1 != ':' ||
+      c2 != ':')
+    {
+      is.setstate (std::ios_base::failbit);
+    }
+  return is;
+}
+std::ostream &operator << (std::ostream &os, const Vector2D &vector)
+{
+  os << vector.x << ":" << vector.y;
+  return os;
+}
+std::istream &operator >> (std::istream &is, Vector2D &vector)
+{
+  char c1;
+  is >> vector.x >> c1 >> vector.y;
+  if (c1 != ':')
+    {
+      is.setstate (std::ios_base::failbit);
+    }
+  return is;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/vector.h	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,126 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#ifndef NS3_VECTOR_H
+#define NS3_VECTOR_H
+
+#include "ns3/attribute.h"
+#include "ns3/attribute-helper.h"
+
+namespace ns3 {
+
+/**
+ * \brief a 3d vector
+ */
+class Vector3D
+{
+public:
+  /**
+   * \param _x x coordinate of vector
+   * \param _y y coordinate of vector
+   * \param _z z coordinate of vector
+   *
+   * Create vector (_x, _y, _z)
+   */
+  Vector3D (double _x, double _y, double _z);
+  /**
+   * Create vector (0.0, 0.0, 0.0)
+   */
+  Vector3D ();
+  /**
+   * x coordinate of vector
+   */
+  double x;
+  /**
+   * y coordinate of vector
+   */
+  double y;
+  /**
+   * z coordinate of vector
+   */
+  double z;
+};
+
+/**
+ * \brief a 3d vector
+ */
+class Vector2D
+{
+public:
+  /**
+   * \param _x x coordinate of vector
+   * \param _y y coordinate of vector
+   *
+   * Create vector (_x, _y)
+   */
+  Vector2D (double _x, double _y);
+  /**
+   * Create vector vector (0.0, 0.0)
+   */
+  Vector2D ();
+  /**
+   * x coordinate of vector
+   */
+  double x;
+  /**
+   * y coordinate of vector
+   */
+  double y;
+};
+
+/**
+ * \param a one point
+ * \param b another point
+ * \returns the cartesian distance between a and b.
+ */
+double CalculateDistance (const Vector3D &a, const Vector3D &b);
+
+/**
+ * \param a one point
+ * \param b another point
+ * \returns the cartesian distance between a and b.
+ */
+double CalculateDistance (const Vector2D &a, const Vector2D &b);
+
+/**
+ * \class ns3::Vector3DValue
+ * \brief hold objects of type ns3::Vector3D
+ */
+/**
+ * \class ns3::Vector2DValue
+ * \brief hold objects of type ns3::Vector2D
+ */
+ATTRIBUTE_HELPER_HEADER (Vector3D);
+ATTRIBUTE_HELPER_HEADER (Vector2D);
+
+std::ostream &operator << (std::ostream &os, const Vector3D &vector);
+std::istream &operator >> (std::istream &is, Vector3D &vector);
+std::ostream &operator << (std::ostream &os, const Vector2D &vector);
+std::istream &operator >> (std::istream &is, Vector2D &vector);
+
+// for compatibility with mobility models
+typedef Vector3D Vector;
+typedef Vector3DValue VectorValue;
+typedef Vector3DChecker VectorChecker;
+ATTRIBUTE_ACCESSOR_DEFINE(Vector);
+Ptr<const AttributeChecker> MakeVectorChecker (void);
+
+} // namespace ns3
+
+#endif /* NS3_VECTOR_H */
--- a/src/core/wscript	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/core/wscript	Tue Aug 18 12:01:35 2009 +0400
@@ -78,6 +78,7 @@
         'config.cc',
         'callback.cc',
         'names.cc',
+        'vector.cc',
         ]
 
     headers = bld.new_task_gen('ns3header')
@@ -123,6 +124,7 @@
         'deprecated.h',
         'abort.h',
         'names.h',
+        'vector.h',
         ]
 
     if sys.platform == 'win32':
--- a/src/devices/wifi/adhoc-wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/adhoc-wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -47,9 +47,8 @@
     .AddConstructor<AdhocWifiMac> ()
     .AddAttribute ("DcaTxop", "The DcaTxop object",
                    PointerValue (),
-                   MakePointerAccessor (&AdhocWifiMac::GetDcaTxop,
-                                        &AdhocWifiMac::SetDcaTxop),
-                   MakePointerChecker<DcaTxop> ())
+                   MakePointerAccessor (&AdhocWifiMac::GetDcaTxop),
+                   MakePointerChecker<DcaTxop> ()) 
   .AddTraceSource ( "TxOkHeader",
                     "The header of successfully transmitted packet",
                     MakeTraceSourceAccessor (
@@ -75,6 +74,11 @@
 
   m_dcfManager = new DcfManager ();
   m_dcfManager->SetupLowListener (m_low);
+
+  m_dca = CreateObject<DcaTxop> ();
+  m_dca->SetLow (m_low);
+  m_dca->SetManager (m_dcfManager);
+  m_dca->SetTxFailedCallback (MakeCallback (&AdhocWifiMac::TxFailed, this));
 }
 AdhocWifiMac::~AdhocWifiMac ()
 {}
@@ -262,13 +266,27 @@
   return m_dca;
 }
 
-void
-AdhocWifiMac::SetDcaTxop (Ptr<DcaTxop> dcaTxop)
+void 
+AdhocWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
 {
-  m_dca = dcaTxop;
-  m_dca->SetLow (m_low);
-  m_dca->SetManager (m_dcfManager);
-  m_dca->SetTxFailedCallback (MakeCallback (&AdhocWifiMac::TxFailed, this));
+  switch (standard)
+    {
+    case WIFI_PHY_STANDARD_holland:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_10Mhz: 
+      // fall through
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      // fall through
+    case WIFI_PHY_STANDARD_80211a:
+      ConfigureDcf (m_dca, 15, 1023, AC_BE_NQOS);
+      break;
+    case WIFI_PHY_STANDARD_80211b:
+      ConfigureDcf (m_dca, 31, 1023, AC_BE_NQOS);
+      break;
+    default:
+      NS_ASSERT (false);
+      break;
+    }
 }
 void
 AdhocWifiMac::TxOk (const WifiMacHeader &hdr)
--- a/src/devices/wifi/adhoc-wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/adhoc-wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -87,10 +87,9 @@
   AdhocWifiMac (const AdhocWifiMac & ctor_arg);
   AdhocWifiMac &operator = (const AdhocWifiMac &o);
   Ptr<DcaTxop> GetDcaTxop(void) const;
-  void SetDcaTxop (Ptr<DcaTxop> dcaTxop);
   void TxOk (WifiMacHeader const &hdr);
   void TxFailed (WifiMacHeader const &hdr);
-
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard);
   Ptr<DcaTxop> m_dca;
   Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> m_upCallback;
   Ptr<WifiRemoteStationManager> m_stationManager;
--- a/src/devices/wifi/dca-txop.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/dca-txop.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -101,21 +101,6 @@
   static TypeId tid = TypeId ("ns3::DcaTxop")
     .SetParent<Object> ()
     .AddConstructor<DcaTxop> ()
-    .AddAttribute ("MinCw", "The minimum value of the contention window.",
-                   UintegerValue (15),
-                   MakeUintegerAccessor (&DcaTxop::SetMinCw,
-                                         &DcaTxop::GetMinCw),
-                   MakeUintegerChecker<uint32_t> ())
-    .AddAttribute ("MaxCw", "The maximum value of the contention window.",
-                   UintegerValue (1023),
-                   MakeUintegerAccessor (&DcaTxop::SetMaxCw,
-                                         &DcaTxop::GetMaxCw),
-                   MakeUintegerChecker<uint32_t> ())
-    .AddAttribute ("Aifsn", "The AIFSN: the default value conforms to simple DCA.",
-                   UintegerValue (2),
-                   MakeUintegerAccessor (&DcaTxop::SetAifsn,
-                                         &DcaTxop::GetAifsn),
-                   MakeUintegerChecker<uint32_t> ())
     ;
   return tid;
 }
--- a/src/devices/wifi/dca-txop.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/dca-txop.h	Tue Aug 18 12:01:35 2009 +0400
@@ -29,6 +29,7 @@
 #include "wifi-mac-header.h"
 #include "wifi-mode.h"
 #include "wifi-remote-station-manager.h"
+#include "dcf.h"
 
 namespace ns3 {
 
@@ -62,7 +63,7 @@
  * The rts/cts policy is similar to the fragmentation policy: when
  * a packet is bigger than a threshold, the rts/cts protocol is used.
  */
-class DcaTxop : public Object
+class DcaTxop : public Dcf
 {
 public:
   static TypeId GetTypeId (void);
@@ -90,12 +91,12 @@
 
   void SetMaxQueueSize (uint32_t size);
   void SetMaxQueueDelay (Time delay);
-  void SetMinCw (uint32_t minCw);
-  void SetMaxCw (uint32_t maxCw);
-  void SetAifsn (uint32_t aifsn);
-  uint32_t GetMinCw (void) const;
-  uint32_t GetMaxCw (void) const;
-  uint32_t GetAifsn (void) const;
+  virtual void SetMinCw (uint32_t minCw);
+  virtual void SetMaxCw (uint32_t maxCw);
+  virtual void SetAifsn (uint32_t aifsn);
+  virtual uint32_t GetMinCw (void) const;
+  virtual uint32_t GetMaxCw (void) const;
+  virtual uint32_t GetAifsn (void) const;
 
   /**
    * \param packet packet to send
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/dcf.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,51 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2005 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as 
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+#include "dcf.h"
+#include "ns3/uinteger.h"
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (Dcf);
+
+TypeId 
+Dcf::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::Dcf")
+    .SetParent<Object> ()
+    .AddAttribute ("MinCw", "The minimum value of the contention window.",
+                   UintegerValue (15),
+                   MakeUintegerAccessor (&Dcf::SetMinCw,
+                                         &Dcf::GetMinCw),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("MaxCw", "The maximum value of the contention window.",
+                   UintegerValue (1023),
+                   MakeUintegerAccessor (&Dcf::SetMaxCw,
+                                         &Dcf::GetMaxCw),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("Aifsn", "The AIFSN: the default value conforms to simple DCA.",
+                   UintegerValue (2),
+                   MakeUintegerAccessor (&Dcf::SetAifsn,
+                                         &Dcf::GetAifsn),
+                   MakeUintegerChecker<uint32_t> ())
+    ;
+  return tid;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/dcf.h	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,43 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2005 INRIA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as 
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+
+#ifndef DCF_H
+#define DCF_H
+
+#include "ns3/object.h"
+
+namespace ns3 {
+
+class Dcf : public Object
+{
+ public:
+  static TypeId GetTypeId (void);
+
+  virtual void SetMinCw (uint32_t minCw) = 0;
+  virtual void SetMaxCw (uint32_t maxCw) = 0;
+  virtual void SetAifsn (uint32_t aifsn) = 0;
+  virtual uint32_t GetMinCw (void) const = 0;
+  virtual uint32_t GetMaxCw (void) const = 0;
+  virtual uint32_t GetAifsn (void) const = 0;
+};
+
+} // namespace ns3
+
+#endif /* DCF_H */
--- a/src/devices/wifi/edca-txop-n.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/edca-txop-n.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -98,21 +98,6 @@
   static TypeId tid = TypeId ("ns3::EdcaTxopN")
     .SetParent<Object> ()
     .AddConstructor<EdcaTxopN> ()
-    .AddAttribute ("MinCw", "The minimun value of the contention window.",
-                   UintegerValue (31),
-                   MakeUintegerAccessor (&EdcaTxopN::SetMinCw,
-                                         &EdcaTxopN::GetMinCw),
-                   MakeUintegerChecker<uint32_t> ())
-    .AddAttribute ("MaxCw", "The maximum value of the contention window.",
-                   UintegerValue (1023),
-                   MakeUintegerAccessor (&EdcaTxopN::SetMaxCw,
-                                         &EdcaTxopN::GetMaxCw),
-                   MakeUintegerChecker<uint32_t> ())
-    .AddAttribute ("Aifsn", "The AIFSN: the default value conforms to simple DCA.",
-                   UintegerValue (3),
-                   MakeUintegerAccessor (&EdcaTxopN::SetAifsn,
-                                         &EdcaTxopN::GetAifsn),
-                   MakeUintegerChecker<uint32_t> ())
     ;
   return tid;
 }
--- a/src/devices/wifi/edca-txop-n.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/edca-txop-n.h	Tue Aug 18 12:01:35 2009 +0400
@@ -30,6 +30,7 @@
 #include "wifi-mac.h"
 #include "wifi-mac-header.h"
 #include "qos-utils.h"
+#include "dcf.h"
 
 #include <map>
 #include <list>
@@ -62,7 +63,7 @@
   ADHOC_STA
 };
 
-class EdcaTxopN : public Object
+class EdcaTxopN : public Dcf
 {
 public:
 
@@ -85,12 +86,12 @@
 
   void SetMaxQueueSize (uint32_t size);
   void SetMaxQueueDelay (Time delay);
-  void SetMinCw (uint32_t minCw);
-  void SetMaxCw (uint32_t maxCw);
-  void SetAifsn (uint32_t aifsn);
-  uint32_t GetMinCw (void) const;
-  uint32_t GetMaxCw (void) const;
-  uint32_t GetAifsn (void) const;
+  virtual void SetMinCw (uint32_t minCw);
+  virtual void SetMaxCw (uint32_t maxCw);
+  virtual void SetAifsn (uint32_t aifsn);
+  virtual uint32_t GetMinCw (void) const;
+  virtual uint32_t GetMaxCw (void) const;
+  virtual uint32_t GetAifsn (void) const;
 
   Ptr<MacLow> Low (void);
   Ptr<MsduAggregator> GetMsduAggregator (void) const;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/minstrel-wifi-manager.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,720 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2009 Duy Nguyen 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Duy Nguyen <duy@soe.ucsc.edu>
+ * 
+ * Some Comments: 
+ * 
+ * 1) Segment Size is declared for completeness but not used  because it has 
+ *    to do more with the requirement of the specific hardware.
+ *
+ * 2) By default, Minstrel applies the multi-rate retry(the core of Minstrel 
+ *    algorithm). Otherwise, please use ConstantRateWifiManager instead.
+ *
+ * http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/minstrel
+ */
+
+
+
+#include "minstrel-wifi-manager.h"
+#include "wifi-phy.h"
+#include "ns3/random-variable.h"
+#include "ns3/simulator.h"
+#include "ns3/log.h"
+#include "ns3/uinteger.h"
+#include "ns3/double.h"
+#include "ns3/wifi-mac.h"
+#include "ns3/assert.h"
+#include <vector>
+
+NS_LOG_COMPONENT_DEFINE ("MinstrelWifiManager");
+
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (MinstrelWifiManager);
+
+TypeId
+MinstrelWifiManager::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::MinstrelWifiManager")
+    .SetParent<WifiRemoteStationManager> ()
+    .AddConstructor<MinstrelWifiManager> ()
+    .AddAttribute ("UpdateStatistics",
+                   "The interval between updating statistics table ",
+                   TimeValue (Seconds (0.1)),
+                   MakeTimeAccessor (&MinstrelWifiManager::m_updateStats),
+                   MakeTimeChecker ())
+    .AddAttribute ("LookAroundRate", 
+                   "the percentage to try other rates",
+                   DoubleValue (10),
+                   MakeDoubleAccessor (&MinstrelWifiManager::m_lookAroundRate),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("EWMA", 
+                   "EWMA level",
+                   DoubleValue (75),
+                   MakeDoubleAccessor (&MinstrelWifiManager::m_ewmaLevel),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("SegmentSize",
+                   "The largest allowable segment size packet",
+                   DoubleValue (6000),
+                   MakeDoubleAccessor (&MinstrelWifiManager::m_segmentSize),
+                   MakeDoubleChecker <double> ())
+    .AddAttribute ("SampleColumn",
+                   "The number of columns used for sampling",
+                   DoubleValue (10),
+                   MakeDoubleAccessor (&MinstrelWifiManager::m_sampleCol),
+                   MakeDoubleChecker <double> ())
+    .AddAttribute ("PacketLength",
+                   "The packet length used for calculating mode TxTime",
+                   DoubleValue (1200),
+                   MakeDoubleAccessor (&MinstrelWifiManager::m_pktLen),
+                   MakeDoubleChecker <double> ())
+    ;
+  return tid;
+}
+
+MinstrelWifiManager::MinstrelWifiManager ()
+{}
+
+MinstrelWifiManager::~MinstrelWifiManager ()
+{}
+
+void
+MinstrelWifiManager::SetupPhy (Ptr<WifiPhy> phy)
+{
+  uint32_t nModes = phy->GetNModes ();
+  for (uint32_t i = 0; i < nModes; i++)
+    {
+      WifiMode mode = phy->GetMode (i);
+      AddCalcTxTime (mode, phy->CalculateTxDuration (m_pktLen, mode, WIFI_PREAMBLE_LONG));
+    }
+  WifiRemoteStationManager::SetupPhy (phy);
+}
+
+WifiRemoteStation *
+MinstrelWifiManager::CreateStation (void)
+{
+  return new MinstrelWifiRemoteStation (this);
+}
+
+Time
+MinstrelWifiManager::GetCalcTxTime (WifiMode mode) const
+{
+
+  for (TxTime::const_iterator i = m_calcTxTime.begin (); i != m_calcTxTime.end (); i++)
+    {
+      if (mode == i->second)
+        {
+          return i->first;
+        }
+    }
+  NS_ASSERT (false);
+  return Seconds (0);
+}
+
+void
+MinstrelWifiManager::AddCalcTxTime (WifiMode mode, Time t)
+{
+  m_calcTxTime.push_back (std::make_pair (t, mode));
+}
+
+MinstrelWifiRemoteStation::MinstrelWifiRemoteStation (Ptr<MinstrelWifiManager> stations)
+  :m_stations (stations),
+  m_nextStatsUpdate (Simulator::Now () + stations->m_updateStats),
+  m_col (0), 
+  m_index (0), 
+  m_maxTpRate (0), 
+  m_maxTpRate2 (0), 
+  m_maxProbRate (0),
+  m_packetCount (0), 
+  m_sampleCount (0), 
+  m_isSampling (false), 
+  m_sampleRate (0), 
+  m_sampleRateSlower (false),
+  m_currentRate (0),
+  m_shortRetry (0),
+  m_longRetry (0),
+  m_retry (0),
+  m_err (0),
+  m_txrate (0),
+  m_initialized (false)
+{}
+
+MinstrelWifiRemoteStation::~MinstrelWifiRemoteStation ()
+{}
+
+void 
+MinstrelWifiRemoteStation::CheckInit(void)
+{
+  if (!m_initialized)
+    {
+      m_minstrelTable  =  MinstrelRate(GetNSupportedModes ());
+      m_sampleTable = SampleRate(GetNSupportedModes (), std::vector<uint32_t> (m_stations->m_sampleCol));
+      InitSampleTable ();
+      RateInit ();
+      m_initialized = true;
+    }
+}
+
+void
+MinstrelWifiRemoteStation::DoReportRxOk (double rxSnr, WifiMode txMode)
+{
+  NS_LOG_DEBUG("DoReportRxOk m_txrate=" << m_txrate);
+}
+
+void
+MinstrelWifiRemoteStation::DoReportRtsFailed (void)
+{
+  NS_LOG_DEBUG("DoReportRtsFailed m_txrate=" << m_txrate);
+
+  m_shortRetry++;
+}
+
+void
+MinstrelWifiRemoteStation::DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr)
+{
+  NS_LOG_DEBUG ("self="<<this<<" rts ok");
+}
+
+void
+MinstrelWifiRemoteStation::DoReportFinalRtsFailed (void)
+{
+  UpdateRetry ();
+  m_err++;
+}
+
+void
+MinstrelWifiRemoteStation::DoReportDataFailed (void)
+{
+  CheckInit();
+
+  m_longRetry++;
+
+  NS_LOG_DEBUG ("DoReportDataFailed " << this << "\t rate " << m_txrate << "\tlongRetry \t" << m_longRetry);
+
+  /// for normal rate, we're not currently sampling random rates
+  if (!m_isSampling)
+    {
+      /// use best throughput rate
+      if( m_longRetry < m_minstrelTable[m_txrate].adjustedRetryCount)
+        {
+          ;  ///<  there's still a few retries left
+        }
+
+      /// use second best throughput rate
+      else if (m_longRetry <= (m_minstrelTable[m_txrate].adjustedRetryCount +  
+               m_minstrelTable[m_maxTpRate].adjustedRetryCount))
+        {
+          m_txrate = m_maxTpRate2;
+        }
+
+      /// use best probability rate
+      else if (m_longRetry <= (m_minstrelTable[m_txrate].adjustedRetryCount +  
+               m_minstrelTable[m_maxTpRate2].adjustedRetryCount + 
+               m_minstrelTable[m_maxTpRate].adjustedRetryCount))
+        {
+          m_txrate = m_maxProbRate;
+        }
+
+      /// use lowest base rate	
+      else if (m_longRetry > (m_minstrelTable[m_txrate].adjustedRetryCount +  
+               m_minstrelTable[m_maxTpRate2].adjustedRetryCount + 
+               m_minstrelTable[m_maxTpRate].adjustedRetryCount))
+        {
+          m_txrate = 0;
+        }
+    }
+
+  /// for look-around rate, we're currently sampling random rates
+  else
+    {
+      /// current sampling rate is slower than the current best rate
+      if (m_sampleRateSlower)
+        {
+          /// use best throughput rate
+          if (m_longRetry < m_minstrelTable[m_txrate].adjustedRetryCount)
+            {
+              ;	///<  there are a few retries left
+            }
+
+          ///	use random rate
+          else if (m_longRetry <= (m_minstrelTable[m_txrate].adjustedRetryCount + 
+                   m_minstrelTable[m_maxTpRate].adjustedRetryCount))
+            {
+              m_txrate = m_sampleRate;
+            }
+
+          /// use max probability rate
+          else if (m_longRetry <= (m_minstrelTable[m_txrate].adjustedRetryCount +  
+                   m_minstrelTable[m_sampleRate].adjustedRetryCount + 
+                   m_minstrelTable[m_maxTpRate].adjustedRetryCount ))
+            {
+              m_txrate = m_maxProbRate;
+            }
+
+          /// use lowest base rate
+          else if (m_longRetry > (m_minstrelTable[m_txrate].adjustedRetryCount +  
+                   m_minstrelTable[m_sampleRate].adjustedRetryCount + 
+                   m_minstrelTable[m_maxTpRate].adjustedRetryCount)) 
+            {
+              m_txrate = 0;
+            }
+        }
+
+        /// current sampling rate is better than current best rate 
+        else
+          {
+            /// use random rate
+            if (m_longRetry < m_minstrelTable[m_txrate].adjustedRetryCount)
+              {
+                ;  ///< keep using it
+              }
+
+            /// use the best rate
+            else if (m_longRetry <= m_minstrelTable[m_txrate].adjustedRetryCount + 
+                     m_minstrelTable[m_sampleRate].adjustedRetryCount)
+              {
+                m_txrate = m_maxTpRate;
+              }
+
+            /// use the best probability rate
+            else if (m_longRetry <= m_minstrelTable[m_txrate].adjustedRetryCount + 
+                     m_minstrelTable[m_maxTpRate].adjustedRetryCount +  
+                     m_minstrelTable[m_sampleRate].adjustedRetryCount)
+              {
+                m_txrate = m_maxProbRate;
+              }
+
+            /// use the lowest base rate
+            else if (m_longRetry > m_minstrelTable[m_txrate].adjustedRetryCount + 
+                     m_minstrelTable[m_maxTpRate].adjustedRetryCount +  
+                     m_minstrelTable[m_sampleRate].adjustedRetryCount) 
+              {
+                m_txrate = 0;
+              }
+          }
+    }
+}
+
+void
+MinstrelWifiRemoteStation::DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr)
+{
+  m_isSampling = false;
+  m_sampleRateSlower=false;
+
+  CheckInit ();
+
+  m_minstrelTable[m_txrate].numRateSuccess++;
+  m_minstrelTable[m_txrate].numRateAttempt++;
+	
+  UpdateRetry ();
+
+  m_minstrelTable[m_txrate].numRateAttempt += m_retry;
+  m_packetCount++;
+
+  if (GetNSupportedModes () >= 1)
+    {
+      m_txrate = FindRate ();
+    }
+}
+
+void
+MinstrelWifiRemoteStation::DoReportFinalDataFailed (void)
+{
+  NS_LOG_DEBUG ("DoReportFinalDataFailed m_txrate=" << m_txrate);
+
+  m_isSampling = false;
+  m_sampleRateSlower=false;
+
+  UpdateRetry ();
+
+  m_minstrelTable[m_txrate].numRateAttempt += m_retry;
+  m_err++;
+
+  if (GetNSupportedModes () >= 1)
+    {
+      m_txrate = FindRate ();
+    }
+}
+
+void
+MinstrelWifiRemoteStation::UpdateRetry (void)
+{
+  m_retry = m_shortRetry + m_longRetry;
+  m_shortRetry = 0;
+  m_longRetry = 0;
+}
+
+Ptr<WifiRemoteStationManager>
+MinstrelWifiRemoteStation::GetManager (void) const
+{
+  return m_stations;
+}
+
+WifiMode
+MinstrelWifiRemoteStation::DoGetDataMode (uint32_t size)
+{
+  UpdateStats ();
+  if (!m_initialized)
+    {
+      CheckInit ();
+
+      /// start the rate at half way
+      m_txrate = GetNSupportedModes () / 2;
+    }
+  return GetSupportedMode (m_txrate);
+}
+
+WifiMode
+MinstrelWifiRemoteStation::DoGetRtsMode (void)
+{
+  NS_LOG_DEBUG ("DoGetRtsMode m_txrate=" << m_txrate);
+
+  UpdateStats ();
+  return GetSupportedMode (0);
+}
+
+uint32_t 
+MinstrelWifiRemoteStation::GetNextSample ()
+{
+  uint32_t bitrate;
+  bitrate = m_sampleTable[m_index][m_col];
+  m_index++;
+
+  /// bookeeping for m_index and m_col variables
+  if (m_index > (GetNSupportedModes () -2)) 
+    {
+      m_index =0;
+      m_col++;
+      if (m_col >= m_stations->m_sampleCol)
+        {
+          m_col = 0;
+        }
+    }
+  return bitrate;
+}
+
+uint32_t
+MinstrelWifiRemoteStation::FindRate ()
+{
+  NS_LOG_DEBUG ("FindRate " << "packet=" << m_packetCount );
+
+  if ((m_sampleCount + m_packetCount) == 0)
+    {
+      return 0;
+    }
+
+
+  uint32_t idx;
+
+  /// for determining when to try a sample rate 
+  UniformVariable coinFlip (0, 100);
+
+  /**
+   * if we are below the target of look around rate percentage, look around
+   * note: do it randomly by flipping a coin instead sampling 
+   * all at once until it reaches the look around rate
+   */
+  if ( (((100* m_sampleCount) / (m_sampleCount + m_packetCount )) < m_stations->m_lookAroundRate) &&
+     ((int)coinFlip.GetValue ()) % 2 == 1 )
+    {
+
+      /// now go through the table and find an index rate
+      idx = GetNextSample	();
+			
+			
+      /**
+       * This if condition is used to make sure that we don't need to use
+       * the sample rate it is the same as our current rate
+       */
+      if (idx != m_maxTpRate && idx != m_txrate) 
+        {
+		
+          /// start sample count
+          m_sampleCount++;
+
+          /// set flag that we are currently sampling
+          m_isSampling = true;
+
+          /// bookeeping for resetting stuff
+          if (m_packetCount >= 10000) 
+            {
+              m_sampleCount = 0;
+              m_packetCount = 0;
+            }
+
+          /// error check
+          if (idx >= GetNSupportedModes	() || idx < 0 )
+            {
+              NS_LOG_DEBUG ("ALERT!!! ERROR");
+            }
+
+          /// set the rate that we're currently sampling
+          m_sampleRate = idx;
+
+          if (m_sampleRate == m_maxTpRate)
+            {
+              m_sampleRate = m_maxTpRate2;
+            }
+
+          /// is this rate slower than the current best rate
+          m_sampleRateSlower = (m_minstrelTable[idx].perfectTxTime > m_minstrelTable[m_maxTpRate].perfectTxTime);
+
+          /// using the best rate instead
+          if (m_sampleRateSlower)
+            {
+              idx =  m_maxTpRate;
+            }
+        }
+			
+    } 
+
+  ///	continue using the best rate
+  else
+    {
+      idx = m_maxTpRate; 
+    }
+
+
+  NS_LOG_DEBUG ("FindRate " << "sample rate=" << idx);
+
+  return idx;
+}
+
+void
+MinstrelWifiRemoteStation::UpdateStats ()
+{
+  if (Simulator::Now () <  m_nextStatsUpdate)
+    {
+      return;
+    }
+
+  NS_LOG_DEBUG ("Updating stats="<<this);
+
+  m_nextStatsUpdate = Simulator::Now () + m_stations->m_updateStats;
+
+  Time txTime;
+  uint32_t tempProb;
+
+  for (uint32_t i =0; i < GetNSupportedModes (); i++)
+    {        
+
+      /// calculate the perfect tx time for this rate
+      txTime = m_minstrelTable[i].perfectTxTime;       
+
+      /// just for initialization
+      if (txTime.GetMicroSeconds () == 0)
+        {
+          txTime = Seconds (1);
+        }
+
+      NS_LOG_DEBUG ("m_txrate=" << m_txrate << "\t attempt=" << m_minstrelTable[i].numRateAttempt << "\t success=" << m_minstrelTable[i].numRateSuccess);
+
+      /// if we've attempted something
+      if (m_minstrelTable[i].numRateAttempt)
+        {
+          /**
+           * calculate the probability of success
+           * assume probability scales from 0 to 18000
+           */
+          tempProb = (m_minstrelTable[i].numRateSuccess * 18000) / m_minstrelTable[i].numRateAttempt;
+
+          /// bookeeping
+          m_minstrelTable[i].successHist += m_minstrelTable[i].numRateSuccess;
+          m_minstrelTable[i].attemptHist += m_minstrelTable[i].numRateAttempt;
+          m_minstrelTable[i].prob = tempProb;
+
+          /// ewma probability (cast for gcc 3.4 compatibility)
+          tempProb = static_cast<uint32_t>(((tempProb * (100 - m_stations->m_ewmaLevel)) + (m_minstrelTable[i].ewmaProb * m_stations->m_ewmaLevel) )/100);
+
+          m_minstrelTable[i].ewmaProb = tempProb;
+
+          /// calculating throughput
+          m_minstrelTable[i].throughput = tempProb * (1000000 / txTime.GetMicroSeconds());
+
+        }
+
+      /// bookeeping
+      m_minstrelTable[i].prevNumRateAttempt= m_minstrelTable[i].numRateAttempt;
+      m_minstrelTable[i].prevNumRateSuccess = m_minstrelTable[i].numRateSuccess;
+      m_minstrelTable[i].numRateSuccess = 0;
+      m_minstrelTable[i].numRateAttempt = 0;
+
+      /// Sample less often below 10% and  above 95% of success
+      if ((m_minstrelTable[i].ewmaProb > 17100) || (m_minstrelTable[i].ewmaProb < 1800)) 
+        {
+          /**
+           * retry count denotes the number of retries permitted for each rate
+           * # retry_count/2
+           */
+          m_minstrelTable[i].adjustedRetryCount = m_minstrelTable[i].retryCount >> 1;
+          if (m_minstrelTable[i].adjustedRetryCount > 2)
+            {
+              m_minstrelTable[i].adjustedRetryCount = 2 ;
+            }
+        }
+      else
+        {
+          m_minstrelTable[i].adjustedRetryCount = m_minstrelTable[i].retryCount;
+        }
+
+      /// if it's 0 allow one retry limit
+      if (m_minstrelTable[i].adjustedRetryCount == 0)
+        {
+          m_minstrelTable[i].adjustedRetryCount = 1;
+        }
+    }
+
+
+  uint32_t max_prob = 0, index_max_prob =0, max_tp =0, index_max_tp=0, index_max_tp2=0;
+
+  /// go find max throughput, second maximum throughput, high probability succ
+  for (uint32_t i =0; i < GetNSupportedModes (); i++) 
+    {
+      NS_LOG_DEBUG ("throughput" << m_minstrelTable[i].throughput << "\n ewma" << m_minstrelTable[i].ewmaProb);
+
+      if (max_tp < m_minstrelTable[i].throughput) 
+        {
+          index_max_tp = i;
+          max_tp = m_minstrelTable[i].throughput;
+        }
+
+      if (max_prob < m_minstrelTable[i].ewmaProb) 
+        {
+          index_max_prob = i;
+          max_prob = m_minstrelTable[i].ewmaProb;
+        }
+    }
+
+
+  max_tp = 0;
+  /// find the second highest max
+  for (uint32_t i =0; i < GetNSupportedModes (); i++) 
+    {
+      if ((i != index_max_tp) && (max_tp < m_minstrelTable[i].throughput))
+        {
+          index_max_tp2 = i;
+          max_tp = m_minstrelTable[i].throughput;
+        }
+    }
+
+  m_maxTpRate = index_max_tp;
+  m_maxTpRate2 = index_max_tp2;
+  m_maxProbRate = index_max_prob;
+  m_currentRate = index_max_tp;
+
+  if (index_max_tp > m_txrate)
+    {
+      m_txrate= index_max_tp;
+    }
+
+  NS_LOG_DEBUG ("max tp="<< index_max_tp << "\nmax tp2="<< index_max_tp2<< "\nmax prob="<< index_max_prob);
+
+  /// reset it
+  RateInit ();
+}
+
+void
+MinstrelWifiRemoteStation::RateInit ()
+{
+  NS_LOG_DEBUG ("RateInit="<<this);
+
+  for (uint32_t i = 0; i < GetNSupportedModes (); i++)
+    {
+      m_minstrelTable[i].numRateAttempt = 0;
+      m_minstrelTable[i].numRateSuccess = 0;
+      m_minstrelTable[i].prob = 0;
+      m_minstrelTable[i].ewmaProb = 0;
+      m_minstrelTable[i].prevNumRateAttempt = 0;
+      m_minstrelTable[i].prevNumRateSuccess = 0;
+      m_minstrelTable[i].successHist = 0;
+      m_minstrelTable[i].attemptHist = 0;
+      m_minstrelTable[i].throughput = 0;
+      m_minstrelTable[i].perfectTxTime = m_stations->GetCalcTxTime (GetSupportedMode (i));
+      m_minstrelTable[i].retryCount =1;
+      m_minstrelTable[i].adjustedRetryCount =1;
+    }
+}
+
+void
+MinstrelWifiRemoteStation::InitSampleTable ()
+{
+  NS_LOG_DEBUG ("InitSampleTable="<<this);
+	
+  m_col = m_index = 0;
+
+  /// for off-seting to make rates fall between 0 and numrates 
+  uint32_t numSampleRates= GetNSupportedModes () - 1;
+
+  uint32_t newIndex;
+  for (uint32_t col = 0; col < m_stations->m_sampleCol; col++)
+    {
+      for (uint32_t i = 0; i < numSampleRates; i++ )
+        {
+
+          /**
+           * The next two lines basically tries to generate a random number
+           * between 0 and the number of available rates 
+           */
+          UniformVariable uv (0, numSampleRates);
+          newIndex = (i + (uint32_t)uv.GetValue	()) % numSampleRates;	
+
+          /// this loop is used for filling in other uninitilized places
+          while	(m_sampleTable[newIndex][col] != 0)
+            {
+              newIndex = (newIndex + 1)%GetNSupportedModes ();
+            }
+          m_sampleTable[newIndex][col] = i+1;
+
+        }
+    }
+}
+
+void
+MinstrelWifiRemoteStation::PrintSampleTable ()
+{
+  NS_LOG_DEBUG ("PrintSampleTable="<<this );
+
+  uint32_t numSampleRates= GetNSupportedModes ();
+  for (uint32_t i=0; i < numSampleRates; i++)
+    {
+      for (uint32_t j=0; j < m_stations->m_sampleCol; j++)
+        {
+          std::cout << m_sampleTable[i][j] << "\t";
+        }
+      std::cout << std::endl;
+    }
+}
+	
+void
+MinstrelWifiRemoteStation::PrintTable ()
+{
+  NS_LOG_DEBUG ("PrintTable="<<this);
+
+  for (uint32_t i=0; i < GetNSupportedModes (); i++)
+    {
+      std::cout << "index(" << i << ") = " << m_minstrelTable[i].perfectTxTime<< "\n";
+    }
+}
+
+} //namespace ns3
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/devices/wifi/minstrel-wifi-manager.h	Tue Aug 18 12:01:35 2009 +0400
@@ -0,0 +1,255 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* 
+ * Copyright (c) 2009 Duy Nguyen 
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * Author: Duy Nguyen <duy@soe.ucsc.edu> 
+ */
+
+
+
+#ifndef MINSTREL_WIFI_MANAGER_H
+#define MINSTREL_WIFI_MANAGER_H
+
+#include "wifi-remote-station-manager.h"
+#include "wifi-mode.h"
+#include "ns3/nstime.h"
+#include <vector>
+
+
+
+/**
+ * \author Duy Nguyen
+ * \brief Implementation of Minstrel Rate Control Algorithm 
+ *
+ * Porting Minstrel from Madwifi and Linux Kernel 
+ * http://linuxwireless.org/en/developers/Documentation/mac80211/RateControl/minstrel
+ */
+
+
+namespace ns3 {
+
+
+/**
+ * A struct to contain all information related to a data rate 
+ */
+struct RateInfo{
+
+  /**
+   * Perfect transmission time calculation, or frame calculation
+   * Given a bit rate and a packet length n bytes 
+   */
+  Time perfectTxTime;		
+
+
+  uint32_t retryCount;  ///< retry limit
+  uint32_t adjustedRetryCount;  ///< adjust the retry limit for this rate
+  uint32_t numRateAttempt;  ///< how many number of attempts so far
+  uint32_t numRateSuccess;  ///< number of successful pkts 
+  uint32_t prob;  ///< (# pkts success )/(# total pkts)
+
+  /**
+   * EWMA calculation
+   * ewma_prob =[prob *(100 - ewma_level) + (ewma_prob_old * ewma_level)]/100 
+   */
+  uint32_t ewmaProb;
+
+  uint32_t prevNumRateAttempt;  ///< from last rate
+  uint32_t prevNumRateSuccess;  ///< from last rate
+  uint64_t successHist;  ///< aggregate of all successes
+  uint64_t attemptHist;  ///< aggregate of all attempts
+  uint32_t throughput;  ///< throughput of a rate
+};
+
+/**
+ * Data structure for a Minstrel Rate table 
+ * A vector of a struct RateInfo 
+ */
+typedef std::vector<struct RateInfo> MinstrelRate;
+
+/**
+ * Data structure for a Sample Rate table
+ * A vector of a vector uint32_t 
+ */
+typedef std::vector<std::vector<uint32_t> > SampleRate;
+
+
+class MinstrelWifiManager : public WifiRemoteStationManager
+{
+
+public:
+  static TypeId GetTypeId (void);
+  MinstrelWifiManager ();
+  virtual ~MinstrelWifiManager();
+
+  virtual void SetupPhy (Ptr<WifiPhy> phy);
+
+  /// for estimating the TxTime of a packet with a given mode  
+  Time GetCalcTxTime (WifiMode mode) const;
+  void AddCalcTxTime (WifiMode mode, Time t);
+
+private:
+  friend class MinstrelWifiRemoteStation;
+  virtual class WifiRemoteStation *CreateStation (void);
+
+  typedef std::vector<std::pair<Time,WifiMode> > TxTime;
+
+  TxTime m_calcTxTime;  ///< to hold all the calculated TxTime for all modes
+  Time m_updateStats;  ///< how frequent do we calculate the stats(1/10 seconds)
+  double m_lookAroundRate;  ///< the % to try other rates than our current rate 
+  double m_ewmaLevel;  ///< exponential weighted moving average
+  uint32_t m_segmentSize;  ///< largest allowable segment size
+  uint32_t m_sampleCol;  ///< number of sample columns
+  uint32_t m_pktLen;  ///< packet length used  for calculate mode TxTime
+  
+};
+
+class MinstrelWifiRemoteStation : public WifiRemoteStation
+{
+public:
+  MinstrelWifiRemoteStation (Ptr<MinstrelWifiManager> stations);
+ 
+  virtual ~MinstrelWifiRemoteStation ();
+
+protected:
+
+  /** 
+   * when packet is successfully received
+   * see wifi-remote-station-manager.h for more documentation
+   */
+  virtual void DoReportRxOk (double rxSnr, WifiMode txMode);
+
+  /// when RTS timeout expires
+  virtual void DoReportRtsFailed (void);
+
+
+  /**
+   *
+   * Retry Chain table is implemented here
+   *
+   * Try |         LOOKAROUND RATE              | NORMAL RATE
+   *     | random < best    | random > best     |
+   * --------------------------------------------------------------
+   *  1  | Best throughput  | Random rate       | Best throughput
+   *  2  | Random rate      | Best throughput   | Next best throughput
+   *  3  | Best probability | Best probability  | Best probability
+   *  4  | Lowest Baserate  | Lowest baserate   | Lowest baserate
+   *
+   * Note: For clarity, multiple blocks of if's and else's are used
+   * After a failing 7 times, DoReportFinalDataFailed will be called
+   */
+  virtual void DoReportDataFailed (void);
+
+  /// when receive a CTS, associated with an RTS
+  virtual void DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr);
+
+  /// when an ACK, associated with a data pkt, is received
+  virtual void DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr);
+
+  /// after calling ReportRtsFailed if NeedRtsRetransmission returns false
+  virtual void DoReportFinalRtsFailed (void);
+
+  /// after calling ReportDataFailed if NeedDataRetransmission returns false
+  virtual void DoReportFinalDataFailed (void);
+
+
+private:
+  virtual Ptr<WifiRemoteStationManager> GetManager (void) const;
+
+  /** 
+   * returns the transmission mode for sending this packet
+   * this function gets called when node is getting ready to send DATA
+   * see wifi-remote-station-manager.h for more documentation
+   */
+  virtual WifiMode DoGetDataMode (uint32_t size);
+
+  /// returns the transmission mode for sending RTS packet
+  virtual WifiMode DoGetRtsMode (void);
+
+  /// update the number of retries and reset accordingly
+  void UpdateRetry (void);
+
+  /// getting the next sample from Sample Table
+  uint32_t GetNextSample (void);
+
+  /// find a rate to use from Minstrel Table
+  uint32_t FindRate (void);
+
+  /// updating the Minstrel Table every 1/10 seconds
+  void UpdateStats (void);
+
+  /// initialize Minstrel Table
+  void RateInit (void);
+
+  /// initialize Sample Table
+  void InitSampleTable (void);
+
+  /// printing Sample Table
+  void PrintSampleTable (void);
+
+  /// printing Minstrel Table
+  void PrintTable (void);
+
+  /**
+   * \param packet lenghth 
+   * \param current WifiMode
+   * \returns calcuated transmit duration 
+   */
+  Time CalcRatePacket (uint32_t, WifiMode);
+
+  void CheckInit(void);  ///< check for initializations
+
+  Ptr<MinstrelWifiManager> m_stations;
+
+  Time m_nextStatsUpdate;  ///< 10 times every second
+
+  MinstrelRate m_minstrelTable;  ///< minstrel table	
+
+  SampleRate m_sampleTable;  ///< sample table
+
+  /**
+   * To keep track of the current position in the our random sample table
+   * going row by row from 1st column until the 10th column(Minstrel defines 10)
+   * then we wrap back to the row 1 col 1.
+   * note: there are many other ways to do this.
+   */
+  uint32_t m_col, m_index;							
+
+  uint32_t m_maxTpRate;  ///< the current throughput rate 
+  uint32_t m_maxTpRate2;  ///< second highest throughput rate
+  uint32_t m_maxProbRate;  ///< rate with highest prob of success
+
+  int m_packetCount;  ///< total number of packets as of now
+  int m_sampleCount;  ///< how many packets we have sample so far
+
+  bool m_isSampling;  ///< a flag to indicate we are currently sampling
+  uint32_t m_sampleRate;  ///< current sample rate
+  bool 	m_sampleRateSlower;  ///< a flag to indicate sample rate is slower
+  uint32_t m_currentRate;  ///< current rate we are using
+
+  uint32_t m_shortRetry;  ///< short retries such as control packts
+  uint32_t m_longRetry;  ///< long retries such as data packets
+  uint32_t m_retry;  ///< total retries short + long
+  uint32_t m_err;  ///< retry errors
+  uint32_t m_txrate;  ///< current transmit rate
+
+  bool m_initialized;  ///< for initializing tables
+
+
+}; 
+
+}// namespace ns3
+
+#endif /* MINSTREL_WIFI_MANAGER_H */
--- a/src/devices/wifi/nqap-wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/nqap-wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -60,8 +60,7 @@
                    MakeBooleanChecker ())
     .AddAttribute ("DcaTxop", "The DcaTxop object",
                    PointerValue (),
-                   MakePointerAccessor (&NqapWifiMac::GetDcaTxop,
-                                        &NqapWifiMac::SetDcaTxop),
+                   MakePointerAccessor (&NqapWifiMac::GetDcaTxop),
                    MakePointerChecker<DcaTxop> ()) 
     ;
   return tid;
@@ -85,6 +84,12 @@
   m_beaconDca->SetMaxCw(0);
   m_beaconDca->SetLow (m_low);
   m_beaconDca->SetManager (m_dcfManager);
+
+  m_dca = CreateObject<DcaTxop> ();
+  m_dca->SetLow (m_low);
+  m_dca->SetManager (m_dcfManager);
+  m_dca->SetTxOkCallback (MakeCallback (&NqapWifiMac::TxOk, this));
+  m_dca->SetTxFailedCallback (MakeCallback (&NqapWifiMac::TxFailed, this));
 }
 NqapWifiMac::~NqapWifiMac ()
 {
@@ -565,14 +570,28 @@
   return m_dca;
 }
 
-void
-NqapWifiMac::SetDcaTxop (Ptr<DcaTxop> dcaTxop)
+void 
+NqapWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
 {
-  m_dca = dcaTxop;
-  m_dca->SetLow (m_low);
-  m_dca->SetManager (m_dcfManager);
-  m_dca->SetTxOkCallback (MakeCallback (&NqapWifiMac::TxOk, this));
-  m_dca->SetTxFailedCallback (MakeCallback (&NqapWifiMac::TxFailed, this));
+  switch (standard)
+    {
+    case WIFI_PHY_STANDARD_holland:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_10Mhz: 
+      // fall through
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      // fall through
+    case WIFI_PHY_STANDARD_80211a:
+      ConfigureDcf (m_dca, 15, 1023, AC_BE_NQOS);
+      break;
+    case WIFI_PHY_STANDARD_80211b:
+      ConfigureDcf (m_dca, 31, 1023, AC_BE_NQOS);
+      break;
+    default:
+      NS_ASSERT (false);
+      break;
+    }
 }
 
+
 } // namespace ns3
--- a/src/devices/wifi/nqap-wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/nqap-wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -115,7 +115,7 @@
   NqapWifiMac (const NqapWifiMac & ctor_arg);
   NqapWifiMac &operator = (const NqapWifiMac &o);
   Ptr<DcaTxop> GetDcaTxop (void) const;
-  void SetDcaTxop (Ptr<DcaTxop> dcaTxop);
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard);
 
   Ptr<DcaTxop> m_dca;
   Ptr<DcaTxop> m_beaconDca;
--- a/src/devices/wifi/nqsta-wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/nqsta-wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -89,8 +89,7 @@
                    MakeBooleanChecker ())
     .AddAttribute ("DcaTxop", "The DcaTxop object",
                    PointerValue (),
-                   MakePointerAccessor (&NqstaWifiMac::GetDcaTxop,
-                                        &NqstaWifiMac::SetDcaTxop),
+                   MakePointerAccessor (&NqstaWifiMac::GetDcaTxop),
                    MakePointerChecker<DcaTxop> ()) 
     .AddTraceSource ("Assoc", "Associated with an access point.",
                      MakeTraceSourceAccessor (&NqstaWifiMac::m_assocLogger))
@@ -115,6 +114,10 @@
 
   m_dcfManager = new DcfManager ();
   m_dcfManager->SetupLowListener (m_low);
+
+  m_dca = CreateObject<DcaTxop> ();
+  m_dca->SetLow (m_low);
+  m_dca->SetManager (m_dcfManager);
 }
 
 NqstaWifiMac::~NqstaWifiMac ()
@@ -208,13 +211,6 @@
 {
   return m_dca;
 }
-void
-NqstaWifiMac::SetDcaTxop (Ptr<DcaTxop> dcaTxop)
-{
-  m_dca = dcaTxop;
-  m_dca->SetLow (m_low);
-  m_dca->SetManager (m_dcfManager);
-}
 void 
 NqstaWifiMac::SetWifiPhy (Ptr<WifiPhy> phy)
 {
@@ -668,4 +664,27 @@
   m_state = value;
 }
 
+void 
+NqstaWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
+{
+  switch (standard)
+    {
+    case WIFI_PHY_STANDARD_holland:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_10Mhz: 
+      // fall through
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      // fall through
+    case WIFI_PHY_STANDARD_80211a:
+      ConfigureDcf (m_dca, 15, 1023, AC_BE_NQOS);
+      break;
+    case WIFI_PHY_STANDARD_80211b:
+      ConfigureDcf (m_dca, 31, 1023, AC_BE_NQOS);
+      break;
+    default:
+      NS_ASSERT (false);
+      break;
+    }
+}
+
 } // namespace ns3
--- a/src/devices/wifi/nqsta-wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/nqsta-wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -139,8 +139,8 @@
   NqstaWifiMac (const NqstaWifiMac & ctor_arg);
   NqstaWifiMac &operator = (const NqstaWifiMac & ctor_arg);
   Ptr<DcaTxop> GetDcaTxop(void) const;
-  void SetDcaTxop (Ptr<DcaTxop> dcaTxop);
   void SetState (enum MacState value);
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard);
 
   enum MacState m_state;
   Time m_probeRequestTimeout;
--- a/src/devices/wifi/qadhoc-wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qadhoc-wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -50,26 +50,22 @@
     .AddAttribute ("VO_EdcaTxopN",
                    "Queue that manages packets belonging to AC_VO access class",
                    PointerValue (),
-                   MakePointerAccessor(&QadhocWifiMac::GetVOQueue,
-                                       &QadhocWifiMac::SetVOQueue),
+                   MakePointerAccessor(&QadhocWifiMac::GetVOQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("VI_EdcaTxopN",
                    "Queue that manages packets belonging to AC_VI access class",
                    PointerValue (),
-                   MakePointerAccessor(&QadhocWifiMac::GetVIQueue,
-                                       &QadhocWifiMac::SetVIQueue),
+                   MakePointerAccessor(&QadhocWifiMac::GetVIQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("BE_EdcaTxopN",
                    "Queue that manages packets belonging to AC_BE access class",
                    PointerValue (),
-                   MakePointerAccessor(&QadhocWifiMac::GetBEQueue,
-                                       &QadhocWifiMac::SetBEQueue),
+                   MakePointerAccessor(&QadhocWifiMac::GetBEQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("BK_EdcaTxopN",
                    "Queue that manages packets belonging to AC_BK access class",
                    PointerValue (),
-                   MakePointerAccessor(&QadhocWifiMac::GetBKQueue,
-                                       &QadhocWifiMac::SetBKQueue),
+                   MakePointerAccessor(&QadhocWifiMac::GetBKQueue),
                    MakePointerChecker<EdcaTxopN> ())
     ;
   return tid;
@@ -88,6 +84,11 @@
 
   m_dcfManager = new DcfManager ();
   m_dcfManager->SetupLowListener (m_low);
+
+  SetQueue (AC_VO);
+  SetQueue (AC_VI);
+  SetQueue (AC_BE);
+  SetQueue (AC_BK);
 }
 
 QadhocWifiMac::~QadhocWifiMac ()
@@ -112,10 +113,9 @@
   m_beEdca = 0;
   m_bkEdca = 0;
   m_stationManager = 0;
-  std::map<AccessClass, Ptr<EdcaTxopN> >::iterator it = m_queues.begin ();
-  for (;it != m_queues.end (); it++)
+  for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i)
     {
-      it->second = 0;
+      (*i).second = 0;
     }
   WifiMac::DoDispose ();
 }
@@ -208,10 +208,10 @@
 {
   NS_LOG_FUNCTION (this << stationManager);
   m_stationManager = stationManager;
-  m_voEdca->SetWifiRemoteStationManager (stationManager);
-  m_viEdca->SetWifiRemoteStationManager (stationManager);
-  m_beEdca->SetWifiRemoteStationManager (stationManager);
-  m_bkEdca->SetWifiRemoteStationManager (stationManager);  
+  for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i)
+    {
+      (*i).second->SetWifiRemoteStationManager (stationManager);
+    }
   m_low->SetWifiRemoteStationManager (stationManager);
 }
 
@@ -373,69 +373,65 @@
 Ptr<EdcaTxopN>
 QadhocWifiMac::GetVOQueue (void) const
 {
-  return m_voEdca;
+  return m_queues.find (AC_VO)->second;
 }
 
 Ptr<EdcaTxopN>
 QadhocWifiMac::GetVIQueue (void) const
 {
-  return m_viEdca;
+  return m_queues.find (AC_VI)->second;
 }
 
 Ptr<EdcaTxopN>
 QadhocWifiMac::GetBEQueue (void) const
 {
-  return m_beEdca;
+  return m_queues.find (AC_BE)->second;
 }
 
 Ptr<EdcaTxopN>
 QadhocWifiMac::GetBKQueue (void) const
 {
-  return m_bkEdca;
-}
-
-void
-QadhocWifiMac::SetVOQueue (Ptr<EdcaTxopN> voQueue)
-{
-  m_voEdca = voQueue;
-  m_queues.insert (std::make_pair(AC_VO, m_voEdca));
-  m_queues[AC_VO]->SetLow (m_low);
-  m_queues[AC_VO]->SetManager (m_dcfManager);
-  m_queues[AC_VO]->SetTypeOfStation (ADHOC_STA);
-  m_queues[AC_VO]->SetTxMiddle (m_txMiddle);
+  return m_queues.find (AC_BK)->second;
 }
 
 void
-QadhocWifiMac::SetVIQueue (Ptr<EdcaTxopN> viQueue)
+QadhocWifiMac::SetQueue (enum AccessClass ac)
 {
-  m_viEdca = viQueue;
-  m_queues.insert (std::make_pair(AC_VI, m_viEdca));
-  m_queues[AC_VI]->SetLow (m_low);
-  m_queues[AC_VI]->SetManager (m_dcfManager);
-  m_queues[AC_VI]->SetTypeOfStation (ADHOC_STA);
-  m_queues[AC_VI]->SetTxMiddle (m_txMiddle);
+  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
+  edca->SetLow (m_low);
+  edca->SetManager (m_dcfManager);
+  edca->SetTypeOfStation (ADHOC_STA);
+  edca->SetTxMiddle (m_txMiddle);
+  m_queues.insert (std::make_pair(ac, edca));
 }
 
-void
-QadhocWifiMac::SetBEQueue (Ptr<EdcaTxopN> beQueue)
+void 
+QadhocWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
 {
-  m_beEdca = beQueue;
-  m_queues.insert (std::make_pair(AC_BE, m_beEdca));
-  m_queues[AC_BE]->SetLow (m_low);
-  m_queues[AC_BE]->SetManager (m_dcfManager);
-  m_queues[AC_BE]->SetTypeOfStation (ADHOC_STA);
-  m_queues[AC_BE]->SetTxMiddle (m_txMiddle);
-}
-
-void
-QadhocWifiMac::SetBKQueue (Ptr<EdcaTxopN> bkQueue)
-{
-  m_bkEdca = bkQueue;
-  m_queues.insert (std::make_pair(AC_BK, m_bkEdca));
-  m_queues[AC_BK]->SetLow (m_low);
-  m_queues[AC_BK]->SetManager (m_dcfManager);
-  m_queues[AC_BK]->SetTypeOfStation (ADHOC_STA);
-  m_queues[AC_BK]->SetTxMiddle (m_txMiddle);
+  switch (standard)
+    {
+    case WIFI_PHY_STANDARD_holland:
+      // fall through
+    case WIFI_PHY_STANDARD_80211a:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_10Mhz:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK);
+      ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE);
+      ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI);
+      ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO);
+      break;
+    case WIFI_PHY_STANDARD_80211b:
+      ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK);
+      ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE);
+      ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI);
+      ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO);
+      break;
+    default:
+      NS_ASSERT (false);
+      break;
+    }
 }
 
 } //namespace ns3
--- a/src/devices/wifi/qadhoc-wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qadhoc-wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -74,6 +74,7 @@
   virtual void SetSsid (Ssid ssid);
   virtual Mac48Address GetBssid (void) const;
 
+
 private:
   Callback<void, Ptr<Packet>, Mac48Address, Mac48Address> m_forwardUp;
   virtual void DoDispose (void);
@@ -92,16 +93,13 @@
   typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> > DeaggregatedMsdus;
   typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
 
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard);
+  void SetQueue (enum AccessClass ac);
   Ptr<EdcaTxopN> GetVOQueue (void) const;
   Ptr<EdcaTxopN> GetVIQueue (void) const;
   Ptr<EdcaTxopN> GetBEQueue (void) const;
   Ptr<EdcaTxopN> GetBKQueue (void) const;
 
-  void SetVOQueue (Ptr<EdcaTxopN> voQueue);
-  void SetVIQueue (Ptr<EdcaTxopN> viQueue);
-  void SetBEQueue (Ptr<EdcaTxopN> beQueue);
-  void SetBKQueue (Ptr<EdcaTxopN> bkQueue);
-
   Queues m_queues;
   Ptr<EdcaTxopN> m_voEdca;
   Ptr<EdcaTxopN> m_viEdca;
--- a/src/devices/wifi/qap-wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qap-wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -63,26 +63,22 @@
     .AddAttribute ("VO_EdcaTxopN",
                    "Queue that manages packets belonging to AC_VO access class",
                    PointerValue (),
-                   MakePointerAccessor(&QapWifiMac::GetVOQueue,
-                                       &QapWifiMac::SetVOQueue),
+                   MakePointerAccessor(&QapWifiMac::GetVOQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("VI_EdcaTxopN",
                    "Queue that manages packets belonging to AC_VI access class",
                    PointerValue (),
-                   MakePointerAccessor(&QapWifiMac::GetVIQueue,
-                                       &QapWifiMac::SetVIQueue),
+                   MakePointerAccessor(&QapWifiMac::GetVIQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("BE_EdcaTxopN",
                    "Queue that manages packets belonging to AC_BE access class",
                    PointerValue (),
-                   MakePointerAccessor(&QapWifiMac::GetBEQueue,
-                                       &QapWifiMac::SetBEQueue),
+                   MakePointerAccessor(&QapWifiMac::GetBEQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("BK_EdcaTxopN",
                    "Queue that manages packets belonging to AC_BK access class",
                    PointerValue (),
-                   MakePointerAccessor(&QapWifiMac::GetBKQueue,
-                                       &QapWifiMac::SetBKQueue),
+                   MakePointerAccessor(&QapWifiMac::GetBKQueue),
                    MakePointerChecker<EdcaTxopN> ())
     ;  
   return tid;
@@ -108,6 +104,11 @@
   m_beaconDca->SetMaxCw(0);
   m_beaconDca->SetLow (m_low);
   m_beaconDca->SetManager (m_dcfManager);
+
+  SetQueue (AC_VO);
+  SetQueue (AC_VI);
+  SetQueue (AC_BE);
+  SetQueue (AC_BK);
 }
 
 QapWifiMac::~QapWifiMac ()
@@ -129,15 +130,10 @@
   m_phy = 0;
   m_beaconDca = 0;
   m_beaconEvent.Cancel ();
-  m_voEdca = 0;
-  m_viEdca = 0;
-  m_beEdca = 0;
-  m_bkEdca = 0;
   m_stationManager = 0;
-  std::map<AccessClass, Ptr<EdcaTxopN> >::iterator it = m_queues.begin ();
-  for (;it != m_queues.end (); it++)
+  for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i)
     {
-      it->second = 0;
+      (*i).second = 0;
     }
   WifiMac::DoDispose ();
 }
@@ -259,10 +255,10 @@
 {
   NS_LOG_FUNCTION (this << stationManager);
   m_stationManager = stationManager;
-  m_voEdca->SetWifiRemoteStationManager (stationManager);
-  m_viEdca->SetWifiRemoteStationManager (stationManager);
-  m_beEdca->SetWifiRemoteStationManager (stationManager);
-  m_bkEdca->SetWifiRemoteStationManager (stationManager);
+  for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i)
+    {
+      (*i).second->SetWifiRemoteStationManager (stationManager);
+    }
   m_beaconDca->SetWifiRemoteStationManager (stationManager);
   m_low->SetWifiRemoteStationManager (stationManager);
 }
@@ -713,77 +709,67 @@
 Ptr<EdcaTxopN>
 QapWifiMac::GetVOQueue (void) const
 {
-  return m_voEdca;
+  return m_queues.find (AC_VO)->second;
 }
 
 Ptr<EdcaTxopN>
 QapWifiMac::GetVIQueue (void) const
 {
-  return m_viEdca;
+  return m_queues.find (AC_VI)->second;
 }
 
 Ptr<EdcaTxopN>
 QapWifiMac::GetBEQueue (void) const
 {
-  return m_beEdca;
+  return m_queues.find (AC_BE)->second;
 }
 
 Ptr<EdcaTxopN>
 QapWifiMac::GetBKQueue (void) const
 {
-  return m_bkEdca;
-}
-
-void
-QapWifiMac::SetVOQueue (Ptr<EdcaTxopN> voQueue)
-{
-  m_voEdca = voQueue;
-  m_queues.insert (std::make_pair(AC_VO, m_voEdca));
-  m_queues[AC_VO]->SetLow (m_low);
-  m_queues[AC_VO]->SetManager (m_dcfManager);
-  m_queues[AC_VO]->SetTypeOfStation (AP);
-  m_queues[AC_VO]->SetTxMiddle (m_txMiddle);
-  m_queues[AC_VO]->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this));
-  m_queues[AC_VO]->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this));
+  return m_queues.find (AC_BK)->second;
 }
 
 void
-QapWifiMac::SetVIQueue (Ptr<EdcaTxopN> viQueue)
+QapWifiMac::SetQueue (enum AccessClass ac)
 {
-  m_viEdca = viQueue;
-  m_queues.insert (std::make_pair(AC_VI, m_viEdca));
-  m_queues[AC_VI]->SetLow (m_low);
-  m_queues[AC_VI]->SetManager (m_dcfManager);
-  m_queues[AC_VI]->SetTypeOfStation (AP);
-  m_queues[AC_VI]->SetTxMiddle (m_txMiddle);
-  m_queues[AC_VI]->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this));
-  m_queues[AC_VI]->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this));
+  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
+  edca->SetLow (m_low);
+  edca->SetManager (m_dcfManager);
+  edca->SetTypeOfStation (AP);
+  edca->SetTxMiddle (m_txMiddle);
+  edca->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this));
+  edca->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this));
+  m_queues.insert (std::make_pair(ac, edca));
 }
 
-void
-QapWifiMac::SetBEQueue (Ptr<EdcaTxopN> beQueue)
+void 
+QapWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
 {
-  m_beEdca = beQueue;
-  m_queues.insert (std::make_pair(AC_BE, m_beEdca));
-  m_queues[AC_BE]->SetLow (m_low);
-  m_queues[AC_BE]->SetManager (m_dcfManager);
-  m_queues[AC_BE]->SetTypeOfStation (AP);
-  m_queues[AC_BE]->SetTxMiddle (m_txMiddle);
-  m_queues[AC_BE]->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this));
-  m_queues[AC_BE]->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this));
-}
-
-void
-QapWifiMac::SetBKQueue (Ptr<EdcaTxopN> bkQueue)
-{
-  m_bkEdca = bkQueue;
-  m_queues.insert (std::make_pair(AC_BK, m_bkEdca));
-  m_queues[AC_BK]->SetLow (m_low);
-  m_queues[AC_BK]->SetManager (m_dcfManager);
-  m_queues[AC_BK]->SetTypeOfStation (AP);
-  m_queues[AC_BK]->SetTxMiddle (m_txMiddle);
-  m_queues[AC_BK]->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this));
-  m_queues[AC_BK]->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this));
+  switch (standard)
+    {
+    case WIFI_PHY_STANDARD_holland:
+      // fall through
+    case WIFI_PHY_STANDARD_80211a:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_10Mhz:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK);
+      ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE);
+      ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI);
+      ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO);
+      break;
+    case WIFI_PHY_STANDARD_80211b:
+      ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK);
+      ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE);
+      ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI);
+      ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO);
+      break;
+    default:
+      NS_ASSERT (false);
+      break;
+    }
 }
 
 }  //namespace ns3
--- a/src/devices/wifi/qap-wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qap-wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -87,6 +87,10 @@
   void StartBeaconing (void);
 
 private:
+  typedef std::map<AccessClass, Ptr<EdcaTxopN> > Queues;
+  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> > DeaggregatedMsdus;
+  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
+  
   virtual void DoDispose (void);
   void Receive (Ptr<Packet> packet, WifiMacHeader const*hdr);
   void ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to);
@@ -107,28 +111,15 @@
   QapWifiMac &operator = (const QapWifiMac &);
   QapWifiMac (const QapWifiMac &);
 
-  typedef std::map<AccessClass, Ptr<EdcaTxopN> > Queues;
-  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> > DeaggregatedMsdus;
-  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
-
-  Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> m_forwardUp;
-  
   Ptr<EdcaTxopN> GetVOQueue (void) const;
   Ptr<EdcaTxopN> GetVIQueue (void) const;
   Ptr<EdcaTxopN> GetBEQueue (void) const;
   Ptr<EdcaTxopN> GetBKQueue (void) const;
-
-  void SetVOQueue (Ptr<EdcaTxopN> voQueue);
-  void SetVIQueue (Ptr<EdcaTxopN> viQueue);
-  void SetBEQueue (Ptr<EdcaTxopN> beQueue);
-  void SetBKQueue (Ptr<EdcaTxopN> bkQueue);
+  void SetQueue (enum AccessClass ac);
 
-  /*Next map is used only for an esay access to a specific queue*/
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard);
+
   Queues m_queues;
-  Ptr<EdcaTxopN> m_voEdca;
-  Ptr<EdcaTxopN> m_viEdca;
-  Ptr<EdcaTxopN> m_beEdca;
-  Ptr<EdcaTxopN> m_bkEdca;
   Ptr<DcaTxop> m_beaconDca;
   Ptr<MacLow> m_low;
   Ptr<WifiPhy> m_phy;
@@ -139,6 +130,7 @@
   Ssid m_ssid;
   EventId m_beaconEvent;
   Time m_beaconInterval;
+  Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> m_forwardUp;
 };
 
 }  //namespace ns3
--- a/src/devices/wifi/qos-utils.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qos-utils.h	Tue Aug 18 12:01:35 2009 +0400
@@ -31,6 +31,7 @@
   AC_VI = 1,
   AC_BE = 2,
   AC_BK = 3,
+  AC_BE_NQOS = 4,
   AC_UNDEF
 };
 
--- a/src/devices/wifi/qsta-wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qsta-wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -69,26 +69,22 @@
     .AddAttribute ("VO_EdcaTxopN",
                    "Queue that manages packets belonging to AC_VO access class",
                    PointerValue (),
-                   MakePointerAccessor(&QstaWifiMac::GetVOQueue,
-                                       &QstaWifiMac::SetVOQueue),
+                   MakePointerAccessor(&QstaWifiMac::GetVOQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("VI_EdcaTxopN",
                    "Queue that manages packets belonging to AC_VI access class",
                    PointerValue (),
-                   MakePointerAccessor(&QstaWifiMac::GetVIQueue,
-                                       &QstaWifiMac::SetVIQueue),
+                   MakePointerAccessor(&QstaWifiMac::GetVIQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("BE_EdcaTxopN",
                    "Queue that manages packets belonging to AC_BE access class",
                    PointerValue (),
-                   MakePointerAccessor(&QstaWifiMac::GetBEQueue,
-                                       &QstaWifiMac::SetBEQueue),
+                   MakePointerAccessor(&QstaWifiMac::GetBEQueue),
                    MakePointerChecker<EdcaTxopN> ())
     .AddAttribute ("BK_EdcaTxopN",
                    "Queue that manages packets belonging to AC_BK access class",
                    PointerValue (),
-                   MakePointerAccessor(&QstaWifiMac::GetBKQueue,
-                                       &QstaWifiMac::SetBKQueue),
+                   MakePointerAccessor(&QstaWifiMac::GetBKQueue),
                    MakePointerChecker<EdcaTxopN> ())
     ;
   return tid;
@@ -111,6 +107,11 @@
 
   m_dcfManager = new DcfManager ();
   m_dcfManager->SetupLowListener (m_low);
+
+  SetQueue (AC_VO);
+  SetQueue (AC_VI);
+  SetQueue (AC_BE);
+  SetQueue (AC_BK);
 }
 
 QstaWifiMac::~QstaWifiMac ()
@@ -131,15 +132,10 @@
   m_low = 0;
   m_phy = 0;
   m_dcfManager = 0;
-  m_voEdca = 0;
-  m_viEdca = 0;
-  m_beEdca = 0;
-  m_bkEdca = 0;
   m_stationManager = 0;
-  std::map<AccessClass, Ptr<EdcaTxopN> >::iterator it = m_queues.begin ();
-  for (;it != m_queues.end (); it++)
+  for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i)
     {
-      it->second = 0;
+      (*i).second = 0;
     }
   WifiMac::DoDispose ();
 }
@@ -706,69 +702,66 @@
 Ptr<EdcaTxopN>
 QstaWifiMac::GetVOQueue (void) const
 {
-  return m_voEdca;
+  return m_queues.find (AC_VO)->second;
 }
 
 Ptr<EdcaTxopN>
 QstaWifiMac::GetVIQueue (void) const
 {
-  return m_viEdca;
+  return m_queues.find (AC_VI)->second;
 }
 
 Ptr<EdcaTxopN>
 QstaWifiMac::GetBEQueue (void) const
 {
-  return m_beEdca;
+  return m_queues.find (AC_BE)->second;
 }
 
 Ptr<EdcaTxopN>
 QstaWifiMac::GetBKQueue (void) const
 {
-  return m_bkEdca;
-}
-
-void
-QstaWifiMac::SetVOQueue (Ptr<EdcaTxopN> voQueue)
-{
-  m_voEdca = voQueue;
-  m_queues.insert (std::make_pair(AC_VO, m_voEdca));
-  m_queues[AC_VO]->SetLow (m_low);
-  m_queues[AC_VO]->SetManager (m_dcfManager);
-  m_queues[AC_VO]->SetTypeOfStation (STA);
-  m_queues[AC_VO]->SetTxMiddle (m_txMiddle);
+  return m_queues.find (AC_BK)->second;
 }
 
 void
-QstaWifiMac::SetVIQueue (Ptr<EdcaTxopN> viQueue)
+QstaWifiMac::SetQueue (enum AccessClass ac)
 {
-  m_viEdca = viQueue;
-  m_queues.insert (std::make_pair(AC_VI, m_viEdca));
-  m_queues[AC_VI]->SetLow (m_low);
-  m_queues[AC_VI]->SetManager (m_dcfManager);
-  m_queues[AC_VI]->SetTypeOfStation (STA);
-  m_queues[AC_VI]->SetTxMiddle (m_txMiddle);
+  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
+  edca->SetLow (m_low);
+  edca->SetManager (m_dcfManager);
+  edca->SetTypeOfStation (STA);
+  edca->SetTxMiddle (m_txMiddle);
+  m_queues.insert (std::make_pair(ac, edca));
 }
 
-void
-QstaWifiMac::SetBEQueue (Ptr<EdcaTxopN> beQueue)
+void 
+QstaWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard)
 {
-  m_beEdca = beQueue;
-  m_queues.insert (std::make_pair(AC_BE, m_beEdca));
-  m_queues[AC_BE]->SetLow (m_low);
-  m_queues[AC_BE]->SetManager (m_dcfManager);
-  m_queues[AC_BE]->SetTypeOfStation (STA);
-  m_queues[AC_BE]->SetTxMiddle (m_txMiddle);
+  switch (standard)
+    {
+    case WIFI_PHY_STANDARD_holland:
+      // fall through
+    case WIFI_PHY_STANDARD_80211a:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_10Mhz:
+      // fall through
+    case WIFI_PHY_STANDARD_80211_5Mhz:
+      ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK);
+      ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE);
+      ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI);
+      ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO);
+      break;
+    case WIFI_PHY_STANDARD_80211b:
+      ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK);
+      ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE);
+      ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI);
+      ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO);
+      break;
+    default:
+      NS_ASSERT (false);
+      break;
+    }
 }
 
-void
-QstaWifiMac::SetBKQueue (Ptr<EdcaTxopN> bkQueue)
-{
-  m_bkEdca = bkQueue;
-  m_queues.insert (std::make_pair(AC_BK, m_bkEdca));
-  m_queues[AC_BK]->SetLow (m_low);
-  m_queues[AC_BK]->SetManager (m_dcfManager);
-  m_queues[AC_BK]->SetTypeOfStation (STA);
-  m_queues[AC_BK]->SetTxMiddle (m_txMiddle);
-}
 
 }  //namespace ns3
--- a/src/devices/wifi/qsta-wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/qsta-wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -111,19 +111,15 @@
   */
   void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket, WifiMacHeader const *hdr);
 
+  QstaWifiMac &operator = (const QstaWifiMac &);
+  QstaWifiMac (const QstaWifiMac &);
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard);
+  void SetQueue (enum AccessClass ac);
   Ptr<EdcaTxopN> GetVOQueue (void) const;
   Ptr<EdcaTxopN> GetVIQueue (void) const;
   Ptr<EdcaTxopN> GetBEQueue (void) const;
   Ptr<EdcaTxopN> GetBKQueue (void) const;
 
-  void SetVOQueue (Ptr<EdcaTxopN> voQueue);
-  void SetVIQueue (Ptr<EdcaTxopN> viQueue);
-  void SetBEQueue (Ptr<EdcaTxopN> beQueue);
-  void SetBKQueue (Ptr<EdcaTxopN> bkQueue);
-
-  QstaWifiMac &operator = (const QstaWifiMac &);
-  QstaWifiMac (const QstaWifiMac &);
-
   typedef std::map<AccessClass, Ptr<EdcaTxopN> > Queues;
   typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> > DeaggregatedMsdus;
   typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
@@ -136,13 +132,7 @@
     REFUSED
   } m_state;
 
-  /*Next map is used only for an esay access to a specific queue*/
   Queues m_queues;
-  Ptr<EdcaTxopN> m_voEdca;
-  Ptr<EdcaTxopN> m_viEdca;
-  Ptr<EdcaTxopN> m_beEdca;
-  Ptr<EdcaTxopN> m_bkEdca;
-
   Ptr<MacLow> m_low;
   Ptr<WifiPhy> m_phy;
   Ptr<WifiRemoteStationManager> m_stationManager;
--- a/src/devices/wifi/wifi-mac.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-mac.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -18,6 +18,7 @@
  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
  */
 #include "wifi-mac.h"
+#include "dcf.h"
 #include "ns3/uinteger.h"
 #include "ns3/trace-source-accessor.h"
 
@@ -117,14 +118,6 @@
 		   MakeSsidAccessor (&WifiMac::GetSsid,
 				     &WifiMac::SetSsid),
 		   MakeSsidChecker ())
-    .AddAttribute ("Standard", "The standard chosen configures some MAC-specific constants",
-                   EnumValue (WIFI_PHY_STANDARD_80211a),
-                   MakeEnumAccessor (&WifiMac::SetStandard),
-                   MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a",
-                                    WIFI_PHY_STANDARD_80211b, "802.11b",
-                                    WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz",
-                                    WIFI_PHY_STANDARD_80211_5Mhz,"802-11_5Mhz",
-                                    WIFI_PHY_STANDARD_holland, "holland"))
     .AddTraceSource ("MacTx", 
                      "A packet has been received from higher layers and is being processed in preparation for "
                      "queueing for transmission.",
@@ -209,9 +202,8 @@
 }
 
 void
-WifiMac::SetStandard (enum WifiPhyStandard standard)
+WifiMac::ConfigureStandard (enum WifiPhyStandard standard)
 {
-  m_standard = standard;
   switch (standard) {
   case WIFI_PHY_STANDARD_80211a:
     Configure80211a ();
@@ -232,6 +224,7 @@
     NS_ASSERT (false);
     break;
   }
+  FinishConfigureStandard (standard);
 }
 
 void
@@ -278,4 +271,41 @@
   SetAckTimeout(MicroSeconds(64+176+21+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); 
 }
 
+void
+WifiMac::ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AccessClass ac)
+{
+  /* see IEE802.11 section 7.3.2.29 */
+  switch (ac) {
+  case AC_VO:
+    dcf->SetMinCw ((cwmin+1)/4-1);
+    dcf->SetMaxCw ((cwmin+1)/2-1);
+    dcf->SetAifsn (2);
+    break;
+  case AC_VI:
+    dcf->SetMinCw ((cwmin+1)/2-1);
+    dcf->SetMaxCw (cwmin);
+    dcf->SetAifsn (2);
+    break;
+  case AC_BE:
+    dcf->SetMinCw (cwmin);
+    dcf->SetMaxCw (cwmax);
+    dcf->SetAifsn (3);
+    break;
+  case AC_BK:
+    dcf->SetMinCw (cwmin);
+    dcf->SetMaxCw (cwmax);
+    dcf->SetAifsn (7);
+    break;
+  case AC_BE_NQOS:
+    dcf->SetMinCw (cwmin);
+    dcf->SetMaxCw (cwmax);
+    dcf->SetAifsn (2);    
+    break;
+  case AC_UNDEF:
+    NS_FATAL_ERROR ("I don't know what to do with this");
+    break;
+  }
+}
+
+
 } // namespace ns3
--- a/src/devices/wifi/wifi-mac.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-mac.h	Tue Aug 18 12:01:35 2009 +0400
@@ -26,9 +26,12 @@
 #include "wifi-phy.h"
 #include "wifi-remote-station-manager.h"
 #include "ssid.h"
+#include "qos-utils.h"
 
 namespace ns3 {
 
+class Dcf;
+
 /**
  * \brief base class for all MAC-level wifi objects.
  *
@@ -209,8 +212,10 @@
   /**
    * \param standard the wifi standard to be configured
    */
-  void SetStandard (enum WifiPhyStandard standard);
+  void ConfigureStandard (enum WifiPhyStandard standard);
 
+protected:
+  void ConfigureDcf (Ptr<Dcf> dcf, uint32_t cwmin, uint32_t cwmax, enum AccessClass ac);
 private:
   static Time GetDefaultMaxPropagationDelay (void);
   static Time GetDefaultSlot (void);
@@ -218,10 +223,18 @@
   static Time GetDefaultEifsNoDifs (void);
   static Time GetDefaultCtsAckDelay (void);
   static Time GetDefaultCtsAckTimeout (void);
+  /**
+   * \param standard the phy standard to be used
+   *
+   * This method is called by ns3::WifiMac::ConfigureStandard to complete
+   * the configuration process for a requested phy standard. Subclasses should
+   * implement this method to configure their dcf queues according to the
+   * requested standard.
+   */
+  virtual void FinishConfigureStandard (enum WifiPhyStandard standard) = 0;
 
   Time m_maxPropagationDelay;
   uint32_t m_maxMsduSize;
-  WifiPhyStandard m_standard;
 
   void Configure80211a (void);
   void Configure80211b (void);
--- a/src/devices/wifi/wifi-mode.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-mode.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -88,11 +88,6 @@
 WifiMode::GetUniqueName (void) const
 {
   // needed for ostream printing of the invalid mode
-  if (m_uid == 0)
-    {
-      return "Invalid-WifiMode";
-    }
-
   struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
   return item->uniqueUid;
 }
@@ -220,7 +215,7 @@
 bool 
 WifiModeFactory::Search (std::string name, WifiMode *mode)
 {
-  uint32_t j = 1;
+  uint32_t j = 0;
   for (WifiModeItemList::const_iterator i = m_itemList.begin ();
        i != m_itemList.end (); i++)
     {
@@ -238,7 +233,7 @@
 uint32_t
 WifiModeFactory::AllocateUid (std::string uniqueUid)
 {
-  uint32_t j = 1;
+  uint32_t j = 0;
   for (WifiModeItemList::const_iterator i = m_itemList.begin ();
        i != m_itemList.end (); i++)
     {
@@ -248,16 +243,16 @@
 	}
       j++;
     }
+  uint32_t uid = m_itemList.size ();
   m_itemList.push_back (WifiModeItem ());
-  uint32_t uid = m_itemList.size ();
   return uid;
 }
 
 struct WifiModeFactory::WifiModeItem *
 WifiModeFactory::Get (uint32_t uid)
 {
-  NS_ASSERT (uid > 0 && uid <= m_itemList.size ());
-  return &m_itemList[uid - 1];
+  NS_ASSERT (uid < m_itemList.size ());
+  return &m_itemList[uid];
 }
 
 WifiModeFactory *
@@ -267,7 +262,16 @@
   static WifiModeFactory factory;
   if (isFirstTime)
     {
-      factory.AllocateUid ("Invalid-WifiMode");
+      uint32_t uid = factory.AllocateUid ("Invalid-WifiMode");
+      WifiModeItem *item = factory.Get (uid);
+      item->uniqueUid = "Invalid-WifiMode";
+      item->bandwidth = 0;
+      item->dataRate = 0;
+      item->phyRate = 0;
+      item->modulation = WifiMode::UNKNOWN;
+      item->constellationSize = 0;
+      item->isMandatory = false;
+      item->standard = WIFI_PHY_UNKNOWN;
       isFirstTime = false;
     }
   return &factory;
--- a/src/devices/wifi/wifi-mode.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-mode.h	Tue Aug 18 12:01:35 2009 +0400
@@ -44,7 +44,8 @@
     BPSK,
     DBPSK,
     DQPSK,
-    QAM
+    QAM,
+    UNKNOWN
   };
   
   /**
--- a/src/devices/wifi/wifi-phy-standard.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-phy-standard.h	Tue Aug 18 12:01:35 2009 +0400
@@ -27,7 +27,8 @@
   WIFI_PHY_STANDARD_80211b,
   WIFI_PHY_STANDARD_80211_10Mhz,
   WIFI_PHY_STANDARD_80211_5Mhz,
-  WIFI_PHY_STANDARD_holland
+  WIFI_PHY_STANDARD_holland,
+  WIFI_PHY_UNKNOWN
 };
 
 } // namespace ns3
--- a/src/devices/wifi/wifi-phy.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-phy.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -205,15 +205,15 @@
 }
 
 void 
-WifiPhy::NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
+WifiPhy::NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
 {
-  m_phyPromiscSniffRxTrace (packet, channelFreqMhz, rate, isShortPreamble, signalDbm, noiseDbm);
+  m_phyPromiscSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
 }
 
 void 
-WifiPhy::NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble)
+WifiPhy::NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)
 {
-  m_phyPromiscSniffTxTrace (packet, channelFreqMhz, rate, isShortPreamble);
+  m_phyPromiscSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble);
 }
 
 WifiMode 
--- a/src/devices/wifi/wifi-phy.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-phy.h	Tue Aug 18 12:01:35 2009 +0400
@@ -253,6 +253,8 @@
   virtual void SetChannelNumber (uint16_t id) = 0;
   /// Return current channel number, see SetChannelNumber()
   virtual uint16_t GetChannelNumber () const = 0;
+
+  virtual void ConfigureStandard (enum WifiPhyStandard standard) = 0;
   
   virtual Ptr<WifiChannel> GetChannel (void) const = 0;
 
@@ -341,7 +343,7 @@
    * @param signalDbm signal power in dBm
    * @param noiseDbm  noise power in dBm
    */
-  void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, 
+  void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, 
                              double signalDbm, double noiseDbm);
 
   /** 
@@ -361,7 +363,7 @@
    * units used both for the radiotap and for the prism header) 
    * @param isShortPreamble true if short preamble is used, false otherwise
    */
-  void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble);
+  void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble);
   
 
 private:
@@ -422,7 +424,7 @@
    *
    * \see class CallBackTraceSource
    */
-  TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace;
+  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace;
 
   /**
    * A trace source that emulates a wifi device in monitor mode
@@ -434,7 +436,7 @@
    *
    * \see class CallBackTraceSource
    */
-  TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace;
+  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace;
 
 };
 
--- a/src/devices/wifi/wifi-test.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wifi-test.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -71,9 +71,8 @@
   Ptr<Node> node = CreateObject<Node> ();
   Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
 
-  Ptr<DcaTxop> queue = CreateObject<DcaTxop> ();
   Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
-  mac->SetAttribute("DcaTxop", PointerValue (queue));
+  mac->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
   Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
   Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
   Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
@@ -81,6 +80,7 @@
   phy->SetChannel (channel);
   phy->SetDevice (dev);
   phy->SetMobility (node);
+  phy->ConfigureStandard (WIFI_PHY_STANDARD_80211a);
   Ptr<WifiRemoteStationManager> manager = m_manager.Create<WifiRemoteStationManager> ();
 
   mobility->SetPosition (pos);
--- a/src/devices/wifi/wscript	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/wscript	Tue Aug 18 12:01:35 2009 +0400
@@ -63,6 +63,8 @@
         'msdu-aggregator.cc',
         'amsdu-subframe-header.cc',
         'msdu-standard-aggregator.cc',
+        'minstrel-wifi-manager.cc',
+        'dcf.cc',
         ]
     headers = bld.new_task_gen('ns3header')
     headers.module = 'wifi'
@@ -106,13 +108,14 @@
         'msdu-aggregator.h',
         'amsdu-subframe-header.h',
         'qos-tag.h',
-# Need this for module devices/mesh
         'mgt-headers.h',
         'status-code.h',
         'capability-information.h',
         'dcf-manager.h',
         'mac-rx-middle.h', 
         'mac-low.h',
+        'minstrel-wifi-manager.h',
+        'dcf.h',
         ]
 
     if bld.env['ENABLE_GSL']:
--- a/src/devices/wifi/yans-wifi-phy.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/yans-wifi-phy.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -105,15 +105,6 @@
                    MakeDoubleAccessor (&YansWifiPhy::SetRxNoiseFigure,
                                        &YansWifiPhy::GetRxNoiseFigure),
                    MakeDoubleChecker<double> ())
-    .AddAttribute ("Standard", "The standard chosen configures a set of transmission modes"
-                   " and some PHY-specific constants.",
-                   EnumValue (WIFI_PHY_STANDARD_80211a),
-                   MakeEnumAccessor (&YansWifiPhy::SetStandard),
-                   MakeEnumChecker (WIFI_PHY_STANDARD_80211a, "802.11a",
-                                    WIFI_PHY_STANDARD_80211b, "802.11b",
-                                    WIFI_PHY_STANDARD_80211_10Mhz,"802.11_10Mhz",
-                                    WIFI_PHY_STANDARD_80211_5Mhz,"802.11_5Mhz",
-                                    WIFI_PHY_STANDARD_holland, "holland"))
     .AddAttribute ("State", "The state of the PHY layer",
                    PointerValue (),
                    MakePointerAccessor (&YansWifiPhy::m_state),
@@ -151,10 +142,9 @@
 }
 
 void
-YansWifiPhy::SetStandard (enum WifiPhyStandard standard)
+YansWifiPhy::ConfigureStandard (enum WifiPhyStandard standard)
 {
   NS_LOG_FUNCTION (this << standard);
-  m_standard = standard;
   switch (standard) {
   case WIFI_PHY_STANDARD_80211a:
     Configure80211a ();
@@ -451,7 +441,7 @@
   NotifyTxBegin (packet);
   uint32_t dataRate500KbpsUnits = txMode.GetDataRate () / 500000;   
   bool isShortPreamble = (WIFI_PREAMBLE_SHORT == preamble);
-  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz(), dataRate500KbpsUnits, isShortPreamble);
+  NotifyPromiscSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble);
   m_state->SwitchToTx (txDuration, packet, txMode, preamble, txPower);
   m_channel->Send (this, packet, GetPowerDbm (txPower) + m_txGainDb, txMode, preamble);
 }
@@ -657,7 +647,7 @@
       bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ());  
       double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
       double noiseDbm = RatioToDb(event->GetRxPowerW() / snrPer.snr) - GetRxNoiseFigure() + 30 ;
-      NotifyPromiscSniffRx (packet, (uint16_t)GetChannelFrequencyMhz(), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
+      NotifyPromiscSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
       m_state->SwitchFromSyncEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
     } 
   else 
--- a/src/devices/wifi/yans-wifi-phy.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/devices/wifi/yans-wifi-phy.h	Tue Aug 18 12:01:35 2009 +0400
@@ -89,7 +89,6 @@
                            WifiMode mode,
                            WifiPreamble preamble);
 
-  void SetStandard (enum WifiPhyStandard standard);
   void SetRxNoiseFigure (double noiseFigureDb);
   void SetTxPowerStart (double start);
   void SetTxPowerEnd (double end);
@@ -133,6 +132,7 @@
   virtual WifiMode GetMode (uint32_t mode) const;
   virtual double CalculateSnr (WifiMode txMode, double ber) const;
   virtual Ptr<WifiChannel> GetChannel (void) const;
+  virtual void ConfigureStandard (enum WifiPhyStandard standard);
 
 private:
   typedef std::vector<WifiMode> Modes;
@@ -170,7 +170,6 @@
   Modes m_modes;
   EventId m_endSyncEvent;
   UniformVariable m_random;
-  WifiPhyStandard m_standard;
   /// Standard-dependent center frequency of 0-th channel, MHz 
   double m_channelStartingFrequency;
   Ptr<WifiPhyStateHelper> m_state;
--- a/src/helper/csma-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/csma-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -23,10 +23,11 @@
 #include "ns3/queue.h"
 #include "ns3/csma-net-device.h"
 #include "ns3/csma-channel.h"
-#include "ns3/pcap-writer.h"
 #include "ns3/config.h"
 #include "ns3/packet.h"
 #include "ns3/names.h"
+#include "ns3/pcap-writer.h"
+#include "ns3/ascii-writer.h"
 #include <string>
 
 namespace ns3 {
@@ -76,7 +77,7 @@
     }
   oss.str ("");
   oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
-  Ptr<PcapWriter> pcap = Create<PcapWriter> ();
+  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
   pcap->Open (oss.str ());
   pcap->WriteEthernetHeader ();
   oss.str ("");
@@ -139,19 +140,20 @@
 void 
 CsmaHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid)
 {
+  Ptr<AsciiWriter> writer = AsciiWriter::Get (os);
   Packet::EnablePrinting ();
   std::ostringstream oss;
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/MacRx";
-  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiRxEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiRxEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/TxQueue/Enqueue";
-  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEnqueueEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiEnqueueEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/TxQueue/Dequeue";
-  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiDequeueEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiDequeueEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/TxQueue/Drop";
-  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiDropEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&CsmaHelper::AsciiDropEvent, writer));
 }
 void 
 CsmaHelper::EnableAscii (std::ostream &os, NetDeviceContainer d)
@@ -294,31 +296,27 @@
 }
 
 void 
-CsmaHelper::AsciiEnqueueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+CsmaHelper::AsciiEnqueueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "+ " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::ENQUEUE, path, packet);
 }
 
 void 
-CsmaHelper::AsciiDequeueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+CsmaHelper::AsciiDequeueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "- " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::DEQUEUE, path, packet);
 }
 
 void 
-CsmaHelper::AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+CsmaHelper::AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "d " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::DROP, path, packet);
 }
 
 void 
-CsmaHelper::AsciiRxEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+CsmaHelper::AsciiRxEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "r " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::RX, path, packet);
 }
 
 } // namespace ns3
--- a/src/helper/csma-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/csma-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -21,7 +21,6 @@
 #define CSMA_HELPER_H
 
 #include <string>
-#include <ostream>
 #include "ns3/attribute.h"
 #include "ns3/object-factory.h"
 #include "ns3/net-device-container.h"
@@ -33,6 +32,7 @@
 
 class Packet;
 class PcapWriter;
+class AsciiWriter;
 
 /**
  * \brief build a set of CsmaNetDevice objects
@@ -353,10 +353,10 @@
 
   static void SniffEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
 
-  static void AsciiRxEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiEnqueueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiDequeueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
+  static void AsciiRxEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiEnqueueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiDequeueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
 
   ObjectFactory m_queueFactory;
   ObjectFactory m_deviceFactory;
--- a/src/helper/emu-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/emu-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -25,6 +25,7 @@
 #include "ns3/queue.h"
 #include "ns3/emu-net-device.h"
 #include "ns3/pcap-writer.h"
+#include "ns3/ascii-writer.h"
 #include "ns3/config.h"
 #include "ns3/packet.h"
 
@@ -70,7 +71,7 @@
   NS_LOG_FUNCTION (filename << nodeid << deviceid << promiscuous);
   std::ostringstream oss;
   oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
-  Ptr<PcapWriter> pcap = Create<PcapWriter> ();
+  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
   pcap->Open (oss.str ());
   pcap->WriteEthernetHeader ();
 
@@ -140,23 +141,24 @@
 EmuHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid)
 {
   NS_LOG_FUNCTION (&os << nodeid << deviceid);
+  Ptr<AsciiWriter> writer = AsciiWriter::Get (os);
   Packet::EnablePrinting ();
   std::ostringstream oss;
 
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::EmuNetDevice/MacRx";
-  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiRxEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiRxEvent, writer));
 
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::EmuNetDevice/TxQueue/Enqueue";
-  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiEnqueueEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiEnqueueEvent, writer));
 
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::EmuNetDevice/TxQueue/Dequeue";
-  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiDequeueEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiDequeueEvent, writer));
 
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::EmuNetDevice/TxQueue/Drop";
-  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiDropEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&EmuHelper::AsciiDropEvent, writer));
 }
 
 void 
@@ -238,48 +240,40 @@
   writer->WritePacket (packet);
 }
 
-void 
-EmuHelper::AsciiEnqueueEvent (
-  std::ostream *os, 
-  std::string path, 
-  Ptr<const Packet> packet)
+void
+EmuHelper::AsciiEnqueueEvent (Ptr<AsciiWriter> writer,
+                              std::string path,
+                              Ptr<const Packet> packet)
 {
-  NS_LOG_FUNCTION (&os << path << packet);
-  *os << "+ " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  NS_LOG_FUNCTION (writer << path << packet);
+  writer->WritePacket (AsciiWriter::ENQUEUE, path, packet);
 }
 
-void 
-EmuHelper::AsciiDequeueEvent (
-  std::ostream *os, 
-  std::string path, 
-  Ptr<const Packet> packet)
+void
+EmuHelper::AsciiDequeueEvent (Ptr<AsciiWriter> writer,
+                              std::string path,
+                              Ptr<const Packet> packet)
 {
-  NS_LOG_FUNCTION (&os << path << packet);
-  *os << "- " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  NS_LOG_FUNCTION (writer << path << packet);
+  writer->WritePacket (AsciiWriter::DEQUEUE, path, packet);
 }
 
-void 
-EmuHelper::AsciiDropEvent (
-  std::ostream *os, 
-  std::string path, 
-  Ptr<const Packet> packet)
+void
+EmuHelper::AsciiDropEvent (Ptr<AsciiWriter> writer,
+                           std::string path,
+                           Ptr<const Packet> packet)
 {
-  NS_LOG_FUNCTION (&os << path << packet);
-  *os << "d " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  NS_LOG_FUNCTION (writer << path << packet);
+  writer->WritePacket (AsciiWriter::DROP, path, packet);
 }
 
-void 
-EmuHelper::AsciiRxEvent (
-  std::ostream *os, 
-  std::string path, 
-  Ptr<const Packet> packet)
+void
+EmuHelper::AsciiRxEvent (Ptr<AsciiWriter> writer,
+                         std::string path,
+                         Ptr<const Packet> packet)
 {
-  NS_LOG_FUNCTION (&os << path << packet);
-  *os << "r " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  NS_LOG_FUNCTION (writer << path << packet);
+  writer->WritePacket (AsciiWriter::RX, path, packet);
 }
 
 } // namespace ns3
--- a/src/helper/emu-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/emu-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -31,6 +31,7 @@
 
 class Packet;
 class PcapWriter;
+class AsciiWriter;
 
 /**
  * \brief build a set of EmuNetDevice objects
@@ -208,10 +209,10 @@
   Ptr<NetDevice> InstallPriv (Ptr<Node> node) const;
   static void SniffEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
 
-  static void AsciiRxEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiEnqueueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiDequeueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
+  static void AsciiRxEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiEnqueueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiDequeueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
 
   ObjectFactory m_queueFactory;
   ObjectFactory m_deviceFactory;
--- a/src/helper/internet-stack-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/internet-stack-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -161,6 +161,8 @@
 #include "ns3/callback.h"
 #include "ns3/node.h"
 #include "ns3/core-config.h"
+#include "ns3/pcap-writer.h"
+#include "ns3/ascii-writer.h"
 #include "internet-stack-helper.h"
 #include "ipv4-list-routing-helper.h"
 #include "ipv4-static-routing-helper.h"
@@ -279,16 +281,17 @@
 void
 InternetStackHelper::EnableAscii (std::ostream &os, NodeContainer n)
 {
+  Ptr<AsciiWriter> writer = AsciiWriter::Get (os);
   Packet::EnablePrinting ();
   std::ostringstream oss;
   for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i)
     {
       Ptr<Node> node = *i;
       oss << "/NodeList/" << node->GetId () << "/$ns3::Ipv4L3Protocol/Drop";
-      Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, &os));
+      Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, writer));
       oss.str ("");
       oss << "/NodeList/" << node->GetId () << "/$ns3::ArpL3Protocol/Drop";
-      Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, &os));
+      Config::Connect (oss.str (), MakeBoundCallback (&InternetStackHelper::AsciiDropEvent, writer));
       oss.str ("");
     }
 }
@@ -356,7 +359,7 @@
   InternetStackHelper::Trace trace;
   trace.nodeId = nodeId;
   trace.interfaceId = interfaceId;
-  trace.writer = Create<PcapWriter> ();
+  trace.writer = CreateObject<PcapWriter> ();
   std::ostringstream oss;
   oss << m_pcapBaseFilename << "-" << nodeId << "-" << interfaceId << ".pcap";
   trace.writer->Open (oss.str ());
@@ -366,10 +369,9 @@
 }
 
 void
-InternetStackHelper::AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+InternetStackHelper::AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "d " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::DROP, path, packet);
 }
 
 } // namespace ns3
--- a/src/helper/internet-stack-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/internet-stack-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -23,7 +23,6 @@
 
 #include "node-container.h"
 #include "net-device-container.h"
-#include "ns3/pcap-writer.h"
 #include "ns3/packet.h"
 #include "ns3/ptr.h"
 #include "ns3/object-factory.h"
@@ -169,7 +168,7 @@
     uint32_t interfaceId;
     Ptr<PcapWriter> writer;
   };
-  static void AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
+  static void AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
   static std::string m_pcapBaseFilename;
   static uint32_t GetNodeIndex (std::string context);
   static std::vector<Trace> m_traces;
--- a/src/helper/nqos-wifi-mac-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/nqos-wifi-mac-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -25,9 +25,7 @@
 namespace ns3 {
 
 NqosWifiMacHelper::NqosWifiMacHelper ()
-{
-  m_queue.SetTypeId ("ns3::DcaTxop");
-}
+{}
 
 NqosWifiMacHelper::~NqosWifiMacHelper ()
 {}
@@ -62,24 +60,10 @@
   m_mac.Set (n7, v7);
 }
 
-void
-NqosWifiMacHelper::SetDcaParameters (std::string n0, const AttributeValue &v0,
-                                     std::string n1, const AttributeValue &v1,
-                                     std::string n2, const AttributeValue &v2,
-                                     std::string n3, const AttributeValue &v3)
-{
-  m_queue.Set (n0, v0);
-  m_queue.Set (n1, v1);
-  m_queue.Set (n2, v2);
-  m_queue.Set (n3, v3);
-}
-
 Ptr<WifiMac>
 NqosWifiMacHelper::Create (void) const
 {
   Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
-  Ptr<DcaTxop> queue = m_queue.Create<DcaTxop> ();
-  mac->SetAttribute ("DcaTxop", PointerValue (queue));
   return mac;
 }
 
--- a/src/helper/nqos-wifi-mac-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/nqos-wifi-mac-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -69,20 +69,6 @@
                 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
                 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
                 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
-  /**
-   * \param n0 the name of the attribute to set
-   * \param v0 the value of the attribute to set
-   * \param n1 the name of the attribute to set
-   * \param v1 the value of the attribute to set
-   * \param n2 the name of the attribute to set
-   * \param v2 the value of the attribute to set
-   * \param n3 the name of the attribute to set
-   * \param v3 the value of the attribute to set
-   */
-  void SetDcaParameters (std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
-                         std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
-                         std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
-                         std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
 private:
   /**
    * \returns a newly-created MAC object.
@@ -92,7 +78,6 @@
   virtual Ptr<WifiMac> Create (void) const;
 
   ObjectFactory m_mac;
-  ObjectFactory m_queue;
 };
 
 } //namespace ns3
--- a/src/helper/point-to-point-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/point-to-point-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -22,10 +22,11 @@
 #include "ns3/point-to-point-net-device.h"
 #include "ns3/point-to-point-channel.h"
 #include "ns3/queue.h"
-#include "ns3/pcap-writer.h"
 #include "ns3/config.h"
 #include "ns3/packet.h"
 #include "ns3/names.h"
+#include "ns3/pcap-writer.h"
+#include "ns3/ascii-writer.h"
 
 namespace ns3 {
 
@@ -75,7 +76,7 @@
     }
   oss.str ("");
   oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
-  Ptr<PcapWriter> pcap = Create<PcapWriter> ();
+  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
   pcap->Open (oss.str ());
   pcap->WritePppHeader ();
   oss.str ("");
@@ -131,19 +132,20 @@
 void 
 PointToPointHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid)
 {
+  Ptr<AsciiWriter> writer = AsciiWriter::Get (os);
   Packet::EnablePrinting ();
   std::ostringstream oss;
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/MacRx";
-  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiRxEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiRxEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/TxQueue/Enqueue";
-  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEnqueueEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiEnqueueEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/TxQueue/Dequeue";
-  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiDequeueEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiDequeueEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/TxQueue/Drop";
-  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiDropEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&PointToPointHelper::AsciiDropEvent, writer));
 }
 
 void 
@@ -256,32 +258,29 @@
   writer->WritePacket (packet);
 }
 
-void 
-PointToPointHelper::AsciiEnqueueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+void
+PointToPointHelper::AsciiEnqueueEvent (Ptr<AsciiWriter> writer, std::string path,
+                                       Ptr<const Packet> packet)
 {
-  *os << "+ " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::ENQUEUE, path, packet);
 }
 
-void 
-PointToPointHelper::AsciiDequeueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+void
+PointToPointHelper::AsciiDequeueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "- " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::DEQUEUE, path, packet);
 }
 
-void 
-PointToPointHelper::AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+void
+PointToPointHelper::AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "d " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::DROP, path, packet);
 }
 
-void 
-PointToPointHelper::AsciiRxEvent (std::ostream *os, std::string path, Ptr<const Packet> packet)
+void
+PointToPointHelper::AsciiRxEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet)
 {
-  *os << "r " << Simulator::Now ().GetSeconds () << " ";
-  *os << path << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::RX, path, packet);
 }
 
 } // namespace ns3
--- a/src/helper/point-to-point-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/point-to-point-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -32,6 +32,7 @@
 class NetDevice;
 class Node;
 class PcapWriter;
+class AsciiWriter;
 
 /**
  * \brief build a set of PointToPointNetDevice objects
@@ -286,10 +287,10 @@
   static void SniffEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet);
 
   void EnableAscii (Ptr<Node> node, Ptr<NetDevice> device);
-  static void AsciiRxEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiEnqueueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiDequeueEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
-  static void AsciiDropEvent (std::ostream *os, std::string path, Ptr<const Packet> packet);
+  static void AsciiRxEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiEnqueueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiDequeueEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
+  static void AsciiDropEvent (Ptr<AsciiWriter> writer, std::string path, Ptr<const Packet> packet);
 
   ObjectFactory m_queueFactory;
   ObjectFactory m_channelFactory;
--- a/src/helper/qos-wifi-mac-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/qos-wifi-mac-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -28,20 +28,12 @@
 
 QosWifiMacHelper::QosWifiMacHelper ()
 {
-  m_aggregators.insert (std::make_pair (AC_VO, ObjectFactory ()));
-  m_aggregators.insert (std::make_pair (AC_VI, ObjectFactory ()));
-  m_aggregators.insert (std::make_pair (AC_BE, ObjectFactory ()));
-  m_aggregators.insert (std::make_pair (AC_BK, ObjectFactory ()));
-
-  m_queues.insert (std::make_pair (AC_VO, ObjectFactory ()));
-  m_queues.insert (std::make_pair (AC_VI, ObjectFactory ()));
-  m_queues.insert (std::make_pair (AC_BE, ObjectFactory ()));
-  m_queues.insert (std::make_pair (AC_BK, ObjectFactory ()));
-
-  m_queues[AC_VO].SetTypeId ("ns3::EdcaTxopN");
-  m_queues[AC_VI].SetTypeId ("ns3::EdcaTxopN");
-  m_queues[AC_BE].SetTypeId ("ns3::EdcaTxopN");
-  m_queues[AC_BK].SetTypeId ("ns3::EdcaTxopN");
+  ObjectFactory defaultAggregator;
+  defaultAggregator.SetTypeId ("ns3::MsduStandardAggregator");
+  m_aggregators.insert (std::make_pair (AC_VO, defaultAggregator));
+  m_aggregators.insert (std::make_pair (AC_VI, defaultAggregator));
+  m_aggregators.insert (std::make_pair (AC_BE, defaultAggregator));
+  m_aggregators.insert (std::make_pair (AC_BK, defaultAggregator));
 }
 
 QosWifiMacHelper::~QosWifiMacHelper ()
@@ -52,19 +44,7 @@
 {
   QosWifiMacHelper helper;
   helper.SetType ("ns3::QstaWifiMac");
-  /* For more details about this default parameters see IEE802.11 section 7.3.2.29 */
-  helper.SetEdcaParametersForAc (AC_VO,"MinCw", UintegerValue (3),
-                                       "MaxCw", UintegerValue (7),
-                                       "Aifsn", UintegerValue (2));
-  helper.SetEdcaParametersForAc (AC_VI,"MinCw", UintegerValue (7),
-                                       "MaxCw", UintegerValue (15),
-                                       "Aifsn", UintegerValue (2));
-  helper.SetEdcaParametersForAc (AC_BE,"MinCw", UintegerValue (15),
-                                       "MaxCw", UintegerValue (1023),
-                                       "Aifsn", UintegerValue (3));
-  helper.SetEdcaParametersForAc (AC_BK,"MinCw", UintegerValue (15),
-                                       "MaxCw", UintegerValue (1023),
-                                       "Aifsn", UintegerValue (7));
+  
   return helper;
 }
 
@@ -110,80 +90,26 @@
 }
 
 void
-QosWifiMacHelper::SetEdcaParametersForAc (AccessClass accessClass,
-                                          std::string n0, const AttributeValue &v0,
-                                          std::string n1, const AttributeValue &v1,
-                                          std::string n2, const AttributeValue &v2,
-                                          std::string n3, const AttributeValue &v3)
+QosWifiMacHelper::Setup (Ptr<WifiMac> mac, enum AccessClass ac, std::string dcaAttrName) const
 {
-  std::map<AccessClass, ObjectFactory>::iterator it;
-  it = m_queues.find (accessClass);
-  if (it != m_queues.end ())
-    {
-      it->second.Set (n0, v0);
-      it->second.Set (n1, v1);
-      it->second.Set (n2, v2);
-      it->second.Set (n3, v3);
-    }
+  ObjectFactory factory  = m_aggregators.find (ac)->second;
+  PointerValue ptr;
+  mac->GetAttribute (dcaAttrName, ptr);
+  Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
+  Ptr<MsduAggregator> aggregator = factory.Create<MsduAggregator> ();
+  edca->SetMsduAggregator (aggregator);
 }
 
+
 Ptr<WifiMac>
 QosWifiMacHelper::Create (void) const
 {
   Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
   
-  Ptr<EdcaTxopN> edcaQueue;
-  Ptr<MsduAggregator> aggregator;
-  std::map<AccessClass, ObjectFactory>::const_iterator itQueue;
-  std::map<AccessClass, ObjectFactory>::const_iterator itAggr;
-
-  /* Setting for VO queue */
-  itQueue = m_queues.find (AC_VO);
-  itAggr = m_aggregators.find (AC_VO);
-
-  edcaQueue = itQueue->second.Create<EdcaTxopN> ();
-  if (itAggr->second.GetTypeId ().GetUid () != 0)
-    {
-      aggregator = itAggr->second.Create<MsduAggregator> ();
-      edcaQueue->SetMsduAggregator (aggregator);
-    }
-  mac->SetAttribute ("VO_EdcaTxopN", PointerValue (edcaQueue));
-
-  /* Setting for VI queue */
-  itQueue = m_queues.find (AC_VI);
-  itAggr = m_aggregators.find (AC_VI);
-
-  edcaQueue = itQueue->second.Create<EdcaTxopN> ();
-  if (itAggr->second.GetTypeId ().GetUid () != 0)
-    {
-      aggregator = itAggr->second.Create<MsduAggregator> ();
-      edcaQueue->SetMsduAggregator (aggregator);
-    }
-  mac->SetAttribute ("VI_EdcaTxopN", PointerValue (edcaQueue));
-
-  /* Setting for BE queue */
-  itQueue = m_queues.find (AC_BE);
-  itAggr = m_aggregators.find (AC_BE);
-
-  edcaQueue = itQueue->second.Create<EdcaTxopN> ();
-  if (itAggr->second.GetTypeId ().GetUid () != 0)
-    {
-      aggregator = itAggr->second.Create<MsduAggregator> ();
-      edcaQueue->SetMsduAggregator (aggregator);
-    }
-  mac->SetAttribute ("BE_EdcaTxopN", PointerValue (edcaQueue));
-  
-  /* Setting for BK queue */
-  itQueue = m_queues.find (AC_BK);
-  itAggr = m_aggregators.find (AC_BK);
-
-  edcaQueue = itQueue->second.Create<EdcaTxopN> ();
-  if (itAggr->second.GetTypeId ().GetUid () != 0)
-    {
-      aggregator = itAggr->second.Create<MsduAggregator> ();
-      edcaQueue->SetMsduAggregator (aggregator);
-    }
-  mac->SetAttribute ("BK_EdcaTxopN", PointerValue (edcaQueue));
+  Setup (mac, AC_VO, "VO_EdcaTxopN");
+  Setup (mac, AC_VI, "VI_EdcaTxopN");
+  Setup (mac, AC_BE, "BE_EdcaTxopN");
+  Setup (mac, AC_BK, "BK_EdcaTxopN");
 
   return mac;
 }
--- a/src/helper/qos-wifi-mac-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/qos-wifi-mac-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -92,23 +92,6 @@
                                std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
                                std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
                                std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
-  /**
-   * \param accessClass access class for which we are setting edca params. Possibilities
-   *  are: AC_BK, AC_BE, AC_VI, AC_VO.
-   * \param n0 the name of the attribute to set
-   * \param v0 the value of the attribute to set
-   * \param n1 the name of the attribute to set
-   * \param v1 the value of the attribute to set
-   * \param n2 the name of the attribute to set
-   * \param v2 the value of the attribute to set
-   * \param n3 the name of the attribute to set
-   * \param v3 the value of the attribute to set
-   */
-  void SetEdcaParametersForAc (AccessClass accessClass,
-                               std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
-                               std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
-                               std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
-                               std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ());
 private:
   /**
    * \returns a newly-created MAC object.
@@ -116,9 +99,10 @@
    * This method implements the pure virtual method defined in \ref ns3::WifiMacHelper.
    */
   virtual Ptr<WifiMac> Create (void) const;
+  void Setup (Ptr<WifiMac> mac, enum AccessClass ac, std::string dcaAttrName) const;
+
 
   ObjectFactory m_mac;
-  std::map<AccessClass, ObjectFactory> m_queues;
   std::map<AccessClass, ObjectFactory> m_aggregators;
 };
 
--- a/src/helper/wifi-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/wifi-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -46,6 +46,7 @@
 {}
 
 WifiHelper::WifiHelper ()
+  : m_standard (WIFI_PHY_STANDARD_80211a)
 {}
 
 WifiHelper
@@ -79,6 +80,12 @@
   m_stationManager.Set (n7, v7);
 }
 
+void 
+WifiHelper::SetStandard (enum WifiPhyStandard standard)
+{
+  m_standard = standard;
+}
+
 NetDeviceContainer 
 WifiHelper::Install (const WifiPhyHelper &phyHelper,
                      const WifiMacHelper &macHelper, NodeContainer c) const
@@ -92,6 +99,8 @@
       Ptr<WifiMac> mac = macHelper.Create ();
       Ptr<WifiPhy> phy = phyHelper.Create (node, device);
       mac->SetAddress (Mac48Address::Allocate ());
+      mac->ConfigureStandard (m_standard);
+      phy->ConfigureStandard (m_standard);
       device->SetMac (mac);
       device->SetPhy (phy);
       device->SetRemoteStationManager (manager);
--- a/src/helper/wifi-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/wifi-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -27,6 +27,7 @@
 #include "ns3/object-factory.h"
 #include "ns3/node-container.h"
 #include "ns3/net-device-container.h"
+#include "ns3/wifi-phy-standard.h"
 
 namespace ns3 {
 
@@ -95,7 +96,8 @@
    * \returns a new WifiHelper in a default state
    *
    * The default state is defined as being an Adhoc MAC layer with an ARF rate control algorithm
-   * and both objects using their default attribute values.
+   * and both objects using their default attribute values. By default, configure MAC and PHY 
+   * for 802.11a.
    */
   static WifiHelper Default (void);
 
@@ -156,12 +158,20 @@
                               const WifiMacHelper &mac, std::string nodeName) const;
 
   /**
+   * \param standard the phy standard to configure during installation
+   *
+   * By default, all objects are configured for 802.11a
+   */
+  void SetStandard (enum WifiPhyStandard standard);
+
+  /**
    * Helper to enable all WifiNetDevice log components with one statement 
    */
   static void EnableLogComponents (void);
 
 private:
   ObjectFactory m_stationManager;
+  enum WifiPhyStandard m_standard;
 };
 
 } // namespace ns3
--- a/src/helper/yans-wifi-helper.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/helper/yans-wifi-helper.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -25,40 +25,41 @@
 #include "ns3/yans-wifi-phy.h"
 #include "ns3/wifi-net-device.h"
 #include "ns3/pcap-writer.h"
+#include "ns3/ascii-writer.h"
 #include "ns3/simulator.h"
 #include "ns3/config.h"
 #include "ns3/names.h"
 
 namespace ns3 {
 
-static void PcapSniffTxEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet, uint16_t channelFreqMhz,  
+static void PcapSniffTxEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet, uint16_t channelFreqMhz,  uint16_t channelNumber, 
                               uint32_t rate, bool isShortPreamble)
 {
   const double unusedValue = 0;
-  writer->WriteWifiMonitorPacket(packet, channelFreqMhz, rate, isShortPreamble, true, unusedValue, unusedValue); 
+  writer->WriteWifiMonitorPacket(packet, channelFreqMhz, channelNumber, rate, isShortPreamble, true, unusedValue, unusedValue); 
 }
 
 
-static void PcapSniffRxEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet, uint16_t channelFreqMhz,  
+static void PcapSniffRxEvent (Ptr<PcapWriter> writer, Ptr<const Packet> packet, uint16_t channelFreqMhz,  uint16_t channelNumber,
                               uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
 {
-  writer->WriteWifiMonitorPacket(packet, channelFreqMhz, rate, isShortPreamble, false, signalDbm, noiseDbm); 
+  writer->WriteWifiMonitorPacket(packet, channelFreqMhz, channelNumber, rate, isShortPreamble, false, signalDbm, noiseDbm); 
 }
 
 
-static void AsciiPhyTxEvent (std::ostream *os, std::string context, 
+static void AsciiPhyTxEvent (Ptr<AsciiWriter> writer, std::string path,
                              Ptr<const Packet> packet,
-                             WifiMode mode, WifiPreamble preamble, 
+                             WifiMode mode, WifiPreamble preamble,
                              uint8_t txLevel)
 {
-  *os << "+ " << Simulator::Now () << " " << context << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::TX, path, packet);
 }
 
-static void AsciiPhyRxOkEvent (std::ostream *os, std::string context, 
-                               Ptr<const Packet> packet, double snr, WifiMode mode, 
+static void AsciiPhyRxOkEvent (Ptr<AsciiWriter> writer, std::string path,
+                               Ptr<const Packet> packet, double snr, WifiMode mode,
                                enum WifiPreamble preamble)
 {
-  *os << "r " << Simulator::Now () << " " << context << " " << *packet << std::endl;
+  writer->WritePacket (AsciiWriter::RX, path, packet);
 }
 
 
@@ -234,9 +235,7 @@
     }
   oss.str ("");
   oss << filename << "-" << nodeid << "-" << deviceid << ".pcap";
-  // we must fully-qualify the call to Create below because it conflicts
-  // with the locally-defined WifiPhyHelper::Create method.
-  Ptr<PcapWriter> pcap = ::ns3::Create<PcapWriter> ();
+  Ptr<PcapWriter> pcap = CreateObject<PcapWriter> ();
   pcap->Open (oss.str ());
 
   switch (m_pcapFormat) {
@@ -309,13 +308,14 @@
 void 
 YansWifiPhyHelper::EnableAscii (std::ostream &os, uint32_t nodeid, uint32_t deviceid)
 {
+  Ptr<AsciiWriter> writer = AsciiWriter::Get (os);
   Packet::EnablePrinting ();
   std::ostringstream oss;
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/RxOk";
-  Config::Connect (oss.str (), MakeBoundCallback (&AsciiPhyRxOkEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&AsciiPhyRxOkEvent, writer));
   oss.str ("");
   oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/Tx";
-  Config::Connect (oss.str (), MakeBoundCallback (&AsciiPhyTxEvent, &os));
+  Config::Connect (oss.str (), MakeBoundCallback (&AsciiPhyTxEvent, writer));
 }
 void 
 YansWifiPhyHelper::EnableAscii (std::ostream &os, NetDeviceContainer d)
--- a/src/internet-stack/udp-socket-impl.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/internet-stack/udp-socket-impl.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -203,9 +203,16 @@
 }
 
 int
-UdpSocketImpl::Close(void)
+UdpSocketImpl::Close (void)
 {
   NS_LOG_FUNCTION_NOARGS ();
+  if (m_shutdownRecv == true && m_shutdownSend == true)
+    {
+      m_errno = Socket::ERROR_BADF;
+      return -1;
+    }
+  m_shutdownRecv = true;
+  m_shutdownSend = true;
   return 0;
 }
 
--- a/src/mobility/constant-position-mobility-model.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/constant-position-mobility-model.h	Tue Aug 18 12:01:35 2009 +0400
@@ -21,7 +21,6 @@
 #define CONSTANT_POSITION_MOBILITY_MODEL_H
 
 #include "mobility-model.h"
-#include "vector.h"
 
 namespace ns3 {
 
--- a/src/mobility/constant-velocity-helper.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/constant-velocity-helper.h	Tue Aug 18 12:01:35 2009 +0400
@@ -21,7 +21,7 @@
 #define CONSTANT_VELOCITY_HELPER_H
 
 #include "ns3/nstime.h"
-#include "vector.h"
+#include "ns3/vector.h"
 
 namespace ns3 {
 
--- a/src/mobility/constant-velocity-mobility-model.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/constant-velocity-mobility-model.h	Tue Aug 18 12:01:35 2009 +0400
@@ -21,8 +21,8 @@
 #define CONSTANT_VELOCITY_MOBILITY_MODEL_H
 
 #include <stdint.h>
+#include "ns3/nstime.h"
 #include "mobility-model.h"
-#include "ns3/nstime.h"
 #include "constant-velocity-helper.h"
 
 namespace ns3 {
--- a/src/mobility/mobility-model.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/mobility-model.h	Tue Aug 18 12:01:35 2009 +0400
@@ -20,8 +20,7 @@
 #ifndef MOBILITY_MODEL_H
 #define MOBILITY_MODEL_H
 
-#include "vector.h"
-
+#include "ns3/vector.h"
 #include "ns3/object.h"
 #include "ns3/traced-callback.h"
 
--- a/src/mobility/position-allocator.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/position-allocator.h	Tue Aug 18 12:01:35 2009 +0400
@@ -22,7 +22,7 @@
 
 #include "ns3/object.h"
 #include "ns3/random-variable.h"
-#include "vector.h"
+#include "ns3/vector.h"
 
 namespace ns3 {
 
--- a/src/mobility/rectangle.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/rectangle.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -18,7 +18,7 @@
  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
  */
 #include "rectangle.h"
-#include "vector.h"
+#include "ns3/vector.h"
 #include "ns3/assert.h"
 #include "ns3/fatal-error.h"
 #include <cmath>
--- a/src/mobility/rectangle.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/rectangle.h	Tue Aug 18 12:01:35 2009 +0400
@@ -22,11 +22,10 @@
 
 #include "ns3/attribute.h"
 #include "ns3/attribute-helper.h"
+#include "ns3/vector.h"
 
 namespace ns3 {
 
-class Vector;
-
 /**
  * \brief a 2d rectangle
  */
--- a/src/mobility/vector.cc	Tue Aug 18 11:47:17 2009 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2007 INRIA
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
- */
-#include "vector.h"
-#include "ns3/fatal-error.h"
-#include <cmath>
-#include <sstream>
-
-namespace ns3 {
-
-ATTRIBUTE_HELPER_CPP (Vector);
-
-
-Vector::Vector (double _x, double _y, double _z)
-  : x (_x),
-    y (_y),
-    z (_z)
-{}
-
-Vector::Vector ()
-  : x (0.0),
-    y (0.0),
-    z (0.0)
-{}
-
-double 
-CalculateDistance (const Vector &a, const Vector &b)
-{
-  double dx = b.x - a.x;
-  double dy = b.y - a.y;
-  double dz = b.z - a.z;
-  double distance = std::sqrt (dx * dx + dy * dy + dz * dz);
-  return distance;
-}
-
-std::ostream &operator << (std::ostream &os, const Vector &vector)
-{
-  os << vector.x << ":" << vector.y << ":" << vector.z;
-  return os;
-}
-std::istream &operator >> (std::istream &is, Vector &vector)
-{
-  char c1, c2;
-  is >> vector.x >> c1 >> vector.y >> c2 >> vector.z;
-  if (c1 != ':' ||
-      c2 != ':')
-    {
-      is.setstate (std::ios_base::failbit);
-    }
-  return is;
-}
-
-} // namespace ns3
--- a/src/mobility/vector.h	Tue Aug 18 11:47:17 2009 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2007 INRIA
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
- */
-#ifndef VECTOR_H
-#define VECTOR_H
-
-#include "ns3/attribute.h"
-#include "ns3/attribute-helper.h"
-
-namespace ns3 {
-
-/**
- * \brief a 3d cartesian position vector
- *
- * Unit is meters.
- */
-class Vector
-{
-public:
-  /**
-   * \param _x x coordinate of vector vector
-   * \param _y y coordinate of vector vector
-   * \param _z z coordinate of vector vector
-   *
-   * Create vector vector (_x, _y, _z)
-   */
-  Vector (double _x, double _y, double _z);
-  /**
-   * Create vector vector (0.0, 0.0, 0.0)
-   */
-  Vector ();
-  /**
-   * x coordinate of vector vector
-   */
-  double x;
-  /**
-   * y coordinate of vector vector
-   */
-  double y;
-  /**
-   * z coordinate of vector vector
-   */
-  double z;
-};
-
-/**
- * \param a one point
- * \param b another point
- * \returns the cartesian distance between a and b.
- */
-double CalculateDistance (const Vector &a, const Vector &b);
-
-/**
- * \class ns3::VectorValue
- * \brief hold objects of type ns3::Vector
- */
-
-ATTRIBUTE_HELPER_HEADER (Vector);
-
-std::ostream &operator << (std::ostream &os, const Vector &vector);
-std::istream &operator >> (std::istream &is, Vector &vector);
-
-} // namespace ns3
-
-#endif /* VECTOR_H */
--- a/src/mobility/wscript	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/mobility/wscript	Tue Aug 18 12:01:35 2009 +0400
@@ -3,7 +3,6 @@
 def build(bld):
     mobility = bld.create_ns3_module('mobility', ['core', 'simulator'])
     mobility.source = [
-        'vector.cc',
         'hierarchical-mobility-model.cc',
         'mobility-model.cc',
         'position-allocator.cc',
@@ -20,7 +19,6 @@
     headers = bld.new_task_gen('ns3header')
     headers.module = 'mobility'
     headers.source = [
-        'vector.h',
         'hierarchical-mobility-model.h',
         'mobility-model.h',
         'position-allocator.h',
--- a/src/node/ipv4.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/node/ipv4.h	Tue Aug 18 12:01:35 2009 +0400
@@ -37,7 +37,9 @@
 /**
  * \ingroup node
  * \defgroup ipv4 Ipv4
- * 
+ */
+/**
+ * \ingroup ipv4
  * \brief Access to the Ipv4 forwarding table, interfaces, and configuration
  *
  * This class defines the API to manipulate the following aspects of
--- a/src/node/packet-socket.cc	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/node/packet-socket.cc	Tue Aug 18 12:01:35 2009 +0400
@@ -172,7 +172,7 @@
       m_errno = ERROR_BADF;
       return -1;
     }
-  m_shutdownRecv = false;
+  m_shutdownRecv = true;
   return 0;
 }
 
@@ -186,6 +186,8 @@
       return -1;
     }
   m_state = STATE_CLOSED;
+  m_shutdownSend = true;
+  m_shutdownRecv = true;
   return 0;
 }
 
--- a/src/node/socket.h	Tue Aug 18 11:47:17 2009 +0400
+++ b/src/node/socket.h	Tue Aug 18 12:01:35 2009 +0400
@@ -184,6 +184,7 @@
 
   /** 
    * \brief Close a socket.
+   * \returns zero on success, -1 on failure.
    *
    * After the Close call, the socket is no longer valid, and cannot
    * safely be used for subsequent operations.