2 * spppcomp_mod.c - modload support for PPP compression STREAMS module.
4 * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
6 * CONTRIBUTOR MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY
7 * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
8 * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
9 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CONTRIBUTOR SHALL NOT BE LIABLE
10 * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
11 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
13 * Copyright (c) 2000 by Sun Microsystems, Inc.
14 * All rights reserved.
16 * Permission to use, copy, modify, and distribute this software and its
17 * documentation is hereby granted, provided that the above copyright
18 * notice appears in all copies.
20 * SUN MAKES NO REPRESENTATION OR WARRANTIES ABOUT THE SUITABILITY OF
21 * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
22 * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
24 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
25 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
27 * Copyright (c) 1994 The Australian National University.
28 * All rights reserved.
30 * Permission to use, copy, modify, and distribute this software and its
31 * documentation is hereby granted, provided that the above copyright
32 * notice appears in all copies. This software is provided without any
33 * warranty, express or implied. The Australian National University
34 * makes no representations about the suitability of this software for
37 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
38 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
39 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
40 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
43 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
44 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
45 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
46 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
47 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
50 * This module is derived from the original SVR4 STREAMS PPP compression
51 * module originally written by Paul Mackerras <paul.mackerras@cs.anu.edu.au>.
53 * James Carlson <james.d.carlson@sun.com> and Adi Masputra
54 * <adi.masputra@sun.com> rewrote and restructured the code for improved
55 * performance and scalability.
58 #include <sys/types.h>
59 #include <sys/syslog.h>
61 #include <sys/errno.h>
64 #include <sys/modctl.h>
65 #include <net/pppio.h>
70 * Globals for PPP compression loadable module wrapper
72 extern struct streamtab spppcomp_tab
;
73 extern const char spppcomp_module_description
[];
75 static struct fmodsw fsw
= {
76 COMP_MOD_NAME
, /* f_name */
77 &spppcomp_tab
, /* f_str */
78 D_NEW
| D_MP
| D_MTPERQ
/* f_flag */
81 static struct modlstrmod modlstrmod
= {
82 &mod_strmodops
, /* strmod_modops */
83 (char *)spppcomp_module_description
, /* strmod_linkinfo */
84 &fsw
/* strmod_fmodsw */
87 static struct modlinkage modlinkage
= {
88 MODREV_1
, /* ml_rev, has to be MODREV_1 */
89 (void *) &modlstrmod
, /* ml_linkage, NULL-terminated list */
90 NULL
/* of linkage structures */
96 return (mod_install(&modlinkage
));
102 return (mod_remove(&modlinkage
));
106 _info(struct modinfo
*modinfop
)
108 return (mod_info(&modlinkage
, modinfop
));