2 * Copyright (C) 2011-2013 Andreas Steffen
4 * Copyright (C) secunet Security Networks AG
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * @defgroup imv_scanner imv_scanner
19 * @ingroup libimcv_plugins
21 * @defgroup imv_scanner_state_t imv_scanner_state
22 * @{ @ingroup imv_scanner
25 #ifndef IMV_SCANNER_STATE_H_
26 #define IMV_SCANNER_STATE_H_
28 #include <imv/imv_state.h>
29 #include <ietf/ietf_attr_port_filter.h>
33 typedef struct imv_scanner_state_t imv_scanner_state_t
;
34 typedef enum imv_scanner_handshake_state_t imv_scanner_handshake_state_t
;
37 * IMV Scanner Handshake States (state machine)
39 enum imv_scanner_handshake_state_t
{
40 IMV_SCANNER_STATE_INIT
,
41 IMV_SCANNER_STATE_ATTR_REQ
,
42 IMV_SCANNER_STATE_WORKITEMS
,
47 * Internal state of an imv_scanner_t connection instance
49 struct imv_scanner_state_t
{
52 * imv_state_t interface
54 imv_state_t interface
;
57 * Set state of the handshake
59 * @param new_state the handshake state of IMV
61 void (*set_handshake_state
)(imv_scanner_state_t
*this,
62 imv_scanner_handshake_state_t new_state
);
65 * Get state of the handshake
67 * @return the handshake state of IMV
69 imv_scanner_handshake_state_t (*get_handshake_state
)(imv_scanner_state_t
*this);
72 * Store an IETF Port Filter attribute for later evaluation
74 * @param attr IETF Port Filter attribute
76 void (*set_port_filter_attr
)(imv_scanner_state_t
*this,
77 ietf_attr_port_filter_t
*attr
);
80 * Get the stored IETF Port Filter attribute
82 * @return IETF Port Filter attribute
84 ietf_attr_port_filter_t
* (*get_port_filter_attr
)(imv_scanner_state_t
*this);
87 * add a violating TCP or UDP port
89 void (*add_violating_port
)(imv_scanner_state_t
*this, char *port
);
93 * Create an imv_scanner_state_t instance
95 * @param id connection ID
97 imv_state_t
* imv_scanner_state_create(TNC_ConnectionID id
);
99 #endif /** IMV_SCANNER_STATE_H_ @}*/