if_pppoe.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* $OpenBSD: if_pppoe.h,v 1.6 2015/04/10 13:58:20 dlg Exp $ */
  2. /* $NetBSD: if_pppoe.h,v 1.5 2003/11/28 08:56:48 keihan Exp $ */
  3. /*
  4. * Copyright (c) 2002 The NetBSD Foundation, Inc.
  5. * All rights reserved.
  6. *
  7. * This code is derived from software contributed to The NetBSD Foundation
  8. * by Martin Husemann <martin@NetBSD.org>.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  21. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  23. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  29. * POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. #ifndef _NET_IF_PPPOE_H_
  32. #define _NET_IF_PPPOE_H_
  33. #define PPPOE_NAMELEN 512 /* should be enough */
  34. struct pppoediscparms {
  35. char ifname[IFNAMSIZ]; /* pppoe interface name */
  36. char eth_ifname[IFNAMSIZ]; /* external ethernet interface name */
  37. char ac_name[PPPOE_NAMELEN]; /* access concentrator name */
  38. char service_name[PPPOE_NAMELEN]; /* service name */
  39. };
  40. #define PPPOESETPARMS _IOW('i', 110, struct pppoediscparms)
  41. #define PPPOEGETPARMS _IOWR('i', 111, struct pppoediscparms)
  42. #define PPPOE_STATE_INITIAL 0
  43. #define PPPOE_STATE_PADI_SENT 1
  44. #define PPPOE_STATE_PADR_SENT 2
  45. #define PPPOE_STATE_SESSION 3
  46. #define PPPOE_STATE_CLOSING 4
  47. /* passive */
  48. #define PPPOE_STATE_PADO_SENT 1
  49. struct pppoeconnectionstate {
  50. char ifname[IFNAMSIZ]; /* pppoe interface name */
  51. u_int state; /* one of the PPPOE_STATE_ states above */
  52. u_int session_id; /* if state == PPPOE_STATE_SESSION */
  53. u_int padi_retry_no; /* number of retries already sent */
  54. u_int padr_retry_no;
  55. struct timeval session_time; /* time the session was established */
  56. };
  57. #define PPPOEGETSESSION _IOWR('i', 112, struct pppoeconnectionstate)
  58. #ifdef _KERNEL
  59. extern struct niqueue pppoediscinq;
  60. extern struct niqueue pppoeinq;
  61. void pppoeintr(void);
  62. #endif /* _KERNEL */
  63. #endif /* _NET_IF_PPPOE_H_ */