PcapFileObject to PcapFileWrapper

This commit is contained in:
Craig Dowell
2010-02-23 10:04:31 -08:00
parent 18a72bd31c
commit d7b6488b64
19 changed files with 120 additions and 121 deletions

View File

@@ -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<unsigned int>::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<unsigned int>::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<unsigned int>::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<ns3::Packet const> p) [member function]
## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Ptr<ns3::Packet const> 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<ns3::Packet const> p) [member function]
## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Header & header, ns3::Ptr<ns3::Packet const> 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')])

View File

@@ -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::OutputStreamKeeper>', 'ns3::Ptr<ns3::OutputStreamKeeper>', 'ns3::Ptr<ns3::Packet const>'])
## callback.h: extern ns3::Callback<void,ns3::Ptr<const ns3::Packet>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr<ns3::PcapFileObject>,::ns3::Ptr<ns3::Packet const> ) * fnPtr, ns3::Ptr<ns3::PcapFileObject> a) [free function]
## callback.h: extern ns3::Callback<void,ns3::Ptr<const ns3::Packet>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr<ns3::PcapFileWrapper>,::ns3::Ptr<ns3::Packet const> ) * fnPtr, ns3::Ptr<ns3::PcapFileWrapper> 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::PcapFileObject>', 'ns3::Ptr<ns3::PcapFileObject>', 'ns3::Ptr<ns3::Packet const>'])
[param('void ( * ) ( ns3::Ptr< ns3::PcapFileWrapper >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::PcapFileWrapper >', 'a')],
template_parameters=['void', 'ns3::Ptr<ns3::PcapFileWrapper>', 'ns3::Ptr<ns3::PcapFileWrapper>', 'ns3::Ptr<ns3::Packet const>'])
## callback.h: extern ns3::Callback<void,std::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<const ns3::Packet>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr<ns3::OutputStreamKeeper>,::std::basic_string<char,std::char_traits<char>,std::allocator<char> >,::ns3::Ptr<ns3::Packet const> ) * fnPtr, ns3::Ptr<ns3::OutputStreamKeeper> 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 >',

View File

@@ -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::PcapFileObject> 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::PcapFileWrapper> 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<ns3::NetDevice> device, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromDevice',

View File

@@ -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<unsigned int>::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<unsigned int>::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<unsigned int>::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<ns3::Packet const> p) [member function]
## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Ptr<ns3::Packet const> 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<ns3::Packet const> p) [member function]
## pcap-file-wrapper.h: bool ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Header & header, ns3::Ptr<ns3::Packet const> 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')])

View File

@@ -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::OutputStreamKeeper>', 'ns3::Ptr<ns3::OutputStreamKeeper>', 'ns3::Ptr<ns3::Packet const>'])
## callback.h: extern ns3::Callback<void,ns3::Ptr<const ns3::Packet>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr<ns3::PcapFileObject>,::ns3::Ptr<ns3::Packet const> ) * fnPtr, ns3::Ptr<ns3::PcapFileObject> a) [free function]
## callback.h: extern ns3::Callback<void,ns3::Ptr<const ns3::Packet>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr<ns3::PcapFileWrapper>,::ns3::Ptr<ns3::Packet const> ) * fnPtr, ns3::Ptr<ns3::PcapFileWrapper> 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::PcapFileObject>', 'ns3::Ptr<ns3::PcapFileObject>', 'ns3::Ptr<ns3::Packet const>'])
[param('void ( * ) ( ns3::Ptr< ns3::PcapFileWrapper >, ns3::Ptr< ns3::Packet const > ) *', 'fnPtr'), param('ns3::Ptr< ns3::PcapFileWrapper >', 'a')],
template_parameters=['void', 'ns3::Ptr<ns3::PcapFileWrapper>', 'ns3::Ptr<ns3::PcapFileWrapper>', 'ns3::Ptr<ns3::Packet const>'])
## callback.h: extern ns3::Callback<void,std::basic_string<char, std::char_traits<char>, std::allocator<char> >,ns3::Ptr<const ns3::Packet>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::MakeBoundCallback(void (*)( ::ns3::Ptr<ns3::OutputStreamKeeper>,::std::basic_string<char,std::char_traits<char>,std::allocator<char> >,::ns3::Ptr<ns3::Packet const> ) * fnPtr, ns3::Ptr<ns3::OutputStreamKeeper> 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 >',

View File

@@ -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::PcapFileObject> 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::PcapFileWrapper> 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<ns3::NetDevice> device, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromDevice',

View File

