if_tun.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* $OpenBSD: if_tun.h,v 1.15 2007/02/06 10:49:40 claudio Exp $ */
  2. /*
  3. * Copyright (c) 1988, Julian Onions <Julian.Onions@nexor.co.uk>
  4. * Nottingham University 1987.
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  17. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  18. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  19. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  25. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #ifndef _NET_IF_TUN_H_
  28. #define _NET_IF_TUN_H_
  29. #include <sys/ioccom.h>
  30. #define TUN_OPEN 0x0001
  31. #define TUN_INITED 0x0002
  32. #define TUN_RCOLL 0x0004 /* unused */
  33. #define TUN_IASET 0x0008
  34. #define TUN_DSTADDR 0x0010
  35. #define TUN_RWAIT 0x0040
  36. #define TUN_ASYNC 0x0080
  37. #define TUN_NBIO 0x0100
  38. #define TUN_BRDADDR 0x0200
  39. #define TUN_STAYUP 0x0400
  40. #define TUN_LAYER2 0x0800
  41. #define TUN_READY (TUN_OPEN | TUN_INITED)
  42. /* Maximum packet size */
  43. #define TUNMTU 3000
  44. /* Maximum receive packet size (hard limit) */
  45. #define TUNMRU 16384
  46. /* iface info */
  47. struct tuninfo {
  48. u_int mtu;
  49. u_short type;
  50. u_short flags;
  51. u_int baudrate;
  52. };
  53. #define TUNSIFINFO _IOW('t', 91, struct tuninfo)
  54. #define TUNGIFINFO _IOR('t', 92, struct tuninfo)
  55. /* ioctl for changing the broadcast/point-to-point status */
  56. #define TUNSIFMODE _IOW('t', 93, int)
  57. /* ioctl's for get/set debug */
  58. #define TUNSDEBUG _IOW('t', 94, int)
  59. #define TUNGDEBUG _IOR('t', 95, int)
  60. #endif /* _NET_IF_TUN_H_ */