2 * lib/activate.c This file contains a small interface function to
3 * use the HW specific activate routines for line
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)
10 * Version: $Id: activate.c,v 1.3 1998/11/15 20:08:55 freitag Exp $
12 * Author: Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
13 * Copyright 1996 Bernd Eckenfels, Germany
17 *960322 {0.01} Bernd Eckenfels: creation
18 *980411 {0.01i} Arnaldo Carvalho: i18n: now uses gettext
20 * This program is free software; you can redistribute it
21 * and/or modify it under the terms of the GNU General
22 * Public License as published by the Free Software
23 * Foundation; either version 2 of the License, or (at
24 * your option) any later version.
28 #include "net-support.h"
29 #include "pathnames.h"
34 extern struct hwtype slip_hwtype;
35 extern struct hwtype cslip_hwtype;
36 extern struct hwtype slip6_hwtype;
37 extern struct hwtype cslip6_hwtype;
38 extern struct hwtype adaptive_hwtype;
39 extern struct hwtype ppp_hwtype;
41 extern int SLIP_activate(int fd);
42 extern int CSLIP_activate(int fd);
43 extern int SLIP6_activate(int fd);
44 extern int CSLIP6_activate(int fd);
45 extern int ADAPTIVE_activate(int fd);
46 extern int PPP_activate(int fd);
48 void activate_init(void)
51 slip_hwtype.activate = SLIP_activate;
52 cslip_hwtype.activate = CSLIP_activate;
53 slip6_hwtype.activate = SLIP6_activate;
54 cslip6_hwtype.activate = CSLIP6_activate;
55 adaptive_hwtype.activate = ADAPTIVE_activate;
58 ppp_hwtype.activate = PPP_activate;
62 int activate_ld(const char *hwname, int fd)
66 hw = get_hwtype(hwname);
69 fprintf(stderr, _("Hardware type `%s' not supported.\n"), hwname);
73 fprintf(stderr, _("Cannot change line discipline to `%s'.\n"), hw->name);
76 return (hw->activate(fd));