3 //! @brief snmpagent dispatch header
5 // Copyright (C) 2008 NTT COMWARE Corporation.
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef L7AG_DISPATCHER_H
12 #define L7AG_DISPATCHER_H
16 #include "lockedqueue.h"
17 #include "QueueContainer.h"
19 #include "parameter.h"
22 #include <boost/function.hpp>
23 #include <boost/bind.hpp>
25 //! messagequeue typedef
26 typedef lockedqueue<QueueContainer> MessageQueue;
28 typedef lockedqueue<trapdata> TrapQueue;
31 //! @class l7ag_dispatcher
32 //! @brief message dispatch class
37 bool stop_flag; //! stopping flag
38 pthread_t dispatch_thread; //! dispatch thread id
40 MessageQueue *message_que; //! message queue object pointer
41 TrapQueue *trap_que; //! trap queue object pointer
43 size_t msg_size; //! message size
44 char *msg; //! message pointer
45 size_t msg_pos; //! message posision
47 std::map< int, boost::function<void (void *)> > dispatch_functions;
52 static void *run(void *);
54 void dispatch_message();
55 void process_setting_command(void *);
56 void process_trap_request(void *);
57 void process_mib_collect_response_vs(void *);
58 void process_mib_collect_response_rs(void *);
60 void change_loglevel(unsigned long long , unsigned long long);
61 void reload_configure();
62 void init_dispatcher_function_map();
65 l7ag_dispatcher(MessageQueue *, TrapQueue *);
71 MessageQueue *get_MessageQueue() {
74 TrapQueue *get_TrapQueue() {
79 #endif //__L7AG_DISPATCHER_H__