ppp_comp_mod.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * ppp_comp_mod.c - modload support for PPP compression STREAMS module.
  3. *
  4. * Copyright (c) 1994 Paul Mackerras. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. *
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in
  15. * the documentation and/or other materials provided with the
  16. * distribution.
  17. *
  18. * 3. The name(s) of the authors of this software must not be used to
  19. * endorse or promote products derived from this software without
  20. * prior written permission.
  21. *
  22. * 4. Redistributions of any form whatsoever must retain the following
  23. * acknowledgment:
  24. * "This product includes software developed by Paul Mackerras
  25. * <paulus@samba.org>".
  26. *
  27. * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
  28. * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  29. * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
  30. * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  31. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  32. * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  33. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  34. *
  35. * $Id: ppp_comp_mod.c,v 1.2 2002/12/06 09:49:16 paulus Exp $
  36. */
  37. /*
  38. * This file is used under Solaris 2.
  39. */
  40. #include <sys/types.h>
  41. #include <sys/param.h>
  42. #include <sys/conf.h>
  43. #include <sys/modctl.h>
  44. #include <sys/sunddi.h>
  45. extern struct streamtab ppp_compinfo;
  46. static struct fmodsw fsw = {
  47. "ppp_comp",
  48. &ppp_compinfo,
  49. D_NEW | D_MP | D_MTQPAIR
  50. };
  51. extern struct mod_ops mod_strmodops;
  52. static struct modlstrmod modlstrmod = {
  53. &mod_strmodops,
  54. "PPP compression module",
  55. &fsw
  56. };
  57. static struct modlinkage modlinkage = {
  58. MODREV_1,
  59. (void *) &modlstrmod,
  60. NULL
  61. };
  62. /*
  63. * Entry points for modloading.
  64. */
  65. int
  66. _init(void)
  67. {
  68. return mod_install(&modlinkage);
  69. }
  70. int
  71. _fini(void)
  72. {
  73. return mod_remove(&modlinkage);
  74. }
  75. int
  76. _info(mip)
  77. struct modinfo *mip;
  78. {
  79. return mod_info(&modlinkage, mip);
  80. }