@@ -1944,7 +1944,7 @@ representing a file.
}
static void
RxDrop (Ptr<PcapFileObject> file, Ptr<const Packet> p)
RxDrop (Ptr<PcapFileWrapper> file, Ptr<const Packet> 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<PcapFileObject>}) represents a pcap file. There
passed around (a @code{Ptr<PcapFileWrapper>}) 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<PcapFileObject> file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP);
Ptr<PcapFileWrapper> 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<PcapFileObject> file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP);
Ptr<PcapFileWrapper> 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<PcapFileObject> file ...
Ptr<PcapFileWrapper> file ...
Ptr<OutputStreamKeeper> stream ...
@end verbatim
The underlying objects are entirely different. For example, the
Ptr<PcapFileObject> is a smart pointer to an @command{ns-3} Object that is a
Ptr<PcapFileWrapper> 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<OutputStreamKeeper>, 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<PcapFileObject> file, Ptr<const Packet> p)
RxDrop (Ptr<PcapFileWrapper> file, Ptr<const Packet> 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<PcapFileObject> file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP);
devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", MakeBoundCallback (&RxDrop, file));
@end verbatim

View File

@@ -168,7 +168,7 @@ CwndChange (Ptr<OutputStreamKeeper> stream, uint32_t oldCwnd, uint32_t newCwnd)
}
static void
RxDrop (Ptr<PcapFileObject> file, Ptr<const Packet> p)
RxDrop (Ptr<PcapFileWrapper> file, Ptr<const Packet> 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<PcapFileObject> file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile ("sixth.pcap", "w", PcapHelper::DLT_PPP);
devices.Get (1)->TraceConnectWithoutContext("PhyRxDrop", MakeBoundCallback (&RxDrop, file));
Simulator::Stop (Seconds(20));

View File

@@ -1013,7 +1013,7 @@ public:
};
PcapFileTestSuite::PcapFileTestSuite ()
: TestSuite ("pcap-file-object", UNIT)
: TestSuite ("pcap-file", UNIT)
{
AddTestCase (new WriteModeCreateTestCase);
AddTestCase (new ReadModeCreateTestCase);

View File

@@ -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<Object> ()
.AddConstructor<PcapFileObject> ()
.AddConstructor<PcapFileWrapper> ()
.AddAttribute ("CaptureSize",
"Maximum length of captured packets (cf. pcap snaplen)",
UintegerValue (PcapFile::SNAPLEN_DEFAULT),
MakeUintegerAccessor (&PcapFileObject::m_snapLen),
MakeUintegerAccessor (&PcapFileWrapper::m_snapLen),
MakeUintegerChecker<uint32_t> (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<const Packet> p)
PcapFileWrapper::Write (Time t, Ptr<const Packet> p)
{
uint8_t buffer[PcapFile::SNAPLEN_DEFAULT];
@@ -105,7 +105,7 @@ PcapFileObject::Write (Time t, Ptr<const Packet> p)
}
bool
PcapFileObject::Write (Time t, Header &header, Ptr<const Packet> p)
PcapFileWrapper::Write (Time t, Header &header, Ptr<const Packet> p)
{
uint8_t buffer[PcapFile::SNAPLEN_DEFAULT];
@@ -129,7 +129,7 @@ PcapFileObject::Write (Time t, Header &header, Ptr<const Packet> 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 ();
}

View File

@@ -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 <string.h>
#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

View File

@@ -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',

View File

@@ -88,7 +88,7 @@ CsmaHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool prom
PcapHelper pcapHelper;
std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device);
Ptr<PcapFileObject> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB);
if (promiscuous)
{
pcapHelper.HookDefaultSink<CsmaNetDevice> (device, "PromiscSniffer", file);

View File

@@ -81,7 +81,7 @@ EmuHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promi
PcapHelper pcapHelper;
std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device);
Ptr<PcapFileObject> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_EN10MB);
if (promiscuous)
{
pcapHelper.HookDefaultSink<EmuNetDevice> (device, "PromiscSniffer", file);

View File

@@ -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<PcapFileObject> at the
// Ipv4 and interface pair into a corresponding Ptr<PcapFileWrapper> 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<Ptr<Ipv4>, uint32_t> InterfacePairIpv4;
typedef std::map<InterfacePairIpv4, Ptr<PcapFileObject> > InterfaceFileMapIpv4;
typedef std::map<InterfacePairIpv4, Ptr<PcapFileWrapper> > InterfaceFileMapIpv4;
typedef std::map<InterfacePairIpv4, Ptr<OutputStreamKeeper> > 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<Ptr<Ipv6>, uint32_t> InterfacePairIpv6;
typedef std::map<InterfacePairIpv6, Ptr<PcapFileObject> > InterfaceFileMapIpv6;
typedef std::map<InterfacePairIpv6, Ptr<PcapFileWrapper> > InterfaceFileMapIpv6;
typedef std::map<InterfacePairIpv6, Ptr<OutputStreamKeeper> > InterfaceStreamMapIpv6;
static InterfaceFileMapIpv6 g_interfaceFileMapIpv6; /**< A mapping of Ipv6/interface pairs to pcap files */
@@ -424,7 +424,7 @@ Ipv4L3ProtocolRxTxSink (Ptr<const Packet> p, Ptr<Ipv4> ipv4, uint32_t interface)
return;
}
Ptr<PcapFileObject> file = g_interfaceFileMapIpv4[pair];
Ptr<PcapFileWrapper> file = g_interfaceFileMapIpv4[pair];
file->Write(Simulator::Now(), p);
}
@@ -460,7 +460,7 @@ InternetStackHelper::EnablePcapIpv4Internal (std::string prefix, Ptr<Ipv4> ipv4,
//
PcapHelper pcapHelper;
std::string filename = pcapHelper.GetFilenameFromInterfacePair (prefix, ipv4, interface);
Ptr<PcapFileObject> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW);
Ptr<PcapFileWrapper> 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<const Packet> p, Ptr<Ipv6> ipv6, uint32_t interface)
return;
}
Ptr<PcapFileObject> file = g_interfaceFileMapIpv6[pair];
Ptr<PcapFileWrapper> file = g_interfaceFileMapIpv6[pair];
file->Write(Simulator::Now(), p);
}
@@ -542,7 +542,7 @@ InternetStackHelper::EnablePcapIpv6Internal (std::string prefix, Ptr<Ipv6> ipv6,
//
PcapHelper pcapHelper;
std::string filename = pcapHelper.GetFilenameFromInterfacePair (prefix, ipv6, interface);
Ptr<PcapFileObject> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_RAW);
//
// However, we only hook the trace source once to avoid multiple trace sink

