ipsec.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2012 Giuliano Grassi
  3. * Copyright (C) 2012 Ralf Sager
  4. * Copyright (C) 2012 Tobias Brunner
  5. * HSR Hochschule fuer Technik Rapperswil
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  14. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15. * for more details.
  16. */
  17. /**
  18. * @defgroup libipsec libipsec
  19. *
  20. * @addtogroup libipsec
  21. * @{
  22. */
  23. #ifndef IPSEC_H_
  24. #define IPSEC_H_
  25. #include "ipsec_sa_mgr.h"
  26. #include "ipsec_policy_mgr.h"
  27. #include "ipsec_event_relay.h"
  28. #include "ipsec_processor.h"
  29. #include <library.h>
  30. typedef struct ipsec_t ipsec_t;
  31. /**
  32. * User space IPsec implementation.
  33. */
  34. struct ipsec_t {
  35. /**
  36. * IPsec SA manager instance
  37. */
  38. ipsec_sa_mgr_t *sas;
  39. /**
  40. * IPsec policy manager instance
  41. */
  42. ipsec_policy_mgr_t *policies;
  43. /**
  44. * Event relay instance
  45. */
  46. ipsec_event_relay_t *events;
  47. /**
  48. * IPsec processor instance
  49. */
  50. ipsec_processor_t *processor;
  51. };
  52. /**
  53. * The single instance of ipsec_t.
  54. *
  55. * Set between calls to libipsec_init() and libipsec_deinit() calls.
  56. */
  57. extern ipsec_t *ipsec;
  58. /**
  59. * Initialize libipsec.
  60. *
  61. * @return FALSE if integrity check failed
  62. */
  63. bool libipsec_init();
  64. /**
  65. * Deinitialize libipsec.
  66. */
  67. void libipsec_deinit();
  68. #endif /** IPSEC_H_ @}*/