2 * lib/netrom_gr.c This file contains an implementation of the NET/ROM
3 * route support functions.
5 * Version: $Id: netrom_gr.c,v 1.5 2000/10/08 01:00:44 ecki Exp $
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>
12 * 980701 {0.02} Arnaldo Carvalho de Melo GNU gettext instead of catgets
15 * This program is free software; you can redistribute it
16 * and/or modify it under the terms of the GNU General
17 * Public License as published by the Free Software
18 * Foundation; either version 2 of the License, or (at
19 * your option) any later version.
27 #include "net-support.h"
28 #include "pathnames.h"
33 int NETROM_rprint(int options)
35 FILE *f1 = fopen(_PATH_PROCNET_NR_NODES, "r");
36 FILE *f2 = fopen(_PATH_PROCNET_NR_NEIGH, "r");
39 /*int ext = options & FLAG_EXT;
40 int numeric = options & FLAG_NUM_HOST; */
42 if (!f1) perror(_PATH_PROCNET_NR_NODES);
43 if (!f2) perror(_PATH_PROCNET_NR_NEIGH);
45 if (f1 == NULL || f2 == NULL) {
46 printf(_("NET/ROM not configured in this system.\n"));
49 printf(_("Kernel NET/ROM routing table\n"));
50 printf(_("Destination Mnemonic Quality Neighbour Iface\n"));
51 if (fgets(buffer, 256, f1))
53 while (fgets(buffer, 256, f1)) {
56 w = atoi(buffer + 19) - 1;
59 qual = atoi(buffer + 24 + 15 * w);
60 n = atoi(buffer + 32 + 15 * w);
62 if (fgets(buffer, 256, f2))
64 while (fgets(buffer, 256, f2)) {
65 if (atoi(buffer) == n) {
68 printf("%3d %-9s %s\n",
69 qual, buffer + 6, buffer + 16);
79 #endif /* HAVE_AFNETROM */