|
Bugzilla – Full Text Bug Listing |
| Summary: | internet: add a CheckAllocated function to Ipv[4,6]AddressGenerator | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Tommaso Pecorella <tommaso.pecorella> |
| Component: | internet | Assignee: | Tommaso Pecorella <tommaso.pecorella> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | ns-bugs, tomh |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | |||
| Bug Blocks: | 2835 | ||
| Attachments: |
first option
Much better approach |
||
(In reply to Tommaso Pecorella from comment #0) > Probably I could optimize it to eliminate the duplicated code and just have > AddNetwork depend on CheckNetwork. I would prefer that solution. Created attachment 2974 [details]
Much better approach
The code doesn't borrow from AddAddress anymore.
The CheckAllocated function is now much simpler, and a new IsNetworkAllocated function checks if any address in a given network has been already allocated.
IsNetworkAllocated is actually the function I needed for LTE, the other one is kept because I think it's useful in some cases.
Pushed in changeset: 13232:896e8dc8bd93 |
Created attachment 2970 [details] first option At the moment there is no way to ask an Ipv[4,6]AddressGenerator about if a network is allocated or not. This patch just does that. The code is mostly borrowed from AddNetwork, but it is not changing any internal state. Probably I could optimize it to eliminate the duplicated code and just have AddNetwork depend on CheckNetwork.