forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nut-scanner: implement iteration across nutscan_ip_range_list_t colle…
…ction [networkupstools#2511] Signed-off-by: Jim Klimov <[email protected]>
- Loading branch information
Showing
15 changed files
with
318 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
NUTSCAN_IP_RANGES_ITER_INC(3) | ||
============================= | ||
|
||
NAME | ||
---- | ||
|
||
nutscan_ip_ranges_iter_inc - Proceed with iteration of an IP address range | ||
using a `nutscan_ip_range_list_iter_t` structure. | ||
|
||
SYNOPSIS | ||
-------- | ||
|
||
#include <nut-scan.h> | ||
|
||
char * nutscan_ip_ranges_iter_inc(nutscan_ip_range_list_iter_t *irliter); | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
The *nutscan_ip_ranges_iter_inc()* function can prepare an iterator from | ||
the specified `nutscan_ip_range_list_t` structure. | ||
|
||
This function skips work if: | ||
|
||
* the structure pointer is `NULL` (`NULL` is returned); | ||
* the structure pointer's `ip_range` list is `NULL` (`NULL` is returned), | ||
* the structure pointer's `ip_range_iter` pointer is `NULL` (`NULL` is | ||
returned). | ||
|
||
Returns the next IP address from the currently iterated registered IP | ||
address range, or switches iteration to the next range if no addresses | ||
remained in the current one. | ||
|
||
NOTES | ||
----- | ||
|
||
Technically, the function is currently defined in 'nutscan-ip.h' file. | ||
|
||
SEE ALSO | ||
-------- | ||
|
||
linkman:nutscan_init_ip_ranges[3], linkman:nutscan_free_ip_ranges[3], | ||
linkman:nutscan_cidr_to_ip[3], | ||
linkman:nutscan_ip_ranges_iter_init[3] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
NUTSCAN_IP_RANGES_ITER_INIT(3) | ||
============================== | ||
|
||
NAME | ||
---- | ||
|
||
nutscan_ip_ranges_iter_init - Begin iteration of an IP address range using | ||
a `nutscan_ip_range_list_iter_t` structure. | ||
|
||
SYNOPSIS | ||
-------- | ||
|
||
#include <nut-scan.h> | ||
|
||
char * nutscan_ip_ranges_iter_init( | ||
nutscan_ip_range_list_iter_t *irliter, | ||
const nutscan_ip_range_list_t *irl); | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
The *nutscan_ip_ranges_iter_init()* function can prepare an iterator from | ||
the specified `nutscan_ip_range_list_t` structure, saving it into the | ||
caller-provided `nutscan_ip_range_list_iter_t` helper object. | ||
|
||
Different iterators may be created to walk the same `nutscan_ip_range_list_t` | ||
list from different scans independently, but the list and its contents should | ||
not be freed while anyone references it. | ||
|
||
This function skips work if: | ||
|
||
* the structure pointer is `NULL` (`NULL` is returned); | ||
* the structure pointer's `ip_range` list is `NULL` (`NULL` is returned). | ||
|
||
Returns the first IP address from the first registered IP address range. | ||
Subsequent addresses can be returned by `nutscan_ip_ranges_iter_inc()`. | ||
|
||
NOTES | ||
----- | ||
|
||
Technically, the function is currently defined in 'nutscan-ip.h' file. | ||
|
||
SEE ALSO | ||
-------- | ||
|
||
linkman:nutscan_init_ip_ranges[3], linkman:nutscan_free_ip_ranges[3], | ||
linkman:nutscan_cidr_to_ip[3], | ||
linkman:nutscan_ip_ranges_iter_inc[3] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.