Annotation of embedaddon/strongswan/src/libimcv/plugins/imc_swima/imc_swima_state.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2017 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 imc_swima imc_swima
18: * @ingroup libimcv_plugins
19: *
20: * @defgroup imc_swima_state_t imc_swima_state
21: * @{ @ingroup imc_swima
22: */
23:
24: #ifndef IMC_SWIMA_STATE_H_
25: #define IMC_SWIMA_STATE_H_
26:
27: #include <imc/imc_state.h>
28: #include <swima/swima_inventory.h>
29: #include <library.h>
30:
31: typedef struct imc_swima_state_t imc_swima_state_t;
32: typedef struct imc_swima_subscription_t imc_swima_subscription_t;
33:
34: /**
35: * State information on subscriptions
36: */
37: struct imc_swima_subscription_t {
38:
39: /**
40: * IMV which sent the subscription request
41: */
42: TNC_IMVID imv_id;
43:
44: /**
45: * SWIMA Request ID
46: */
47: uint32_t request_id;
48:
49: /**
50: * SWIMA Request targets
51: */
52: swima_inventory_t *targets;
53:
54: /**
55: * Retrieve SW Identifiers only
56: */
57: bool sw_id_only;
58:
59: };
60:
61: /**
62: * Internal state of an imc_swima_t connection instance
63: */
64: struct imc_swima_state_t {
65:
66: /**
67: * imc_state_t interface
68: */
69: imc_state_t interface;
70:
71: /**
72: * Set or clear a subscription
73: *
74: * @param subscription state information on subscription
75: * @param set TRUE sets and FALSE clears a subscripton
76: */
77: void (*set_subscription)(imc_swima_state_t *this,
78: imc_swima_subscription_t *subscription, bool set);
79:
80: /**
81: * Get the subscription status
82: *
83: * @param subscription state information on subscription
84: * @return TRUE if subscription is set
85: */
86: bool (*get_subscription)(imc_swima_state_t *this,
87: imc_swima_subscription_t**subscription);
88:
89: /**
90: * Set the earliest EID for the next subscription round
91: *
92: * @param eid Earliest EID for events or 0 for inventories
93: */
94: void (*set_earliest_eid)(imc_swima_state_t *this, uint32_t eid);
95:
96: /**
97: * Get earliest EID for the next subscription round
98: *
99: * @return Earliest EID for events or 0 for inventories
100: */
101: uint32_t (*get_earliest_eid)(imc_swima_state_t *this);
102: };
103:
104: /**
105: * Create an imc_swima_state_t instance
106: *
107: * @param id connection ID
108: */
109: imc_state_t* imc_swima_state_create(TNC_ConnectionID id);
110:
111: #endif /** IMC_SWIMA_STATE_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>