1 /* support for ap->rresolv missing */
4 1998-07-01 - Arnaldo Carvalho de Melo - GNU gettext instead of catgets,
5 snprintf instead of sprintf
11 #include <asm/types.h>
12 #include <sys/types.h>
13 #include <sys/socket.h>
14 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
15 #include <netipx/ipx.h>
25 #include <netinet/in.h>
27 #include "net-support.h"
28 #include "pathnames.h"
33 int IPX_rprint(int options
)
35 /* int ext = options & FLAG_EXT; */
36 int numeric
= options
& FLAG_NUM_HOST
;
38 char net
[128], router_net
[128];
39 char router_node
[128];
41 FILE *fp
= fopen(_PATH_PROCNET_IPX_ROUTE
, "r");
45 if ((ap
= get_afntype(AF_IPX
)) == NULL
) {
46 EINTERN("lib/ipx_rt.c", "AF_IPX missing");
51 perror(_PATH_PROCNET_IPX_ROUTE
);
52 printf(_("IPX not configured in this system.\n"));
56 printf(_("Kernel IPX routing table\n")); /* xxx */
57 printf(_("Destination Router Net Router Node\n"));
59 fgets(buff
, 1023, fp
);
61 while (fgets(buff
, 1023, fp
)) {
62 num
= sscanf(buff
, "%s %s %s", net
, router_net
, router_node
);
66 /* Fetch and resolve the Destination */
67 (void) ap
->input(5, net
, &sa
);
68 strcpy(net
, ap
->sprint(&sa
, numeric
));
70 /* Fetch and resolve the Router Net */
71 (void) ap
->input(5, router_net
, &sa
);
72 strcpy(router_net
, ap
->sprint(&sa
, numeric
));
74 /* Fetch and resolve the Router Node */
75 (void) ap
->input(2, router_node
, &sa
);
76 strcpy(router_node
, ap
->sprint(&sa
, numeric
));
78 printf("%-25s %-25s %-25s\n", net
, router_net
, router_node
);
85 #endif /* HAVE_AFIPX */