View File

@@ -85,7 +85,7 @@ PointToPointHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, b
PcapHelper pcapHelper;
std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device);
Ptr<PcapFileObject> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_PPP);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, "w", PcapHelper::DLT_PPP);
pcapHelper.HookDefaultSink<PointToPointNetDevice> (device, "PromiscSniffer", file);
}

View File

@@ -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<PcapFileObject>
Ptr<PcapFileWrapper>
PcapHelper::CreateFile (
std::string filename,
std::string filemode,
@@ -55,7 +55,7 @@ PcapHelper::CreateFile (
{
NS_LOG_FUNCTION (filename << filemode << dataLinkType << snapLen << tzCorrection);
Ptr<PcapFileObject> file = CreateObject<PcapFileObject> ();
Ptr<PcapFileWrapper> file = CreateObject<PcapFileWrapper> ();
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> object
// file which is good enough for most kinds of captures.
//
void
PcapHelper::DefaultSink (Ptr<PcapFileObject> file, Ptr<const Packet> p)
PcapHelper::DefaultSink (Ptr<PcapFileWrapper> file, Ptr<const Packet> p)
{
NS_LOG_FUNCTION (file << p);
file->Write(Simulator::Now(), p);

View File

@@ -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<PcapFileObject> CreateFile (std::string filename, std::string filemode,
Ptr<PcapFileWrapper> 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 <typename T> void HookDefaultSink (Ptr<T> object, std::string traceName, Ptr<PcapFileObject> file);
template <typename T> void HookDefaultSink (Ptr<T> object, std::string traceName, Ptr<PcapFileWrapper> file);
private:
static void DefaultSink (Ptr<PcapFileObject> file, Ptr<const Packet> p);
static void DefaultSink (Ptr<PcapFileWrapper> file, Ptr<const Packet> p);
};
template <typename T> void
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileObject> file)
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
{
bool __attribute__ ((unused)) result =
object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));

View File

@@ -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> node, Ptr<WifiNetDevice> device) const
static void
PcapSniffTxEvent (
Ptr<PcapFileObject> file,
Ptr<PcapFileWrapper> file,
Ptr<const Packet> packet,
uint16_t channelFreqMhz,
uint16_t channelNumber,
@@ -299,7 +299,7 @@ PcapSniffTxEvent (
static void
PcapSniffRxEvent (
Ptr<PcapFileObject> file,
Ptr<PcapFileWrapper> file,
Ptr<const Packet> packet,
uint16_t channelFreqMhz,
uint16_t channelNumber,
@@ -400,7 +400,7 @@ YansWifiPhyHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bo
PcapHelper pcapHelper;
std::string filename = pcapHelper.GetFilenameFromDevice (prefix, device);
Ptr<PcapFileObject> file = pcapHelper.CreateFile (filename, "w", m_pcapDlt);
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, "w", m_pcapDlt);
phy->TraceConnectWithoutContext ("PromiscSnifferTx", MakeBoundCallback (&PcapSniffTxEvent, file));
phy->TraceConnectWithoutContext ("PromiscSnifferRx", MakeBoundCallback (&PcapSniffRxEvent, file));