BDatagram_unix.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * @file BDatagram_unix.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. */
  22. #include <misc/debugerror.h>
  23. #include <base/DebugObject.h>
  24. #define BDATAGRAM_SEND_LIMIT 2
  25. #define BDATAGRAM_RECV_LIMIT 2
  26. struct BDatagram_s {
  27. BReactor *reactor;
  28. void *user;
  29. BDatagram_handler handler;
  30. int fd;
  31. BFileDescriptor bfd;
  32. int wait_events;
  33. struct {
  34. BReactorLimit limit;
  35. int have_addrs;
  36. BAddr remote_addr;
  37. BIPAddr local_addr;
  38. int inited;
  39. int mtu;
  40. PacketPassInterface iface;
  41. BPending job;
  42. int busy;
  43. const uint8_t *busy_data;
  44. int busy_data_len;
  45. } send;
  46. struct {
  47. BReactorLimit limit;
  48. int started;
  49. int have_addrs;
  50. BAddr remote_addr;
  51. BIPAddr local_addr;
  52. int inited;
  53. int mtu;
  54. PacketRecvInterface iface;
  55. BPending job;
  56. int busy;
  57. uint8_t *busy_data;
  58. } recv;
  59. DebugError d_err;
  60. DebugObject d_obj;
  61. };