You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

iptunnel.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* This file is part of Netsukuku
  2. * (c) Copyright 2005 Andrea Lo Pumo aka AlpT <alpt@freaknet.org>
  3. *
  4. * This source code is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as published
  6. * by the Free Software Foundation; either version 2 of the License,
  7. * or (at your option) any later version.
  8. *
  9. * This source code is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. * Please refer to the GNU Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Public License along with
  15. * this source code; if not, write to:
  16. * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #ifndef IPTUNNEL_H
  19. #define IPTUNNEL_H
  20. #include "if.h"
  21. #define DEFAULT_TUNL_PREFIX "tunl"
  22. #define DEFAULT_TUNL_NUMBER 0 /* The permanent tunl0 device */
  23. #define DEFAULT_TUNL_IF "tunl0"
  24. #define NTK_TUNL_PREFIX "ntk_tunl"
  25. /* Usage: printf(TUNL_STRING, TUNL_NUMBER("tunl", x)); */
  26. #define TUNL_STRING "%s%d"
  27. #define TUNL_N(prefix, x) prefix, x
  28. #define MAX_TUNNEL_IFS 24 /* it must be >= MAX_MULTIPATH_ROUTES,
  29. since in igs.c we are using a tunnel
  30. for each nexthop inet-gw */
  31. /*
  32. * * Globals * *
  33. */
  34. interface tunnel_ifs[MAX_TUNNEL_IFS];
  35. /*
  36. * Functions declaration
  37. */
  38. int tunnel_add(inet_prefix *remote, inet_prefix *local, char *dev,
  39. char *tunl_prefix, int tunl_number);
  40. int tunnel_change(inet_prefix *remote, inet_prefix *local, char *dev,
  41. char *tunl_prefix, int tunl_number);
  42. int tunnel_del(inet_prefix *remote, inet_prefix *local, char *dev,
  43. char *tunl_prefix, int tunl_number);
  44. int tun_add_tunl(interface *ifs, char *tunl_prefix, u_char tunl_number);
  45. int tun_del_tunl(interface *ifs, char *tunl_prefix, u_char tunl_number);
  46. void init_tunnels_ifs(void);
  47. int set_tunnel_ip(char *tunl_prefix, int tunl_number, inet_prefix *tunl_ip);
  48. int first_free_tunnel_if(void);
  49. int do_get(char *dev);
  50. int add_tunnel_if(inet_prefix *remote, inet_prefix *local, char *dev,
  51. char *tunl_prefix, int tunl_number, inet_prefix *tunl_ip);
  52. int del_tunnel_if(inet_prefix *remote, inet_prefix *local, char *dev,
  53. char *tunl_prefix, int tunl_number);
  54. void del_all_tunnel_ifs(inet_prefix *remote, inet_prefix *local, char *dev,
  55. char *tunl_prefix);
  56. #endif /* IPTUNNEL_H */