~ubuntu-branches/ubuntu/trusty/ipxe/trusty

« back to all changes in this revision

Viewing changes to src/usr/route.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-11-26 17:50:47 UTC
  • mfrom: (1.2.2)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: package-import@ubuntu.com-20131126175047-rrtzcroy6yyz7lqp
Tags: upstream-1.0.0+git-20131111.c3d1e78
ImportĀ upstreamĀ versionĀ 1.0.0+git-20131111.c3d1e78

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
FILE_LICENCE ( GPL2_OR_LATER );
21
21
 
22
 
#include <stdio.h>
23
22
#include <ipxe/netdevice.h>
24
 
#include <ipxe/ip.h>
25
23
#include <usr/route.h>
26
24
 
27
25
/** @file
28
26
 *
29
 
 * Routing table management
 
27
 * Routing management
30
28
 *
31
29
 */
32
30
 
 
31
/**
 
32
 * Print routing table
 
33
 *
 
34
 */
33
35
void route ( void ) {
34
 
        struct ipv4_miniroute *miniroute;
 
36
        struct net_device *netdev;
 
37
        struct routing_family *family;
35
38
 
36
 
        list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) {
37
 
                printf ( "%s: %s/", miniroute->netdev->name,
38
 
                         inet_ntoa ( miniroute->address ) );
39
 
                printf ( "%s", inet_ntoa ( miniroute->netmask ) );
40
 
                if ( miniroute->gateway.s_addr )
41
 
                        printf ( " gw %s", inet_ntoa ( miniroute->gateway ) );
42
 
                if ( ! netdev_is_open ( miniroute->netdev ) )
43
 
                        printf ( " (inaccessible)" );
44
 
                printf ( "\n" );
 
39
        for_each_netdev ( netdev ) {
 
40
                for_each_table_entry ( family, ROUTING_FAMILIES ) {
 
41
                        family->print ( netdev );
 
42
                }
45
43
        }
46
44
}