OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [userland/] [route/] [lib/] [rose_gr.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.