ip_ipip.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* $OpenBSD: ip_ipip.h,v 1.6 2007/12/14 18:33:41 deraadt Exp $ */
  2. /*
  3. * The authors of this code are John Ioannidis (ji@tla.org),
  4. * Angelos D. Keromytis (kermit@csd.uch.gr) and
  5. * Niels Provos (provos@physnet.uni-hamburg.de).
  6. *
  7. * The original version of this code was written by John Ioannidis
  8. * for BSD/OS in Athens, Greece, in November 1995.
  9. *
  10. * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996,
  11. * by Angelos D. Keromytis.
  12. *
  13. * Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis
  14. * and Niels Provos.
  15. *
  16. * Additional features in 1999 by Angelos D. Keromytis.
  17. *
  18. * Copyright (C) 1995, 1996, 1997, 1998, 1999 by John Ioannidis,
  19. * Angelos D. Keromytis and Niels Provos.
  20. * Copyright (c) 2001, Angelos D. Keromytis.
  21. *
  22. * Permission to use, copy, and modify this software with or without fee
  23. * is hereby granted, provided that this entire notice is included in
  24. * all copies of any software which is or includes a copy or
  25. * modification of this software.
  26. * You may use this code under the GNU public license if you so wish. Please
  27. * contribute changes back to the authors under this freer than GPL license
  28. * so that we may further the use of strong encryption without limitations to
  29. * all.
  30. *
  31. * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
  32. * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
  33. * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
  34. * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
  35. * PURPOSE.
  36. */
  37. #ifndef _NETINET_IPIP_H_
  38. #define _NETINET_IPIP_H_
  39. /*
  40. * IP-inside-IP processing.
  41. * Not quite all the functionality of RFC-1853, but the main idea is there.
  42. */
  43. struct ipipstat
  44. {
  45. u_int32_t ipips_ipackets; /* total input packets */
  46. u_int32_t ipips_opackets; /* total output packets */
  47. u_int32_t ipips_hdrops; /* packet shorter than header shows */
  48. u_int32_t ipips_qfull;
  49. u_int64_t ipips_ibytes;
  50. u_int64_t ipips_obytes;
  51. u_int32_t ipips_pdrops; /* packet dropped due to policy */
  52. u_int32_t ipips_spoof; /* IP spoofing attempts */
  53. u_int32_t ipips_family; /* Protocol family mismatch */
  54. u_int32_t ipips_unspec; /* Missing tunnel endpoint address */
  55. };
  56. #define IP4_DEFAULT_TTL 0
  57. #define IP4_SAME_TTL -1
  58. /*
  59. * Names for IPIP sysctl objects
  60. */
  61. #define IPIPCTL_ALLOW 1 /* accept incoming IP4 packets */
  62. #define IPIPCTL_STATS 2 /* IPIP stats */
  63. #define IPIPCTL_MAXID 3
  64. #define IPIPCTL_NAMES { \
  65. { 0, 0 }, \
  66. { "allow", CTLTYPE_INT }, \
  67. { "stats", CTLTYPE_STRUCT }, \
  68. }
  69. #ifdef _KERNEL
  70. int ipip_sysctl(int *, u_int, void *, size_t *, void *, size_t);
  71. extern int ipip_allow;
  72. extern struct ipipstat ipipstat;
  73. #endif /* _KERNEL */
  74. #endif /* _NETINET_IPIP_H_ */