OSDN Git Service

Merge DHC codes
[ultramonkey-l7/ultramonkey-l7-v3.git] / snmpagent / interproccom.cpp
1
2 #include "interproccom.h"
3 #include "subagent.h"
4
5
6 #define SCOPED_LOCK(m)                                                  \
7   pthread_mutex_lock(&m); /* エラー処理は略 */                          \
8   void u_(pthread_mutex_t** m_) { pthread_mutex_unlock(*m_); }          \
9   __attribute__((__cleanup__(u_))) pthread_mutex_t* scoped_lock_ = &m
10
11
12 /*!
13  *
14  */
15 l7ag_interproccommunicate::l7ag_interproccommunicate()
16 {
17         status    = STOP;
18         stop_flag = false;
19
20         pthread_mutex_init(&mutex_sbuf, NULL);
21         pthread_mutex_init(&mutex_rbuf, NULL);
22 }
23
24
25 /*!
26  *
27  */
28 l7ag_interproccommunicate::l7ag_interproccommunicate(l7ag_subagent *p_subagent)
29 {
30         status    = STOP;
31         stop_flag = false;
32
33         pthread_mutex_init(&mutex_sbuf, NULL);
34         pthread_mutex_init(&mutex_rbuf, NULL);
35
36         set_parent(p_subagent);
37 }
38
39
40 /*!
41  *
42  */
43 l7ag_interproccommunicate::~l7ag_interproccommunicate()
44 {
45
46
47 }
48
49
50 /*!
51  *
52  */
53 void
54 l7ag_interproccommunicate::start_thread()
55 {
56
57
58 }
59
60
61 /*!
62  *
63  */
64 void
65 l7ag_interproccommunicate::send_mibdatacollect(std::string oid)
66 {
67         //make request message
68
69 }
70
71
72 /*!
73  *
74  */
75 void
76 l7ag_interproccommunicate::set_parent(l7ag_subagent *p_subagent)
77 {
78         parent = p_subagent;
79 }
80
81
82 /*!
83  *
84  */
85 void *
86 l7ag_interproccommunicate::do_communicate(void *args)
87 {
88         l7ag_interproccommunicate    *proccom = (l7ag_interproccommunicate *)args;
89         //initialize
90
91         while (1) {
92                 //recv
93                 //send
94                 //stop
95                 if (proccom->getStopFlag()) {
96                         //
97                 }
98         }
99         //finalize
100 }
101
102
103 /*!
104  *
105  */
106 void
107 l7ag_interproccommunicate::setRequestMessage()
108 {
109 }
110