2 * Copyright (C) 2011 Martin Willi
3 * Copyright (C) 2011 revosec AG
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 "duplicheck_plugin.h"
18 #include "duplicheck_listener.h"
22 typedef struct private_duplicheck_plugin_t private_duplicheck_plugin_t
;
25 * Private data of duplicheck plugin
27 struct private_duplicheck_plugin_t
{
30 * Implements plugin interface
32 duplicheck_plugin_t
public;
35 * Listener doing duplicate checks
37 duplicheck_listener_t
*listener
;
40 METHOD(plugin_t
, destroy
, void,
41 private_duplicheck_plugin_t
*this)
43 charon
->bus
->remove_listener(charon
->bus
, &this->listener
->listener
);
44 this->listener
->destroy(this->listener
);
51 plugin_t
*duplicheck_plugin_create()
53 private_duplicheck_plugin_t
*this;
61 .listener
= duplicheck_listener_create(),
64 charon
->bus
->add_listener(charon
->bus
, &this->listener
->listener
);
66 return &this->public.plugin
;