man/pt_BR/ifconfig.8: remove untranslated paragraph
[platform/upstream/net-tools.git] / lib / ax25_gr.c
1 /*
2  * lib/ax25_gr.c      This file contains an implementation of the "AX.25"
3  *                      route print support functions.
4  *
5  * Version:     $Id: ax25_gr.c,v 1.4 1999/01/05 20:53:21 philip Exp $
6  *
7  * Author:      Bernd Eckenfels, <ecki@lina.inka.de>
8  *              Copyright 1999 Bernd Eckenfels, Germany
9  *              base on Code from Jonathan Naylor <jsn@Cs.Nott.AC.UK>
10  *
11  *              This program is free software; you can redistribute it
12  *              and/or  modify it under  the terms of  the GNU General
13  *              Public  License as  published  by  the  Free  Software
14  *              Foundation;  either  version 2 of the License, or  (at
15  *              your option) any later version.
16  */
17 #include "config.h"
18
19 #if HAVE_AFAX25
20 #if 0
21 #include <sys/types.h>
22 #include <sys/ioctl.h>
23 #include <sys/socket.h>
24 #include <linux/ax25.h>
25 #include <linux/if_arp.h>       /* ARPHRD_AX25 */
26 #include <ctype.h>
27 #include <errno.h>
28 #include <fcntl.h>
29 #include <string.h>
30 #include <termios.h>
31 #endif
32 #include <stdlib.h>
33 #include <stdio.h>
34 #include <unistd.h>
35 #include "net-support.h"
36 #include "pathnames.h"
37 #include "intl.h"
38
39 int AX25_rprint(int options)
40 {
41     FILE *f = fopen(_PATH_PROCNET_AX25_ROUTE, "r");
42     char buffer[256];
43     int use;
44
45     if (f == NULL) {
46         perror(_PATH_PROCNET_AX25_ROUTE);
47         printf(_("AX.25 not configured in this system.\n"));    /* xxx */
48         return 1;
49     }
50     printf(_("Kernel AX.25 routing table\n"));  /* xxx */
51     printf(_("Destination  Iface    Use\n"));   /* xxx */
52     if (fgets(buffer, 256, f))
53         /* eat line */;
54     while (fgets(buffer, 256, f)) {
55         buffer[9] = 0;
56         buffer[14] = 0;
57         use = atoi(buffer + 15);
58         printf("%-9s    %-5s  %5d\n",
59                buffer, buffer + 10, use);
60     }
61     fclose(f);
62     return 0;
63 }
64
65 #endif                          /* HAVE_AFAX25 */