2 * Copyright (C) 2010 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
16 #include "tnc_imc_plugin.h"
17 #include "tnc_imc_manager.h"
22 METHOD(plugin_t
, destroy
, void,
23 tnc_imc_plugin_t
*this)
25 charon
->imcs
->destroy(charon
->imcs
);
32 plugin_t
*tnc_imc_plugin_create()
34 char *tnc_config
, *pref_lang
, *name
, *filename
;
35 tnc_imc_plugin_t
*this;
44 pref_lang
= lib
->settings
->get_str(lib
->settings
,
45 "charon.plugins.tnc-imc.preferred_language", "en");
46 tnc_config
= lib
->settings
->get_str(lib
->settings
,
47 "charon.plugins.tnc-imc.tnc_config", "/etc/tnc_config");
49 /* Create IMC manager */
50 charon
->imcs
= tnc_imc_manager_create();
53 * Create, register and initialize IMCs
54 * Abort if one of the IMCs fails to initialize successfully
58 filename
= "/usr/local/lib/libdummyimc.so";
59 imc
= tnc_imc_create(name
, filename
);
62 charon
->imcs
->destroy(charon
->imcs
);
66 if (!charon
->imcs
->add(charon
->imcs
, imc
))
69 charon
->imcs
->destroy(charon
->imcs
);