2 * lib/x25_gr.c This file contains an implementation of the "X.25"
3 * route print support functions.
5 * Version: lib/x25_gr.c 1.00 08/15/98
7 * Author: Stephane Fillod, <sfillod@charybde.gyptis.frmug.org>
8 * based on ax25_gr.c by:
9 * Bernd Eckenfels, <ecki@lina.inka.de>
10 * Copyright 1999 Bernd Eckenfels, Germany
11 * base on Code from Jonathan Naylor <jsn@Cs.Nott.AC.UK>
13 * This program is free software; you can redistribute it
14 * and/or modify it under the terms of the GNU General
15 * Public License as published by the Free Software
16 * Foundation; either version 2 of the License, or (at
17 * your option) any later version.
23 #include <sys/types.h>
24 #include <sys/ioctl.h>
25 #include <sys/socket.h>
26 #include <linux/x25.h>
27 #include <linux/if_arp.h> /* ARPHRD_X25 */
38 #include "net-support.h"
39 #include "pathnames.h"
42 #include "net-locale.h"
46 /* is in net/x25.h, not in the public header file linux/x25.h. Why?*/
48 #define X25_ADDR_LEN 16
51 int X25_rprint(int options
)
53 FILE *f
=fopen(_PATH_PROCNET_X25_ROUTE
, "r");
60 printf( _("X.25 not configured in this system.\n")); /* xxx */
63 printf( _("Kernel X.25 routing table\n")); /* xxx */
64 printf( _("Destination Iface\n")); /* xxx */
66 while(fgets(buffer
,256,f
))
68 p
= strchr(buffer
,'\n');
74 digits
=atoi(buffer
+17);
75 if (digits
< 0 || digits
> 15)
79 printf("* %-5s\n", buffer
+25);
81 printf("%s/%*d %-5s\n",
82 buffer
,digits
-17,digits
,buffer
+25);
88 #endif /* HAVE_AFX25 */