Gentoo Archives: gentoo-commits

From: "Chi-Thanh Christopher Nguyen (chithanh)" <chithanh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-voip/gnugk/files: gnugk-3.4-ptrace.patch
Date: Tue, 01 Oct 2013 15:21:07
Message-Id: 20131001152103.DC8152004C@flycatcher.gentoo.org
1 chithanh 13/10/01 15:21:03
2
3 Added: gnugk-3.4-ptrace.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.1/cvs/Linux x86_64, unsigned Manifest commit)
8
9 Revision Changes Path
10 1.1 net-voip/gnugk/files/gnugk-3.4-ptrace.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-voip/gnugk/files/gnugk-3.4-ptrace.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-voip/gnugk/files/gnugk-3.4-ptrace.patch?rev=1.1&content-type=text/plain
14
15 Index: gnugk-3.4-ptrace.patch
16 ===================================================================
17 diff -ur a/capctrl.cxx b/capctrl.cxx
18 --- a/capctrl.cxx 2011-11-28 13:33:41.000000000 +0100
19 +++ b/capctrl.cxx 2013-10-01 13:20:47.712492425 +0200
20 @@ -255,6 +255,7 @@
21 m_cliCallVolumes = cliCallVolumes;
22
23 PTRACE(5, "CAPCTRL\t" << ipRules << " IP rules loaded");
24 +#if PTRACING
25 if (PTrace::CanTrace(6)) {
26 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
27 strm << "Per IP call volume rules:" << endl;
28 @@ -264,8 +265,10 @@
29 }
30 PTrace::End(strm);
31 }
32 +#endif
33
34 PTRACE(5, "CAPCTRL\t" << h323IdRules << " H.323 ID rules loaded");
35 +#if PTRACING
36 if (PTrace::CanTrace(6)) {
37 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
38 strm << "Per H.323 ID call volume rules:" << endl;
39 @@ -275,8 +278,10 @@
40 }
41 PTrace::End(strm);
42 }
43 +#endif
44
45 PTRACE(5, "CAPCTRL\t" << cliRules << " CLI rules loaded");
46 +#if PTRACING
47 if (PTrace::CanTrace(6)) {
48 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
49 strm << "Per CLI call volume rules:" << endl;
50 @@ -286,6 +291,7 @@
51 }
52 PTrace::End(strm);
53 }
54 +#endif
55 }
56
57 PString CapacityControl::PrintRules()
58 diff -ur a/clirw.cxx b/clirw.cxx
59 --- a/clirw.cxx 2013-09-02 21:57:18.000000000 +0200
60 +++ b/clirw.cxx 2013-10-01 13:20:47.713492425 +0200
61 @@ -458,6 +458,7 @@
62 }
63
64 PTRACE(5, "CLIRW\t" << inboundRules << " inbound rules loaded");
65 +#if PTRACING
66 if (PTrace::CanTrace(6)) {
67 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
68 strm << "Inbound CLI rewrite rules:" << endl;
69 @@ -468,8 +469,10 @@
70 }
71 PTrace::End(strm);
72 }
73 +#endif
74
75 PTRACE(5, "CLIRW\t" << outboundRules << " outbound rules loaded");
76 +#if PTRACING
77 if (PTrace::CanTrace(6)) {
78 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
79 strm << "Outbound CLI rewrite rules:" << endl;
80 @@ -482,6 +485,7 @@
81 }
82 PTrace::End(strm);
83 }
84 +#endif
85
86 m_processSourceAddress = Toolkit::AsBool(cfg->GetString(CLIRewriteSection, ProcessSourceAddress, "1"));
87 m_removeH323Id = Toolkit::AsBool(cfg->GetString(CLIRewriteSection, RemoveH323Id, "1"));
88 diff -ur a/gkacct.cxx b/gkacct.cxx
89 --- a/gkacct.cxx 2013-07-31 15:03:07.000000000 +0200
90 +++ b/gkacct.cxx 2013-10-01 13:20:47.714492425 +0200
91 @@ -924,6 +924,7 @@
92 switch (status)
93 {
94 case GkAcctLogger::Ok:
95 +#if PTRACING
96 if (PTrace::CanTrace(3)) {
97 ostream& strm = PTrace::Begin(3,__FILE__,__LINE__);
98 strm << "GKACCT\t" << logger->GetName() << " logged event " << evt;
99 @@ -931,9 +932,11 @@
100 strm << " for call no. " << call->GetCallNumber();
101 PTrace::End(strm);
102 }
103 +#endif
104 break;
105
106 default:
107 +#if PTRACING
108 if (PTrace::CanTrace(3)) {
109 ostream& strm = PTrace::Begin(3, __FILE__, __LINE__);
110 strm << "GKACCT\t" << logger->GetName() << " failed to log event " << evt;
111 @@ -942,6 +945,7 @@
112 strm << " for call no. " << call->GetCallNumber();
113 PTrace::End(strm);
114 }
115 +#endif
116 // required and sufficient rules always determine
117 // status of the request
118 if (logger->GetControlFlag() == GkAcctLogger::Required
119 @@ -959,7 +963,8 @@
120 // a last rule determine status of the the request
121 if (finalResult && status != GkAcctLogger::Ok)
122 finalResult = false;
123 -
124 +
125 +#if PTRACING
126 if (PTrace::CanTrace(2)) {
127 ostream& strm = PTrace::Begin(2, __FILE__, __LINE__);
128 strm << "GKACCT\t" << (finalResult ? "Successfully logged event "
129 @@ -972,6 +977,7 @@
130 SNMP_TRAP(7, SNMPError, Accounting, "Failed to log event " + PString(PString::Unsigned, evt));
131 #endif
132 }
133 +#endif
134 return finalResult;
135 }
136
137 @@ -994,6 +1000,7 @@
138 switch (status)
139 {
140 case GkAcctLogger::Ok:
141 +#if PTRACING
142 if (PTrace::CanTrace(3)) {
143 ostream& strm = PTrace::Begin(3,__FILE__,__LINE__);
144 strm << "GKACCT\t" << logger->GetName() << " logged event " << evt;
145 @@ -1001,9 +1008,11 @@
146 strm << " for endpoint " << ep->GetEndpointIdentifier().GetValue();
147 PTrace::End(strm);
148 }
149 +#endif
150 break;
151
152 default:
153 +#if PTRACING
154 if (PTrace::CanTrace(3)) {
155 ostream& strm = PTrace::Begin(3, __FILE__, __LINE__);
156 strm << "GKACCT\t" << logger->GetName() << " failed to log event " << evt;
157 @@ -1012,6 +1021,7 @@
158 PTrace::End(strm);
159 SNMP_TRAP(7, SNMPError, Accounting, logger->GetName() + " failed to log event " + PString(evt));
160 }
161 +#endif
162 // required and sufficient rules always determine
163 // status of the request
164 if (logger->GetControlFlag() == GkAcctLogger::Required
165 @@ -1030,6 +1040,7 @@
166 if (finalResult && status != GkAcctLogger::Ok)
167 finalResult = false;
168
169 +#if PTRACING
170 if (PTrace::CanTrace(2)) {
171 ostream& strm = PTrace::Begin(2, __FILE__, __LINE__);
172 strm << "GKACCT\t" << (finalResult ? "Successfully logged event "
173 @@ -1042,6 +1053,7 @@
174 SNMP_TRAP(7, SNMPError, Accounting, "Failed to log event " + PString(PString::Unsigned, evt));
175 #endif
176 }
177 +#endif
178 return finalResult;
179 }
180
181 diff -ur a/gk.cxx b/gk.cxx
182 --- a/gk.cxx 2013-09-19 15:27:22.000000000 +0200
183 +++ b/gk.cxx 2013-10-01 13:20:47.715492425 +0200
184 @@ -1212,9 +1212,11 @@
185 bool Gatekeeper::InitLogging(const PArgList & args)
186 {
187 // Syslog is the default when compiled as service, but we don't want that
188 +#if PTRACING
189 PTrace::ClearOptions(PTrace::SystemLogStream);
190 PTrace::SetOptions(PTrace::DateAndTime | PTrace::TraceLevel | PTrace::FileAndLine);
191 PTrace::SetLevel(args.GetOptionCount('t'));
192 +#endif
193 if (args.HasOption('o')) {
194 if (!SetLogFilename(args.GetOptionString('o'))) {
195 cerr << "Warning: could not open the log file \""
196 @@ -1717,7 +1719,9 @@
197 EnableLogFileRotation(false);
198 }
199
200 +#if PTRACING
201 PTrace::SetStream(&cerr);
202 +#endif
203
204 #ifndef hasDeletingSetStream
205 delete m_logFile;
206 @@ -1732,7 +1736,9 @@
207 return false;
208 }
209 m_logFile->SetPosition(0, PFile::End);
210 +#if PTRACING
211 PTrace::SetStream(m_logFile);
212 +#endif
213 return true;
214 }
215
216 @@ -1742,7 +1748,9 @@
217
218 if (m_logFile) {
219 PTRACEX(1, "GK\tLogging closed (log file rotation)");
220 +#if PTRACING
221 PTrace::SetStream(&cerr); // redirect to cerr
222 +#endif
223 #ifndef hasDeletingSetStream
224 delete m_logFile;
225 #endif
226 @@ -1779,7 +1787,9 @@
227 }
228
229 m_logFile->SetPosition(0, PFile::End);
230 +#if PTRACING
231 PTrace::SetStream(m_logFile);
232 +#endif
233 PTRACEX(1, "GK\tLogging restarted\n" + Toolkit::GKVersion());
234 return true;
235 }
236 @@ -1790,7 +1800,9 @@
237
238 if (m_logFile) {
239 PTRACEX(1, "GK\tLogging closed (reopen log file)");
240 +#if PTRACING
241 PTrace::SetStream(&cerr); // redirect to cerr
242 +#endif
243 #ifndef hasDeletingSetStream
244 delete m_logFile;
245 #endif
246 @@ -1819,7 +1831,9 @@
247 }
248 }
249 m_logFile->SetPosition(0, PFile::End);
250 +#if PTRACING
251 PTrace::SetStream(m_logFile);
252 +#endif
253 PTRACEX(1, "GK\tLogging restarted\n" + Toolkit::GKVersion());
254 return true;
255 }
256 @@ -1831,7 +1845,9 @@
257 if (m_logFile) {
258 PTRACEX(1, "GK\tLogging closed");
259 }
260 +#if PTRACING
261 PTrace::SetStream(&cerr);
262 +#endif
263 #ifndef hasDeletingSetStream
264 delete m_logFile;
265 #endif
266 diff -ur a/GkStatus.cxx b/GkStatus.cxx
267 --- a/GkStatus.cxx 2013-09-12 12:51:56.000000000 +0200
268 +++ b/GkStatus.cxx 2013-10-01 13:20:47.716492425 +0200
269 @@ -1327,6 +1327,7 @@
270 );
271 } else {
272 if (args[1] *= "trc") {
273 +#if PTRACING
274 if(args.GetSize() >= 3) {
275 if((args[2] == "-") && (PTrace::GetLevel() > 0))
276 PTrace::SetLevel(PTrace::GetLevel()-1);
277 @@ -1335,6 +1336,7 @@
278 else PTrace::SetLevel(args[2].AsInteger());
279 }
280 WriteString(PString(PString::Printf, "Trace Level is now %d\r\n", PTrace::GetLevel()));
281 +#endif
282 } else if (args[1] *= "cfg") {
283 if (args.GetSize()>=4)
284 WriteString(GkConfig()->GetString(args[2],args[3],"") + "\r\n;\r\n");
285 diff -ur a/ipauth.cxx b/ipauth.cxx
286 --- a/ipauth.cxx 2013-08-03 14:26:19.000000000 +0200
287 +++ b/ipauth.cxx 2013-10-01 13:20:47.716492425 +0200
288 @@ -230,6 +230,7 @@
289
290 PTRACE(5, GetName() << "\t" << m_authList.size() << " entries loaded");
291
292 +#if PTRACING
293 if (PTrace::CanTrace(6)) {
294 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
295 strm << GetName() << " entries:\n";
296 @@ -242,6 +243,7 @@
297 }
298 PTrace::End(strm);
299 }
300 +#endif
301
302 if (dynamicCfg) {
303 delete cfg;
304 diff -ur a/ProxyChannel.cxx b/ProxyChannel.cxx
305 --- a/ProxyChannel.cxx 2013-09-19 18:53:07.000000000 +0200
306 +++ b/ProxyChannel.cxx 2013-10-01 13:34:34.499541266 +0200
307 @@ -1741,7 +1741,7 @@
308
309 m_result = Forwarding;
310
311 -#ifdef HAS_H46017
312 +#if defined(HAS_H46017) && PTRACING
313 // only show full decode of H.460.26 RTP when level 7 trace is active
314 if (m_h46017Enabled && m_maintainConnection && (q931pdu->GetMessageType() == Q931::InformationMsg) && !PTrace::CanTrace(7)) {
315 // don't print Info message
316 diff -ur a/RasSrv.cxx b/RasSrv.cxx
317 --- a/RasSrv.cxx 2013-08-29 11:42:09.000000000 +0200
318 +++ b/RasSrv.cxx 2013-10-01 13:20:47.717492425 +0200
319 @@ -245,6 +245,7 @@
320 delete msg;
321 return NULL;
322 }
323 +#if PTRACING
324 if ((msg->GetTag() != H225_RasMessage::e_serviceControlIndication && msg->GetTag() != H225_RasMessage::e_serviceControlResponse)
325 || PTrace::CanTrace(5)) {
326 if (PTrace::CanTrace(3))
327 @@ -252,17 +253,20 @@
328 else
329 PTRACE(2, "RAS\tReceived " << msg->GetTagName() << " from " << AsString(msg->m_peerAddr, msg->m_peerPort));
330 }
331 +#endif
332 msg->m_localAddr = GetLocalAddr(msg->m_peerAddr);
333 return msg;
334 }
335
336 bool RasListener::SendRas(const H225_RasMessage & rasobj, const Address & addr, WORD pt)
337 {
338 +#if PTRACING
339 if ( ((rasobj.GetTag() != H225_RasMessage::e_serviceControlIndication && rasobj.GetTag() != H225_RasMessage::e_serviceControlResponse) && PTrace::CanTrace(3))
340 || PTrace::CanTrace(5))
341 PTRACE(3, "RAS\tSend to " << AsString(addr, pt) << '\n' << setprecision(2) << rasobj);
342 else
343 PTRACE(2, "RAS\tSend " << RasName[rasobj.GetTag()] << " to " << AsString(addr, pt));
344 +#endif
345
346 PPER_Stream wtstrm;
347 rasobj.Encode(wtstrm);
348 diff -ur a/RasTbl.cxx b/RasTbl.cxx
349 --- a/RasTbl.cxx 2013-09-12 12:51:57.000000000 +0200
350 +++ b/RasTbl.cxx 2013-10-01 13:20:47.719492425 +0200
351 @@ -1950,6 +1950,7 @@
352 endpoints->push_back(routes.front().m_destEndpoint.operator->());
353 }
354
355 +#if PTRACING
356 if (PTrace::CanTrace(4)) {
357 ostream &strm = PTrace::Begin(4, __FILE__, __LINE__);
358 strm << "RASTBL\tPrefix match for gateways: ";
359 @@ -1960,6 +1961,7 @@
360 }
361 PTrace::End(strm);
362 }
363 +#endif
364
365 return true;
366 }
367 diff -ur a/Routing.cxx b/Routing.cxx
368 --- a/Routing.cxx 2013-04-11 07:10:34.000000000 +0200
369 +++ b/Routing.cxx 2013-10-01 13:20:47.719492425 +0200
370 @@ -1465,6 +1465,7 @@
371 PTRACE(5, "ROUTING\t" << m_name << " policy loaded with " << m_prefixes.size()
372 << " prefix entries");
373
374 +#if PTRACING
375 if (PTrace::CanTrace(6)) {
376 ostream &strm = PTrace::Begin(6, __FILE__, __LINE__);
377 strm << "ROUTING\t" << m_name << " policy prefixes:" << endl;
378 @@ -1474,6 +1475,7 @@
379 << m_prefixes[i].m_maxLength << endl;
380 PTrace::End(strm);
381 }
382 +#endif
383 }
384
385 bool NumberAnalysisPolicy::OnRequest(AdmissionRequest & request)
386 diff -ur a/Toolkit.cxx b/Toolkit.cxx
387 --- a/Toolkit.cxx 2013-09-10 17:49:47.000000000 +0200
388 +++ b/Toolkit.cxx 2013-10-01 13:20:47.720492425 +0200
389 @@ -1025,6 +1025,7 @@
390 return;
391 }
392
393 +#if PTRACING
394 if (PTrace::CanTrace(3) && (m_GWRewrite.GetSize() < 100)) {
395 for (PINDEX i = 0; i < m_GWRewrite.GetSize(); ++i) {
396 // In
397 @@ -1038,6 +1039,7 @@
398 }
399 }
400 }
401 +#endif
402 PTRACE(2, "GK\tLoaded " << m_GWRewrite.GetSize() << " GW entries with rewrite info");
403 }
404
405 @@ -1727,7 +1729,9 @@
406 // read the gatekeeper name from the config file, because it might be used as a key into the SQL config
407 m_GKName = Config()->GetString("Name", "OpenH323GK");
408
409 +#if PTRACING
410 PTrace::SetLevel(GkConfig()->GetInteger("TraceLevel", PTrace::GetLevel()));
411 +#endif
412
413 // set the max size of an array in an ASN encoded message (eg. max length of alias list)
414 PINDEX maxArraySize = GkConfig()->GetInteger("MaxASNArraySize", 0);
415 diff -ur a/yasocket.cxx b/yasocket.cxx
416 --- a/yasocket.cxx 2013-09-04 18:11:57.000000000 +0200
417 +++ b/yasocket.cxx 2013-10-01 13:20:47.720492425 +0200
418 @@ -1026,10 +1026,12 @@
419 return false;
420 }
421 ConfigReloadMutex.StartRead();
422 +#if PTRACING
423 if (PTrace::CanTrace(6)) {
424 PString msg(PString::Printf, "\t%u sockets selected from %u, total %u/%u", slist.GetSize(), ss, m_socksize, m_rmsize);
425 PTRACE(6, GetName() << msg);
426 }
427 +#endif
428 return true;
429 }