Add new field for IP netmask#21
Conversation
|
I'm not sure yet about the wording. "IP Network" or "IP Netmask"? What values should it accept? I now implemented the CIDR notation because it is the simplest variant. We could also accept a leading Successfully tested so far:
|
|
Validation now removes a leading Tested for: Mapping import (NMAP), Std Import (CSV), Add Device Finding and Edit Device Finding |
|
Thinking about the naming again: I think |
| verbose_name='IP Address' | ||
| ) | ||
| ip_netmask = models.CharField( | ||
| max_length=1000, |
There was a problem hiding this comment.
why not a more reasonable value?
There was a problem hiding this comment.
Because most other fields like IP addresse and mac address also have a maximum length of 1000. So, I used the existing convention.
@sebix is it still "draft" or ready to merge? |
|
Because of these:
|
|
And also this open question:
|
|
Since NetBox displays the CIDR notation. CDIR notation is sufficient for now. The nomenclature has to be decided. However it also can easily be changed later. The main reason for the draft status is that some aspects are missing, which I want to add myself in the pull request |
|
The problem with the missing netmask should be resolved right by the /findings/import/ and /findings/stdimport in template findings_import:
Use of ipAddress with the common netbox display
|
|
TODOs here:
|
The IPAM module has one field for IP address + netmask, so this was not a reference for the code.
Implemented as well, tested for add, edit, import and stdimport |
Validation now removes a leading `/` and makes sure the netmask is >= 0 and <= 32. Tested for: Mapping import (NMAP), Std Import (CSV), Add Device Finding and Edit Device Finding
…n not working yet
if not given explicitly for adding and editing a devicefinding, and import & stdimport
|
Rebased on main |
It's not well tested; therefore, it's a draft. Creating with a divergent netmask already works.
fixes #18