riot_sys::bindgen

Function gnrc_ipv6_nib_pl_iter

Source
pub unsafe extern "C" fn gnrc_ipv6_nib_pl_iter(
    iface: c_uint,
    state: *mut *mut c_void,
    ple: *mut gnrc_ipv6_nib_pl_t,
) -> bool
Expand description

@brief Iterates over all prefix list entries in the NIB.

@pre (state != NULL) && (ple != NULL)

@param[in] iface Restrict iteration to entries on this interface. 0 for any interface. @param[in,out] state Iteration state of the prefix list. Must point to NULL pointer to start iteration @param[out] ple The next prefix list entry.

Usage example:

#include "net/gnrc/ipv6/nib/pl.h"

int main(void) {
    void *state = NULL;
    gnrc_ipv6_nib_pl_t ple;

    puts("My prefixes:");
    while (gnrc_ipv6_nib_pl_iter(0, &state, &ple)) {
        gnrc_ipv6_nib_pl_print(&ple);
    }
    return 0;
}

@note The list may change during iteration.

@return true, if iteration can be continued. @return false, if @p ple is the last prefix list ple in the NIB.