iPXE
Functions
neighmgmt.c File Reference

Neighbour management. More...

#include <stdio.h>
#include <ipxe/neighbour.h>
#include <usr/neighmgmt.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
void nstat (void)
 Print neighbour table.

Detailed Description

Neighbour management.

Definition in file neighmgmt.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
void nstat ( void  )

Print neighbour table.

Definition at line 40 of file neighmgmt.c.

References neighbour::discovery, list_for_each_entry, neighbour::ll_dest, net_device::ll_protocol, neighbour_discovery::name, net_protocol::name, ll_protocol::name, net_device::name, neighbour_has_ll_dest(), neighbours, neighbour::net_dest, neighbour::net_protocol, neighbour::netdev, netdev, net_protocol::ntoa, ll_protocol::ntoa, and printf().

Referenced by nstat_exec().

                    {
        struct neighbour *neighbour;
        struct net_device *netdev;
        struct ll_protocol *ll_protocol;
        struct net_protocol *net_protocol;

        list_for_each_entry ( neighbour, &neighbours, list ) {
                netdev = neighbour->netdev;
                ll_protocol = netdev->ll_protocol;
                net_protocol = neighbour->net_protocol;
                printf ( "%s %s %s is %s %s", netdev->name, net_protocol->name,
                         net_protocol->ntoa ( neighbour->net_dest ),
                         ll_protocol->name,
                         ( neighbour_has_ll_dest ( neighbour ) ?
                           ll_protocol->ntoa ( neighbour->ll_dest ) :
                           "(incomplete)" ) );
                if ( neighbour->discovery )
                        printf ( " (%s)", neighbour->discovery->name );
                printf ( "\n" );
        }
}