5 #include <boost/shared_ptr.hpp>
6 #include "error_code.h"
7 #include "l7vs_command.h"
8 #include "command_receiver.h"
9 #include "virtualservice_element.h"
11 #include "parameter.h"
12 #include "replication_stub.h"
17 typedef std::list< virtualservice_element > vselist_type; //!< virtual service element list typedef
19 typedef std::list< std::pair<LOG_CATEGORY_TAG, LOG_LEVEL_TAG> > logstatus_list_type; //!< logstatus list typedef
21 static bool list_vs_called;
22 static bool list_vs_v_called;
23 static bool add_vs_called;
24 static bool del_vs_called;
25 static bool edit_vs_called;
26 static bool add_rs_called;
27 static bool del_rs_called;
28 static bool edit_rs_called;
29 static bool flush_vs_called;
30 static bool rep_cmd_called;
31 static bool set_loglevel_called;
32 static bool snmp_set_loglevel_called;
33 static bool param_called;
35 static bool list_vs_fail;
36 static bool list_vs_v_fail;
37 static bool add_vs_fail;
38 static bool del_vs_fail;
39 static bool edit_vs_fail;
40 static bool add_rs_fail;
41 static bool del_rs_fail;
42 static bool edit_rs_fail;
43 static bool flush_vs_fail;
44 static bool rep_cmd_fail;
45 static bool set_loglevel_fail;
46 static bool snmp_set_loglevel_fail;
47 static bool param_fail;
50 void list_virtual_service( vselist_type*, error_code& err )
52 list_vs_called = true;
53 if(list_vs_fail) err.setter( true, "");
55 void list_virtual_service_verbose( l7vsd_response*, error_code& err )
57 list_vs_v_called = true;
58 if(list_vs_v_fail) err.setter( true, "");
60 void add_virtual_service( const virtualservice_element*, error_code& err )
63 if(add_vs_fail) err.setter( true, "");
65 void del_virtual_service( const virtualservice_element*, error_code& err )
68 if(del_vs_fail) err.setter( true, "");
70 void edit_virtual_service( const virtualservice_element*, error_code& err )
72 edit_vs_called = true;
73 if(edit_vs_fail) err.setter( true, "");
76 void add_real_server( const virtualservice_element*, error_code& err )
79 if(add_rs_fail) err.setter( true, "");
81 void del_real_server( const virtualservice_element*, error_code& err )
84 if(del_rs_fail) err.setter( true, "");
86 void edit_real_server( const virtualservice_element*, error_code& err )
88 edit_rs_called = true;
89 if(edit_rs_fail) err.setter( true, "");
92 void flush_virtual_service( error_code& err )
94 flush_vs_called = true;
95 if(flush_vs_fail) err.setter( true, "");
98 void replication_command( const l7vsadm_request::REPLICATION_COMMAND_TAG*, error_code& err )
100 rep_cmd_called = true;
101 if(rep_cmd_fail) err.setter( true, "");
103 void set_loglevel( const LOG_CATEGORY_TAG*, const LOG_LEVEL_TAG*, error_code& err )
105 set_loglevel_called = true;
106 if(set_loglevel_fail) err.setter( true, "");
108 void snmp_set_loglevel( const LOG_CATEGORY_TAG*, const LOG_LEVEL_TAG*, error_code& err )
110 snmp_set_loglevel_called = true;
111 if(snmp_set_loglevel_fail) err.setter( true, "");
113 void reload_parameter( const PARAMETER_COMPONENT_TAG*, error_code& err )
116 if(param_fail) err.setter( true, "");