Teach nut-scanner -m auto*/ADDRLEN modes#2517
Merged
jimklimov merged 21 commits intonetworkupstools:masterfrom Jul 9, 2024
Merged
Teach nut-scanner -m auto*/ADDRLEN modes#2517jimklimov merged 21 commits intonetworkupstools:masterfrom
nut-scanner -m auto*/ADDRLEN modes#2517jimklimov merged 21 commits intonetworkupstools:masterfrom
Conversation
…parate method [networkupstools#2244] Allow for some shorter indentation Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…un-indent it some more [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
Testing erroneous-input checking:
UPDATE: Using |
…workupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…intouts [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…overed subnets are filtered out [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ict, NEWS.adoc: handle_arg_cidr(): add `-m auto*/ADDRLEN` mode [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… "arg_addr" [networkupstools#2244] Avoid warning about clash with a global variable. Fallout of refactoring original code into a method. Also make it `const` as we do not change the original value anyway. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… subnet by family before checking for mask length [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…() not atoi() [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…t atol() [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
✅ Build nut 2.8.2.1889-master completed (commit fc5e3466ed by @jimklimov) |
… before we declare vars and types Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… ip_range_t definition into header [networkupstools#2244] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… for ip_ranges[] list and helper metadata, and methods as part of libnutscan [networkupstools#2244, networkupstools#2511] Not bumping library version, because it was recently bumped as part of other PRs about this issue. Technically the scope of the library has been changed by new exported methods and header lines. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Member
Author
|
Exposed the code for IP range lists tracking as part of |
|
❌ Build nut 2.8.2.1895-master failed (commit 0488fac52f by @jimklimov) |
…/cidr IPs [networkupstools#2519] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
….3 man pages Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…orkupstools#2244, networkupstools#2511] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…nts [networkupstools#2244, networkupstools#2511] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… comments [networkupstools#2244, networkupstools#2511] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up for PRs #2509 and #2513, of issue #2244.
This PR adds a way to constrain the scan amounts in discovered subnets by specifying the bit-width of the host address part (e.g. in a typical IPv4
/24subnet, that part of the option value would be32-24 = 8=>-m auto4/8).Also it now reports detailed reasons why this or that discovered subnet was ignored (too large, loopback, not up and running...)
Detailed "screenshot" from a test run:
And with
-m auto4/16it did accept some of the address ranges:I've initially considered adding (also?) a mode for layman users to request the amount of scans they would tolerate, e.g.
-m auto4#200that would translate into "200 < 256 => bit length 8 or less is okay for host address part", but per https://stackoverflow.com/questions/466204/rounding-up-to-next-power-of-2 it is not too trivial - and for IPv6 support to be on par across the board, some fiddling withuint128_t(not ubiquitous) would be needed.