if_enc.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* $OpenBSD: if_enc.h,v 1.12 2014/12/08 10:46:14 mpi Exp $ */
  2. /*
  3. * Copyright (c) 2010 Reyk Floeter <reyk@vantronix.net>
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _NET_ENC_H
  18. #define _NET_ENC_H
  19. #define ENCMTU 1536 /* XXX should be bigger, maybe LOMTU */
  20. #define ENC_HDRLEN 12
  21. struct enchdr {
  22. u_int32_t af;
  23. u_int32_t spi;
  24. u_int32_t flags;
  25. };
  26. #ifdef _KERNEL
  27. struct enc_softc {
  28. struct ifnet sc_if; /* virtual interface */
  29. u_int sc_unit;
  30. struct ifaddr sc_ifa; /* needed to attach rtentry */
  31. };
  32. struct ifnet *enc_getif(u_int, u_int);
  33. struct ifaddr *enc_getifa(u_int, u_int);
  34. #endif /* _KERNEL */
  35. #endif /* _NET_ENC_H */