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

Subversion Repositories or1k_old

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 745 simons
/*
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.1 2002-03-17 19:58:53 simons 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
    fgets(buffer, 256, f);
53
    while (fgets(buffer, 256, f)) {
54
        buffer[9] = 0;
55
        buffer[14] = 0;
56
        use = atoi(buffer + 15);
57
        printf("%-9s    %-5s  %5d\n",
58
               buffer, buffer + 10, use);
59
    }
60
    fclose(f);
61
    return 0;
62
}
63
 
64
#endif                          /* HAVE_AFAX25 */

powered by: WebSVN 2.1.0

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