SCKeepaliveSource.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * @file SCKeepaliveSource.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 SCProto keepalive packets.
  25. */
  26. #ifndef BADVPN_FLOW_SCKEEPALIVESOURCE_H
  27. #define BADVPN_FLOW_SCKEEPALIVESOURCE_H
  28. #include <system/DebugObject.h>
  29. #include <flow/PacketRecvInterface.h>
  30. /**
  31. * A {@link PacketRecvInterface} source which provides SCProto keepalive packets.
  32. */
  33. typedef struct {
  34. DebugObject d_obj;
  35. PacketRecvInterface output;
  36. } SCKeepaliveSource;
  37. /**
  38. * Initializes the object.
  39. *
  40. * @param o the object
  41. */
  42. void SCKeepaliveSource_Init (SCKeepaliveSource *o);
  43. /**
  44. * Frees the object.
  45. *
  46. * @param o the object
  47. */
  48. void SCKeepaliveSource_Free (SCKeepaliveSource *o);
  49. /**
  50. * Returns the output interface.
  51. * The MTU of the output interface will be sizeof(struct sc_header).
  52. *
  53. * @param o the object
  54. * @return output interface
  55. */
  56. PacketRecvInterface * SCKeepaliveSource_GetOutput (SCKeepaliveSource *o);
  57. #endif