Return to eap_radius_provider.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / src / libcharon / plugins / eap_radius |
1.1 misho 1: /* 2: * Copyright (C) 2018 Tobias Brunner 3: * HSR Hochschule fuer Technik Rapperswil 4: * 5: * Copyright (C) 2013 Martin Willi 6: * Copyright (C) 2013 revosec AG 7: * 8: * This program is free software; you can redistribute it and/or modify it 9: * under the terms of the GNU General Public License as published by the 10: * Free Software Foundation; either version 2 of the License, or (at your 11: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. 12: * 13: * This program is distributed in the hope that it will be useful, but 14: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16: * for more details. 17: */ 18: 19: /** 20: * @defgroup eap_radius_provider eap_radius_provider 21: * @{ @ingroup eap_radius 22: */ 23: 24: #ifndef EAP_RADIUS_PROVIDER_H_ 25: #define EAP_RADIUS_PROVIDER_H_ 26: 27: #include <attributes/attributes.h> 28: #include <attributes/attribute_provider.h> 29: 30: typedef struct eap_radius_provider_t eap_radius_provider_t; 31: 32: /** 33: * IKE configuration attribute fed by RADIUS attributes 34: */ 35: struct eap_radius_provider_t { 36: 37: /** 38: * Implements attribute_provider_t 39: */ 40: attribute_provider_t provider; 41: 42: /** 43: * Add a received Framed-IP-Address to the provider to serve to client. 44: * 45: * @param id IKE_SA unique identifier 46: * @param ip IP address received from RADIUS server, gets owned 47: */ 48: void (*add_framed_ip)(eap_radius_provider_t *this, uint32_t id, 49: host_t *ip); 50: 51: /** 52: * Add a configuration attribute received from RADIUS to forward. 53: * 54: * @param id IKE_SA unique identifier 55: * @param type attribute type 56: * @param data attribute data 57: */ 58: void (*add_attribute)(eap_radius_provider_t *this, uint32_t id, 59: configuration_attribute_type_t type, chunk_t data); 60: 61: /** 62: * Clears any unclaimed IP addresses and attributes for the given IKE_SA. 63: * 64: * @param id IKE_SA unique identifier 65: * @return enumerator over unclaimed IP addresses, if any 66: */ 67: enumerator_t *(*clear_unclaimed)(eap_radius_provider_t *this, uint32_t id); 68: 69: /** 70: * Destroy a eap_radius_provider_t. 71: */ 72: void (*destroy)(eap_radius_provider_t *this); 73: }; 74: 75: /** 76: * Create a eap_radius_provider instance. 77: */ 78: eap_radius_provider_t *eap_radius_provider_create(); 79: 80: /** 81: * Get singleton instance previously created with eap_radius_provider_create(). 82: */ 83: eap_radius_provider_t *eap_radius_provider_get(); 84: 85: #endif /** EAP_RADIUS_PROVIDER_H_ @}*/