OSDN Git Service

Change filename again...
[ultramonkey-l7/ultramonkey-l7-v3.git] / snmpagent / interproccom.h
1 #ifndef __INTERPROCCOM_H__
2 #define __INTERPROCCOM_H__
3
4 #include <string>
5 #include <pthread.h>
6
7 #include "l7ag_socket.h"
8 #include "tag_threadstat.h"
9 #include "dispatch_message.h"
10 #include "store_mibdata.h"
11
12 class    l7ag_subagent;
13
14 class    l7ag_interproccommunicate : public l7ag_socket
15 {
16 private:
17         l7ag_subagent     *parent;
18         THREAD_STAT_TAG    status;
19         bool        stop_flag;
20
21         pthread_mutex_t    mutex_sbuf;
22         pthread_mutex_t    mutex_rbuf;
23         char     *buffer_send;
24         char     *buffer_recv;
25
26 protected:
27         l7ag_interproccommunicate();
28
29         static    void     *do_communicate(void *args);
30
31 public:
32         l7ag_interproccommunicate(l7ag_subagent *p_subagent);
33         ~l7ag_interproccommunicate();
34
35         void    set_parent(l7ag_subagent *p_subagent);
36
37         void    start_thread();
38         void    stop_thread() {
39                 stop_flag = true;
40         }
41
42         void    send_mibdatacollect(std::string oid);
43         bool    getStopFlag() {
44                 return stop_flag;
45         }
46         void    setRequestMessage();
47 };
48
49 #endif //__INTERPROCCOM_H__
50