DataProtoKeepaliveSource.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @file DataProtoKeepaliveSource.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. * @section DESCRIPTION
  23. *
  24. * A {@link PacketRecvInterface} source which provides DataProto keepalive packets.
  25. */
  26. #ifndef BADVPN_FLOW_DATAPROTOKEEPALIVESOURCE_H
  27. #define BADVPN_FLOW_DATAPROTOKEEPALIVESOURCE_H
  28. #include <system/DebugObject.h>
  29. #include <flow/PacketRecvInterface.h>
  30. /**
  31. * A {@link PacketRecvInterface} source which provides DataProto keepalive packets.
  32. * These packets have no payload, no destination peers and flags zero.
  33. */
  34. typedef struct {
  35. DebugObject d_obj;
  36. PacketRecvInterface output;
  37. } DataProtoKeepaliveSource;
  38. /**
  39. * Initializes the object.
  40. *
  41. * @param o the object
  42. * @param pg pending group
  43. */
  44. void DataProtoKeepaliveSource_Init (DataProtoKeepaliveSource *o, BPendingGroup *pg);
  45. /**
  46. * Frees the object.
  47. *
  48. * @param o the object
  49. */
  50. void DataProtoKeepaliveSource_Free (DataProtoKeepaliveSource *o);
  51. /**
  52. * Returns the output interface.
  53. * The MTU of the output interface will be sizeof(struct dataproto_header).
  54. *
  55. * @param o the object
  56. * @return output interface
  57. */
  58. PacketRecvInterface * DataProtoKeepaliveSource_GetOutput (DataProtoKeepaliveSource *o);
  59. #endif