device.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef TINC_DEVICE_H
  2. #define TINC_DEVICE_H
  3. /*
  4. device.h -- generic header for device.c
  5. Copyright (C) 2001-2005 Ivo Timmermans
  6. 2001-2012 Guus Sliepen <guus@tinc-vpn.org>
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License along
  16. with this program; if not, write to the Free Software Foundation, Inc.,
  17. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. */
  19. #include "net.h"
  20. extern int device_fd;
  21. extern char *device;
  22. extern char *iface;
  23. typedef struct devops_t {
  24. bool (*setup)(void);
  25. void (*close)(void);
  26. bool (*read)(struct vpn_packet_t *packet);
  27. bool (*write)(struct vpn_packet_t *packet);
  28. void (*dump_stats)(void);
  29. } devops_t;
  30. extern const devops_t os_devops;
  31. extern const devops_t dummy_devops;
  32. extern const devops_t raw_socket_devops;
  33. extern const devops_t multicast_devops;
  34. extern const devops_t uml_devops;
  35. extern const devops_t vde_devops;
  36. extern devops_t devops;
  37. #endif