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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [userland/] [route/] [lib/] [setroute.c] - Blame information for rev 1767

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 745 simons
/*
2
 * lib/setroute.c     This file contains a small interface function to
3
 *                      use the AF specific input routine for the routing
4
 *                      table.
5
 *
6
 * NET-LIB      A collection of functions used from the base set of the
7
 *              NET-3 Networking Distribution for the LINUX operating
8
 *              system. (net-tools, net-drivers)
9
 *
10
 * Version:     $Id: setroute.c,v 1.1 2002-03-17 19:58:53 simons Exp $
11
 *
12
 * Author:      Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
13
 *              Copyright 1999 Bernd Eckenfels, Germany
14
 *
15
 * Modifications:
16
 *
17
 *960221 {0.01} Bernd Eckenfels:        generated from getroute.c
18
 *960413 {0.02} Bernd Eckenfels:        new RTACTION support
19
 *960809        Frank Strauss:          INET6
20
 *
21
 *              This program is free software; you can redistribute it
22
 *              and/or  modify it under  the terms of  the GNU General
23
 *              Public  License as  published  by  the  Free  Software
24
 *              Foundation;  either  version 2 of the License, or  (at
25
 *              your option) any later version.
26
 */
27
#include <stdio.h>
28
#include <string.h>
29
#include "net-support.h"
30
#include "pathnames.h"
31
#include "version.h"
32
#include "config.h"
33
#include "intl.h"
34
 
35
extern struct aftype unspec_aftype;
36
extern struct aftype unix_aftype;
37
extern struct aftype inet_aftype;
38
extern struct aftype inet6_aftype;
39
extern struct aftype ax25_aftype;
40
extern struct aftype netrom_aftype;
41
extern struct aftype ipx_aftype;
42
extern struct aftype ddp_aftype;
43
 
44
void setroute_init(void)
45
{
46
#if HAVE_AFINET
47
    inet_aftype.rinput = INET_rinput;
48
#endif
49
#if HAVE_AFINET6
50
    inet6_aftype.rinput = INET6_rinput;
51
#endif
52
#if HAVE_AFNETROM
53
    netrom_aftype.rinput = NETROM_rinput;
54
#endif
55
#if HAVE_AFIPX
56
    ipx_aftype.rinput = IPX_rinput;
57
#endif
58
#if 0
59
#if HAVE_AFAX25
60
    ax25_aftype.rinput = AX25_rinput;
61
#endif
62
#if HAVE_AFATALK
63
    ddp_aftype.rinput = DDP_rinput;
64
#endif
65
#endif
66
}
67
 
68
 
69
int route_edit(int action, const char *afname, int options, char **argv)
70
{
71
    struct aftype *ap;
72
 
73
    ap = get_aftype(afname);
74
 
75
    if (!ap) {
76
        fprintf(stderr, _("Address family `%s' not supported.\n"), afname);
77
        return (E_OPTERR);
78
    }
79
    if (!ap->rinput) {
80
        fprintf(stderr, _("No routing for address family `%s'.\n"), ap->name);
81
        return (E_OPTERR);
82
    }
83
    return (ap->rinput(action, options, argv));
84
}

powered by: WebSVN 2.1.0

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