bug 372: fragmentation is broken
This commit is contained in:
@@ -1874,7 +1874,7 @@ def register_functions(root_module):
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
[],
|
||||
template_parameters=['long'])
|
||||
template_parameters=['long long'])
|
||||
## type-name.h: extern std::string ns3::TypeNameGet() [free function]
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
@@ -1894,7 +1894,7 @@ def register_functions(root_module):
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
[],
|
||||
template_parameters=['unsigned long'])
|
||||
template_parameters=['unsigned long long'])
|
||||
## type-name.h: extern std::string ns3::TypeNameGet() [free function]
|
||||
module.add_function('TypeNameGet',
|
||||
'std::string',
|
||||
@@ -1910,22 +1910,14 @@ def register_functions(root_module):
|
||||
'std::string',
|
||||
[],
|
||||
template_parameters=['unsigned char'])
|
||||
## log.h: extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function]
|
||||
module.add_function('LogComponentDisable',
|
||||
'void',
|
||||
[param('char const *', 'name'), param('ns3::LogLevel', 'level')])
|
||||
## string.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeStringChecker() [free function]
|
||||
module.add_function('MakeStringChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
## enum.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeEnumChecker(int v1, std::string n1, int v2=0, std::string n2="", int v3=0, std::string n3="", int v4=0, std::string n4="", int v5=0, std::string n5="", int v6=0, std::string n6="", int v7=0, std::string n7="", int v8=0, std::string n8="", int v9=0, std::string n9="", int v10=0, std::string n10="", int v11=0, std::string n11="", int v12=0, std::string n12="") [free function]
|
||||
module.add_function('MakeEnumChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[param('int', 'v1'), param('std::string', 'n1'), param('int', 'v2', default_value='0'), param('std::string', 'n2', default_value='""'), param('int', 'v3', default_value='0'), param('std::string', 'n3', default_value='""'), param('int', 'v4', default_value='0'), param('std::string', 'n4', default_value='""'), param('int', 'v5', default_value='0'), param('std::string', 'n5', default_value='""'), param('int', 'v6', default_value='0'), param('std::string', 'n6', default_value='""'), param('int', 'v7', default_value='0'), param('std::string', 'n7', default_value='""'), param('int', 'v8', default_value='0'), param('std::string', 'n8', default_value='""'), param('int', 'v9', default_value='0'), param('std::string', 'n9', default_value='""'), param('int', 'v10', default_value='0'), param('std::string', 'n10', default_value='""'), param('int', 'v11', default_value='0'), param('std::string', 'n11', default_value='""'), param('int', 'v12', default_value='0'), param('std::string', 'n12', default_value='""')])
|
||||
## log.h: extern void ns3::LogComponentEnableAll(ns3::LogLevel level) [free function]
|
||||
module.add_function('LogComponentEnableAll',
|
||||
'void',
|
||||
[param('ns3::LogLevel', 'level')])
|
||||
## type-id.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeTypeIdChecker() [free function]
|
||||
module.add_function('MakeTypeIdChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
## ptr.h: extern ns3::Ptr<ns3::PointerValue> ns3::Create() [free function]
|
||||
module.add_function('Create',
|
||||
'ns3::Ptr< ns3::PointerValue >',
|
||||
@@ -1936,6 +1928,14 @@ def register_functions(root_module):
|
||||
'ns3::Ptr< ns3::ObjectVectorValue >',
|
||||
[],
|
||||
template_parameters=['ns3::ObjectVectorValue'])
|
||||
## log.h: extern void ns3::LogComponentEnableAll(ns3::LogLevel level) [free function]
|
||||
module.add_function('LogComponentEnableAll',
|
||||
'void',
|
||||
[param('ns3::LogLevel', 'level')])
|
||||
## type-id.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeTypeIdChecker() [free function]
|
||||
module.add_function('MakeTypeIdChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
## object-factory.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeObjectFactoryChecker() [free function]
|
||||
module.add_function('MakeObjectFactoryChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
@@ -1952,14 +1952,14 @@ def register_functions(root_module):
|
||||
module.add_function('MakeRandomVariableChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
## log.h: extern void ns3::LogComponentDisable(char const * name, ns3::LogLevel level) [free function]
|
||||
module.add_function('LogComponentDisable',
|
||||
'void',
|
||||
[param('char const *', 'name'), param('ns3::LogLevel', 'level')])
|
||||
## log.h: extern void ns3::LogComponentEnable(char const * name, ns3::LogLevel level) [free function]
|
||||
module.add_function('LogComponentEnable',
|
||||
'void',
|
||||
[param('char const *', 'name'), param('ns3::LogLevel', 'level')])
|
||||
## enum.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeEnumChecker(int v1, std::string n1, int v2=0, std::string n2="", int v3=0, std::string n3="", int v4=0, std::string n4="", int v5=0, std::string n5="", int v6=0, std::string n6="", int v7=0, std::string n7="", int v8=0, std::string n8="", int v9=0, std::string n9="", int v10=0, std::string n10="", int v11=0, std::string n11="", int v12=0, std::string n12="") [free function]
|
||||
module.add_function('MakeEnumChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[param('int', 'v1'), param('std::string', 'n1'), param('int', 'v2', default_value='0'), param('std::string', 'n2', default_value='""'), param('int', 'v3', default_value='0'), param('std::string', 'n3', default_value='""'), param('int', 'v4', default_value='0'), param('std::string', 'n4', default_value='""'), param('int', 'v5', default_value='0'), param('std::string', 'n5', default_value='""'), param('int', 'v6', default_value='0'), param('std::string', 'n6', default_value='""'), param('int', 'v7', default_value='0'), param('std::string', 'n7', default_value='""'), param('int', 'v8', default_value='0'), param('std::string', 'n8', default_value='""'), param('int', 'v9', default_value='0'), param('std::string', 'n9', default_value='""'), param('int', 'v10', default_value='0'), param('std::string', 'n10', default_value='""'), param('int', 'v11', default_value='0'), param('std::string', 'n11', default_value='""'), param('int', 'v12', default_value='0'), param('std::string', 'n12', default_value='""')])
|
||||
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
|
||||
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
|
||||
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
|
||||
@@ -2017,6 +2017,10 @@ def register_functions_ns3_Config(module, root_module):
|
||||
module.add_function('SetGlobalFailSafe',
|
||||
'bool',
|
||||
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
|
||||
## config.h: extern void ns3::Config::Disconnect(std::string path, ns3::CallbackBase const & cb) [free function]
|
||||
module.add_function('Disconnect',
|
||||
'void',
|
||||
[param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
|
||||
## config.h: extern uint32_t ns3::Config::GetRootNamespaceObjectN() [free function]
|
||||
module.add_function('GetRootNamespaceObjectN',
|
||||
'uint32_t',
|
||||
@@ -2033,10 +2037,6 @@ def register_functions_ns3_Config(module, root_module):
|
||||
module.add_function('RegisterRootNamespaceObject',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Object >', 'obj')])
|
||||
## config.h: extern void ns3::Config::Disconnect(std::string path, ns3::CallbackBase const & cb) [free function]
|
||||
module.add_function('Disconnect',
|
||||
'void',
|
||||
[param('std::string', 'path'), param('ns3::CallbackBase const &', 'cb')])
|
||||
return
|
||||
|
||||
def register_functions_ns3_olsr(module, root_module):
|
||||
|
||||
@@ -358,10 +358,11 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
|
||||
cls.add_method('Insert',
|
||||
'void',
|
||||
[param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')])
|
||||
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4L4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) [member function]
|
||||
## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4L4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) const [member function]
|
||||
cls.add_method('GetProtocol',
|
||||
'ns3::Ptr< ns3::Ipv4L4Protocol >',
|
||||
[param('int', 'protocolNumber')])
|
||||
[param('int', 'protocolNumber')],
|
||||
is_const=True)
|
||||
## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::Ipv4L4Protocol> protocol) [member function]
|
||||
cls.add_method('Remove',
|
||||
'void',
|
||||
|
||||
@@ -2581,10 +2581,18 @@ def register_Ns3SimpleNetDevice_methods(root_module, cls):
|
||||
|
||||
def register_functions(root_module):
|
||||
module = root_module
|
||||
## mac48-address.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeMac48AddressChecker() [free function]
|
||||
module.add_function('MakeMac48AddressChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function]
|
||||
module.add_function('ReadFrom',
|
||||
'void',
|
||||
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')])
|
||||
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Address & ad, uint32_t len) [free function]
|
||||
module.add_function('ReadFrom',
|
||||
'void',
|
||||
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address &', 'ad'), param('uint32_t', 'len')])
|
||||
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv4Address & ad) [free function]
|
||||
module.add_function('ReadFrom',
|
||||
'void',
|
||||
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address &', 'ad')])
|
||||
## ipv4-address.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeIpv4AddressChecker() [free function]
|
||||
module.add_function('MakeIpv4AddressChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
@@ -2609,18 +2617,10 @@ def register_functions(root_module):
|
||||
module.add_function('MakeIpv4MaskChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function]
|
||||
module.add_function('ReadFrom',
|
||||
'void',
|
||||
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')])
|
||||
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Address & ad, uint32_t len) [free function]
|
||||
module.add_function('ReadFrom',
|
||||
'void',
|
||||
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address &', 'ad'), param('uint32_t', 'len')])
|
||||
## address-utils.h: extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv4Address & ad) [free function]
|
||||
module.add_function('ReadFrom',
|
||||
'void',
|
||||
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address &', 'ad')])
|
||||
## mac48-address.h: extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeMac48AddressChecker() [free function]
|
||||
module.add_function('MakeMac48AddressChecker',
|
||||
'ns3::Ptr< ns3::AttributeChecker const >',
|
||||
[])
|
||||
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
|
||||
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
|
||||
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
|
||||
|
||||
@@ -507,16 +507,16 @@ def register_Ns3WifiRemoteStation_methods(root_module, cls):
|
||||
'bool',
|
||||
[param('ns3::Ptr< ns3::Packet const >', 'packet')],
|
||||
is_virtual=True)
|
||||
## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetNFragments(ns3::Ptr<const ns3::Packet> packet) [member function]
|
||||
cls.add_method('GetNFragments',
|
||||
'uint32_t',
|
||||
[param('ns3::Ptr< ns3::Packet const >', 'packet')],
|
||||
is_virtual=True)
|
||||
## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetFragmentSize(ns3::Ptr<const ns3::Packet> packet, uint32_t fragmentNumber) [member function]
|
||||
cls.add_method('GetFragmentSize',
|
||||
'uint32_t',
|
||||
[param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')],
|
||||
is_virtual=True)
|
||||
## wifi-remote-station-manager.h: uint32_t ns3::WifiRemoteStation::GetFragmentOffset(ns3::Ptr<const ns3::Packet> packet, uint32_t fragmentNumber) [member function]
|
||||
cls.add_method('GetFragmentOffset',
|
||||
'uint32_t',
|
||||
[param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')],
|
||||
is_virtual=True)
|
||||
## wifi-remote-station-manager.h: bool ns3::WifiRemoteStation::IsLastFragment(ns3::Ptr<const ns3::Packet> packet, uint32_t fragmentNumber) [member function]
|
||||
cls.add_method('IsLastFragment',
|
||||
'bool',
|
||||
|
||||
@@ -305,12 +305,6 @@ DcaTxop::NeedFragmentation (void)
|
||||
return station->NeedFragmentation (m_currentPacket);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
DcaTxop::GetNFragments (void)
|
||||
{
|
||||
WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
|
||||
return station->GetNFragments (m_currentPacket);
|
||||
}
|
||||
void
|
||||
DcaTxop::NextFragment (void)
|
||||
{
|
||||
@@ -337,12 +331,19 @@ DcaTxop::GetNextFragmentSize (void)
|
||||
return station->GetFragmentSize (m_currentPacket, m_fragmentNumber + 1);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
DcaTxop::GetFragmentOffset (void)
|
||||
{
|
||||
WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
|
||||
return station->GetFragmentOffset (m_currentPacket, m_fragmentNumber);
|
||||
}
|
||||
|
||||
Ptr<Packet>
|
||||
DcaTxop::GetFragmentPacket (WifiMacHeader *hdr)
|
||||
{
|
||||
*hdr = m_currentHdr;
|
||||
hdr->SetFragmentNumber (m_fragmentNumber);
|
||||
uint32_t startOffset = m_fragmentNumber * GetFragmentSize ();
|
||||
uint32_t startOffset = GetFragmentOffset ();
|
||||
Ptr<Packet> fragment;
|
||||
if (IsLastFragment ())
|
||||
{
|
||||
|
||||
@@ -137,9 +137,9 @@ private:
|
||||
bool NeedRtsRetransmission (void);
|
||||
bool NeedDataRetransmission (void);
|
||||
bool NeedFragmentation (void);
|
||||
uint32_t GetNFragments (void);
|
||||
uint32_t GetNextFragmentSize (void);
|
||||
uint32_t GetFragmentSize (void);
|
||||
uint32_t GetFragmentOffset (void);
|
||||
WifiRemoteStation *GetStation (Mac48Address to) const;
|
||||
bool IsLastFragment (void);
|
||||
void NextFragment (void);
|
||||
|
||||
@@ -656,6 +656,14 @@ WifiRemoteStation::GetFragmentSize (Ptr<const Packet> packet, uint32_t fragmentN
|
||||
return GetManager ()->GetFragmentationThreshold ();
|
||||
}
|
||||
}
|
||||
uint32_t
|
||||
WifiRemoteStation::GetFragmentOffset (Ptr<const Packet> packet, uint32_t fragmentNumber)
|
||||
{
|
||||
uint32_t nFragment = GetNFragments (packet);
|
||||
NS_ASSERT (fragmentNumber < nFragment);
|
||||
uint32_t fragmentOffset = fragmentNumber * GetManager ()->GetFragmentationThreshold ();
|
||||
return fragmentOffset;
|
||||
}
|
||||
|
||||
bool
|
||||
WifiRemoteStation::IsLastFragment (Ptr<const Packet> packet, uint32_t fragmentNumber)
|
||||
|
||||
@@ -226,17 +226,18 @@ public:
|
||||
* \returns true if this packet should be fragmented, false otherwise.
|
||||
*/
|
||||
virtual bool NeedFragmentation (Ptr<const Packet> packet);
|
||||
/**
|
||||
* \param packet the packet to send
|
||||
* \returns the number of fragments which should be used for this packet.
|
||||
*/
|
||||
virtual uint32_t GetNFragments (Ptr<const Packet> packet);
|
||||
/**
|
||||
* \param packet the packet to send
|
||||
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero).
|
||||
* \returns the size of the corresponding fragment.
|
||||
*/
|
||||
virtual uint32_t GetFragmentSize (Ptr<const Packet> packet, uint32_t fragmentNumber);
|
||||
/**
|
||||
* \param packet the packet to send
|
||||
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero).
|
||||
* \returns the offset within the original packet where this fragment starts.
|
||||
*/
|
||||
virtual uint32_t GetFragmentOffset (Ptr<const Packet> packet, uint32_t fragmentNumber);
|
||||
/**
|
||||
* \param packet the packet to send
|
||||
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero).
|
||||
@@ -262,6 +263,7 @@ private:
|
||||
virtual Ptr<WifiRemoteStationManager> GetManager (void) const = 0;
|
||||
virtual WifiMode DoGetDataMode (uint32_t size) = 0;
|
||||
virtual WifiMode DoGetRtsMode (void) = 0;
|
||||
uint32_t GetNFragments (Ptr<const Packet> packet);
|
||||
protected:
|
||||
virtual void DoReportRtsFailed (void) = 0;
|
||||
virtual void DoReportDataFailed (void) = 0;
|
||||
|
||||
Reference in New Issue
Block a user