diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py index 0af5e4294..f52a7e23a 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py @@ -47,6 +47,8 @@ def register_types(module): module.add_class('Chunk', parent=root_module['ns3::ObjectBase']) ## header.h: ns3::Header [class] module.add_class('Header', parent=root_module['ns3::Chunk']) + ## pcap-file-object.h: ns3::PcapFileObject [class] + module.add_class('PcapFileObject', parent=root_module['ns3::Object']) ## pcap-writer.h: ns3::PcapWriter [class] module.add_class('PcapWriter', parent=root_module['ns3::Object']) ## simple-ref-count.h: ns3::SimpleRefCount > [class] @@ -175,6 +177,7 @@ def register_methods(root_module): register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) + register_Ns3PcapFileObject_methods(root_module, root_module['ns3::PcapFileObject']) register_Ns3PcapWriter_methods(root_module, root_module['ns3::PcapWriter']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) register_Ns3AsciiWriter_methods(root_module, root_module['ns3::AsciiWriter']) @@ -948,6 +951,38 @@ def register_Ns3Header_methods(root_module, cls): is_pure_virtual=True, is_const=True, is_virtual=True) return +def register_Ns3PcapFileObject_methods(root_module, cls): + ## pcap-file-object.h: ns3::PcapFileObject::PcapFileObject(ns3::PcapFileObject const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapFileObject const &', 'arg0')]) + ## pcap-file-object.h: ns3::PcapFileObject::PcapFileObject() [constructor] + cls.add_constructor([]) + ## pcap-file-object.h: void ns3::PcapFileObject::Close() [member function] + cls.add_method('Close', + 'void', + []) + ## pcap-file-object.h: static ns3::TypeId ns3::PcapFileObject::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## pcap-file-object.h: bool ns3::PcapFileObject::Init(uint32_t dataLinkType, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT, int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] + cls.add_method('Init', + 'bool', + [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'tzCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT')]) + ## pcap-file-object.h: bool ns3::PcapFileObject::Open(std::string const & filename, std::string const & mode) [member function] + cls.add_method('Open', + 'bool', + [param('std::string const &', 'filename'), param('std::string const &', 'mode')]) + ## pcap-file-object.h: bool ns3::PcapFileObject::Write(ns3::Time t, ns3::Ptr p) [member function] + cls.add_method('Write', + 'bool', + [param('ns3::Time', 't'), param('ns3::Ptr< ns3::Packet const >', 'p')]) + ## pcap-file-object.h: bool ns3::PcapFileObject::Write(ns3::Time t, uint8_t const * buffer, uint32_t length) [member function] + cls.add_method('Write', + 'bool', + [param('ns3::Time', 't'), param('uint8_t const *', 'buffer'), param('uint32_t', 'length')]) + return + 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')]) diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py index 64ee1c931..fb119d80b 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py @@ -3043,6 +3043,11 @@ def register_functions(root_module): module.add_function('MakeBooleanChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) + ## callback.h: extern ns3::Callback,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr,::ns3::Ptr ) * fnPtr, ns3::Ptr a) [free function] + module.add_function('MakeBoundCallback', + 'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', + [param('void ( * ) ( ns3::Ptr< ns3::PcapFileObject >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::PcapFileObject >', 'a')], + template_parameters=['void', 'ns3::Ptr', 'ns3::Ptr', 'ns3::Ptr']) ## callback.h: extern ns3::Ptr ns3::MakeCallbackChecker() [free function] module.add_function('MakeCallbackChecker', 'ns3::Ptr< ns3::AttributeChecker const >', @@ -3097,7 +3102,7 @@ def register_functions(root_module): module.add_function('TypeNameGet', 'std::string', [], - template_parameters=['long long']) + template_parameters=['long']) ## type-name.h: extern std::string ns3::TypeNameGet() [free function] module.add_function('TypeNameGet', 'std::string', diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py index 209f3b675..b909570b8 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py @@ -11,12 +11,8 @@ def register_types(module): module.add_class('AthstatsHelper', allow_subclassing=False) ## bridge-helper.h: ns3::BridgeHelper [class] module.add_class('BridgeHelper', allow_subclassing=False) - ## csma-helper.h: ns3::CsmaHelper [class] - module.add_class('CsmaHelper', allow_subclassing=False) ## csma-star-helper.h: ns3::CsmaStarHelper [class] module.add_class('CsmaStarHelper', allow_subclassing=False) - ## emu-helper.h: ns3::EmuHelper [class] - module.add_class('EmuHelper', allow_subclassing=False) ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class] module.add_class('FlowMonitorHelper', allow_subclassing=False) ## internet-stack-helper.h: ns3::InternetStackHelper [class] @@ -57,6 +53,12 @@ def register_types(module): module.add_class('PacketSinkHelper', allow_subclassing=False) ## packet-socket-helper.h: ns3::PacketSocketHelper [class] module.add_class('PacketSocketHelper', allow_subclassing=False) + ## pcap-helper.h: ns3::PcapHelper [class] + module.add_class('PcapHelper', allow_subclassing=False) + ## pcap-helper.h: ns3::PcapHelper::DataLinkType [enumeration] + module.add_enum('DataLinkType', ['DLT_NULL', 'DLT_EN10MB', 'DLT_PPP', 'DLT_IEEE802_11', 'DLT_PRISM_HEADER', 'DLT_IEEE802_11_RADIO'], outer_class=root_module['ns3::PcapHelper']) + ## pcap-user-helper.h: ns3::PcapUserHelper [class] + module.add_class('PcapUserHelper', allow_subclassing=False) ## ping6-helper.h: ns3::Ping6Helper [class] module.add_class('Ping6Helper', allow_subclassing=False) ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper [class] @@ -64,7 +66,7 @@ def register_types(module): ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper [class] module.add_class('PointToPointGridHelper', allow_subclassing=False) ## point-to-point-helper.h: ns3::PointToPointHelper [class] - module.add_class('PointToPointHelper', allow_subclassing=False) + module.add_class('PointToPointHelper', allow_subclassing=False, parent=root_module['ns3::PcapUserHelper']) ## point-to-point-star-helper.h: ns3::PointToPointStarHelper [class] module.add_class('PointToPointStarHelper', allow_subclassing=False) ## tap-bridge-helper.h: ns3::TapBridgeHelper [class] @@ -89,12 +91,12 @@ def register_types(module): module.add_class('WifiPhyHelper', allow_subclassing=False) ## yans-wifi-helper.h: ns3::YansWifiChannelHelper [class] module.add_class('YansWifiChannelHelper', allow_subclassing=False) - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper [class] - module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper']) - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::PcapFormat [enumeration] - module.add_enum('PcapFormat', ['PCAP_FORMAT_80211', 'PCAP_FORMAT_80211_PRISM', 'PCAP_FORMAT_80211_RADIOTAP'], outer_class=root_module['ns3::YansWifiPhyHelper']) ## aodv-helper.h: ns3::AodvHelper [class] module.add_class('AodvHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## csma-helper.h: ns3::CsmaHelper [class] + module.add_class('CsmaHelper', allow_subclassing=False, parent=root_module['ns3::PcapUserHelper']) + ## emu-helper.h: ns3::EmuHelper [class] + module.add_class('EmuHelper', allow_subclassing=False, parent=root_module['ns3::PcapUserHelper']) ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper [class] module.add_class('Ipv4GlobalRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper [class] @@ -203,9 +205,7 @@ def register_methods(root_module): register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer']) register_Ns3AthstatsHelper_methods(root_module, root_module['ns3::AthstatsHelper']) register_Ns3BridgeHelper_methods(root_module, root_module['ns3::BridgeHelper']) - register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper']) register_Ns3CsmaStarHelper_methods(root_module, root_module['ns3::CsmaStarHelper']) - register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper']) register_Ns3FlowMonitorHelper_methods(root_module, root_module['ns3::FlowMonitorHelper']) register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper']) register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper']) @@ -225,6 +225,8 @@ def register_methods(root_module): register_Ns3OnOffHelper_methods(root_module, root_module['ns3::OnOffHelper']) register_Ns3PacketSinkHelper_methods(root_module, root_module['ns3::PacketSinkHelper']) register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper']) + register_Ns3PcapHelper_methods(root_module, root_module['ns3::PcapHelper']) + register_Ns3PcapUserHelper_methods(root_module, root_module['ns3::PcapUserHelper']) register_Ns3Ping6Helper_methods(root_module, root_module['ns3::Ping6Helper']) register_Ns3PointToPointDumbbellHelper_methods(root_module, root_module['ns3::PointToPointDumbbellHelper']) register_Ns3PointToPointGridHelper_methods(root_module, root_module['ns3::PointToPointGridHelper']) @@ -241,8 +243,9 @@ def register_methods(root_module): register_Ns3WifiMacHelper_methods(root_module, root_module['ns3::WifiMacHelper']) register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper']) register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper']) - register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper']) register_Ns3AodvHelper_methods(root_module, root_module['ns3::AodvHelper']) + register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper']) + register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper']) register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, root_module['ns3::Ipv4GlobalRoutingHelper']) register_Ns3Ipv4ListRoutingHelper_methods(root_module, root_module['ns3::Ipv4ListRoutingHelper']) register_Ns3Ipv4NixVectorHelper_methods(root_module, root_module['ns3::Ipv4NixVectorHelper']) @@ -372,120 +375,6 @@ def register_Ns3BridgeHelper_methods(root_module, cls): [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) return -def register_Ns3CsmaHelper_methods(root_module, cls): - ## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')]) - ## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor] - cls.add_constructor([]) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAsciiAll(std::ostream & os) [member function] - cls.add_method('EnableAsciiAll', - 'void', - [param('std::ostream &', 'os')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::Ptr nd, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, std::string ndName, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcapAll(std::string filename, bool promiscuous) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string name) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'name')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, std::string channelName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'channelName')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, ns3::Ptr channel) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'nodeName'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, std::string channelName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'nodeName'), param('std::string', 'channelName')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, std::string channelName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c'), param('std::string', 'channelName')], - is_const=True) - ## csma-helper.h: void ns3::CsmaHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetChannelAttribute', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## csma-helper.h: void ns3::CsmaHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetDeviceAttribute', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] - cls.add_method('SetQueue', - 'void', - [param('std::string', 'type'), 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()')]) - return - def register_Ns3CsmaStarHelper_methods(root_module, cls): ## csma-star-helper.h: ns3::CsmaStarHelper::CsmaStarHelper(ns3::CsmaStarHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::CsmaStarHelper const &', 'arg0')]) @@ -536,86 +425,6 @@ def register_Ns3CsmaStarHelper_methods(root_module, cls): is_const=True) return -def register_Ns3EmuHelper_methods(root_module, cls): - ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')]) - ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor] - cls.add_constructor([]) - ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnableAsciiAll(std::ostream & os) [member function] - cls.add_method('EnableAsciiAll', - 'void', - [param('std::ostream &', 'os')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::Ptr nd, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, std::string ndName, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcapAll(std::string filename, bool promiscuous) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::Ptr node) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node')], - is_const=True) - ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(std::string nodeName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'nodeName')], - is_const=True) - ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c')], - is_const=True) - ## emu-helper.h: void ns3::EmuHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetAttribute', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] - cls.add_method('SetQueue', - 'void', - [param('std::string', 'type'), 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()')]) - return - def register_Ns3FlowMonitorHelper_methods(root_module, cls): ## flow-monitor-helper.h: ns3::FlowMonitorHelper::FlowMonitorHelper(ns3::FlowMonitorHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::FlowMonitorHelper const &', 'arg0')]) @@ -1310,6 +1119,57 @@ def register_Ns3PacketSocketHelper_methods(root_module, cls): is_const=True) return +def register_Ns3PcapHelper_methods(root_module, cls): + ## pcap-helper.h: ns3::PcapHelper::PcapHelper(ns3::PcapHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')]) + ## pcap-helper.h: ns3::PcapHelper::PcapHelper() [constructor] + cls.add_constructor([]) + ## pcap-helper.h: ns3::Ptr ns3::PcapHelper::CreateFile(std::string filename, std::string filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function] + cls.add_method('CreateFile', + 'ns3::Ptr< ns3::PcapFileObject >', + [param('std::string', 'filename'), param('std::string', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')]) + ## pcap-helper.h: std::string ns3::PcapHelper::GetFilename(std::string prefix, ns3::Ptr device, bool useObjectNames=true) [member function] + cls.add_method('GetFilename', + 'std::string', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'useObjectNames', default_value='true')]) + return + +def register_Ns3PcapUserHelper_methods(root_module, cls): + ## pcap-user-helper.h: ns3::PcapUserHelper::PcapUserHelper() [constructor] + cls.add_constructor([]) + ## pcap-user-helper.h: ns3::PcapUserHelper::PcapUserHelper(ns3::PcapUserHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapUserHelper const &', 'arg0')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string prefix, std::string ndName, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'prefix'), param('std::string', 'ndName'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcapAll(std::string filename, bool promiscuous=false) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], + is_pure_virtual=True, is_virtual=True) + return + def register_Ns3Ping6Helper_methods(root_module, cls): ## ping6-helper.h: ns3::Ping6Helper::Ping6Helper(ns3::Ping6Helper const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ping6Helper const &', 'arg0')]) @@ -1452,36 +1312,6 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::Ptr nd) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, std::string ndName) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcapAll(std::string filename) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename')], - is_static=True) ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::NodeContainer c) [member function] cls.add_method('Install', 'ns3::NetDeviceContainer', @@ -1514,6 +1344,11 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): cls.add_method('SetQueue', 'void', [param('std::string', 'type'), 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()')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')], + visibility='private', is_virtual=True) return def register_Ns3PointToPointStarHelper_methods(root_module, cls): @@ -1827,87 +1662,6 @@ def register_Ns3YansWifiChannelHelper_methods(root_module, cls): [param('std::string', 'name'), 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()')]) return -def register_Ns3YansWifiPhyHelper_methods(root_module, cls): - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper(ns3::YansWifiPhyHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::YansWifiPhyHelper const &', 'arg0')]) - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper() [constructor] - cls.add_constructor([]) - ## yans-wifi-helper.h: static ns3::YansWifiPhyHelper ns3::YansWifiPhyHelper::Default() [member function] - cls.add_method('Default', - 'ns3::YansWifiPhyHelper', - [], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAsciiAll(std::ostream & os) [member function] - cls.add_method('EnableAsciiAll', - 'void', - [param('std::ostream &', 'os')], - is_static=True) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::Ptr nd) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, std::string ndName) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcapAll(std::string filename) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] - cls.add_method('Set', - 'void', - [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(ns3::Ptr channel) [member function] - cls.add_method('SetChannel', - 'void', - [param('ns3::Ptr< ns3::YansWifiChannel >', 'channel')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(std::string channelName) [member function] - cls.add_method('SetChannel', - 'void', - [param('std::string', 'channelName')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetErrorRateModel(std::string name, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] - cls.add_method('SetErrorRateModel', - 'void', - [param('std::string', 'name'), 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()')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetPcapFormat(ns3::YansWifiPhyHelper::PcapFormat format) [member function] - cls.add_method('SetPcapFormat', - 'void', - [param('ns3::YansWifiPhyHelper::PcapFormat', 'format')]) - ## yans-wifi-helper.h: ns3::Ptr ns3::YansWifiPhyHelper::Create(ns3::Ptr node, ns3::Ptr device) const [member function] - cls.add_method('Create', - 'ns3::Ptr< ns3::WifiPhy >', - [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::WifiNetDevice >', 'device')], - is_const=True, visibility='private', is_virtual=True) - return - def register_Ns3AodvHelper_methods(root_module, cls): ## aodv-helper.h: ns3::AodvHelper::AodvHelper(ns3::AodvHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::AodvHelper const &', 'arg0')]) @@ -1929,6 +1683,150 @@ def register_Ns3AodvHelper_methods(root_module, cls): [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) return +def register_Ns3CsmaHelper_methods(root_module, cls): + ## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')]) + ## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor] + cls.add_constructor([]) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string name) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'name')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: void ns3::CsmaHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetChannelAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## csma-helper.h: void ns3::CsmaHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), 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()')]) + ## csma-helper.h: void ns3::CsmaHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')], + visibility='private', is_virtual=True) + return + +def register_Ns3EmuHelper_methods(root_module, cls): + ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')]) + ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor] + cls.add_constructor([]) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## emu-helper.h: void ns3::EmuHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), 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()')]) + ## emu-helper.h: void ns3::EmuHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')], + visibility='private', is_virtual=True) + return + def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls): ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor] cls.add_constructor([]) diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_common.py b/bindings/python/apidefs/gcc-LP64/ns3_module_common.py index 0af5e4294..f52a7e23a 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_common.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_common.py @@ -47,6 +47,8 @@ def register_types(module): module.add_class('Chunk', parent=root_module['ns3::ObjectBase']) ## header.h: ns3::Header [class] module.add_class('Header', parent=root_module['ns3::Chunk']) + ## pcap-file-object.h: ns3::PcapFileObject [class] + module.add_class('PcapFileObject', parent=root_module['ns3::Object']) ## pcap-writer.h: ns3::PcapWriter [class] module.add_class('PcapWriter', parent=root_module['ns3::Object']) ## simple-ref-count.h: ns3::SimpleRefCount > [class] @@ -175,6 +177,7 @@ def register_methods(root_module): register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) + register_Ns3PcapFileObject_methods(root_module, root_module['ns3::PcapFileObject']) register_Ns3PcapWriter_methods(root_module, root_module['ns3::PcapWriter']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) register_Ns3AsciiWriter_methods(root_module, root_module['ns3::AsciiWriter']) @@ -948,6 +951,38 @@ def register_Ns3Header_methods(root_module, cls): is_pure_virtual=True, is_const=True, is_virtual=True) return +def register_Ns3PcapFileObject_methods(root_module, cls): + ## pcap-file-object.h: ns3::PcapFileObject::PcapFileObject(ns3::PcapFileObject const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapFileObject const &', 'arg0')]) + ## pcap-file-object.h: ns3::PcapFileObject::PcapFileObject() [constructor] + cls.add_constructor([]) + ## pcap-file-object.h: void ns3::PcapFileObject::Close() [member function] + cls.add_method('Close', + 'void', + []) + ## pcap-file-object.h: static ns3::TypeId ns3::PcapFileObject::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## pcap-file-object.h: bool ns3::PcapFileObject::Init(uint32_t dataLinkType, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT, int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] + cls.add_method('Init', + 'bool', + [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'tzCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT')]) + ## pcap-file-object.h: bool ns3::PcapFileObject::Open(std::string const & filename, std::string const & mode) [member function] + cls.add_method('Open', + 'bool', + [param('std::string const &', 'filename'), param('std::string const &', 'mode')]) + ## pcap-file-object.h: bool ns3::PcapFileObject::Write(ns3::Time t, ns3::Ptr p) [member function] + cls.add_method('Write', + 'bool', + [param('ns3::Time', 't'), param('ns3::Ptr< ns3::Packet const >', 'p')]) + ## pcap-file-object.h: bool ns3::PcapFileObject::Write(ns3::Time t, uint8_t const * buffer, uint32_t length) [member function] + cls.add_method('Write', + 'bool', + [param('ns3::Time', 't'), param('uint8_t const *', 'buffer'), param('uint32_t', 'length')]) + return + 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')]) diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_core.py b/bindings/python/apidefs/gcc-LP64/ns3_module_core.py index 6772883d9..a4cef0357 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_core.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_core.py @@ -3043,6 +3043,11 @@ def register_functions(root_module): module.add_function('MakeBooleanChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) + ## callback.h: extern ns3::Callback,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr,::ns3::Ptr ) * fnPtr, ns3::Ptr a) [free function] + module.add_function('MakeBoundCallback', + 'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', + [param('void ( * ) ( ns3::Ptr< ns3::PcapFileObject >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::PcapFileObject >', 'a')], + template_parameters=['void', 'ns3::Ptr', 'ns3::Ptr', 'ns3::Ptr']) ## callback.h: extern ns3::Ptr ns3::MakeCallbackChecker() [free function] module.add_function('MakeCallbackChecker', 'ns3::Ptr< ns3::AttributeChecker const >', diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py index 209f3b675..b909570b8 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py @@ -11,12 +11,8 @@ def register_types(module): module.add_class('AthstatsHelper', allow_subclassing=False) ## bridge-helper.h: ns3::BridgeHelper [class] module.add_class('BridgeHelper', allow_subclassing=False) - ## csma-helper.h: ns3::CsmaHelper [class] - module.add_class('CsmaHelper', allow_subclassing=False) ## csma-star-helper.h: ns3::CsmaStarHelper [class] module.add_class('CsmaStarHelper', allow_subclassing=False) - ## emu-helper.h: ns3::EmuHelper [class] - module.add_class('EmuHelper', allow_subclassing=False) ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class] module.add_class('FlowMonitorHelper', allow_subclassing=False) ## internet-stack-helper.h: ns3::InternetStackHelper [class] @@ -57,6 +53,12 @@ def register_types(module): module.add_class('PacketSinkHelper', allow_subclassing=False) ## packet-socket-helper.h: ns3::PacketSocketHelper [class] module.add_class('PacketSocketHelper', allow_subclassing=False) + ## pcap-helper.h: ns3::PcapHelper [class] + module.add_class('PcapHelper', allow_subclassing=False) + ## pcap-helper.h: ns3::PcapHelper::DataLinkType [enumeration] + module.add_enum('DataLinkType', ['DLT_NULL', 'DLT_EN10MB', 'DLT_PPP', 'DLT_IEEE802_11', 'DLT_PRISM_HEADER', 'DLT_IEEE802_11_RADIO'], outer_class=root_module['ns3::PcapHelper']) + ## pcap-user-helper.h: ns3::PcapUserHelper [class] + module.add_class('PcapUserHelper', allow_subclassing=False) ## ping6-helper.h: ns3::Ping6Helper [class] module.add_class('Ping6Helper', allow_subclassing=False) ## point-to-point-dumbbell-helper.h: ns3::PointToPointDumbbellHelper [class] @@ -64,7 +66,7 @@ def register_types(module): ## point-to-point-grid-helper.h: ns3::PointToPointGridHelper [class] module.add_class('PointToPointGridHelper', allow_subclassing=False) ## point-to-point-helper.h: ns3::PointToPointHelper [class] - module.add_class('PointToPointHelper', allow_subclassing=False) + module.add_class('PointToPointHelper', allow_subclassing=False, parent=root_module['ns3::PcapUserHelper']) ## point-to-point-star-helper.h: ns3::PointToPointStarHelper [class] module.add_class('PointToPointStarHelper', allow_subclassing=False) ## tap-bridge-helper.h: ns3::TapBridgeHelper [class] @@ -89,12 +91,12 @@ def register_types(module): module.add_class('WifiPhyHelper', allow_subclassing=False) ## yans-wifi-helper.h: ns3::YansWifiChannelHelper [class] module.add_class('YansWifiChannelHelper', allow_subclassing=False) - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper [class] - module.add_class('YansWifiPhyHelper', allow_subclassing=False, parent=root_module['ns3::WifiPhyHelper']) - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::PcapFormat [enumeration] - module.add_enum('PcapFormat', ['PCAP_FORMAT_80211', 'PCAP_FORMAT_80211_PRISM', 'PCAP_FORMAT_80211_RADIOTAP'], outer_class=root_module['ns3::YansWifiPhyHelper']) ## aodv-helper.h: ns3::AodvHelper [class] module.add_class('AodvHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) + ## csma-helper.h: ns3::CsmaHelper [class] + module.add_class('CsmaHelper', allow_subclassing=False, parent=root_module['ns3::PcapUserHelper']) + ## emu-helper.h: ns3::EmuHelper [class] + module.add_class('EmuHelper', allow_subclassing=False, parent=root_module['ns3::PcapUserHelper']) ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper [class] module.add_class('Ipv4GlobalRoutingHelper', allow_subclassing=False, parent=root_module['ns3::Ipv4RoutingHelper']) ## ipv4-list-routing-helper.h: ns3::Ipv4ListRoutingHelper [class] @@ -203,9 +205,7 @@ def register_methods(root_module): register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer']) register_Ns3AthstatsHelper_methods(root_module, root_module['ns3::AthstatsHelper']) register_Ns3BridgeHelper_methods(root_module, root_module['ns3::BridgeHelper']) - register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper']) register_Ns3CsmaStarHelper_methods(root_module, root_module['ns3::CsmaStarHelper']) - register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper']) register_Ns3FlowMonitorHelper_methods(root_module, root_module['ns3::FlowMonitorHelper']) register_Ns3InternetStackHelper_methods(root_module, root_module['ns3::InternetStackHelper']) register_Ns3Ipv4AddressHelper_methods(root_module, root_module['ns3::Ipv4AddressHelper']) @@ -225,6 +225,8 @@ def register_methods(root_module): register_Ns3OnOffHelper_methods(root_module, root_module['ns3::OnOffHelper']) register_Ns3PacketSinkHelper_methods(root_module, root_module['ns3::PacketSinkHelper']) register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper']) + register_Ns3PcapHelper_methods(root_module, root_module['ns3::PcapHelper']) + register_Ns3PcapUserHelper_methods(root_module, root_module['ns3::PcapUserHelper']) register_Ns3Ping6Helper_methods(root_module, root_module['ns3::Ping6Helper']) register_Ns3PointToPointDumbbellHelper_methods(root_module, root_module['ns3::PointToPointDumbbellHelper']) register_Ns3PointToPointGridHelper_methods(root_module, root_module['ns3::PointToPointGridHelper']) @@ -241,8 +243,9 @@ def register_methods(root_module): register_Ns3WifiMacHelper_methods(root_module, root_module['ns3::WifiMacHelper']) register_Ns3WifiPhyHelper_methods(root_module, root_module['ns3::WifiPhyHelper']) register_Ns3YansWifiChannelHelper_methods(root_module, root_module['ns3::YansWifiChannelHelper']) - register_Ns3YansWifiPhyHelper_methods(root_module, root_module['ns3::YansWifiPhyHelper']) register_Ns3AodvHelper_methods(root_module, root_module['ns3::AodvHelper']) + register_Ns3CsmaHelper_methods(root_module, root_module['ns3::CsmaHelper']) + register_Ns3EmuHelper_methods(root_module, root_module['ns3::EmuHelper']) register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, root_module['ns3::Ipv4GlobalRoutingHelper']) register_Ns3Ipv4ListRoutingHelper_methods(root_module, root_module['ns3::Ipv4ListRoutingHelper']) register_Ns3Ipv4NixVectorHelper_methods(root_module, root_module['ns3::Ipv4NixVectorHelper']) @@ -372,120 +375,6 @@ def register_Ns3BridgeHelper_methods(root_module, cls): [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) return -def register_Ns3CsmaHelper_methods(root_module, cls): - ## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')]) - ## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor] - cls.add_constructor([]) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnableAsciiAll(std::ostream & os) [member function] - cls.add_method('EnableAsciiAll', - 'void', - [param('std::ostream &', 'os')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::Ptr nd, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, std::string ndName, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: static void ns3::CsmaHelper::EnablePcapAll(std::string filename, bool promiscuous) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename'), param('bool', 'promiscuous')], - is_static=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string name) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'name')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, std::string channelName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'channelName')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, ns3::Ptr channel) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'nodeName'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, std::string channelName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'nodeName'), param('std::string', 'channelName')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], - is_const=True) - ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, std::string channelName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c'), param('std::string', 'channelName')], - is_const=True) - ## csma-helper.h: void ns3::CsmaHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetChannelAttribute', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## csma-helper.h: void ns3::CsmaHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetDeviceAttribute', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] - cls.add_method('SetQueue', - 'void', - [param('std::string', 'type'), 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()')]) - return - def register_Ns3CsmaStarHelper_methods(root_module, cls): ## csma-star-helper.h: ns3::CsmaStarHelper::CsmaStarHelper(ns3::CsmaStarHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::CsmaStarHelper const &', 'arg0')]) @@ -536,86 +425,6 @@ def register_Ns3CsmaStarHelper_methods(root_module, cls): is_const=True) return -def register_Ns3EmuHelper_methods(root_module, cls): - ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')]) - ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor] - cls.add_constructor([]) - ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnableAsciiAll(std::ostream & os) [member function] - cls.add_method('EnableAsciiAll', - 'void', - [param('std::ostream &', 'os')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::Ptr nd, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, std::string ndName, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: static void ns3::EmuHelper::EnablePcapAll(std::string filename, bool promiscuous) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename'), param('bool', 'promiscuous')], - is_static=True) - ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::Ptr node) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::Ptr< ns3::Node >', 'node')], - is_const=True) - ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(std::string nodeName) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('std::string', 'nodeName')], - is_const=True) - ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function] - cls.add_method('Install', - 'ns3::NetDeviceContainer', - [param('ns3::NodeContainer const &', 'c')], - is_const=True) - ## emu-helper.h: void ns3::EmuHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] - cls.add_method('SetAttribute', - 'void', - [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) - ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] - cls.add_method('SetQueue', - 'void', - [param('std::string', 'type'), 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()')]) - return - def register_Ns3FlowMonitorHelper_methods(root_module, cls): ## flow-monitor-helper.h: ns3::FlowMonitorHelper::FlowMonitorHelper(ns3::FlowMonitorHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::FlowMonitorHelper const &', 'arg0')]) @@ -1310,6 +1119,57 @@ def register_Ns3PacketSocketHelper_methods(root_module, cls): is_const=True) return +def register_Ns3PcapHelper_methods(root_module, cls): + ## pcap-helper.h: ns3::PcapHelper::PcapHelper(ns3::PcapHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')]) + ## pcap-helper.h: ns3::PcapHelper::PcapHelper() [constructor] + cls.add_constructor([]) + ## pcap-helper.h: ns3::Ptr ns3::PcapHelper::CreateFile(std::string filename, std::string filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function] + cls.add_method('CreateFile', + 'ns3::Ptr< ns3::PcapFileObject >', + [param('std::string', 'filename'), param('std::string', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')]) + ## pcap-helper.h: std::string ns3::PcapHelper::GetFilename(std::string prefix, ns3::Ptr device, bool useObjectNames=true) [member function] + cls.add_method('GetFilename', + 'std::string', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'useObjectNames', default_value='true')]) + return + +def register_Ns3PcapUserHelper_methods(root_module, cls): + ## pcap-user-helper.h: ns3::PcapUserHelper::PcapUserHelper() [constructor] + cls.add_constructor([]) + ## pcap-user-helper.h: ns3::PcapUserHelper::PcapUserHelper(ns3::PcapUserHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapUserHelper const &', 'arg0')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string prefix, std::string ndName, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'prefix'), param('std::string', 'ndName'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string filename, ns3::NodeContainer n, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false) [member function] + cls.add_method('EnablePcap', + 'void', + [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcapAll(std::string filename, bool promiscuous=false) [member function] + cls.add_method('EnablePcapAll', + 'void', + [param('std::string', 'filename'), param('bool', 'promiscuous', default_value='false')]) + ## pcap-user-helper.h: void ns3::PcapUserHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous')], + is_pure_virtual=True, is_virtual=True) + return + def register_Ns3Ping6Helper_methods(root_module, cls): ## ping6-helper.h: ns3::Ping6Helper::Ping6Helper(ns3::Ping6Helper const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ping6Helper const &', 'arg0')]) @@ -1452,36 +1312,6 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::Ptr nd) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, std::string ndName) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## point-to-point-helper.h: static void ns3::PointToPointHelper::EnablePcapAll(std::string filename) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename')], - is_static=True) ## point-to-point-helper.h: ns3::NetDeviceContainer ns3::PointToPointHelper::Install(ns3::NodeContainer c) [member function] cls.add_method('Install', 'ns3::NetDeviceContainer', @@ -1514,6 +1344,11 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): cls.add_method('SetQueue', 'void', [param('std::string', 'type'), 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()')]) + ## point-to-point-helper.h: void ns3::PointToPointHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')], + visibility='private', is_virtual=True) return def register_Ns3PointToPointStarHelper_methods(root_module, cls): @@ -1827,87 +1662,6 @@ def register_Ns3YansWifiChannelHelper_methods(root_module, cls): [param('std::string', 'name'), 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()')]) return -def register_Ns3YansWifiPhyHelper_methods(root_module, cls): - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper(ns3::YansWifiPhyHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::YansWifiPhyHelper const &', 'arg0')]) - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper() [constructor] - cls.add_constructor([]) - ## yans-wifi-helper.h: static ns3::YansWifiPhyHelper ns3::YansWifiPhyHelper::Default() [member function] - cls.add_method('Default', - 'ns3::YansWifiPhyHelper', - [], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] - cls.add_method('EnableAscii', - 'void', - [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], - is_static=True) - ## yans-wifi-helper.h: static void ns3::YansWifiPhyHelper::EnableAsciiAll(std::ostream & os) [member function] - cls.add_method('EnableAsciiAll', - 'void', - [param('std::ostream &', 'os')], - is_static=True) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, uint32_t nodeid, uint32_t deviceid) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::Ptr nd) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, std::string ndName) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('std::string', 'ndName')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::NetDeviceContainer d) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NetDeviceContainer', 'd')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcap(std::string filename, ns3::NodeContainer n) [member function] - cls.add_method('EnablePcap', - 'void', - [param('std::string', 'filename'), param('ns3::NodeContainer', 'n')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::EnablePcapAll(std::string filename) [member function] - cls.add_method('EnablePcapAll', - 'void', - [param('std::string', 'filename')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::Set(std::string name, ns3::AttributeValue const & v) [member function] - cls.add_method('Set', - 'void', - [param('std::string', 'name'), param('ns3::AttributeValue const &', 'v')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(ns3::Ptr channel) [member function] - cls.add_method('SetChannel', - 'void', - [param('ns3::Ptr< ns3::YansWifiChannel >', 'channel')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetChannel(std::string channelName) [member function] - cls.add_method('SetChannel', - 'void', - [param('std::string', 'channelName')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetErrorRateModel(std::string name, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] - cls.add_method('SetErrorRateModel', - 'void', - [param('std::string', 'name'), 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()')]) - ## yans-wifi-helper.h: void ns3::YansWifiPhyHelper::SetPcapFormat(ns3::YansWifiPhyHelper::PcapFormat format) [member function] - cls.add_method('SetPcapFormat', - 'void', - [param('ns3::YansWifiPhyHelper::PcapFormat', 'format')]) - ## yans-wifi-helper.h: ns3::Ptr ns3::YansWifiPhyHelper::Create(ns3::Ptr node, ns3::Ptr device) const [member function] - cls.add_method('Create', - 'ns3::Ptr< ns3::WifiPhy >', - [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::WifiNetDevice >', 'device')], - is_const=True, visibility='private', is_virtual=True) - return - def register_Ns3AodvHelper_methods(root_module, cls): ## aodv-helper.h: ns3::AodvHelper::AodvHelper(ns3::AodvHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::AodvHelper const &', 'arg0')]) @@ -1929,6 +1683,150 @@ def register_Ns3AodvHelper_methods(root_module, cls): [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) return +def register_Ns3CsmaHelper_methods(root_module, cls): + ## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')]) + ## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor] + cls.add_constructor([]) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], + is_static=True) + ## csma-helper.h: static void ns3::CsmaHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string name) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'name')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::Ptr node, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(std::string nodeName, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, ns3::Ptr channel) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::CsmaChannel >', 'channel')], + is_const=True) + ## csma-helper.h: ns3::NetDeviceContainer ns3::CsmaHelper::Install(ns3::NodeContainer const & c, std::string channelName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c'), param('std::string', 'channelName')], + is_const=True) + ## csma-helper.h: void ns3::CsmaHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetChannelAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## csma-helper.h: void ns3::CsmaHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetDeviceAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), 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()')]) + ## csma-helper.h: void ns3::CsmaHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')], + visibility='private', is_virtual=True) + return + +def register_Ns3EmuHelper_methods(root_module, cls): + ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')]) + ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor] + cls.add_constructor([]) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, uint32_t nodeid, uint32_t deviceid) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NetDeviceContainer d) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NetDeviceContainer', 'd')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAscii(std::ostream & os, ns3::NodeContainer n) [member function] + cls.add_method('EnableAscii', + 'void', + [param('std::ostream &', 'os'), param('ns3::NodeContainer', 'n')], + is_static=True) + ## emu-helper.h: static void ns3::EmuHelper::EnableAsciiAll(std::ostream & os) [member function] + cls.add_method('EnableAsciiAll', + 'void', + [param('std::ostream &', 'os')], + is_static=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::Ptr node) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::Ptr< ns3::Node >', 'node')], + is_const=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(std::string nodeName) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('std::string', 'nodeName')], + is_const=True) + ## emu-helper.h: ns3::NetDeviceContainer ns3::EmuHelper::Install(ns3::NodeContainer const & c) const [member function] + cls.add_method('Install', + 'ns3::NetDeviceContainer', + [param('ns3::NodeContainer const &', 'c')], + is_const=True) + ## emu-helper.h: void ns3::EmuHelper::SetAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] + cls.add_method('SetAttribute', + 'void', + [param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')]) + ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, 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(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] + cls.add_method('SetQueue', + 'void', + [param('std::string', 'type'), 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()')]) + ## emu-helper.h: void ns3::EmuHelper::EnablePcapInternal(std::string prefix, ns3::Ptr nd, bool promiscuous=false) [member function] + cls.add_method('EnablePcapInternal', + 'void', + [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false')], + visibility='private', is_virtual=True) + return + def register_Ns3Ipv4GlobalRoutingHelper_methods(root_module, cls): ## ipv4-global-routing-helper.h: ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper() [constructor] cls.add_constructor([]) diff --git a/examples/csma/csma-bridge-one-hop.cc b/examples/csma/csma-bridge-one-hop.cc index e3c3ce420..f7df74af5 100644 --- a/examples/csma/csma-bridge-one-hop.cc +++ b/examples/csma/csma-bridge-one-hop.cc @@ -221,11 +221,11 @@ main (int argc, char *argv[]) // // Also configure some tcpdump traces; each interface will be traced. // The output files will be named: - // csma-bridge--.pcap + // csma-bridge-one-hop--.pcap // and can be read by the "tcpdump -r" command (use "-tt" option to // display timestamps correctly) // - CsmaHelper::EnablePcapAll ("csma-bridge-one-hop", false); + csma.EnablePcapAll ("csma-bridge-one-hop", false); // // Now, do the actual simulation. diff --git a/examples/csma/csma-bridge.cc b/examples/csma/csma-bridge.cc index 64303a240..5c24c0844 100644 --- a/examples/csma/csma-bridge.cc +++ b/examples/csma/csma-bridge.cc @@ -154,7 +154,7 @@ main (int argc, char *argv[]) // and can be read by the "tcpdump -r" command (use "-tt" option to // display timestamps correctly) // - CsmaHelper::EnablePcapAll ("csma-bridge", false); + csma.EnablePcapAll ("csma-bridge", false); // // Now, do the actual simulation. diff --git a/examples/csma/csma-bridge.py b/examples/csma/csma-bridge.py index 3f0d9f6e1..9dd1330d7 100644 --- a/examples/csma/csma-bridge.py +++ b/examples/csma/csma-bridge.py @@ -134,7 +134,7 @@ def main(argv): # and can be read by the "tcpdump -r" command(use "-tt" option to # display timestamps correctly) # - ns3.CsmaHelper.EnablePcapAll("csma-bridge", False) + csma.EnablePcapAll("csma-bridge", False) # # Now, do the actual simulation. diff --git a/examples/csma/csma-broadcast.cc b/examples/csma/csma-broadcast.cc index b89f01ab5..ac616d4b4 100644 --- a/examples/csma/csma-broadcast.cc +++ b/examples/csma/csma-broadcast.cc @@ -111,7 +111,7 @@ main (int argc, char *argv[]) // The output files will be named // csma-broadcast--.pcap // and can be read by the "tcpdump -tt -r" command - CsmaHelper::EnablePcapAll ("csma-broadcast", false); + csma.EnablePcapAll ("csma-broadcast", false); std::ofstream ascii; ascii.open ("csma-broadcast.tr", std::ios_base::binary | std::ios_base::out); CsmaHelper::EnableAsciiAll (ascii); diff --git a/examples/csma/csma-multicast.cc b/examples/csma/csma-multicast.cc index 6d502e8d5..3046e5661 100644 --- a/examples/csma/csma-multicast.cc +++ b/examples/csma/csma-multicast.cc @@ -170,7 +170,7 @@ main (int argc, char *argv[]) // csma-multicast--.pcap // and can be read by the "tcpdump -r" command (use "-tt" option to // display timestamps correctly) - CsmaHelper::EnablePcapAll ("csma-multicast", false); + csma.EnablePcapAll ("csma-multicast", false); // // Now, do the actual simulation. // diff --git a/examples/csma/csma-one-subnet.cc b/examples/csma/csma-one-subnet.cc index 09fdc4393..67dee42a9 100644 --- a/examples/csma/csma-one-subnet.cc +++ b/examples/csma/csma-one-subnet.cc @@ -129,7 +129,7 @@ main (int argc, char *argv[]) // and can be read by the "tcpdump -r" command (use "-tt" option to // display timestamps correctly) // - CsmaHelper::EnablePcapAll ("csma-one-subnet", false); + csma.EnablePcapAll ("csma-one-subnet", false); // // Now, do the actual simulation. // diff --git a/examples/csma/csma-star.cc b/examples/csma/csma-star.cc index dc82494e6..0c5b61720 100644 --- a/examples/csma/csma-star.cc +++ b/examples/csma/csma-star.cc @@ -182,7 +182,7 @@ main (int argc, char *argv[]) // // Do pcap tracing on all devices on all nodes. // - CsmaHelper::EnablePcapAll ("csma-star", false); + csma.EnablePcapAll ("csma-star", false); NS_LOG_INFO ("Run Simulation."); Simulator::Run (); diff --git a/examples/emulation/emu-ping.cc b/examples/emulation/emu-ping.cc index d4ae019d8..359e16f92 100644 --- a/examples/emulation/emu-ping.cc +++ b/examples/emulation/emu-ping.cc @@ -203,7 +203,8 @@ main (int argc, char *argv[]) // // Enable a promiscuous pcap trace to see what is coming and going on our device. // - EmuHelper::EnablePcap ("emu-ping", device, true); + EmuHelper emu; + emu.EnablePcap ("emu-ping", device, true); // // Now, do the actual emulation. diff --git a/examples/emulation/emu-udp-echo.cc b/examples/emulation/emu-udp-echo.cc index 6fe4e5449..6e8e79875 100644 --- a/examples/emulation/emu-udp-echo.cc +++ b/examples/emulation/emu-udp-echo.cc @@ -150,7 +150,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("emu-udp-echo.tr"); - EmuHelper::EnablePcapAll ("emu-udp-echo", true); + emu.EnablePcapAll ("emu-udp-echo", true); // // Now, do the actual simulation. diff --git a/examples/error-model/simple-error-model.cc b/examples/error-model/simple-error-model.cc index 83c950983..45597a7fd 100644 --- a/examples/error-model/simple-error-model.cc +++ b/examples/error-model/simple-error-model.cc @@ -168,7 +168,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("simple-error-model.tr"); - PointToPointHelper::EnablePcapAll ("simple-error-model"); + p2p.EnablePcapAll ("simple-error-model"); PointToPointHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/ipv6/fragmentation-ipv6.cc b/examples/ipv6/fragmentation-ipv6.cc index dd1aef847..4b6706610 100644 --- a/examples/ipv6/fragmentation-ipv6.cc +++ b/examples/ipv6/fragmentation-ipv6.cc @@ -152,7 +152,7 @@ int main (int argc, char** argv) std::ofstream ascii; ascii.open ("fragmentation-ipv6.tr"); - CsmaHelper::EnablePcapAll (std::string ("fragmentation-ipv6"), true); + csma.EnablePcapAll (std::string ("fragmentation-ipv6"), true); CsmaHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/ipv6/icmpv6-redirect.cc b/examples/ipv6/icmpv6-redirect.cc index 0c139be11..a842af90e 100644 --- a/examples/ipv6/icmpv6-redirect.cc +++ b/examples/ipv6/icmpv6-redirect.cc @@ -175,7 +175,7 @@ int main (int argc, char **argv) std::ofstream ascii; ascii.open ("icmpv6-redirect.tr"); - CsmaHelper::EnablePcapAll ("icmpv6-redirect", true); + csma.EnablePcapAll ("icmpv6-redirect", true); CsmaHelper::EnableAsciiAll (ascii); /* Now, do the actual simulation. */ diff --git a/examples/ipv6/loose-routing-ipv6.cc b/examples/ipv6/loose-routing-ipv6.cc index 74e841866..30f06e25b 100644 --- a/examples/ipv6/loose-routing-ipv6.cc +++ b/examples/ipv6/loose-routing-ipv6.cc @@ -160,7 +160,7 @@ int main (int argc, char **argv) std::ofstream ascii; ascii.open ("loose-routing-ipv6.tr"); - CsmaHelper::EnablePcapAll ("loose-routing-ipv6", true); + csma.EnablePcapAll ("loose-routing-ipv6", true); CsmaHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/ipv6/ping6.cc b/examples/ipv6/ping6.cc index 0b5d89ec0..f4e3b25d1 100644 --- a/examples/ipv6/ping6.cc +++ b/examples/ipv6/ping6.cc @@ -100,7 +100,7 @@ int main (int argc, char **argv) std::ofstream ascii; ascii.open ("ping6.tr"); - CsmaHelper::EnablePcapAll (std::string ("ping6"), true); + csma.EnablePcapAll (std::string ("ping6"), true); CsmaHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/ipv6/radvd-two-prefix.cc b/examples/ipv6/radvd-two-prefix.cc index 2d5e6fde3..ee637e1c9 100644 --- a/examples/ipv6/radvd-two-prefix.cc +++ b/examples/ipv6/radvd-two-prefix.cc @@ -210,7 +210,7 @@ int main (int argc, char** argv) std::ofstream ascii; ascii.open ("radvd-two-prefix.tr"); - CsmaHelper::EnablePcapAll (std::string ("radvd-two-prefix"), true); + csma.EnablePcapAll (std::string ("radvd-two-prefix"), true); CsmaHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/ipv6/radvd.cc b/examples/ipv6/radvd.cc index 2c4d52ca4..6f47036e7 100644 --- a/examples/ipv6/radvd.cc +++ b/examples/ipv6/radvd.cc @@ -145,7 +145,7 @@ int main (int argc, char** argv) std::ofstream ascii; ascii.open ("radvd.tr"); - CsmaHelper::EnablePcapAll (std::string ("radvd"), true); + csma.EnablePcapAll (std::string ("radvd"), true); CsmaHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/naming/object-names.cc b/examples/naming/object-names.cc index abde3412f..64daf99d5 100644 --- a/examples/naming/object-names.cc +++ b/examples/naming/object-names.cc @@ -153,6 +153,24 @@ main (int argc, char *argv[]) // Config::Connect ("/Names/client/eth0/MacRx", MakeCallback (&RxEvent)); + // + // Set up some pcap tracing on the CSMA devices. The names of the trace + // files will automatically correspond to the object names if present. + // In this case, you will find trace files called: + // + // object-names-client-eth0.pcap + // object-names-server-eth0.pcap + // + // since those nodes and devices have had names associated with them. You + // will also see: + // + // object-names-2-1.pcap + // object-names-3-1.pcap + // + // since nodes two and three have no associated names. + // + csma.EnablePcapAll ("object-names"); + Simulator::Run (); Simulator::Destroy (); } diff --git a/examples/realtime/realtime-udp-echo.cc b/examples/realtime/realtime-udp-echo.cc index 3f3083064..9239e85d2 100644 --- a/examples/realtime/realtime-udp-echo.cc +++ b/examples/realtime/realtime-udp-echo.cc @@ -107,7 +107,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("realtime-udp-echo.tr"); - CsmaHelper::EnablePcapAll ("realtime-udp-echo", false); + csma.EnablePcapAll ("realtime-udp-echo", false); CsmaHelper::EnableAsciiAll (ascii); // diff --git a/examples/routing/dynamic-global-routing.cc b/examples/routing/dynamic-global-routing.cc index 8ce876bc8..a27dacf27 100644 --- a/examples/routing/dynamic-global-routing.cc +++ b/examples/routing/dynamic-global-routing.cc @@ -192,9 +192,9 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("dynamic-global-routing.tr", std::ios_base::binary | std::ios_base::out); - PointToPointHelper::EnablePcapAll ("dynamic-global-routing"); + p2p.EnablePcapAll ("dynamic-global-routing"); PointToPointHelper::EnableAsciiAll (ascii); - CsmaHelper::EnablePcapAll ("dynamic-global-routing", false); + csma.EnablePcapAll ("dynamic-global-routing", false); CsmaHelper::EnableAsciiAll (ascii); InternetStackHelper::EnableAsciiAll (ascii); diff --git a/examples/routing/global-injection-slash32.cc b/examples/routing/global-injection-slash32.cc index 3716120c1..584a86303 100644 --- a/examples/routing/global-injection-slash32.cc +++ b/examples/routing/global-injection-slash32.cc @@ -148,7 +148,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("global-routing-injection32.tr", std::ios_base::binary | std::ios_base::out); - PointToPointHelper::EnablePcapAll ("global-routing-injection32"); + p2p.EnablePcapAll ("global-routing-injection32"); PointToPointHelper::EnableAsciiAll (ascii); Simulator::Run (); diff --git a/examples/routing/global-routing-slash32.cc b/examples/routing/global-routing-slash32.cc index 397ae4514..acba7350a 100644 --- a/examples/routing/global-routing-slash32.cc +++ b/examples/routing/global-routing-slash32.cc @@ -121,7 +121,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("global-routing-slash32.tr", std::ios_base::binary | std::ios_base::out); - PointToPointHelper::EnablePcapAll ("global-routing-slash32"); + p2p.EnablePcapAll ("global-routing-slash32"); PointToPointHelper::EnableAsciiAll (ascii); Simulator::Run (); diff --git a/examples/routing/mixed-global-routing.cc b/examples/routing/mixed-global-routing.cc index 02bc5ee35..dfeac9f1a 100644 --- a/examples/routing/mixed-global-routing.cc +++ b/examples/routing/mixed-global-routing.cc @@ -122,9 +122,9 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("mixed-global-routing.tr"); - PointToPointHelper::EnablePcapAll ("mixed-global-routing"); + p2p.EnablePcapAll ("mixed-global-routing"); PointToPointHelper::EnableAsciiAll (ascii); - CsmaHelper::EnablePcapAll ("mixed-global-routing", false); + csma.EnablePcapAll ("mixed-global-routing", false); CsmaHelper::EnableAsciiAll (ascii); diff --git a/examples/routing/simple-alternate-routing.cc b/examples/routing/simple-alternate-routing.cc index 22c375717..f727fe165 100644 --- a/examples/routing/simple-alternate-routing.cc +++ b/examples/routing/simple-alternate-routing.cc @@ -154,7 +154,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("simple-alternate-routing.tr"); - PointToPointHelper::EnablePcapAll ("simple-alternate-routing"); + p2p.EnablePcapAll ("simple-alternate-routing"); PointToPointHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/routing/simple-global-routing.cc b/examples/routing/simple-global-routing.cc index a75fa6111..93f76dfd5 100644 --- a/examples/routing/simple-global-routing.cc +++ b/examples/routing/simple-global-routing.cc @@ -147,7 +147,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("simple-global-routing.tr"); - PointToPointHelper::EnablePcapAll ("simple-global-routing"); + p2p.EnablePcapAll ("simple-global-routing"); PointToPointHelper::EnableAsciiAll (ascii); // Flow Monitor diff --git a/examples/routing/simple-point-to-point-olsr.cc b/examples/routing/simple-point-to-point-olsr.cc index f38a913b7..3535625c9 100644 --- a/examples/routing/simple-point-to-point-olsr.cc +++ b/examples/routing/simple-point-to-point-olsr.cc @@ -159,7 +159,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("simple-point-to-point-olsr.tr"); - PointToPointHelper::EnablePcapAll ("simple-point-to-point-olsr"); + p2p.EnablePcapAll ("simple-point-to-point-olsr"); PointToPointHelper::EnableAsciiAll (ascii); Simulator::Stop (Seconds (30)); diff --git a/examples/routing/simple-routing-ping6.cc b/examples/routing/simple-routing-ping6.cc index df14a122b..a2240dc99 100644 --- a/examples/routing/simple-routing-ping6.cc +++ b/examples/routing/simple-routing-ping6.cc @@ -153,7 +153,7 @@ int main (int argc, char** argv) std::ofstream ascii; ascii.open ("simple-routing-ping6.tr"); - CsmaHelper::EnablePcapAll (std::string ("simple-routing-ping6"), true); + csma.EnablePcapAll (std::string ("simple-routing-ping6"), true); CsmaHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/routing/static-routing-slash32.cc b/examples/routing/static-routing-slash32.cc index e2978d1cb..5f69b281b 100644 --- a/examples/routing/static-routing-slash32.cc +++ b/examples/routing/static-routing-slash32.cc @@ -126,7 +126,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("static-routing-slash32.tr"); - PointToPointHelper::EnablePcapAll ("static-routing-slash32"); + p2p.EnablePcapAll ("static-routing-slash32"); PointToPointHelper::EnableAsciiAll (ascii); Simulator::Run (); diff --git a/examples/socket/socket-bound-static-routing.cc b/examples/socket/socket-bound-static-routing.cc index 9e9df10b9..bee3c7d47 100644 --- a/examples/socket/socket-bound-static-routing.cc +++ b/examples/socket/socket-bound-static-routing.cc @@ -147,7 +147,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("socket-bound-static-routing.tr"); - PointToPointHelper::EnablePcapAll ("socket-bound-static-routing"); + p2p.EnablePcapAll ("socket-bound-static-routing"); PointToPointHelper::EnableAsciiAll (ascii); LogComponentEnableAll (LOG_PREFIX_TIME); diff --git a/examples/socket/socket-bound-tcp-static-routing.cc b/examples/socket/socket-bound-tcp-static-routing.cc index 6b1f1e581..15ae1f46a 100644 --- a/examples/socket/socket-bound-tcp-static-routing.cc +++ b/examples/socket/socket-bound-tcp-static-routing.cc @@ -163,7 +163,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("socket-bound-tcp-static-routing.tr"); - PointToPointHelper::EnablePcapAll ("socket-bound-tcp-static-routing"); + p2p.EnablePcapAll ("socket-bound-tcp-static-routing"); PointToPointHelper::EnableAsciiAll (ascii); LogComponentEnableAll (LOG_PREFIX_TIME); diff --git a/examples/tap/tap-csma.cc b/examples/tap/tap-csma.cc index efc9bf79b..130810b23 100644 --- a/examples/tap/tap-csma.cc +++ b/examples/tap/tap-csma.cc @@ -102,7 +102,7 @@ main (int argc, char *argv[]) tapBridge.SetAttribute ("DeviceName", StringValue (tapName)); tapBridge.Install (nodes.Get (0), devices.Get (0)); - CsmaHelper::EnablePcapAll ("tap-csma", false); + csma.EnablePcapAll ("tap-csma", false); Ipv4GlobalRoutingHelper::PopulateRoutingTables (); Simulator::Stop (Seconds (60.)); diff --git a/examples/tap/tap-wifi-dumbbell.cc b/examples/tap/tap-wifi-dumbbell.cc index d99e54832..57ad07b5f 100644 --- a/examples/tap/tap-wifi-dumbbell.cc +++ b/examples/tap/tap-wifi-dumbbell.cc @@ -217,7 +217,8 @@ main (int argc, char *argv[]) apps.Start (Seconds (1.0)); wifiPhy.EnablePcapAll ("tap-wifi-dumbbell"); - CsmaHelper::EnablePcapAll ("tap-wifi-dumbbell", false); + + csmaRight.EnablePcapAll ("tap-wifi-dumbbell", false); Ipv4GlobalRoutingHelper::PopulateRoutingTables (); Simulator::Stop (Seconds (60.)); diff --git a/examples/tcp/star.cc b/examples/tcp/star.cc index ceb2bd1e7..f24714a14 100644 --- a/examples/tcp/star.cc +++ b/examples/tcp/star.cc @@ -109,7 +109,7 @@ main (int argc, char *argv[]) // // Do pcap tracing on all point-to-point devices on all nodes. // - PointToPointHelper::EnablePcapAll ("star"); + pointToPoint.EnablePcapAll ("star"); NS_LOG_INFO ("Run Simulation."); Simulator::Run (); diff --git a/examples/tcp/tcp-large-transfer.cc b/examples/tcp/tcp-large-transfer.cc index 7266933e0..a846b034c 100644 --- a/examples/tcp/tcp-large-transfer.cc +++ b/examples/tcp/tcp-large-transfer.cc @@ -171,7 +171,7 @@ int main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("tcp-large-transfer.tr"); PointToPointHelper::EnableAsciiAll (ascii); - PointToPointHelper::EnablePcapAll ("tcp-large-transfer"); + p2p.EnablePcapAll ("tcp-large-transfer"); // Finally, set up the simulator to run. The 1000 second hard limit is a // failsafe in case some change above causes the simulation to never end diff --git a/examples/tcp/tcp-nsc-lfn.cc b/examples/tcp/tcp-nsc-lfn.cc index eed82205f..f4cdd0bf4 100644 --- a/examples/tcp/tcp-nsc-lfn.cc +++ b/examples/tcp/tcp-nsc-lfn.cc @@ -142,7 +142,7 @@ int main (int argc, char *argv[]) MakeCallback (&CwndTracer)); // This tells ns-3 to generate pcap traces. - PointToPointHelper::EnablePcapAll ("tcp-nsc-lfn"); + p2p.EnablePcapAll ("tcp-nsc-lfn"); Simulator::Stop (Seconds(900)); Simulator::Run (); diff --git a/examples/tcp/tcp-nsc-zoo.cc b/examples/tcp/tcp-nsc-zoo.cc index 559ea570f..b6d6f228d 100644 --- a/examples/tcp/tcp-nsc-zoo.cc +++ b/examples/tcp/tcp-nsc-zoo.cc @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) } } - CsmaHelper::EnablePcapAll ("tcp-nsc-zoo", false); + csma.EnablePcapAll ("tcp-nsc-zoo", false); Simulator::Stop (Seconds(100)); Simulator::Run (); diff --git a/examples/tcp/tcp-star-server.cc b/examples/tcp/tcp-star-server.cc index ebc91d05a..4cb36556f 100644 --- a/examples/tcp/tcp-star-server.cc +++ b/examples/tcp/tcp-star-server.cc @@ -155,7 +155,7 @@ main (int argc, char *argv[]) //configure tracing std::ofstream ascii; ascii.open ("tcp-star-server.tr"); - PointToPointHelper::EnablePcapAll ("tcp-star-server"); + p2p.EnablePcapAll ("tcp-star-server"); PointToPointHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/tunneling/virtual-net-device.cc b/examples/tunneling/virtual-net-device.cc index 96a60bc20..fe12cfa81 100644 --- a/examples/tunneling/virtual-net-device.cc +++ b/examples/tunneling/virtual-net-device.cc @@ -291,7 +291,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("virtual-net-device.tr"); - PointToPointHelper::EnablePcapAll ("virtual-net-device"); + p2p.EnablePcapAll ("virtual-net-device"); PointToPointHelper::EnableAsciiAll (ascii); NS_LOG_INFO ("Run Simulation."); diff --git a/examples/tutorial/second.cc b/examples/tutorial/second.cc index 9ded20722..786c3e521 100644 --- a/examples/tutorial/second.cc +++ b/examples/tutorial/second.cc @@ -103,8 +103,8 @@ main (int argc, char *argv[]) Ipv4GlobalRoutingHelper::PopulateRoutingTables (); - PointToPointHelper::EnablePcapAll ("second"); - CsmaHelper::EnablePcap ("second", csmaDevices.Get (1), true); + pointToPoint.EnablePcapAll ("second"); + csma.EnablePcap ("second", csmaDevices.Get (1), true); Simulator::Run (); Simulator::Destroy (); diff --git a/examples/tutorial/third.cc b/examples/tutorial/third.cc index c48ae110a..b3c05cb8f 100644 --- a/examples/tutorial/third.cc +++ b/examples/tutorial/third.cc @@ -162,9 +162,9 @@ main (int argc, char *argv[]) Simulator::Stop (Seconds (10.0)); - PointToPointHelper::EnablePcapAll ("third"); + pointToPoint.EnablePcapAll ("third"); phy.EnablePcap ("third", apDevices.Get (0)); - CsmaHelper::EnablePcap ("third", csmaDevices.Get (0), true); + csma.EnablePcap ("third", csmaDevices.Get (0), true); Simulator::Run (); Simulator::Destroy (); diff --git a/examples/udp/udp-echo.cc b/examples/udp/udp-echo.cc index 07707750d..cf4f6a33d 100644 --- a/examples/udp/udp-echo.cc +++ b/examples/udp/udp-echo.cc @@ -120,7 +120,7 @@ main (int argc, char *argv[]) std::ofstream ascii; ascii.open ("udp-echo.tr"); - CsmaHelper::EnablePcapAll ("udp-echo", false); + csma.EnablePcapAll ("udp-echo", false); CsmaHelper::EnableAsciiAll (ascii); // diff --git a/examples/wireless/mixed-wireless.cc b/examples/wireless/mixed-wireless.cc index 2cb2c6fd2..eba1e7431 100644 --- a/examples/wireless/mixed-wireless.cc +++ b/examples/wireless/mixed-wireless.cc @@ -394,7 +394,12 @@ main (int argc, char *argv[]) // Let's do a pcap trace on the application source and sink, ifIndex 0 // Csma captures in non-promiscuous mode - CsmaHelper::EnablePcap ("mixed-wireless", appSource->GetId (), 0, false); + CsmaHelper csma; +#if 0 + csma.EnablePcap ("mixed-wireless", appSource->GetId (), 0, false); +#else + csma.EnablePcapAll ("mixed-wireless", false); +#endif wifiPhy.EnablePcap ("mixed-wireless", appSink->GetId (), 0); wifiPhy.EnablePcap ("mixed-wireless", 9, 2); wifiPhy.EnablePcap ("mixed-wireless", 9, 0); diff --git a/examples/wireless/wifi-simple-adhoc-grid.cc b/examples/wireless/wifi-simple-adhoc-grid.cc index f22642e83..6ba47be78 100644 --- a/examples/wireless/wifi-simple-adhoc-grid.cc +++ b/examples/wireless/wifi-simple-adhoc-grid.cc @@ -159,8 +159,8 @@ int main (int argc, char *argv[]) // This is one parameter that matters when using FixedRssLossModel // set it to zero; otherwise, gain will be added wifiPhy.Set ("RxGain", DoubleValue (-10) ); - // ns-3 support RadioTap and Prism tracing extensions for 802.11b - wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + // ns-3 supports RadioTap and Prism tracing extensions for 802.11b + wifiPhy.SetPcapDataLinkType (PcapHelper::DLT_IEEE802_11_RADIO); YansWifiChannelHelper wifiChannel ; wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); diff --git a/examples/wireless/wifi-simple-adhoc.cc b/examples/wireless/wifi-simple-adhoc.cc index 1cbf95d0f..92c93aa9f 100644 --- a/examples/wireless/wifi-simple-adhoc.cc +++ b/examples/wireless/wifi-simple-adhoc.cc @@ -134,8 +134,8 @@ int main (int argc, char *argv[]) // This is one parameter that matters when using FixedRssLossModel // set it to zero; otherwise, gain will be added wifiPhy.Set ("RxGain", DoubleValue (0) ); - // ns-3 support RadioTap and Prism tracing extensions for 802.11b - wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + // ns-3 supports RadioTap and Prism tracing extensions for 802.11b + wifiPhy.SetPcapDataLinkType (PcapHelper::DLT_IEEE802_11_RADIO); YansWifiChannelHelper wifiChannel ; wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); diff --git a/examples/wireless/wifi-simple-infra.cc b/examples/wireless/wifi-simple-infra.cc index f9bc35da7..11a05dc17 100644 --- a/examples/wireless/wifi-simple-infra.cc +++ b/examples/wireless/wifi-simple-infra.cc @@ -135,8 +135,8 @@ int main (int argc, char *argv[]) // This is one parameter that matters when using FixedRssLossModel // set it to zero; otherwise, gain will be added wifiPhy.Set ("RxGain", DoubleValue (0) ); - // ns-3 support RadioTap and Prism tracing extensions for 802.11b - wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + // ns-3 supports RadioTap and Prism tracing extensions for 802.11b + wifiPhy.SetPcapDataLinkType (PcapHelper::DLT_IEEE802_11_RADIO); YansWifiChannelHelper wifiChannel ; wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); diff --git a/examples/wireless/wifi-simple-interference.cc b/examples/wireless/wifi-simple-interference.cc index 21bdb1259..51aaf3c1d 100644 --- a/examples/wireless/wifi-simple-interference.cc +++ b/examples/wireless/wifi-simple-interference.cc @@ -180,8 +180,8 @@ int main (int argc, char *argv[]) wifiPhy.Set ("RxGain", DoubleValue (0) ); wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0) ); - // ns-3 support RadioTap and Prism tracing extensions for 802.11b - wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + // ns-3 supports RadioTap and Prism tracing extensions for 802.11b + wifiPhy.SetPcapDataLinkType (PcapHelper::DLT_IEEE802_11_RADIO); YansWifiChannelHelper wifiChannel ; wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); diff --git a/examples/wireless/wifi-wired-bridging.cc b/examples/wireless/wifi-wired-bridging.cc index 003a6df5e..989b31970 100644 --- a/examples/wireless/wifi-wired-bridging.cc +++ b/examples/wireless/wifi-wired-bridging.cc @@ -90,7 +90,7 @@ int main (int argc, char *argv[]) double wifiX = 0.0; YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); - wifiPhy.SetPcapFormat(YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + wifiPhy.SetPcapDataLinkType (PcapHelper::DLT_IEEE802_11_RADIO); for (uint32_t i = 0; i < nWifis; ++i) { diff --git a/src/common/pcap-file-object.cc b/src/common/pcap-file-object.cc new file mode 100644 index 000000000..170d318d3 --- /dev/null +++ b/src/common/pcap-file-object.cc @@ -0,0 +1,133 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * 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 + */ + +#include "pcap-file-object.h" +#include "ns3/log.h" + +NS_LOG_COMPONENT_DEFINE ("PcapFileObject"); + +namespace ns3 { + +NS_OBJECT_ENSURE_REGISTERED (PcapFileObject); + +TypeId +PcapFileObject::GetTypeId (void) +{ + static TypeId tid = TypeId ("ns3::PcapFileObject") + .SetParent () + .AddConstructor () + ; + return tid; +} + + +PcapFileObject::PcapFileObject () +{ +} + +PcapFileObject::~PcapFileObject () +{ + Close (); +} + +void +PcapFileObject::Close (void) +{ + file.Close (); +} + +bool +PcapFileObject::Open (std::string const &filename, std::string const &mode) +{ + return file.Open (filename, mode); +} + +bool +PcapFileObject::Init (uint32_t dataLinkType, uint32_t snapLen, int32_t tzCorrection) +{ + return file.Init (dataLinkType, snapLen, tzCorrection); +} + +bool +PcapFileObject::Write (Time t, Ptr p) +{ + uint64_t current = t.GetMicroSeconds (); + uint64_t s = current / 1000000; + uint64_t us = current % 1000000; + + uint32_t bufferSize = p->GetSize (); + uint8_t *buffer = new uint8_t[bufferSize]; + p->CopyData (buffer, bufferSize); + bool rc = file.Write (s, us, buffer, bufferSize); + delete [] buffer; + return rc; +} + +bool +PcapFileObject::Write (Time t, uint8_t const *buffer, uint32_t length) +{ + uint64_t current = t.GetMicroSeconds (); + uint64_t s = current / 1000000; + uint64_t us = current % 1000000; + + return file.Write (s, us, buffer, length); +} + +uint32_t +PcapFileObject::GetMagic (void) +{ + return file.GetMagic (); +} + +uint16_t +PcapFileObject::GetVersionMajor (void) +{ + return file.GetVersionMajor (); +} + +uint16_t +PcapFileObject::GetVersionMinor (void) +{ + return file.GetVersionMinor (); +} + +int32_t +PcapFileObject::GetTimeZoneOffset (void) +{ + return file.GetTimeZoneOffset (); +} + +uint32_t +PcapFileObject::GetSigFigs (void) +{ + return file.GetSigFigs (); +} + +uint32_t +PcapFileObject::GetSnapLen (void) +{ + return file.GetSnapLen (); +} + +uint32_t +PcapFileObject::GetDataLinkType (void) +{ + return file.GetDataLinkType (); +} + +} //namespace ns3 diff --git a/src/common/pcap-file-object.h b/src/common/pcap-file-object.h new file mode 100644 index 000000000..a404db524 --- /dev/null +++ b/src/common/pcap-file-object.h @@ -0,0 +1,68 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * 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 + */ + +#ifndef PCAP_FILE_OBJECT_H +#define PCAP_FILE_OBJECT_H + +#include +#include "ns3/ptr.h" +#include "ns3/packet.h" +#include "ns3/nstime.h" +#include "pcap-file.h" + +namespace ns3 { + +/* + * A class representing a pcap file tailored for use in model code. + */ + +class PcapFileObject : public Object +{ +public: + static TypeId GetTypeId (void); + + PcapFileObject (); + ~PcapFileObject (); + + bool Open (std::string const &filename, std::string const &mode); + + void Close (void); + + bool Init (uint32_t dataLinkType, + uint32_t snapLen = PcapFile::SNAPLEN_DEFAULT, + int32_t tzCorrection = PcapFile::ZONE_DEFAULT); + + bool Write (Time t, Ptr p); + bool Write (Time t, uint8_t const *buffer, uint32_t length); + + uint32_t GetMagic (void); + uint16_t GetVersionMajor (void); + uint16_t GetVersionMinor (void); + int32_t GetTimeZoneOffset (void); + uint32_t GetSigFigs (void); + uint32_t GetSnapLen (void); + uint32_t GetDataLinkType (void); + +private: + PcapFile file; +}; + +} //namespace ns3 + +#endif // PCAP_FILE_OBJECT_H + diff --git a/src/common/wscript b/src/common/wscript index 0e3b20c46..b38c30b51 100644 --- a/src/common/wscript +++ b/src/common/wscript @@ -21,6 +21,7 @@ def build(bld): 'ascii-writer.cc', 'pcap-file.cc', 'pcap-file-test-suite.cc', + 'pcap-file-object.cc', ] headers = bld.new_task_gen('ns3header') @@ -43,4 +44,5 @@ def build(bld): 'ascii-writer.h', 'sgi-hashmap.h', 'pcap-file.h', + 'pcap-file-object.h', ] diff --git a/src/helper/csma-helper.cc b/src/helper/csma-helper.cc index 388c9ea1f..6063ed9c8 100644 --- a/src/helper/csma-helper.cc +++ b/src/helper/csma-helper.cc @@ -17,7 +17,9 @@ * * Author: Mathieu Lacage */ -#include "csma-helper.h" + +#include "ns3/abort.h" +#include "ns3/log.h" #include "ns3/simulator.h" #include "ns3/object-factory.h" #include "ns3/queue.h" @@ -28,8 +30,14 @@ #include "ns3/names.h" #include "ns3/pcap-writer.h" #include "ns3/ascii-writer.h" + +#include "pcap-helper.h" +#include "csma-helper.h" + #include +NS_LOG_COMPONENT_DEFINE ("CsmaHelper"); + namespace ns3 { CsmaHelper::CsmaHelper () @@ -66,75 +74,31 @@ CsmaHelper::SetChannelAttribute (std::string n1, const AttributeValue &v1) } void -CsmaHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) +CsmaHelper::EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous) { - std::ostringstream oss; - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::CsmaNetDevice/"; - Config::MatchContainer matches = Config::LookupMatches (oss.str ()); - if (matches.GetN () == 0) + // + // All of the Pcap enable functions vector through here including the ones + // that are wandering through all of devices on perhaps all of the nodes in + // the system. We can only deal with devices of type CsmaNetDevice. + // + Ptr device = nd->GetObject (); + if (device == 0) { + NS_LOG_INFO ("CsmaHelper::EnablePcapInternal(): Device " << device << " not of type ns3::CsmaNetDevice"); return; } - oss.str (""); - oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; - Ptr pcap = CreateObject (); - pcap->Open (oss.str ()); - pcap->WriteEthernetHeader (); - oss.str (""); - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; + + PcapHelper pcapHelper; + std::string filename = pcapHelper.GetFilename (prefix, device); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB); if (promiscuous) { - oss << "/$ns3::CsmaNetDevice/PromiscSniffer"; + pcapHelper.HookDefaultSink (device, "PromiscSniffer", file); } else { - oss << "/$ns3::CsmaNetDevice/Sniffer"; + pcapHelper.HookDefaultSink (device, "Sniffer", file); } - Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&CsmaHelper::SniffEvent, pcap)); -} - -void -CsmaHelper::EnablePcap (std::string filename, NetDeviceContainer d, bool promiscuous) -{ - for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) - { - Ptr dev = *i; - EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex (), promiscuous); - } -} - -void -CsmaHelper::EnablePcap (std::string filename, Ptr nd, bool promiscuous) -{ - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex (), promiscuous); -} - -void -CsmaHelper::EnablePcap (std::string filename, std::string ndName, bool promiscuous) -{ - Ptr nd = Names::Find (ndName); - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex (), promiscuous); -} - -void -CsmaHelper::EnablePcap (std::string filename, NodeContainer n, bool promiscuous) -{ - NetDeviceContainer devs; - for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) - { - Ptr node = *i; - for (uint32_t j = 0; j < node->GetNDevices (); ++j) - { - devs.Add (node->GetDevice (j)); - } - } - EnablePcap (filename, devs, promiscuous); -} - -void -CsmaHelper::EnablePcapAll (std::string filename, bool promiscuous) -{ - EnablePcap (filename, NodeContainer::GetGlobal (), promiscuous); } void @@ -268,12 +232,6 @@ CsmaHelper::InstallPriv (Ptr node, Ptr channel) const return device; } -void -CsmaHelper::SniffEvent (Ptr writer, Ptr packet) -{ - writer->WritePacket (packet); -} - void CsmaHelper::AsciiEnqueueEvent (Ptr writer, std::string path, Ptr packet) { diff --git a/src/helper/csma-helper.h b/src/helper/csma-helper.h index 867ff7f82..9f4703421 100644 --- a/src/helper/csma-helper.h +++ b/src/helper/csma-helper.h @@ -21,6 +21,7 @@ #define CSMA_HELPER_H #include + #include "ns3/attribute.h" #include "ns3/object-factory.h" #include "ns3/net-device-container.h" @@ -28,16 +29,17 @@ #include "ns3/csma-channel.h" #include "ns3/deprecated.h" +#include "pcap-user-helper.h" + namespace ns3 { class Packet; -class PcapWriter; class AsciiWriter; /** * \brief build a set of CsmaNetDevice objects */ -class CsmaHelper +class CsmaHelper : public PcapUserHelper { public: /** @@ -83,67 +85,6 @@ public: */ void SetChannelAttribute (std::string n1, const AttributeValue &v1); - /** - * \param filename filename prefix to use for pcap files. - * \param nodeid the id of the node to generate pcap output for. - * \param deviceid the id of the device to generate pcap output for. - * \param promiscuous If true capture all possible packets available at the device. - * - * Generate a pcap file which contains the link-level data observed - * by the specified deviceid within the specified nodeid. The pcap - * data is stored in the file prefix-nodeid-deviceid.pcap. - * - * This method should be invoked after the network topology has - * been fully constructed. - */ - static void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param nd Net device in which you want to enable tracing. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output the indicated net device. - */ - static void EnablePcap (std::string filename, Ptr nd, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param ndName The name of the net device in which you want to enable tracing. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output the indicated net device. - */ - static void EnablePcap (std::string filename, std::string ndName, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param d container of devices of type ns3::CsmaNetDevice - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each input device which is of the ns3::CsmaNetDevice type. - */ - static void EnablePcap (std::string filename, NetDeviceContainer d, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param n container of nodes. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each device which is of the - * ns3::CsmaNetDevice type and which is located in one of the - * input nodes. - */ - static void EnablePcap (std::string filename, NodeContainer n, bool promiscuous); - /** - * \param filename filename prefix to use for pcap files. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each device which is of the - * ns3::CsmaNetDevice type - */ - static void EnablePcapAll (std::string filename, bool promiscuous); - /** * \param os output stream * \param nodeid the id of the node to generate ascii output for. @@ -291,10 +232,17 @@ private: */ Ptr InstallPriv (Ptr node, Ptr channel) const; - /* - * \internal + /** + * \brief Enable pcap output the indicated net device. + * + * NetDevice-specific implementation mechanism for hooking the trace and + * writing to the trace file. + * + * \param prefix Filename prefix to use for pcap files. + * \param nd Net device for which you want to enable tracing. + * \param promiscuous If true capture all possible packets available at the device. */ - static void SniffEvent (Ptr writer, Ptr packet); + virtual void EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous = false); static void AsciiRxEvent (Ptr writer, std::string path, Ptr packet); /* diff --git a/src/helper/emu-helper.cc b/src/helper/emu-helper.cc index 758a259f1..0c3e30e71 100644 --- a/src/helper/emu-helper.cc +++ b/src/helper/emu-helper.cc @@ -29,6 +29,7 @@ #include "ns3/config.h" #include "ns3/packet.h" +#include "pcap-helper.h" #include "emu-helper.h" NS_LOG_COMPONENT_DEFINE ("EmuHelper"); @@ -66,75 +67,31 @@ EmuHelper::SetAttribute (std::string n1, const AttributeValue &v1) } void -EmuHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous) +EmuHelper::EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous) { - NS_LOG_FUNCTION (filename << nodeid << deviceid << promiscuous); - std::ostringstream oss; - oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; - Ptr pcap = CreateObject (); - pcap->Open (oss.str ()); - pcap->WriteEthernetHeader (); + // + // All of the Pcap enable functions vector through here including the ones + // that are wandering through all of devices on perhaps all of the nodes in + // the system. We can only deal with devices of type EmuNetDevice. + // + Ptr device = nd->GetObject (); + if (device == 0) + { + NS_LOG_INFO ("EmuHelper::EnablePcapInternal(): Device " << device << " not of type ns3::EmuNetDevice"); + return; + } - oss.str (""); - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; + PcapHelper pcapHelper; + std::string filename = pcapHelper.GetFilename (prefix, device); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB); if (promiscuous) { - oss << "/$ns3::EmuNetDevice/PromiscSniffer"; + pcapHelper.HookDefaultSink (device, "PromiscSniffer", file); } else { - oss << "/$ns3::EmuNetDevice/Sniffer"; + pcapHelper.HookDefaultSink (device, "Sniffer", file); } - Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&EmuHelper::SniffEvent, pcap)); -} - -void -EmuHelper::EnablePcap (std::string filename, Ptr nd, bool promiscuous) -{ - NS_LOG_FUNCTION (filename << &nd << promiscuous); - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex (), promiscuous); -} - -void -EmuHelper::EnablePcap (std::string filename, std::string ndName, bool promiscuous) -{ - NS_LOG_FUNCTION (filename << ndName << promiscuous); - Ptr nd = Names::Find (ndName); - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex (), promiscuous); -} - -void -EmuHelper::EnablePcap (std::string filename, NetDeviceContainer d, bool promiscuous) -{ - NS_LOG_FUNCTION (filename << &d << promiscuous); - for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) - { - Ptr dev = *i; - EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex (), promiscuous); - } -} - -void -EmuHelper::EnablePcap (std::string filename, NodeContainer n, bool promiscuous) -{ - NS_LOG_FUNCTION (filename << &n << promiscuous); - NetDeviceContainer devs; - for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) - { - Ptr node = *i; - for (uint32_t j = 0; j < node->GetNDevices (); ++j) - { - devs.Add (node->GetDevice (j)); - } - } - EnablePcap (filename, devs, promiscuous); -} - -void -EmuHelper::EnablePcapAll (std::string filename, bool promiscuous) -{ - NS_LOG_FUNCTION (filename << promiscuous); - EnablePcap (filename, NodeContainer::GetGlobal (), promiscuous); } void @@ -233,13 +190,6 @@ EmuHelper::InstallPriv (Ptr node) const return device; } -void -EmuHelper::SniffEvent (Ptr writer, Ptr packet) -{ - NS_LOG_FUNCTION (writer << packet); - writer->WritePacket (packet); -} - void EmuHelper::AsciiEnqueueEvent (Ptr writer, std::string path, diff --git a/src/helper/emu-helper.h b/src/helper/emu-helper.h index e63b472d0..b74a9d6fd 100644 --- a/src/helper/emu-helper.h +++ b/src/helper/emu-helper.h @@ -21,12 +21,15 @@ #include #include + #include "ns3/attribute.h" #include "ns3/object-factory.h" #include "ns3/net-device-container.h" #include "ns3/node-container.h" #include "ns3/emu-net-device.h" +#include "pcap-user-helper.h" + namespace ns3 { class Packet; @@ -36,7 +39,7 @@ class AsciiWriter; /** * \brief build a set of EmuNetDevice objects */ -class EmuHelper +class EmuHelper : public PcapUserHelper { public: /* @@ -74,71 +77,6 @@ public: */ void SetAttribute (std::string n1, const AttributeValue &v1); - /** - * \param filename filename prefix to use for pcap files. - * \param nodeid the id of the node to generate pcap output for. - * \param deviceid the id of the device to generate pcap output for. - * \param promiscuous If true capture all possible packets available at the device. - * - * Generate a pcap file which contains the link-level data observed - * by the specified deviceid within the specified nodeid. The pcap - * data is stored in the file prefix-nodeid-deviceid.pcap. - * - * This method should be invoked after the network topology has - * been fully constructed. - */ - static void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param nd Indicates net device on which you want to enable tracing. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each input device which is of the - * ns3::EmuNetDevice type. - */ - static void EnablePcap (std::string filename, Ptr nd, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param ndName Name of net device on which you want to enable tracing. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each input device which is of the - * ns3::EmuNetDevice type. - */ - static void EnablePcap (std::string filename, std::string ndName, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param d container of devices of type ns3::EmuNetDevice - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each input device which is of the - * ns3::EmuNetDevice type. - */ - static void EnablePcap (std::string filename, NetDeviceContainer d, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param n container of nodes. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each device which is of the - * ns3::EmuNetDevice type and which is located in one of the - * input nodes. - */ - static void EnablePcap (std::string filename, NodeContainer n, bool promiscuous); - - /** - * \param filename filename prefix to use for pcap files. - * \param promiscuous If true capture all possible packets available at the device. - * - * Enable pcap output on each device which is of the - * ns3::EmuNetDevice type - */ - static void EnablePcapAll (std::string filename, bool promiscuous); - /** * \param os output stream * \param nodeid the id of the node to generate ascii output for. @@ -215,10 +153,17 @@ private: */ Ptr InstallPriv (Ptr node) const; - /* - * \internal + /** + * \brief Enable pcap output the indicated net device. + * + * NetDevice-specific implementation mechanism for hooking the trace and + * writing to the trace file. + * + * \param prefix Filename prefix to use for pcap files. + * \param nd Net device for which you want to enable tracing. + * \param promiscuous If true capture all possible packets available at the device. */ - static void SniffEvent (Ptr writer, Ptr packet); + virtual void EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous = false); /* * \internal diff --git a/src/helper/pcap-helper.cc b/src/helper/pcap-helper.cc new file mode 100644 index 000000000..e7aeb8a24 --- /dev/null +++ b/src/helper/pcap-helper.cc @@ -0,0 +1,135 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * 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 + */ + +#include +#include +#include + +#include "ns3/abort.h" +#include "ns3/assert.h" +#include "ns3/log.h" +#include "ns3/ptr.h" +#include "ns3/node.h" +#include "ns3/names.h" +#include "ns3/net-device.h" +#include "ns3/pcap-file-object.h" + +#include "pcap-helper.h" + +NS_LOG_COMPONENT_DEFINE("PcapHelper"); + +namespace ns3 { + +PcapHelper::PcapHelper () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +PcapHelper::~PcapHelper () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +Ptr +PcapHelper::CreateFile ( + std::string filename, + std::string filemode, + uint32_t dataLinkType, + uint32_t snapLen, + int32_t tzCorrection) +{ + NS_LOG_FUNCTION (filename << filemode << dataLinkType << snapLen << tzCorrection); + + Ptr file = CreateObject (); + bool err = file->Open (filename, filemode); + NS_ABORT_MSG_IF (err, "Unable to Open " << filename << " for mode " << filemode); + + err = file->Init (dataLinkType, snapLen, tzCorrection); + NS_ABORT_MSG_IF (err, "Unable to Init " << filename); + + // + // Note that the pcap helper promptly forgets all about the pcap file. We + // rely on the reference count of the file object which will soon be owned + // by the caller to keep the object alive. If the caller uses the file + // object to hook a trace source, ownership of the file object will be + // implicitly transferred to the callback which keeps the object alive. + // When the callback is destroyed (when either the trace is disconnected or + // the object with the trace source is deleted) the callback will be destroyed + // and the file object will be destroyed, releasing the pointer and closing + // the file. + // + return file; +} + +std::string +PcapHelper::GetFilename (std::string prefix, Ptr device, bool useObjectNames) +{ + NS_LOG_FUNCTION (prefix << device << useObjectNames); + NS_ABORT_MSG_UNLESS (prefix.size (), "Empty prefix string"); + + std::ostringstream oss; + oss << prefix << "-"; + + std::string nodename; + std::string devicename; + + Ptr node = device->GetNode (); + + if (useObjectNames) + { + nodename = Names::FindName (node); + devicename = Names::FindName (device); + } + + if (nodename.size ()) + { + oss << nodename; + } + else + { + oss << node->GetId (); + } + + oss << "-"; + + if (devicename.size ()) + { + oss << devicename; + } + else + { + oss << device->GetIfIndex (); + } + + oss << ".pcap"; + + return oss.str (); +} + +// +// The basic default trace sink. This one just writes the packet to the pcap +// file which is good enough for most kinds of captures. +// +void +PcapHelper::DefaultSink (Ptr file, Ptr p) +{ + NS_LOG_FUNCTION (file << p); + file->Write(Simulator::Now(), p); +} + +} // namespace ns3 diff --git a/src/helper/pcap-helper.h b/src/helper/pcap-helper.h new file mode 100644 index 000000000..52890f04d --- /dev/null +++ b/src/helper/pcap-helper.h @@ -0,0 +1,90 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * 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 + */ + +#ifndef PCAP_HELPER_H +#define PCAP_HELPER_H + +#include "ns3/net-device-container.h" +#include "ns3/node-container.h" +#include "ns3/simulator.h" +#include "ns3/pcap-file-object.h" + +namespace ns3 { + +/** + * \brief Manage pcap files for device models + * + * Handling pcap files is a common operation for ns-3 devices. It is useful to + * provide a common base class for dealing with these ops. + */ + +class PcapHelper +{ +public: + // + // These are the data link types that will be written to the pcap file. We + // don't include pcap-bpf.h to avoid an explicit dependency on the real pcap + // and we don't make an enumeration of all of the values to make it easy to + // pass new values in. + // + enum {DLT_NULL = 0}; + enum {DLT_EN10MB = 1}; + enum {DLT_PPP = 9}; + enum {DLT_IEEE802_11 = 105}; + enum {DLT_PRISM_HEADER = 119}; + enum {DLT_IEEE802_11_RADIO = 127}; + + /** + * @brief Create a pcap helper. + */ + PcapHelper (); + + /** + * @brief Destroy a pcap helper. + */ + ~PcapHelper (); + + /** + * @brief Let the pcap helper figure out a reasonable filename to use for the + * pcap file. + */ + std::string GetFilename (std::string prefix, Ptr device, bool useObjectNames = true); + + /** + * @brief Create and initialize a pcap file. + */ + Ptr CreateFile (std::string filename, std::string filemode, + uint32_t dataLinkType, uint32_t snapLen = 65535, int32_t tzCorrection = 0); + /** + * @brief Hook a trace source to the default trace sink + */ + template void HookDefaultSink (Ptr object, std::string traceName, Ptr file); + +private: + static void DefaultSink (Ptr file, Ptr p); +}; + +template void +PcapHelper::HookDefaultSink (Ptr object, std::string tracename, Ptr file) +{ + object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file)); +} + +} // namespace ns3 + +#endif /* PCAP_HELPER_H */ diff --git a/src/helper/pcap-user-helper.cc b/src/helper/pcap-user-helper.cc new file mode 100644 index 000000000..605bfedc2 --- /dev/null +++ b/src/helper/pcap-user-helper.cc @@ -0,0 +1,90 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * 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 + */ + +#include "ns3/abort.h" +#include "ns3/names.h" +#include "pcap-user-helper.h" + +namespace ns3 { + +void +PcapUserHelper::EnablePcap (std::string prefix, Ptr nd, bool promiscuous) +{ + EnablePcapInternal (prefix, nd, promiscuous); +} + +void +PcapUserHelper::EnablePcap (std::string prefix, std::string ndName, bool promiscuous) +{ + Ptr nd = Names::Find (ndName); + EnablePcap (prefix, nd, promiscuous); +} + +void +PcapUserHelper::EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous) +{ + for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) + { + Ptr dev = *i; + EnablePcap (prefix, dev, promiscuous); + } +} + +void +PcapUserHelper::EnablePcap (std::string prefix, NodeContainer n, bool promiscuous) +{ + NetDeviceContainer devs; + for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) + { + Ptr node = *i; + for (uint32_t j = 0; j < node->GetNDevices (); ++j) + { + devs.Add (node->GetDevice (j)); + } + } + EnablePcap (prefix, devs, promiscuous); +} + +void +PcapUserHelper::EnablePcapAll (std::string prefix, bool promiscuous) +{ + EnablePcap (prefix, NodeContainer::GetGlobal (), promiscuous); +} + +void +PcapUserHelper::EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous) +{ + NodeContainer n = NodeContainer::GetGlobal (); + + for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) + { + Ptr node = *i; + if (node->GetId () != nodeid) + { + continue; + } + + NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "PcapUserHelper::EnablePcap(): Unknown deviceid = " << deviceid); + Ptr nd = node->GetDevice (deviceid); + + EnablePcap (prefix, nd, promiscuous); + return; + } +} + +} // namespace ns3 diff --git a/src/helper/pcap-user-helper.h b/src/helper/pcap-user-helper.h new file mode 100644 index 000000000..7f78207f4 --- /dev/null +++ b/src/helper/pcap-user-helper.h @@ -0,0 +1,104 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 University of Washington + * + * 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 + */ + +#ifndef PCAP_USER_HELPER_H +#define PCAP_USER_HELPER_H + +#include +#include "ns3/net-device-container.h" +#include "ns3/node-container.h" + +namespace ns3 { + +/** + * \brief Base class providing common pcap operations. + */ +class PcapUserHelper +{ +public: + /** + * @brief Enable pcap output the indicated net device. + * @internal + * + * @param prefix Filename prefix to use for pcap files. + * @param nd Net device for which you want to enable tracing. + * @param promiscuous If true capture all possible packets available at the device. + */ + virtual void EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous) = 0; + + /** + * @brief Enable pcap output the indicated net device. + * + * @param prefix Filename prefix to use for pcap files. + * @param nd Net device for which you want to enable tracing. + * @param promiscuous If true capture all possible packets available at the device. + */ + void EnablePcap (std::string prefix, Ptr nd, bool promiscuous = false); + + /** + * @brief Enable pcap output the indicated net device using a device previously + * named using the ns-3 object name service. + * + * @param filename filename prefix to use for pcap files. + * @param ndName The name of the net device in which you want to enable tracing. + * @param promiscuous If true capture all possible packets available at the device. + */ + void EnablePcap (std::string prefix, std::string ndName, bool promiscuous = false); + + /** + * @brief Enable pcap output on each device in the container which is of the + * appropriate type. + * + * @param prefix Filename prefix to use for pcap files. + * @param d container of devices of type ns3::CsmaNetDevice + * @param promiscuous If true capture all possible packets available at the device. + */ + void EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous = false); + + /** + * @brief Enable pcap output on each device (which is of the appropriate type) + * in the nodes provided in the container. + * + * \param prefix Filename prefix to use for pcap files. + * \param n container of nodes. + * \param promiscuous If true capture all possible packets available at the device. + */ + void EnablePcap (std::string prefix, NodeContainer n, bool promiscuous = false); + + /** + * @brief Enable pcap output on each device (which is of the appropriate type) + * in the set of all nodes created in the simulation. + * + * @param prefix Filename prefix to use for pcap files. + * @param promiscuous If true capture all possible packets available at the device. + */ + void EnablePcapAll (std::string prefix, bool promiscuous = false); + + /** + * @brief Enable pcap output on the device specified by a global node-id (of + * a previously created node) and associated device-id. + * + * @param prefix Filename prefix to use for pcap files. + * @param promiscuous If true capture all possible packets available at the device. + */ + void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous = false); +}; + +} // namespace ns3 + +#endif // PCAP_USER_HELPER_H diff --git a/src/helper/point-to-point-helper.cc b/src/helper/point-to-point-helper.cc index 4a1d53e17..4f73ad939 100644 --- a/src/helper/point-to-point-helper.cc +++ b/src/helper/point-to-point-helper.cc @@ -17,7 +17,9 @@ * * Author: Mathieu Lacage */ -#include "point-to-point-helper.h" + +#include "ns3/abort.h" +#include "ns3/log.h" #include "ns3/simulator.h" #include "ns3/point-to-point-net-device.h" #include "ns3/point-to-point-channel.h" @@ -28,8 +30,12 @@ #include "ns3/pcap-writer.h" #include "ns3/ascii-writer.h" -namespace ns3 { +#include "pcap-helper.h" +#include "point-to-point-helper.h" +NS_LOG_COMPONENT_DEFINE ("PointToPointHelper"); + +namespace ns3 { PointToPointHelper::PointToPointHelper () { @@ -65,68 +71,24 @@ PointToPointHelper::SetChannelAttribute (std::string n1, const AttributeValue &v } void -PointToPointHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid) +PointToPointHelper::EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous) { - std::ostringstream oss; - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::PointToPointNetDevice/"; - Config::MatchContainer matches = Config::LookupMatches (oss.str ()); - if (matches.GetN () == 0) + // + // All of the Pcap enable functions vector through here including the ones + // that are wandering through all of devices on perhaps all of the nodes in + // the system. We can only deal with devices of type PointToPointNetDevice. + // + Ptr device = nd->GetObject (); + if (device == 0) { + NS_LOG_INFO ("PointToPointHelper::EnablePcapInternal(): Device " << device << " not of type ns3::PointToPointNetDevice"); return; } - oss.str (""); - oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; - Ptr pcap = CreateObject (); - pcap->Open (oss.str ()); - pcap->WritePppHeader (); - oss.str (""); - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; - oss << "/$ns3::PointToPointNetDevice/PromiscSniffer"; - Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&PointToPointHelper::SniffEvent, pcap)); -} -void -PointToPointHelper::EnablePcap (std::string filename, Ptr nd) -{ - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex ()); -} - -void -PointToPointHelper::EnablePcap (std::string filename, std::string ndName) -{ - Ptr nd = Names::Find (ndName); - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex ()); -} - -void -PointToPointHelper::EnablePcap (std::string filename, NetDeviceContainer d) -{ - for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) - { - Ptr dev = *i; - EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex ()); - } -} - -void -PointToPointHelper::EnablePcap (std::string filename, NodeContainer n) -{ - NetDeviceContainer devs; - for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) - { - Ptr node = *i; - for (uint32_t j = 0; j < node->GetNDevices (); ++j) - { - devs.Add (node->GetDevice (j)); - } - } - EnablePcap (filename, devs); -} - -void -PointToPointHelper::EnablePcapAll (std::string filename) -{ - EnablePcap (filename, NodeContainer::GetGlobal ()); + PcapHelper pcapHelper; + std::string filename = pcapHelper.GetFilename (prefix, device); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_PPP); + pcapHelper.HookDefaultSink (device, "PromiscSniffer", file); } void @@ -232,12 +194,6 @@ PointToPointHelper::Install (std::string aName, std::string bName) return Install (a, b); } -void -PointToPointHelper::SniffEvent (Ptr writer, Ptr packet) -{ - writer->WritePacket (packet); -} - void PointToPointHelper::AsciiEnqueueEvent (Ptr writer, std::string path, Ptr packet) diff --git a/src/helper/point-to-point-helper.h b/src/helper/point-to-point-helper.h index 12fdcbe35..2b3774391 100644 --- a/src/helper/point-to-point-helper.h +++ b/src/helper/point-to-point-helper.h @@ -24,6 +24,7 @@ #include "ns3/net-device-container.h" #include "ns3/node-container.h" #include "ns3/deprecated.h" +#include "pcap-user-helper.h" #include namespace ns3 { @@ -37,7 +38,7 @@ class AsciiWriter; /** * \brief Build a set of PointToPointNetDevice objects */ -class PointToPointHelper +class PointToPointHelper : public PcapUserHelper { public: /** @@ -94,66 +95,6 @@ public: */ void SetChannelAttribute (std::string name, const AttributeValue &value); - /** - * \param filename filename prefix to use for pcap files. - * \param nodeid the id of the node to generate pcap output for. - * \param deviceid the id of the device to generate pcap output for. - * - * Generate a pcap file which contains the link-level data observed - * by the specified deviceid within the specified nodeid. The pcap - * data is stored in the file prefix-nodeid-deviceid.pcap. - * - * This method should be invoked after the network topology has - * been fully constructed. - */ - static void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid); - - /** - * \param filename filename prefix to use for pcap files. - * \param nd Net device on which you want to enable tracing. - * - * Enable pcap output on each input device which is of the - * ns3::PointToPointNetDevice type. - */ - static void EnablePcap (std::string filename, Ptr nd); - - /** - * \param filename filename prefix to use for pcap files. - * \param ndName Name of net device on which you want to enable tracing. - * - * Enable pcap output on each input device which is of the - * ns3::PointToPointNetDevice type. - */ - static void EnablePcap (std::string filename, std::string ndName); - - /** - * \param filename filename prefix to use for pcap files. - * \param d container of devices of type ns3::PointToPointNetDevice - * - * Enable pcap output on each input device which is of the - * ns3::PointToPointNetDevice type. - */ - static void EnablePcap (std::string filename, NetDeviceContainer d); - - - /** - * \param filename filename prefix to use for pcap files. - * \param n container of nodes. - * - * Enable pcap output on each device which is of the - * ns3::PointToPointNetDevice type and which is located in one of the - * input nodes. - */ - static void EnablePcap (std::string filename, NodeContainer n); - - /** - * \param filename filename prefix to use for pcap files. - * - * Enable pcap output on each device which is of the - * ns3::PointToPointNetDevice type - */ - static void EnablePcapAll (std::string filename); - /** * \param os output stream * \param nodeid the id of the node to generate ascii output for. @@ -241,8 +182,17 @@ public: NetDeviceContainer Install (std::string aNode, std::string bNode); private: - void EnablePcap (Ptr node, Ptr device, Ptr queue); - static void SniffEvent (Ptr writer, Ptr packet); + /** + * \brief Enable pcap output the indicated net device. + * + * NetDevice-specific implementation mechanism for hooking the trace and + * writing to the trace file. + * + * \param prefix Filename prefix to use for pcap files. + * \param nd Net device for which you want to enable tracing. + * \param promiscuous If true capture all possible packets available at the device. + */ + virtual void EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous = false); void EnableAscii (Ptr node, Ptr device); static void AsciiRxEvent (Ptr writer, std::string path, Ptr packet); diff --git a/src/helper/wscript b/src/helper/wscript index b3d6ad7b7..e6d637a20 100644 --- a/src/helper/wscript +++ b/src/helper/wscript @@ -48,6 +48,8 @@ def build(bld): 'point-to-point-star-helper.cc', 'csma-star-helper.cc', 'udp-client-server-helper.cc', + 'pcap-helper.cc', + 'pcap-user-helper.cc', ] headers = bld.new_task_gen('ns3header') @@ -99,6 +101,8 @@ def build(bld): 'point-to-point-star-helper.h', 'csma-star-helper.h', 'udp-client-server-helper.h', + 'pcap-helper.h', + 'pcap-user-helper.h', ] env = bld.env_of_name('default') diff --git a/src/helper/yans-wifi-helper.cc b/src/helper/yans-wifi-helper.cc index 5b5980986..ef4e1683e 100644 --- a/src/helper/yans-wifi-helper.cc +++ b/src/helper/yans-wifi-helper.cc @@ -17,6 +17,8 @@ * * Author: Mathieu Lacage */ +#include "pcap-helper.h" +#include "pcap-user-helper.h" #include "yans-wifi-helper.h" #include "ns3/error-rate-model.h" #include "ns3/propagation-loss-model.h" @@ -24,29 +26,20 @@ #include "ns3/yans-wifi-channel.h" #include "ns3/yans-wifi-phy.h" #include "ns3/wifi-net-device.h" +#include "ns3/radiotap-header.h" #include "ns3/pcap-writer.h" #include "ns3/ascii-writer.h" +#include "ns3/pcap-file-object.h" #include "ns3/simulator.h" #include "ns3/config.h" #include "ns3/names.h" +#include "ns3/abort.h" +#include "ns3/log.h" + +NS_LOG_COMPONENT_DEFINE ("YansWifiHelper"); namespace ns3 { -static void PcapSniffTxEvent (Ptr writer, Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, - uint32_t rate, bool isShortPreamble) -{ - const double unusedValue = 0; - writer->WriteWifiMonitorPacket(packet, channelFreqMhz, channelNumber, rate, isShortPreamble, true, unusedValue, unusedValue); -} - - -static void PcapSniffRxEvent (Ptr writer, Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, - uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) -{ - writer->WriteWifiMonitorPacket(packet, channelFreqMhz, channelNumber, rate, isShortPreamble, false, signalDbm, noiseDbm); -} - - static void AsciiPhyTxEvent (Ptr writer, std::string path, Ptr packet, WifiMode mode, WifiPreamble preamble, @@ -149,8 +142,7 @@ YansWifiChannelHelper::Create (void) const YansWifiPhyHelper::YansWifiPhyHelper () : m_channel (0), - m_pcapFormat(PCAP_FORMAT_80211) - + m_pcapDlt(PcapHelper::DLT_IEEE802_11) { m_phy.SetTypeId ("ns3::YansWifiPhy"); } @@ -215,94 +207,177 @@ YansWifiPhyHelper::Create (Ptr node, Ptr device) const return phy; } +static void +PcapSniffTxEvent ( + Ptr file, + Ptr packet, + uint16_t channelFreqMhz, + uint16_t channelNumber, + uint32_t rate, + bool isShortPreamble) +{ + uint32_t dlt = file->GetDataLinkType (); + + switch (dlt) + { + case PcapHelper::DLT_IEEE802_11: + file->Write (Simulator::Now (), packet); + return; + case PcapHelper::DLT_PRISM_HEADER: + { + NS_FATAL_ERROR ("PcapSniffTxEvent(): DLT_PRISM_HEADER not implemented"); + return; + } + case PcapHelper::DLT_IEEE802_11_RADIO: + { + Ptr p = packet->Copy (); + RadiotapHeader header; + header.SetTsft (Simulator::Now ().GetMicroSeconds ()); + + if (isShortPreamble) + { + header.SetFrameFlags (RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE); + } + else + { + header.SetFrameFlags (RadiotapHeader::FRAME_FLAG_NONE); + } + + header.SetRate (rate); + + if (channelFreqMhz < 2500) + { + header.SetChannelFrequencyAndFlags (channelFreqMhz, + RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ | RadiotapHeader::CHANNEL_FLAG_CCK); + } + else + { + header.SetChannelFrequencyAndFlags (channelFreqMhz, + RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ | RadiotapHeader::CHANNEL_FLAG_OFDM); + } + + p->AddHeader (header); + file->Write (Simulator::Now (), p); + return; + } + default: + NS_ABORT_MSG ("PcapSniffTxEvent(): Unexpected data link type " << dlt); + } +} + +static void +PcapSniffRxEvent ( + Ptr file, + Ptr packet, + uint16_t channelFreqMhz, + uint16_t channelNumber, + uint32_t rate, + bool isShortPreamble, + double signalDbm, + double noiseDbm) +{ + uint32_t dlt = file->GetDataLinkType (); + + switch (dlt) + { + case PcapHelper::DLT_IEEE802_11: + file->Write (Simulator::Now (), packet); + return; + case PcapHelper::DLT_PRISM_HEADER: + { + NS_FATAL_ERROR ("PcapSniffRxEvent(): DLT_PRISM_HEADER not implemented"); + return; + } + case PcapHelper::DLT_IEEE802_11_RADIO: + { + Ptr p = packet->Copy (); + RadiotapHeader header; + header.SetTsft (Simulator::Now ().GetMicroSeconds ()); + + if (isShortPreamble) + { + header.SetFrameFlags (RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE); + } + else + { + header.SetFrameFlags (RadiotapHeader::FRAME_FLAG_NONE); + } + + header.SetRate (rate); + + if (channelFreqMhz < 2500) + { + header.SetChannelFrequencyAndFlags (channelFreqMhz, + RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ | RadiotapHeader::CHANNEL_FLAG_CCK); + } + else + { + header.SetChannelFrequencyAndFlags (channelFreqMhz, + RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ | RadiotapHeader::CHANNEL_FLAG_OFDM); + } + + header.SetAntennaSignalPower (signalDbm); + header.SetAntennaNoisePower (noiseDbm); + + p->AddHeader (header); + file->Write (Simulator::Now (), p); + return; + } + default: + NS_ABORT_MSG ("PcapSniffRxEvent(): Unexpected data link type " << dlt); + } +} void YansWifiPhyHelper::SetPcapFormat (enum PcapFormat format) { - m_pcapFormat = format; + switch (format) + { + case PCAP_FORMAT_80211: + m_pcapDlt = PcapHelper::DLT_IEEE802_11; + return; + case PCAP_FORMAT_80211_PRISM: + m_pcapDlt = PcapHelper::DLT_PRISM_HEADER; + return; + case PCAP_FORMAT_80211_RADIOTAP: + m_pcapDlt = PcapHelper::DLT_IEEE802_11_RADIO; + return; + default: + NS_ABORT_MSG ("YansWifiPhyHelper::SetPcapFormat(): Unexpected format"); + } } +void +YansWifiPhyHelper::SetPcapDataLinkType (uint32_t dlt) +{ + m_pcapDlt = dlt; +} void -YansWifiPhyHelper::EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid) +YansWifiPhyHelper::EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous) { - std::ostringstream oss; - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/"; - Config::MatchContainer matches = Config::LookupMatches (oss.str ()); - if (matches.GetN () == 0) + // + // All of the Pcap enable functions vector through here including the ones + // that are wandering through all of devices on perhaps all of the nodes in + // the system. We can only deal with devices of type WifiNetDevice. + // + Ptr device = nd->GetObject (); + if (device == 0) { + NS_LOG_INFO ("YansWifiHelper::EnablePcapInternal(): Device " << &device << " not of type ns3::WifiNetDevice"); return; } - oss.str (""); - oss << filename << "-" << nodeid << "-" << deviceid << ".pcap"; - Ptr pcap = CreateObject (); - pcap->Open (oss.str ()); - switch (m_pcapFormat) { - case PCAP_FORMAT_80211: - pcap->WriteWifiHeader (); - break; - case PCAP_FORMAT_80211_RADIOTAP: - pcap->WriteWifiRadiotapHeader (); - break; - case PCAP_FORMAT_80211_PRISM: - pcap->WriteWifiPrismHeader (); - break; - } - - oss.str (""); - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; - oss << "/$ns3::WifiNetDevice/Phy/PromiscSnifferTx"; - Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&PcapSniffTxEvent, pcap)); + Ptr phy = device->GetPhy (); + NS_ABORT_MSG_IF (phy == 0, "YansWifiPhyHelper::EnablePcapInternal(): Phy layer in WifiNetDevice must be set"); - oss.str (""); - oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid; - oss << "/$ns3::WifiNetDevice/Phy/PromiscSnifferRx"; - Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&PcapSniffRxEvent, pcap)); -} + PcapHelper pcapHelper; + std::string filename = pcapHelper.GetFilename (prefix, device); -void -YansWifiPhyHelper::EnablePcap (std::string filename, NetDeviceContainer d) -{ - for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) - { - Ptr dev = *i; - EnablePcap (filename, dev->GetNode ()->GetId (), dev->GetIfIndex ()); - } -} + Ptr file = pcapHelper.CreateFile (filename, "w", m_pcapDlt); -void -YansWifiPhyHelper::EnablePcap (std::string filename, Ptr nd) -{ - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex ()); -} - -void -YansWifiPhyHelper::EnablePcap (std::string filename, std::string ndName) -{ - Ptr nd = Names::Find (ndName); - EnablePcap (filename, nd->GetNode ()->GetId (), nd->GetIfIndex ()); -} - -void -YansWifiPhyHelper::EnablePcap (std::string filename, NodeContainer n) -{ - NetDeviceContainer devs; - for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) - { - Ptr node = *i; - for (uint32_t j = 0; j < node->GetNDevices (); ++j) - { - devs.Add (node->GetDevice (j)); - } - } - EnablePcap (filename, devs); -} - -void -YansWifiPhyHelper::EnablePcapAll (std::string filename) -{ - EnablePcap (filename, NodeContainer::GetGlobal ()); + phy->TraceConnectWithoutContext ("PromiscSnifferTx", MakeBoundCallback (&PcapSniffTxEvent, file)); + phy->TraceConnectWithoutContext ("PromiscSnifferRx", MakeBoundCallback (&PcapSniffRxEvent, file)); } void diff --git a/src/helper/yans-wifi-helper.h b/src/helper/yans-wifi-helper.h index 1fdf52ea6..79b1ae8ba 100644 --- a/src/helper/yans-wifi-helper.h +++ b/src/helper/yans-wifi-helper.h @@ -21,7 +21,9 @@ #define YANS_WIFI_HELPER_H #include "wifi-helper.h" +#include "pcap-user-helper.h" #include "ns3/yans-wifi-channel.h" +#include "ns3/deprecated.h" namespace ns3 { @@ -133,7 +135,7 @@ private: * The Pcap and ascii traces generated by the EnableAscii and EnablePcap methods defined * in this class correspond to PHY-level traces. */ -class YansWifiPhyHelper : public WifiPhyHelper + class YansWifiPhyHelper : public WifiPhyHelper, public PcapUserHelper { public: /** @@ -219,69 +221,24 @@ public: * * @param format the PcapFormat to be used */ - void SetPcapFormat (enum PcapFormat format); + void SetPcapFormat (enum PcapFormat format) NS_DEPRECATED; - /** - * \param filename filename prefix to use for pcap files. - * \param nodeid the id of the node to generate pcap output for. - * \param deviceid the id of the device to generate pcap output for. + /** + * Set the data link type of PCAP traces to be used. This function has to be + * called before EnablePcap(), so that the header of the pcap file can be + * written correctly. * - * Generate a pcap file which contains the link-level data observed - * by the specified deviceid within the specified nodeid. The pcap - * data is stored in the file prefix-nodeid-deviceid.pcap. By - * default, no PHY layer information is provided. An optional header - * with PHY layer information, such as the radiotap or the prism - * header, can be used by invoking SetPcapFormat(). + * In madwifi, this corresponds to setting /proc/sys/net/ath0/dev_type to a + * particular value, however we use the pcap DLT instead of the dev_type to + * avoid introducing another unnecessary definition. See * - * This method should be invoked after the network topology has - * been fully constructed. + * http://madwifi-project.org/wiki/UserDocs/MonitorModeInterface + * + * for more information. + * + * @param dlt The data link type of the pcap file (and packets) to be used */ - void EnablePcap (std::string filename, uint32_t nodeid, uint32_t deviceid); - - /** - * \param filename filename prefix to use for pcap files. - * \param nd Net device on which you want to enable tracing. - * - * Enable pcap output on each input device which is of the - * ns3::WifiNetDevice type. - */ - void EnablePcap (std::string filename, Ptr nd); - - /** - * \param filename filename prefix to use for pcap files. - * \param ndName Name of net device on which you want to enable tracing. - * - * Enable pcap output on each input device which is of the - * ns3::WifiNetDevice type. - */ - void EnablePcap (std::string filename, std::string ndName); - - /** - * \param filename filename prefix to use for pcap files. - * \param d container of devices of type ns3::WifiNetDevice - * - * Enable pcap output on each input device which is of the - * ns3::WifiNetDevice type. - */ - void EnablePcap (std::string filename, NetDeviceContainer d); - - /** - * \param filename filename prefix to use for pcap files. - * \param n container of nodes. - * - * Enable pcap output on each device which is of the - * ns3::WifiNetDevice type and which is located in one of the - * input nodes. - */ - void EnablePcap (std::string filename, NodeContainer n); - - /** - * \param filename filename prefix to use for pcap files. - * - * Enable pcap output on each device which is of the - * ns3::WifiNetDevice type - */ - void EnablePcapAll (std::string filename); + void SetPcapDataLinkType (uint32_t dlt); /** * \param os output stream @@ -335,10 +292,22 @@ private: */ virtual Ptr Create (Ptr node, Ptr device) const; + /** + * @brief Enable pcap output the indicated net device. + * + * NetDevice-specific implementation mechanism for hooking the trace and + * writing to the trace file. + * + * @param prefix Filename prefix to use for pcap files. + * @param nd Net device for which you want to enable tracing. + * @param promiscuous If true capture all possible packets available at the device. + */ + virtual void EnablePcapInternal (std::string prefix, Ptr nd, bool promiscuous); + ObjectFactory m_phy; ObjectFactory m_errorRateModel; Ptr m_channel; - enum PcapFormat m_pcapFormat; + uint32_t m_pcapDlt; }; } // namespace ns3 diff --git a/src/node/radiotap-header.cc b/src/node/radiotap-header.cc new file mode 100644 index 000000000..6d08bdc4d --- /dev/null +++ b/src/node/radiotap-header.cc @@ -0,0 +1,404 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 CTTC + * + * 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, Include., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Nicola Baldo + */ + +#include +#include +#include "ns3/log.h" +#include "radiotap-header.h" + +NS_LOG_COMPONENT_DEFINE ("RadiotapHeader"); + +namespace ns3 { + +RadiotapHeader::RadiotapHeader() + : m_length(8), + m_present(0), + m_tsft(0), + m_flags(FRAME_FLAG_NONE), + m_rate(0), + m_channelFreq(0), + m_channelFlags(CHANNEL_FLAG_NONE), + m_antennaSignal(0), + m_antennaNoise(0) +{ + NS_LOG_FUNCTION (this); +} + +TypeId RadiotapHeader::GetTypeId (void) +{ + static TypeId tid = TypeId ("RadiotapHeader") + .SetParent
() + .AddConstructor () + ; + return tid; +} + +TypeId +RadiotapHeader::GetInstanceTypeId (void) const +{ + NS_LOG_FUNCTION (this); + return GetTypeId (); +} + +uint32_t +RadiotapHeader::GetSerializedSize (void) const +{ + NS_LOG_FUNCTION (this); + return m_length; +} + +void +RadiotapHeader::Serialize (Buffer::Iterator start) const +{ + NS_LOG_FUNCTION (this); + + start.WriteU8 (0); // major version of radiotap header + start.WriteU8 (0); // pad field + start.WriteU16 (m_length); // entire length of radiotap data + header + start.WriteU32 (m_present); // bits describing which fields follow header + + // + // Time Synchronization Function Timer (when the first bit of the MPDU + // arrived at the MAC) + // + if (m_present & RADIOTAP_TSFT) // bit 0 + { + start.WriteU64 (m_tsft); + } + + // + // Properties of transmitted and received frames. + // + if (m_present & RADIOTAP_FLAGS) // bit 1 + { + start.WriteU8 (m_flags); + } + + // + // TX/RX data rate in units of 500 kbps + // + if (m_present & RADIOTAP_RATE) // bit 2 + { + start.WriteU8 (m_rate); + } + + // + // Tx/Rx frequency in MHz, followed by flags. + // + if (m_present & RADIOTAP_CHANNEL) // bit 3 + { + start.WriteU16 (m_channelFreq); + start.WriteU16 (m_channelFlags); + } + + // + // RF signal power at the antenna, decibel difference from an arbitrary, fixed + // reference. + // + if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5 + { + start.WriteU8 (m_antennaSignal); + } + + // + // RF noise power at the antenna, decibel difference from an arbitrary, fixed + // reference. + // + if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6 + { + start.WriteU8 (m_antennaNoise); + } +} + +uint32_t +RadiotapHeader::Deserialize (Buffer::Iterator start) +{ + NS_LOG_FUNCTION (this); + + uint8_t tmp = start.ReadU8 (); // major version of radiotap header + NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version"); + start.ReadU8 (); // pad field + + m_length = start.ReadU16 (); // entire length of radiotap data + header + m_present = start.ReadU32 (); // bits describing which fields follow header + + uint32_t bytesRead = 8; + + // + // Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC) + // + if (m_present & RADIOTAP_TSFT) // bit 0 + { + m_tsft = start.ReadU64(); + bytesRead += 8; + } + + // + // Properties of transmitted and received frames. + // + if (m_present & RADIOTAP_FLAGS) // bit 1 + { + m_flags = start.ReadU8(); + ++bytesRead; + } + + // + // TX/RX data rate in units of 500 kbps + // + if (m_present & RADIOTAP_RATE) // bit 2 + { + m_rate = start.ReadU8(); + ++bytesRead; + } + + // + // Tx/Rx frequency in MHz, followed by flags. + // + if (m_present & RADIOTAP_CHANNEL) // bit 3 + { + m_channelFreq = start.ReadU16(); + m_channelFlags = start.ReadU16(); + bytesRead += 4; + } + + // + // The hop set and pattern for frequency-hopping radios. We don't need it but + // still need to account for it. + // + if (m_present & RADIOTAP_FHSS) // bit 4 + { + start.ReadU8(); + ++bytesRead; + } + + // + // RF signal power at the antenna, decibel difference from an arbitrary, fixed + // reference. + // + if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5 + { + m_antennaSignal = start.ReadU8(); + ++bytesRead; + } + + // + // RF noise power at the antenna, decibel difference from an arbitrary, fixed + // reference. + // + if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6 + { + m_antennaNoise = start.ReadU8(); + ++bytesRead; + } + + NS_ASSERT_MSG(m_length == bytesRead, "RadiotapHeader::Deserialize(): expected and actual lengths inconsistent"); + return bytesRead; +} + +void +RadiotapHeader::Print (std::ostream &os) const +{ + NS_LOG_FUNCTION (this); + os << " tsft=" << m_tsft + << " flags=" << std::hex << m_flags << std::dec + << " rate=" << (uint16_t) m_rate + << " freq=" << m_channelFreq + << " chflags=" << std::hex << (uint32_t)m_channelFlags << std::dec + << " signal=" << (int16_t) m_antennaSignal + << " noise=" << (int16_t) m_antennaNoise; +} + +void +RadiotapHeader::SetTsft (uint64_t value) +{ + NS_LOG_FUNCTION (this << value); + m_tsft = value; + + if (!(m_present & RADIOTAP_TSFT)) + { + m_present |= RADIOTAP_TSFT; + m_length += 8; + } + + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} + +uint64_t +RadiotapHeader::GetTsft () const +{ + NS_LOG_FUNCTION (this); + return m_tsft; +} + +void +RadiotapHeader::SetFrameFlags (uint8_t flags) +{ + NS_LOG_FUNCTION (this << flags); + m_flags = flags; + + if (!(m_present & RADIOTAP_FLAGS)) + { + m_present |= RADIOTAP_FLAGS; + m_length += 1; + } + + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} + +uint8_t +RadiotapHeader::GetFrameFlags (void) const +{ + NS_LOG_FUNCTION (this); + return m_flags; +} + +void +RadiotapHeader::SetRate (uint8_t rate) +{ + NS_LOG_FUNCTION (this << rate); + m_rate = rate; + + if (!(m_present & RADIOTAP_RATE)) + { + m_present |= RADIOTAP_RATE; + m_length += 1; + } + + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} + +uint8_t +RadiotapHeader::GetRate (void) const +{ + NS_LOG_FUNCTION (this); + return m_rate; +} + +void +RadiotapHeader::SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags) +{ + NS_LOG_FUNCTION (this << frequency << flags); + m_channelFreq = frequency; + m_channelFlags = flags; + + if (!(m_present & RADIOTAP_CHANNEL)) + { + m_present |= RADIOTAP_CHANNEL; + m_length += 4; + } + + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} + +uint16_t +RadiotapHeader::GetChannelFrequency (void) const +{ + NS_LOG_FUNCTION (this); + return m_channelFreq; +} + +uint16_t +RadiotapHeader::GetChannelFlags (void) const +{ + NS_LOG_FUNCTION (this); + return m_channelFlags; +} + +void +RadiotapHeader::SetAntennaSignalPower (int8_t signal) +{ + NS_LOG_FUNCTION (this << signal); + m_antennaSignal = signal; + + if (!(m_present & RADIOTAP_DBM_ANTSIGNAL)) + { + m_present |= RADIOTAP_DBM_ANTSIGNAL; + m_length += 1; + } + + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} + +void +RadiotapHeader::SetAntennaSignalPower (double signal) +{ + NS_LOG_FUNCTION (this << signal); + + if (signal < -128) + { + return SetAntennaSignalPower (static_cast (-128)); + } + + if (signal > 127) + { + return SetAntennaSignalPower (static_cast (127)); + } + + SetAntennaSignalPower (static_cast (floor(signal + 0.5))); +} + +uint8_t +RadiotapHeader::GetAntennaSignalPower (void) const +{ + NS_LOG_FUNCTION (this); + return m_antennaSignal; +} + +void +RadiotapHeader::SetAntennaNoisePower (int8_t noise) +{ + NS_LOG_FUNCTION (this << noise); + m_antennaNoise = noise; + + if (!(m_present & RADIOTAP_DBM_ANTNOISE)) + { + m_present |= RADIOTAP_DBM_ANTNOISE; + m_length += 1; + } + + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} + +void +RadiotapHeader::SetAntennaNoisePower (double noise) +{ + NS_LOG_FUNCTION (this << noise); + + if (noise < -128) + { + return SetAntennaNoisePower (static_cast (-128)); + } + + if (noise > 127) + { + return SetAntennaNoisePower (static_cast (127)); + } + + SetAntennaNoisePower (static_cast (floor(noise + 0.5))); +} + +uint8_t +RadiotapHeader::GetAntennaNoisePower (void) const +{ + NS_LOG_FUNCTION (this); + return m_antennaNoise; +} + +} // namespace ns3 diff --git a/src/node/radiotap-header.h b/src/node/radiotap-header.h new file mode 100644 index 000000000..8ca3087a1 --- /dev/null +++ b/src/node/radiotap-header.h @@ -0,0 +1,273 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2009 CTTC + * + * 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, Include., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Nicola Baldo + */ + +#ifndef RADIOTAP_HEADER_H +#define RADIOTAP_HEADER_H + + +#include + +namespace ns3 { + +/** + * @brief Radiotap header implementation + * + * Radiotap is a de facto standard for 802.11 frame injection and reception. + * The radiotap header format is a mechanism to supply additional information + * about frames, from the driver to userspace applications such as libpcap, and + * from a userspace application to the driver for transmission. + * + * @warning the radiotap header specification says that the fields included in + * the header should be aligned to their natural ize (e.g., 16-bit fields + * aligned to 16-bit boundaries, 32-bit fields aligned to 32-bit boundaries, + * and so on. This implementation does not enforce this. However, the radiotap + * specification enforces an order in which fields have to appear (if they + * appear), and this ordering is such that, provided you don't leave gaps, all + * fields will end up aligned without the need of inserting padding space. By + * the term "gap" I mean not using a field which would appear between two used + * fields. Moral: don't leave gaps, or if you do be careful about how you + * do it. + */ +class RadiotapHeader : public Header +{ +public: + RadiotapHeader(); + static TypeId GetTypeId (void); + virtual TypeId GetInstanceTypeId (void) const; + + /** + * This method is used by Packet::AddHeader to store the header into the byte + * buffer of a packet. This method returns the number of bytes which are + * needed to store the header data during a Serialize. + * + * @returns The expected size of the header. + */ + virtual uint32_t GetSerializedSize (void) const; + + /** + * This method is used by Packet::AddHeader to store the header into the byte + * buffer of a packet. The data written is expected to match bit-for-bit the + * representation of this header in a real network. + * + * @param start An iterator which points to where the header should + * be written. + */ + virtual void Serialize (Buffer::Iterator start) const; + + /** + * This method is used by Packet::RemoveHeader to re-create a header from the + * byte buffer of a packet. The data read is expected to match bit-for-bit + * the representation of this header in real networks. + * + * @param start An iterator which points to where the header should + * written. + * @returns The number of bytes read. + */ + virtual uint32_t Deserialize (Buffer::Iterator start); + + /** + * This method is used by Packet::Print to print the content of the header as + * ascii data to a C++ output stream. Although the header is free to format + * its output as it wishes, it is recommended to follow a few rules to integrate + * with the packet pretty printer: start with flags, small field + * values located between a pair of parens. Values should be separated + * by whitespace. Follow the parens with the important fields, + * separated by whitespace. + * + * eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 + * + * @param os The output stream + */ + virtual void Print (std::ostream &os) const; + + /** + * @brief Set the Time Synchronization Function Timer (TSFT) value. Valid for + * received frames only. + * + * @param tsft Value in microseconds of the MAC's 64-bit 802.11 Time + * Synchronization Function timer when the first bit of the MPDU + * arrived at the MAC. + */ + void SetTsft (uint64_t tsft); + + /** + * @brief Get the Time Synchronization Function Timer (TSFT) value. Valid for + * received frames only. + * + * @returns The value in microseconds of the MAC's 64-bit 802.11 Time + * Synchronization Function timer when the first bit of the MPDU + * arrived at the MAC. + */ + uint64_t GetTsft (void) const; + + enum {FRAME_FLAG_NONE = 0x00}; /**< No flags set */ + enum {FRAME_FLAG_CFP = 0x01}; /**< Frame sent/received during CFP */ + enum {FRAME_FLAG_SHORT_PREAMBLE = 0x02}; /**< Frame sent/received with short preamble */ + enum {FRAME_FLAG_WEP = 0x04}; /**< Frame sent/received with WEP encryption */ + enum {FRAME_FLAG_FRAGMENTED = 0x08}; /**< Frame sent/received with fragmentation */ + enum {FRAME_FLAG_FCS_INCLUDED = 0x10}; /**< Frame includes FCS */ + enum {FRAME_FLAG_DATA_PADDING = 0x20}; /**< Frame has padding between 802.11 header and payload (to 32-bit boundary) */ + enum {FRAME_FLAG_BAD_FCS = 0x40}; /**< Frame failed FCS check */ + enum {FRAME_FLAG_SHORT_GUARD = 0x80}; /**< Frame used short guard interval (HT) */ + + /** + * @brief Set the frame flags of the transmitted or received frame. + * @param flags flags to set. + */ + void SetFrameFlags (uint8_t flags); + + /** + * @brief Get the frame flags of the transmitted or received frame. + * @returns The frame flags. + * @see FrameFlags. + */ + uint8_t GetFrameFlags (void) const; + + /** + * @brief Set the transmit/receive channel frequency in units of megahertz + * @param rate the transmit/receive channel frequency in units of megahertz. + */ + void SetRate (uint8_t rate); + + /** + * @brief Get the transmit/receive channel frequency in units of megahertz. + * @returns The transmit/receive channel frequency in units of megahertz. + */ + uint8_t GetRate (void) const; + + enum {CHANNEL_FLAG_NONE = 0x0000}; /**< No flags set */ + enum {CHANNEL_FLAG_TURBO = 0x0010}; /**< Turbo Channel */ + enum {CHANNEL_FLAG_CCK = 0x0020}; /**< CCK channel */ + enum {CHANNEL_FLAG_OFDM = 0x0040}; /**< OFDM channel */ + enum {CHANNEL_FLAG_SPECTRUM_2GHZ = 0x0080}; /**< 2 GHz spectrum channel */ + enum {CHANNEL_FLAG_SPECTRUM_5GHZ = 0x0100}; /**< 5 GHz spectrum channel */ + enum {CHANNEL_FLAG_PASSIVE = 0x0200}; /**< Only passive scan allowed */ + enum {CHANNEL_FLAG_DYNAMIC = 0x0400}; /**< Dynamic CCK-OFDM channel */ + enum {CHANNEL_FLAG_GFSK = 0x0800}; /**< GFSK channel (FHSS PHY) */ + + /** + * @brief Set the transmit/receive channel frequency and flags + * @param frequency The transmit/receive data rate in units of 500 kbps. + * @param flags The flags to set. + * @see ChannelFlags + */ + void SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags); + + /** + * @brief Get the transmit/receive data rate in units of 500 kbps. + * @returns The transmit/receive data rate in units of 500 kbps. + */ + uint16_t GetChannelFrequency (void) const; + + /** + * @brief Get the channel flags of the transmitted or received frame. + * @returns The frame flags. + * @see ChannelFlags. + */ + uint16_t GetChannelFlags (void) const; + + /** + * @brief Set the RF signal power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + * + * @param signal The RF signal power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + */ + void SetAntennaSignalPower (int8_t signal); + + /** + * @brief Set the RF signal power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + * + * @param signal The RF signal power at the antenna as a decibel difference + * from an arbitrary, fixed reference; + */ + void SetAntennaSignalPower (double signal); + + /** + * @brief Get the RF signal power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + * + * @returns The RF signal power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + */ + uint8_t GetAntennaSignalPower (void) const; + + /** + * @brief Set the RF noise power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + * + * @param noise The RF noise power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + */ + void SetAntennaNoisePower (int8_t noise); + + /** + * @brief Set the RF noise power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + * + * @param noise The RF noise power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + */ + void SetAntennaNoisePower (double noise); + + /** + * @brief Get the RF noise power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + * + * @returns The RF noise power at the antenna as a decibel difference + * from an arbitrary, fixed reference. + */ + uint8_t GetAntennaNoisePower (void) const; + +private: + enum {RADIOTAP_TSFT = 0x00000001}; + enum {RADIOTAP_FLAGS = 0x00000002}; + enum {RADIOTAP_RATE = 0x00000004}; + enum {RADIOTAP_CHANNEL = 0x00000008}; + enum {RADIOTAP_FHSS = 0x00000010}; + enum {RADIOTAP_DBM_ANTSIGNAL = 0x00000020}; + enum {RADIOTAP_DBM_ANTNOISE = 0x00000040}; + enum {RADIOTAP_LOCK_QUALITY = 0x00000080}; + enum {RADIOTAP_TX_ATTENUATION = 0x00000100}; + enum {RADIOTAP_DB_TX_ATTENUATION = 0x00000200}; + enum {RADIOTAP_DBM_TX_POWER = 0x00000200}; + enum {RADIOTAP_ANTENNA = 0x00000400}; + enum {RADIOTAP_DB_ANTSIGNAL = 0x00000800}; + enum {RADIOTAP_DB_ANTNOISE = 0x00001000}; + enum {RADIOTAP_EXT = 0x10000000}; + + void CheckAddChannelField(); + + uint16_t m_length; + uint32_t m_present; + + uint64_t m_tsft; + uint8_t m_flags; + uint8_t m_rate; + uint16_t m_channelFreq; + uint16_t m_channelFlags; + int8_t m_antennaSignal; + int8_t m_antennaNoise; +}; + +} // namespace ns3 + +#endif /* RADIOTAP_HEADER_H */ diff --git a/src/node/wscript b/src/node/wscript index 723abf6a2..c32249b75 100644 --- a/src/node/wscript +++ b/src/node/wscript @@ -48,6 +48,7 @@ def build(bld): 'ipv6-routing-protocol.cc', 'packetbb.cc', 'packetbb-test-suite.cc', + 'radiotap-header.cc', ] headers = bld.new_task_gen('ns3header') @@ -96,4 +97,5 @@ def build(bld): 'ipv6-raw-socket-factory.h', 'ipv6-routing-protocol.h', 'packetbb.h', + 'radiotap-header.h', ] diff --git a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc index d3563f975..2feb00b0b 100644 --- a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc +++ b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc @@ -323,7 +323,7 @@ Ns3TcpCwndTestCase1::DoRun (void) if (m_writeResults) { - PointToPointHelper::EnablePcapAll ("tcp-cwnd"); + pointToPoint.EnablePcapAll ("tcp-cwnd"); } Simulator::Stop (Seconds(2)); @@ -490,7 +490,8 @@ Ns3TcpCwndTestCase2::DoRun (void) if (m_writeResults) { // Write a pcap for tcp cwnd testcase with out-of-order delivery - PointToPointHelper::EnablePcapAll ("tcp-cwnd-ood"); + PointToPointHelper pointToPoint; + pointToPoint.EnablePcapAll ("tcp-cwnd-ood"); } // Finally, set up the simulator to run. diff --git a/src/test/ns3tcp/ns3tcp-interop-test-suite.cc b/src/test/ns3tcp/ns3tcp-interop-test-suite.cc index c1e7d9d5a..283d5ff2f 100644 --- a/src/test/ns3tcp/ns3tcp-interop-test-suite.cc +++ b/src/test/ns3tcp/ns3tcp-interop-test-suite.cc @@ -282,7 +282,7 @@ Ns3TcpInteroperabilityTestCase::DoRun (void) if (m_writeVectors) { - PointToPointHelper::EnablePcapAll ("tcp-interop"); + pointToPoint.EnablePcapAll ("tcp-interop"); } Simulator::Stop (Seconds(20)); diff --git a/src/test/ns3wifi/wifi-interference-test-suite.cc b/src/test/ns3wifi/wifi-interference-test-suite.cc index 200d64851..9979877c7 100644 --- a/src/test/ns3wifi/wifi-interference-test-suite.cc +++ b/src/test/ns3wifi/wifi-interference-test-suite.cc @@ -148,8 +148,9 @@ WifiInterferenceTestCase::WifiSimpleInterference (std::string phyMode,double Prs wifiPhy.Set ("RxGain", DoubleValue (0) ); wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0) ); - // ns-3 support RadioTap and Prism tracing extensions for 802.11b - wifiPhy.SetPcapFormat (YansWifiPhyHelper::PCAP_FORMAT_80211_RADIOTAP); + // ns-3 supports RadioTap and Prism tracing extensions for 802.11b + const uint32_t DLT_IEEE802_11_RADIO = 127; + wifiPhy.SetPcapDataLinkType (DLT_IEEE802_11_RADIO); YansWifiChannelHelper wifiChannel ; wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");