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_imv_plugin.h"
21 METHOD(plugin_t
, destroy
, void,
22 tnc_imv_plugin_t
*this)
26 while (charon
->imvs
->remove_last(charon
->imvs
, (void**)&imv
) == SUCCESS
)
29 imv
->terminate(imv
->get_id(imv
)) != TNC_RESULT_SUCCESS
)
31 DBG1(DBG_TNC
, "IMV '%s' not terminated successfully",
42 plugin_t
*tnc_imv_plugin_create()
44 TNC_IMVID next_id
= 1;
46 char *tnc_config
, *name
, *filename
;
47 tnc_imv_plugin_t
*this;
56 tnc_config
= lib
->settings
->get_str(lib
->settings
,
57 "charon.plugins.tnc-imv.tnc_config", "/etc/tnc_config");
60 filename
= "/usr/local/lib/libdummyimv.so";
61 imv
= tnc_imv_create(name
, filename
, next_id
);
64 /* Initialize the module */
65 if (imv
->initialize(next_id
, TNC_IFIMV_VERSION_1
, TNC_IFIMV_VERSION_1
,
66 &version
) != TNC_RESULT_SUCCESS
)
68 DBG1(DBG_TNC
, "could not initialize IMV '%s'\n",
74 charon
->imvs
->insert_last(charon
->imvs
, imv
);