diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py index d03b897ee..fa28aa619 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_common.py @@ -47,8 +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-file-wrapper.h: ns3::PcapFileWrapper [class] + module.add_class('PcapFileWrapper', parent=root_module['ns3::Object']) ## propagation-delay-model.h: ns3::PropagationDelayModel [class] module.add_class('PropagationDelayModel', parent=root_module['ns3::Object']) ## propagation-loss-model.h: ns3::PropagationLossModel [class] @@ -197,7 +197,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_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper']) register_Ns3PropagationDelayModel_methods(root_module, root_module['ns3::PropagationDelayModel']) register_Ns3PropagationLossModel_methods(root_module, root_module['ns3::PropagationLossModel']) register_Ns3RandomPropagationDelayModel_methods(root_module, root_module['ns3::RandomPropagationDelayModel']) @@ -987,65 +987,65 @@ 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] +def register_Ns3PcapFileWrapper_methods(root_module, cls): + ## pcap-file-wrapper.h: ns3::PcapFileWrapper::PcapFileWrapper(ns3::PcapFileWrapper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapFileWrapper const &', 'arg0')]) + ## pcap-file-wrapper.h: ns3::PcapFileWrapper::PcapFileWrapper() [constructor] cls.add_constructor([]) - ## pcap-file-object.h: void ns3::PcapFileObject::Close() [member function] + ## pcap-file-wrapper.h: void ns3::PcapFileWrapper::Close() [member function] cls.add_method('Close', 'void', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetDataLinkType() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetDataLinkType() [member function] cls.add_method('GetDataLinkType', 'uint32_t', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetMagic() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetMagic() [member function] cls.add_method('GetMagic', 'uint32_t', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetSigFigs() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetSigFigs() [member function] cls.add_method('GetSigFigs', 'uint32_t', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetSnapLen() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetSnapLen() [member function] cls.add_method('GetSnapLen', 'uint32_t', []) - ## pcap-file-object.h: int32_t ns3::PcapFileObject::GetTimeZoneOffset() [member function] + ## pcap-file-wrapper.h: int32_t ns3::PcapFileWrapper::GetTimeZoneOffset() [member function] cls.add_method('GetTimeZoneOffset', 'int32_t', []) - ## pcap-file-object.h: static ns3::TypeId ns3::PcapFileObject::GetTypeId() [member function] + ## pcap-file-wrapper.h: static ns3::TypeId ns3::PcapFileWrapper::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) - ## pcap-file-object.h: uint16_t ns3::PcapFileObject::GetVersionMajor() [member function] + ## pcap-file-wrapper.h: uint16_t ns3::PcapFileWrapper::GetVersionMajor() [member function] cls.add_method('GetVersionMajor', 'uint16_t', []) - ## pcap-file-object.h: uint16_t ns3::PcapFileObject::GetVersionMinor() [member function] + ## pcap-file-wrapper.h: uint16_t ns3::PcapFileWrapper::GetVersionMinor() [member function] cls.add_method('GetVersionMinor', 'uint16_t', []) - ## pcap-file-object.h: bool ns3::PcapFileObject::Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits::max(), int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits::max(), int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] cls.add_method('Init', 'bool', [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='std::numeric_limits::max()'), 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] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::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] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::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, ns3::Header & header, ns3::Ptr p) [member function] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Header & header, ns3::Ptr p) [member function] cls.add_method('Write', 'bool', [param('ns3::Time', 't'), param('ns3::Header &', 'header'), 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] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::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')]) diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py index 92338589a..ba78b57a7 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_core.py @@ -3060,11 +3060,11 @@ def register_functions(root_module): '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::OutputStreamKeeper >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::OutputStreamKeeper >', 'a')], template_parameters=['void', 'ns3::Ptr', 'ns3::Ptr', 'ns3::Ptr']) - ## 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] + ## 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']) + [param('void ( * ) ( ns3::Ptr< ns3::PcapFileWrapper >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::PcapFileWrapper >', 'a')], + template_parameters=['void', 'ns3::Ptr', 'ns3::Ptr', 'ns3::Ptr']) ## callback.h: extern ns3::Callback, std::allocator >,ns3::Ptr,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr,::std::basic_string,std::allocator >,::ns3::Ptr ) * fnPtr, ns3::Ptr a) [free function] module.add_function('MakeBoundCallback', 'ns3::Callback< void, std::basic_string< char, std::char_traits< char >, std::allocator< char > >, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', diff --git a/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py index c6abff5d2..2b7ebbb29 100644 --- a/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-ILP32/ns3_module_helper.py @@ -1336,9 +1336,9 @@ def register_Ns3PcapHelper_methods(root_module, cls): cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')]) ## trace-helper.h: ns3::PcapHelper::PcapHelper() [constructor] cls.add_constructor([]) - ## trace-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] + ## trace-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 >', + 'ns3::Ptr< ns3::PcapFileWrapper >', [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')]) ## trace-helper.h: std::string ns3::PcapHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr device, bool useObjectNames=true) [member function] cls.add_method('GetFilenameFromDevice', diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_common.py b/bindings/python/apidefs/gcc-LP64/ns3_module_common.py index d03b897ee..fa28aa619 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_common.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_common.py @@ -47,8 +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-file-wrapper.h: ns3::PcapFileWrapper [class] + module.add_class('PcapFileWrapper', parent=root_module['ns3::Object']) ## propagation-delay-model.h: ns3::PropagationDelayModel [class] module.add_class('PropagationDelayModel', parent=root_module['ns3::Object']) ## propagation-loss-model.h: ns3::PropagationLossModel [class] @@ -197,7 +197,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_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper']) register_Ns3PropagationDelayModel_methods(root_module, root_module['ns3::PropagationDelayModel']) register_Ns3PropagationLossModel_methods(root_module, root_module['ns3::PropagationLossModel']) register_Ns3RandomPropagationDelayModel_methods(root_module, root_module['ns3::RandomPropagationDelayModel']) @@ -987,65 +987,65 @@ 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] +def register_Ns3PcapFileWrapper_methods(root_module, cls): + ## pcap-file-wrapper.h: ns3::PcapFileWrapper::PcapFileWrapper(ns3::PcapFileWrapper const & arg0) [copy constructor] + cls.add_constructor([param('ns3::PcapFileWrapper const &', 'arg0')]) + ## pcap-file-wrapper.h: ns3::PcapFileWrapper::PcapFileWrapper() [constructor] cls.add_constructor([]) - ## pcap-file-object.h: void ns3::PcapFileObject::Close() [member function] + ## pcap-file-wrapper.h: void ns3::PcapFileWrapper::Close() [member function] cls.add_method('Close', 'void', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetDataLinkType() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetDataLinkType() [member function] cls.add_method('GetDataLinkType', 'uint32_t', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetMagic() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetMagic() [member function] cls.add_method('GetMagic', 'uint32_t', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetSigFigs() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetSigFigs() [member function] cls.add_method('GetSigFigs', 'uint32_t', []) - ## pcap-file-object.h: uint32_t ns3::PcapFileObject::GetSnapLen() [member function] + ## pcap-file-wrapper.h: uint32_t ns3::PcapFileWrapper::GetSnapLen() [member function] cls.add_method('GetSnapLen', 'uint32_t', []) - ## pcap-file-object.h: int32_t ns3::PcapFileObject::GetTimeZoneOffset() [member function] + ## pcap-file-wrapper.h: int32_t ns3::PcapFileWrapper::GetTimeZoneOffset() [member function] cls.add_method('GetTimeZoneOffset', 'int32_t', []) - ## pcap-file-object.h: static ns3::TypeId ns3::PcapFileObject::GetTypeId() [member function] + ## pcap-file-wrapper.h: static ns3::TypeId ns3::PcapFileWrapper::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) - ## pcap-file-object.h: uint16_t ns3::PcapFileObject::GetVersionMajor() [member function] + ## pcap-file-wrapper.h: uint16_t ns3::PcapFileWrapper::GetVersionMajor() [member function] cls.add_method('GetVersionMajor', 'uint16_t', []) - ## pcap-file-object.h: uint16_t ns3::PcapFileObject::GetVersionMinor() [member function] + ## pcap-file-wrapper.h: uint16_t ns3::PcapFileWrapper::GetVersionMinor() [member function] cls.add_method('GetVersionMinor', 'uint16_t', []) - ## pcap-file-object.h: bool ns3::PcapFileObject::Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits::max(), int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits::max(), int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] cls.add_method('Init', 'bool', [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='std::numeric_limits::max()'), 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] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::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] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::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, ns3::Header & header, ns3::Ptr p) [member function] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Header & header, ns3::Ptr p) [member function] cls.add_method('Write', 'bool', [param('ns3::Time', 't'), param('ns3::Header &', 'header'), 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] + ## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::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')]) diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_core.py b/bindings/python/apidefs/gcc-LP64/ns3_module_core.py index 18760b263..06068d71c 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_core.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_core.py @@ -3060,11 +3060,11 @@ def register_functions(root_module): '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::OutputStreamKeeper >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::OutputStreamKeeper >', 'a')], template_parameters=['void', 'ns3::Ptr', 'ns3::Ptr', 'ns3::Ptr']) - ## 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] + ## 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']) + [param('void ( * ) ( ns3::Ptr< ns3::PcapFileWrapper >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::PcapFileWrapper >', 'a')], + template_parameters=['void', 'ns3::Ptr', 'ns3::Ptr', 'ns3::Ptr']) ## callback.h: extern ns3::Callback, std::allocator >,ns3::Ptr,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr,::std::basic_string,std::allocator >,::ns3::Ptr ) * fnPtr, ns3::Ptr a) [free function] module.add_function('MakeBoundCallback', 'ns3::Callback< void, std::basic_string< char, std::char_traits< char >, std::allocator< char > >, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', diff --git a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py index c6abff5d2..2b7ebbb29 100644 --- a/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py +++ b/bindings/python/apidefs/gcc-LP64/ns3_module_helper.py @@ -1336,9 +1336,9 @@ def register_Ns3PcapHelper_methods(root_module, cls): cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')]) ## trace-helper.h: ns3::PcapHelper::PcapHelper() [constructor] cls.add_constructor([]) - ## trace-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] + ## trace-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 >', + 'ns3::Ptr< ns3::PcapFileWrapper >', [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')]) ## trace-helper.h: std::string ns3::PcapHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr device, bool useObjectNames=true) [member function] cls.add_method('GetFilenameFromDevice', diff --git a/doc/tutorial/tracing.texi b/doc/tutorial/tracing.texi index 350af8734..37c9f100e 100644 --- a/doc/tutorial/tracing.texi +++ b/doc/tutorial/tracing.texi @@ -1944,7 +1944,7 @@ representing a file. } static void - RxDrop (Ptr file, Ptr p) + RxDrop (Ptr file, Ptr p) { NS_LOG_UNCOND ("RxDrop at " << Simulator::Now ().GetSeconds ()); file->Write(Simulator::Now(), p); @@ -1978,7 +1978,7 @@ carrying around a @code{std::ofstream} for you, and you can use it here like any other output stream. A similar situation happens in @code{RxDrop} except that the object being -passed around (a @code{Ptr}) represents a pcap file. There +passed around (a @code{Ptr}) represents a pcap file. There is a one-liner in the trace sink to write a timestamp and the contents of the packet being dropped to the pcap file: @@ -1998,7 +1998,7 @@ look in the @code{main} function, you will find new code to do just that: ... PcapHelper pcapHelper; - Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); + Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", MakeBoundCallback (&RxDrop, file)); @end verbatim @@ -2030,7 +2030,7 @@ In the second section of code in the snippet above, we instantiate a with the @code{AsciiTraceHelper}. The line of code, @verbatim - Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); + Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); @end verbatim creates a pcap file named ``sixth.pcap'' with file mode ``w''. This means that @@ -2053,12 +2053,12 @@ An important detour: It is important to notice that even though both of these objects are declared in very similar ways, @verbatim - Ptr file ... + Ptr file ... Ptr stream ... @end verbatim The underlying objects are entirely different. For example, the -Ptr is a smart pointer to an @command{ns-3} Object that is a +Ptr is a smart pointer to an @command{ns-3} Object that is a fairly heaviweight thing that supports @code{Attributes} and is integrated into the config system. The Ptr, on the other hand, is a smart pointer to a reference counted object that is a very lightweight thing. @@ -2069,10 +2069,10 @@ For example, take a look at @code{src/common/pcap-file-object.h} in the distribution and notice, @verbatim - class PcapFileObject : public Object + class PcapFileWrapper : public Object @end verbatim -that class @code{PcapFileObject} is an @command{ns-3} Object by virtue of +that class @code{PcapFileWrapper} is an @command{ns-3} Object by virtue of its inheritance. Then look at @code{src/common/output-stream-keeper.h} and notice, @@ -2153,7 +2153,7 @@ core code involved, and we did this in only 18 lines of code: ... static void - RxDrop (Ptr file, Ptr p) + RxDrop (Ptr file, Ptr p) { NS_LOG_UNCOND ("RxDrop at " << Simulator::Now ().GetSeconds ()); file->Write(Simulator::Now(), p); @@ -2162,7 +2162,7 @@ core code involved, and we did this in only 18 lines of code: ... PcapHelper pcapHelper; - Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); + Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", MakeBoundCallback (&RxDrop, file)); @end verbatim diff --git a/examples/tutorial/sixth.cc b/examples/tutorial/sixth.cc index 508df05cf..4f975d7bc 100644 --- a/examples/tutorial/sixth.cc +++ b/examples/tutorial/sixth.cc @@ -168,7 +168,7 @@ CwndChange (Ptr stream, uint32_t oldCwnd, uint32_t newCwnd) } static void -RxDrop (Ptr file, Ptr p) +RxDrop (Ptr file, Ptr p) { NS_LOG_UNCOND ("RxDrop at " << Simulator::Now ().GetSeconds ()); file->Write(Simulator::Now(), p); @@ -219,7 +219,7 @@ main (int argc, char *argv[]) ns3TcpSocket->TraceConnectWithoutContext ("CongestionWindow", MakeBoundCallback (&CwndChange, stream)); PcapHelper pcapHelper; - Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); + Ptr file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP); devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", MakeBoundCallback (&RxDrop, file)); Simulator::Stop (Seconds(20)); diff --git a/src/common/pcap-file-test-suite.cc b/src/common/pcap-file-test-suite.cc index e87b9bbe7..b2ca5cdd1 100644 --- a/src/common/pcap-file-test-suite.cc +++ b/src/common/pcap-file-test-suite.cc @@ -1013,7 +1013,7 @@ public: }; PcapFileTestSuite::PcapFileTestSuite () - : TestSuite ("pcap-file-object", UNIT) + : TestSuite ("pcap-file", UNIT) { AddTestCase (new WriteModeCreateTestCase); AddTestCase (new ReadModeCreateTestCase); diff --git a/src/common/pcap-file-object.cc b/src/common/pcap-file-wrapper.cc similarity index 75% rename from src/common/pcap-file-object.cc rename to src/common/pcap-file-wrapper.cc index 87bbc391e..6ea57e2a6 100644 --- a/src/common/pcap-file-object.cc +++ b/src/common/pcap-file-wrapper.cc @@ -21,53 +21,53 @@ #include "buffer.h" #include "header.h" -#include "pcap-file-object.h" +#include "pcap-file-wrapper.h" -NS_LOG_COMPONENT_DEFINE ("PcapFileObject"); +NS_LOG_COMPONENT_DEFINE ("PcapFileWrapper"); namespace ns3 { -NS_OBJECT_ENSURE_REGISTERED (PcapFileObject); +NS_OBJECT_ENSURE_REGISTERED (PcapFileWrapper); TypeId -PcapFileObject::GetTypeId (void) +PcapFileWrapper::GetTypeId (void) { - static TypeId tid = TypeId ("ns3::PcapFileObject") + static TypeId tid = TypeId ("ns3::PcapFileWrapper") .SetParent () - .AddConstructor () + .AddConstructor () .AddAttribute ("CaptureSize", "Maximum length of captured packets (cf. pcap snaplen)", UintegerValue (PcapFile::SNAPLEN_DEFAULT), - MakeUintegerAccessor (&PcapFileObject::m_snapLen), + MakeUintegerAccessor (&PcapFileWrapper::m_snapLen), MakeUintegerChecker (0, PcapFile::SNAPLEN_DEFAULT)) ; return tid; } -PcapFileObject::PcapFileObject () +PcapFileWrapper::PcapFileWrapper () { } -PcapFileObject::~PcapFileObject () +PcapFileWrapper::~PcapFileWrapper () { Close (); } void -PcapFileObject::Close (void) +PcapFileWrapper::Close (void) { m_file.Close (); } bool -PcapFileObject::Open (std::string const &filename, std::string const &mode) +PcapFileWrapper::Open (std::string const &filename, std::string const &mode) { return m_file.Open (filename, mode); } bool -PcapFileObject::Init (uint32_t dataLinkType, uint32_t snapLen, int32_t tzCorrection) +PcapFileWrapper::Init (uint32_t dataLinkType, uint32_t snapLen, int32_t tzCorrection) { // // If the user doesn't provide a snaplen, the default value will come in. If @@ -90,7 +90,7 @@ PcapFileObject::Init (uint32_t dataLinkType, uint32_t snapLen, int32_t tzCorrect } bool -PcapFileObject::Write (Time t, Ptr p) +PcapFileWrapper::Write (Time t, Ptr p) { uint8_t buffer[PcapFile::SNAPLEN_DEFAULT]; @@ -105,7 +105,7 @@ PcapFileObject::Write (Time t, Ptr p) } bool -PcapFileObject::Write (Time t, Header &header, Ptr p) +PcapFileWrapper::Write (Time t, Header &header, Ptr p) { uint8_t buffer[PcapFile::SNAPLEN_DEFAULT]; @@ -129,7 +129,7 @@ PcapFileObject::Write (Time t, Header &header, Ptr p) } bool -PcapFileObject::Write (Time t, uint8_t const *buffer, uint32_t length) +PcapFileWrapper::Write (Time t, uint8_t const *buffer, uint32_t length) { uint64_t current = t.GetMicroSeconds (); uint64_t s = current / 1000000; @@ -139,43 +139,43 @@ PcapFileObject::Write (Time t, uint8_t const *buffer, uint32_t length) } uint32_t -PcapFileObject::GetMagic (void) +PcapFileWrapper::GetMagic (void) { return m_file.GetMagic (); } uint16_t -PcapFileObject::GetVersionMajor (void) +PcapFileWrapper::GetVersionMajor (void) { return m_file.GetVersionMajor (); } uint16_t -PcapFileObject::GetVersionMinor (void) +PcapFileWrapper::GetVersionMinor (void) { return m_file.GetVersionMinor (); } int32_t -PcapFileObject::GetTimeZoneOffset (void) +PcapFileWrapper::GetTimeZoneOffset (void) { return m_file.GetTimeZoneOffset (); } uint32_t -PcapFileObject::GetSigFigs (void) +PcapFileWrapper::GetSigFigs (void) { return m_file.GetSigFigs (); } uint32_t -PcapFileObject::GetSnapLen (void) +PcapFileWrapper::GetSnapLen (void) { return m_file.GetSnapLen (); } uint32_t -PcapFileObject::GetDataLinkType (void) +PcapFileWrapper::GetDataLinkType (void) { return m_file.GetDataLinkType (); } diff --git a/src/common/pcap-file-object.h b/src/common/pcap-file-wrapper.h similarity index 96% rename from src/common/pcap-file-object.h rename to src/common/pcap-file-wrapper.h index 1dc18b09f..07c203dc0 100644 --- a/src/common/pcap-file-object.h +++ b/src/common/pcap-file-wrapper.h @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PCAP_FILE_OBJECT_H -#define PCAP_FILE_OBJECT_H +#ifndef PCAP_FILE_WRAPPER_H +#define PCAP_FILE_WRAPPER_H #include #include "ns3/ptr.h" @@ -31,16 +31,16 @@ namespace ns3 { * A class representing a pcap file tailored for use in model code. */ -class PcapFileObject : public Object +class PcapFileWrapper : public Object { public: static TypeId GetTypeId (void); - PcapFileObject (); - ~PcapFileObject (); + PcapFileWrapper (); + ~PcapFileWrapper (); /** - * Create a new pcap file object representing a new or existing pcap file. + * Create a new pcap file wrapper representing a new or existing pcap file. * Semantics are similar to the C standard library function \c fopen * * Possible modes are: @@ -104,7 +104,7 @@ public: void Close (void); /** - * Initialize the pcap file associated with this object. This file must have + * Initialize the pcap file associated with this wrapper. This file must have * been previously opened with write permissions. * * \param dataLinkType A data link type as defined in the pcap library. If @@ -231,5 +231,4 @@ private: } //namespace ns3 -#endif // PCAP_FILE_OBJECT_H - +#endif // PCAP_FILE_WRAPPER_H diff --git a/src/common/wscript b/src/common/wscript index 6f80d2e95..25ea3b714 100644 --- a/src/common/wscript +++ b/src/common/wscript @@ -19,7 +19,7 @@ def build(bld): 'nix-vector.cc', 'pcap-file.cc', 'pcap-file-test-suite.cc', - 'pcap-file-object.cc', + 'pcap-file-wrapper.cc', 'output-stream-keeper.cc', 'propagation-delay-model.cc', 'propagation-loss-model.cc', @@ -45,7 +45,7 @@ def build(bld): 'nix-vector.h', 'sgi-hashmap.h', 'pcap-file.h', - 'pcap-file-object.h', + 'pcap-file-wrapper.h', 'output-stream-keeper.h', 'propagation-delay-model.h', 'propagation-loss-model.h', diff --git a/src/helper/csma-helper.cc b/src/helper/csma-helper.cc index 0d00dec86..7a496d947 100644 --- a/src/helper/csma-helper.cc +++ b/src/helper/csma-helper.cc @@ -88,7 +88,7 @@ CsmaHelper::EnablePcapInternal (std::string prefix, Ptr nd, bool prom PcapHelper pcapHelper; std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device); - Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB); if (promiscuous) { pcapHelper.HookDefaultSink (device, "PromiscSniffer", file); diff --git a/src/helper/emu-helper.cc b/src/helper/emu-helper.cc index 933bda9bc..530540b8c 100644 --- a/src/helper/emu-helper.cc +++ b/src/helper/emu-helper.cc @@ -81,7 +81,7 @@ EmuHelper::EnablePcapInternal (std::string prefix, Ptr nd, bool promi PcapHelper pcapHelper; std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device); - Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB); if (promiscuous) { pcapHelper.HookDefaultSink (device, "PromiscSniffer", file); diff --git a/src/helper/internet-stack-helper.cc b/src/helper/internet-stack-helper.cc index 27f0a22c8..8cb2d72f4 100644 --- a/src/helper/internet-stack-helper.cc +++ b/src/helper/internet-stack-helper.cc @@ -193,7 +193,7 @@ namespace ns3 { // are going to multiplex receive and transmit callbacks for all Ipv4 and // interface pairs through one callback. We want packets to or from each // distinct pair to go to an individual file, so we have got to demultiplex the -// Ipv4 and interface pair into a corresponding Ptr at the +// Ipv4 and interface pair into a corresponding Ptr at the // callback. // // A complication in this situation is that the trace sources are hooked on @@ -211,14 +211,14 @@ namespace ns3 { // bill. // typedef std::pair, uint32_t> InterfacePairIpv4; -typedef std::map > InterfaceFileMapIpv4; +typedef std::map > InterfaceFileMapIpv4; typedef std::map > InterfaceStreamMapIpv4; static InterfaceFileMapIpv4 g_interfaceFileMapIpv4; /**< A mapping of Ipv4/interface pairs to pcap files */ static InterfaceStreamMapIpv4 g_interfaceStreamMapIpv4; /**< A mapping of Ipv4/interface pairs to ascii streams */ typedef std::pair, uint32_t> InterfacePairIpv6; -typedef std::map > InterfaceFileMapIpv6; +typedef std::map > InterfaceFileMapIpv6; typedef std::map > InterfaceStreamMapIpv6; static InterfaceFileMapIpv6 g_interfaceFileMapIpv6; /**< A mapping of Ipv6/interface pairs to pcap files */ @@ -424,7 +424,7 @@ Ipv4L3ProtocolRxTxSink (Ptr p, Ptr ipv4, uint32_t interface) return; } - Ptr file = g_interfaceFileMapIpv4[pair]; + Ptr file = g_interfaceFileMapIpv4[pair]; file->Write(Simulator::Now(), p); } @@ -460,7 +460,7 @@ InternetStackHelper::EnablePcapIpv4Internal (std::string prefix, Ptr ipv4, // PcapHelper pcapHelper; std::string filename = pcapHelper.GetFilenameFromInterfacePair (prefix, ipv4, interface); - Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW); // // However, we only hook the trace source once to avoid multiple trace sink @@ -506,7 +506,7 @@ Ipv6L3ProtocolRxTxSink (Ptr p, Ptr ipv6, uint32_t interface) return; } - Ptr file = g_interfaceFileMapIpv6[pair]; + Ptr file = g_interfaceFileMapIpv6[pair]; file->Write(Simulator::Now(), p); } @@ -542,7 +542,7 @@ InternetStackHelper::EnablePcapIpv6Internal (std::string prefix, Ptr ipv6, // PcapHelper pcapHelper; std::string filename = pcapHelper.GetFilenameFromInterfacePair (prefix, ipv6, interface); - Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW); // // However, we only hook the trace source once to avoid multiple trace sink diff --git a/src/helper/point-to-point-helper.cc b/src/helper/point-to-point-helper.cc index 6ce2f56da..d01bb7915 100644 --- a/src/helper/point-to-point-helper.cc +++ b/src/helper/point-to-point-helper.cc @@ -85,7 +85,7 @@ PointToPointHelper::EnablePcapInternal (std::string prefix, Ptr nd, b PcapHelper pcapHelper; std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device); - Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_PPP); + Ptr file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_PPP); pcapHelper.HookDefaultSink (device, "PromiscSniffer", file); } diff --git a/src/helper/trace-helper.cc b/src/helper/trace-helper.cc index 7727aea72..68ff0b3ef 100644 --- a/src/helper/trace-helper.cc +++ b/src/helper/trace-helper.cc @@ -27,7 +27,7 @@ #include "ns3/node.h" #include "ns3/names.h" #include "ns3/net-device.h" -#include "ns3/pcap-file-object.h" +#include "ns3/pcap-file-wrapper.h" #include "trace-helper.h" @@ -45,7 +45,7 @@ PcapHelper::~PcapHelper () NS_LOG_FUNCTION_NOARGS (); } -Ptr +Ptr PcapHelper::CreateFile ( std::string filename, std::string filemode, @@ -55,7 +55,7 @@ PcapHelper::CreateFile ( { NS_LOG_FUNCTION (filename << filemode << dataLinkType << snapLen << tzCorrection); - Ptr file = CreateObject (); + Ptr file = CreateObject (); bool err = file->Open (filename, filemode); NS_ABORT_MSG_IF (err, "Unable to Open " << filename << " for mode " << filemode); @@ -164,7 +164,7 @@ PcapHelper::GetFilenameFromInterfacePair (std::string prefix, Ptr object // file which is good enough for most kinds of captures. // void -PcapHelper::DefaultSink (Ptr file, Ptr p) +PcapHelper::DefaultSink (Ptr file, Ptr p) { NS_LOG_FUNCTION (file << p); file->Write(Simulator::Now(), p); diff --git a/src/helper/trace-helper.h b/src/helper/trace-helper.h index 60a3089a4..e0b9c2134 100644 --- a/src/helper/trace-helper.h +++ b/src/helper/trace-helper.h @@ -25,7 +25,7 @@ #include "ns3/ipv6-interface-container.h" #include "ns3/node-container.h" #include "ns3/simulator.h" -#include "ns3/pcap-file-object.h" +#include "ns3/pcap-file-wrapper.h" #include "ns3/output-stream-keeper.h" #include "ns3/ipv4.h" #include "ns3/ipv6.h" @@ -84,19 +84,19 @@ public: /** * @brief Create and initialize a pcap file. */ - Ptr CreateFile (std::string filename, std::string filemode, + 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); + template void HookDefaultSink (Ptr object, std::string traceName, Ptr file); private: - static void DefaultSink (Ptr file, Ptr p); + static void DefaultSink (Ptr file, Ptr p); }; template void -PcapHelper::HookDefaultSink (Ptr object, std::string tracename, Ptr file) +PcapHelper::HookDefaultSink (Ptr object, std::string tracename, Ptr file) { bool __attribute__ ((unused)) result = object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file)); diff --git a/src/helper/yans-wifi-helper.cc b/src/helper/yans-wifi-helper.cc index e554f2851..d0e6f1ed2 100644 --- a/src/helper/yans-wifi-helper.cc +++ b/src/helper/yans-wifi-helper.cc @@ -27,7 +27,7 @@ #include "ns3/yans-wifi-phy.h" #include "ns3/wifi-net-device.h" #include "ns3/radiotap-header.h" -#include "ns3/pcap-file-object.h" +#include "ns3/pcap-file-wrapper.h" #include "ns3/simulator.h" #include "ns3/config.h" #include "ns3/names.h" @@ -241,7 +241,7 @@ YansWifiPhyHelper::Create (Ptr node, Ptr device) const static void PcapSniffTxEvent ( - Ptr file, + Ptr file, Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, @@ -299,7 +299,7 @@ PcapSniffTxEvent ( static void PcapSniffRxEvent ( - Ptr file, + Ptr file, Ptr packet, uint16_t channelFreqMhz, uint16_t channelNumber, @@ -400,7 +400,7 @@ YansWifiPhyHelper::EnablePcapInternal (std::string prefix, Ptr nd, bo PcapHelper pcapHelper; std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device); - Ptr file = pcapHelper.CreateFile (filename, "w", m_pcapDlt); + Ptr file = pcapHelper.CreateFile (filename, "w", m_pcapDlt); phy->TraceConnectWithoutContext ("PromiscSnifferTx", MakeBoundCallback (&PcapSniffTxEvent, file)); phy->TraceConnectWithoutContext ("PromiscSnifferRx", MakeBoundCallback (&PcapSniffRxEvent, file));