Annotation of embedaddon/strongswan/src/libcharon/sa/trap_manager.h, revision 1.1
1.1 ! misho 1: /*
! 2: * Copyright (C) 2013-2017 Tobias Brunner
! 3: * Copyright (C) 2009 Martin Willi
! 4: * HSR Hochschule fuer Technik Rapperswil
! 5: *
! 6: * This program is free software; you can redistribute it and/or modify it
! 7: * under the terms of the GNU General Public License as published by the
! 8: * Free Software Foundation; either version 2 of the License, or (at your
! 9: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
! 10: *
! 11: * This program is distributed in the hope that it will be useful, but
! 12: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 13: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
! 14: * for more details.
! 15: */
! 16:
! 17: /**
! 18: * @defgroup trap_manager trap_manager
! 19: * @{ @ingroup sa
! 20: */
! 21:
! 22: #ifndef TRAP_MANAGER_H_
! 23: #define TRAP_MANAGER_H_
! 24:
! 25: #include <library.h>
! 26: #include <collections/enumerator.h>
! 27: #include <config/peer_cfg.h>
! 28:
! 29: typedef struct trap_manager_t trap_manager_t;
! 30:
! 31: /**
! 32: * Manage policies to create SAs from traffic.
! 33: */
! 34: struct trap_manager_t {
! 35:
! 36: /**
! 37: * Install a policy as a trap.
! 38: *
! 39: * @param peer peer configuration to initiate on trap
! 40: * @param child child configuration to install as a trap
! 41: * @return TRUE if successfully installed
! 42: */
! 43: bool (*install)(trap_manager_t *this, peer_cfg_t *peer, child_cfg_t *child);
! 44:
! 45: /**
! 46: * Uninstall a trap policy.
! 47: *
! 48: * If no peer configuration name is given the first matching child
! 49: * configuration is uninstalled.
! 50: *
! 51: * @param peer peer configuration name or NULL
! 52: * @param child child configuration name
! 53: * @return TRUE if uninstalled successfully
! 54: */
! 55: bool (*uninstall)(trap_manager_t *this, char *peer, char *child);
! 56:
! 57: /**
! 58: * Create an enumerator over all installed traps.
! 59: *
! 60: * @return enumerator over (peer_cfg_t, child_sa_t)
! 61: */
! 62: enumerator_t* (*create_enumerator)(trap_manager_t *this);
! 63:
! 64: /**
! 65: * Acquire an SA triggered by an installed trap.
! 66: *
! 67: * @param reqid requid of the triggering CHILD_SA
! 68: * @param src source of the triggering packet
! 69: * @param dst destination of the triggering packet
! 70: */
! 71: void (*acquire)(trap_manager_t *this, uint32_t reqid,
! 72: traffic_selector_t *src, traffic_selector_t *dst);
! 73:
! 74: /**
! 75: * Clear any installed trap.
! 76: */
! 77: void (*flush)(trap_manager_t *this);
! 78:
! 79: /**
! 80: * Destroy a trap_manager_t.
! 81: */
! 82: void (*destroy)(trap_manager_t *this);
! 83: };
! 84:
! 85: /**
! 86: * Create a trap_manager instance.
! 87: */
! 88: trap_manager_t *trap_manager_create();
! 89:
! 90: #endif /** TRAP_MANAGER_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>