route.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * INET An implementation of the TCP/IP protocol suite for the LINUX
  3. * operating system. INET is implemented using the BSD Socket
  4. * interface as the means of communication with the user level.
  5. *
  6. * Global definitions for the IP router interface.
  7. *
  8. * Version: @(#)route.h 1.0.3 05/27/93
  9. *
  10. * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
  11. * for the purposes of compatibility only.
  12. *
  13. * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  14. *
  15. * Changes:
  16. * Mike McLagan : Routing by source
  17. *
  18. * This program is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU General Public License
  20. * as published by the Free Software Foundation; either version
  21. * 2 of the License, or (at your option) any later version.
  22. */
  23. #ifndef _LINUX_ROUTE_H
  24. #define _LINUX_ROUTE_H
  25. #include <linux/if.h>
  26. #include <linux/compiler.h>
  27. /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
  28. struct rtentry {
  29. unsigned long rt_pad1;
  30. struct sockaddr rt_dst; /* target address */
  31. struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
  32. struct sockaddr rt_genmask; /* target network mask (IP) */
  33. unsigned short rt_flags;
  34. short rt_pad2;
  35. unsigned long rt_pad3;
  36. void *rt_pad4;
  37. short rt_metric; /* +1 for binary compatibility! */
  38. char __user *rt_dev; /* forcing the device at add */
  39. unsigned long rt_mtu; /* per route MTU/Window */
  40. #ifndef __KERNEL__
  41. #define rt_mss rt_mtu /* Compatibility :-( */
  42. #endif
  43. unsigned long rt_window; /* Window clamping */
  44. unsigned short rt_irtt; /* Initial RTT */
  45. };
  46. #define RTF_UP 0x0001 /* route usable */
  47. #define RTF_GATEWAY 0x0002 /* destination is a gateway */
  48. #define RTF_HOST 0x0004 /* host entry (net otherwise) */
  49. #define RTF_REINSTATE 0x0008 /* reinstate route after tmout */
  50. #define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */
  51. #define RTF_MODIFIED 0x0020 /* modified dyn. (by redirect) */
  52. #define RTF_MTU 0x0040 /* specific MTU for this route */
  53. #define RTF_MSS RTF_MTU /* Compatibility :-( */
  54. #define RTF_WINDOW 0x0080 /* per route window clamping */
  55. #define RTF_IRTT 0x0100 /* Initial round trip time */
  56. #define RTF_REJECT 0x0200 /* Reject route */
  57. /*
  58. * <linux/ipv6_route.h> uses RTF values >= 64k
  59. */
  60. #endif /* _LINUX_ROUTE_H */