Bugzilla – Bug 95
where data rate is set for PointToPoint NetDevice/Channel
Last modified: 2008-07-01 13:32:18 UTC
Presently, both the PointToPointNetDevice and PointToPointChannel have public API allowing user to pass the DataRate object for use on the link. The one on the channel is supposed to be a maximum rate, according to the Doxygen, while the one on the NetDevice is the actual. However, when PointToPointNetDevice::Attach() is called, the channel DataRate overwrites the NetDevice DataRate object. And the maximum is never enforced. I propose to remove the so-called maximum data rate (DataRate) in the channel, and just let users set the DataRate in the NetDevice.
Created attachment 88 [details] a more modest bug fix, plus DataRate operators I ended up not trying to change the DataRate assignment being driven by the channel, for this time around, since it would require then changing the examples and topology code. I will leave that for a future cleanup. This patch instead just enforces that a user cannot SetDataRate() on a NetDevice to a DataRate that exceeds the channel maximum. And along the way, some const versions of the DataRate operators were missing so I added them too.
I think that you could just get rid of the non-const versions of the member methods.
got rid of non-const operators; patches applied as changesets 1825 and 1826