Implemented IF-M segmentation
[strongswan.git] / src / libimcv / seg / seg_contract_manager.h
1 /*
2 * Copyright (C) 2014 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup seg_contract_manager seg_contract_manager
18 * @{ @ingroup libimcv
19 */
20
21 #ifndef SEG_CONTRACT_MANAGER_H_
22 #define SEG_CONTRACT_MANAGER_H_
23
24 typedef struct seg_contract_manager_t seg_contract_manager_t;
25
26 #include "seg_contract.h"
27
28 /**
29 * Interface for a PA-TNC attribute segmentation contract manager
30 *
31 */
32 struct seg_contract_manager_t {
33
34 /**
35 * Add segmentation contract
36 *
37 * @param contract Segmentation contract to be added
38 */
39 void (*add_contract)(seg_contract_manager_t *this, seg_contract_t *contract);
40
41 /**
42 * Get segmentation contract
43 *
44 * @param msg_type PA-TNC message type governed by contract
45 * @param is_issuer If TRUE get only issuer contracts
46 */
47 seg_contract_t* (*get_contract)(seg_contract_manager_t *this,
48 pen_type_t msg_type, bool is_issuer);
49
50 /**
51 * Destroys a seg_contract_manager_t object.
52 */
53 void (*destroy)(seg_contract_manager_t *this);
54 };
55
56 /**
57 * Create a PA-TNC attribute segmentation contract manager
58 */
59 seg_contract_manager_t* seg_contract_manager_create();
60
61 #endif /** SEG_CONTRACT_MANAGER_H_ @}*/