~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to plugins/globals-structtypes.xml

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2005-01-30 21:59:13 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050130215913-xc3ke963bw49b3k4
Tags: 2:3.0-5
* Updated README.Debian file so users will understand what to do at
  install, closes: #291794, #287802.
* Updated ntop init script to give better output.
* Also changed log directory from /var/lib/ntop to /var/log/ntop,
  closes: #252352.
* Quoted the interface list to allow whitespace, closes: #267248.
* Added a couple of logcheck ignores, closes: #269321, #269319.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
3
 *                          http://www.ntop.org
 
4
 *
 
5
 * Copyright (C) 1998-2004 Luca Deri <deri@ntop.org>
 
6
 *
 
7
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software Foundation,
 
21
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
22
 */
 
23
 
 
24
/* ************************************************************* */
 
25
 
 
26
typedef struct simpleProtoTrafficInfo {
 
27
  TrafficCounter local, local2remote, remote, remote2local;
 
28
  TrafficCounter lastLocal, lastLocal2remote, lastRem, lastRem2local;
 
29
} SimpleProtoTrafficInfo;
 
30
/*XMLSECTIONBEGIN xml_s_simpleprototrafficinfo.inc parent input */
 
31
/*XML e      SimpleProtoTrafficInfo         parent:Work            "" */
 
32
/*XML trafficcounter local                          Work                   "" */
 
33
/*XML trafficcounter local2remote                   Work                   "" */
 
34
/*XML trafficcounter remote                         Work                   "" */
 
35
/*XML trafficcounter remote2local                   Work                   "" */
 
36
/*XML trafficcounter lastLocal                      Work                   "" */
 
37
/*XML trafficcounter lastLocal2remote               Work                   "" */
 
38
/*XML trafficcounter lastRem                        Work                   "" */
 
39
/*XML trafficcounter lastRem2local                  Work                   "" */
 
40
/*XMLSECTIONEND */
 
41
 
 
42
// NtopInterface
 
43
/*XMLSECTIONBEGIN xml_s_ntopinterface.inc parent input */
 
44
/*XMLNOTE - use parent, not work, because the parent node is defined in g_intf.inc */
 
45
/*XML s              name                 parent        "" */
 
46
/*XML s              humanFriendlyName    parent        "" */
 
47
/*XML h              flags                parent        "status of the interface" */
 
48
/*XML h              addr                 parent        "" */
 
49
/*XML s              ipdot                parent        "" */
 
50
/*XML s              fqdn                 parent        "" */
 
51
 
 
52
/*XML in_addr        network              parent        "" */
 
53
/*XML in_addr        netmask              parent        "" */
 
54
/*XML n:u            numHosts             parent        "" */
 
55
/*XML in_addr        ifAddr               parent        "" */
 
56
/*XML time_t         started              parent        "" */
 
57
/*XML time_t         firstpkt             parent        "" */
 
58
/*XML time_t         lastpkt              parent        "" */
 
59
 
 
60
/*XMLNOTE TODO pcap_t *pcapPtr; */
 
61
/*XMLNOTE TODO pcap_dumper_t *pcapDumper; */
 
62
/*XMLNOTE TODO pcap_dumper_t *pcapErrDumper */
 
63
/*XMLNOTE TODO pcap_dumper_t *pcapOtherDumper */
 
64
 
 
65
/*XML b              virtualDevice        parent        "" */
 
66
/*XML b              dummyDevice          parent        "" */
 
67
/*XML n              snaplen              parent        "" */
 
68
/*XML h              datalink             parent        "" */
 
69
/*XML s              filter               parent        "" */
 
70
/*XML n              fd                   parent        "" */
 
71
 
 
72
/*XML e              packetStats          parent:Work   "" */
 
73
/*XML trafficcounter receivedPkts         Work          "" */
 
74
/*XML trafficcounter droppedPkts          Work          "" */
 
75
/*XML trafficcounter ethernetPkts         Work          "" */
 
76
/*XML trafficcounter broadcastPkts        Work          "" */
 
77
/*XML trafficcounter multicastPkts        Work          "" */
 
78
/*XML trafficcounter ipPkts               Work          "" */
 
79
/*XML trafficcounter lastMinEthernetPkts  Work          "" */
 
80
/*XML trafficcounter lastFiveMinsEthernetPkts  Work     "" */
 
81
/*XML trafficcounter lastNumEthernetPkts  Work          "" */
 
82
/*XML trafficcounter lastEthernetPkts     Work          "" */
 
83
/*XML trafficcounter lastTotalPkts        Work          "" */
 
84
/*XML trafficcounter lastBroadcastPkts    Work          "" */
 
85
/*XML trafficcounter lastMulticastPkts    Work          "" */
 
86
 
 
87
/*XML e              byteStats            parent:Work   "" */
 
88
/*XML trafficcounter ethernetBytes        Work          "" */
 
89
/*XML trafficcounter ipBytes              Work          "" */
 
90
/*XML trafficcounter fragmentedIpBytes    Work          "" */
 
91
/*XML trafficcounter tcpBytes             Work          "" */
 
92
/*XML trafficcounter udpBytes             Work          "" */
 
93
/*XML trafficcounter otherIpBytes         Work          "" */
 
94
/*XML trafficcounter icmpBytes            Work          "" */
 
95
/*XML trafficcounter dlcBytes             Work          "" */
 
96
/*XML trafficcounter ipxBytes             Work          "" */
 
97
/*XML trafficcounter stpBytes             Work          "" */
 
98
/*XML trafficcounter decnetBytes          Work          "" */
 
99
/*XML trafficcounter netbiosBytes         Work          "" */
 
100
/*XML trafficcounter arpRarpBytes         Work          "" */
 
101
/*XML trafficcounter atalkBytes           Work          "" */
 
102
/*XML trafficcounter egpBytes             Work          "" */
 
103
/*XML trafficcounter osiBytes             Work          "" */
 
104
/*XML trafficcounter ipv6Bytes            Work          "" */
 
105
/*XML trafficcounter otherBytes           Work          "" */
 
106
/*XML trafficcounter lastMinEthernetBytes Work          "" */
 
107
/*XML trafficcounter lastFiveMinsEthernetBytes Work     "" */
 
108
/*XML trafficcounter lastEthernetBytes    Work          "" */
 
109
/*XML trafficcounter lastIpBytes          Work          "" */
 
110
/*XML trafficcounter lastNonIpBytes       Work          "" */
 
111
 
 
112
/*XMLNOTE TODO PortCounter    *ipPorts[MAX_IP_PORT]; */
 
113
 
 
114
/*XML &packetstats   rcvdPktStats         parent        "" */
 
115
/*XML &ttlstats      rcvdPktTTLStats      parent        "" */
 
116
 
 
117
/*XML e              throughputStats      parent:Work   "" */
 
118
/*XML n:f            peakThroughput       Work          "" */
 
119
/*XML n:f            actualThpt           Work          "" */
 
120
/*XML n:f            lastMinThpt          Work          "" */
 
121
/*XML n:f            lastFiveMinsThpt     Work          "" */
 
122
/*XML n:f            peakPacketThroughput Work          "" */
 
123
/*XML n:f            actualPktsThpt       Work          "" */
 
124
/*XML n:f            lastMinPktsThpt      Work          "" */
 
125
/*XML n:f            lastFiveMinsPktsThpt Work          "" */
 
126
/*XML time_t         lastThptUpdate       Work          "" */
 
127
/*XML time_t         lastMinThptUpdate    Work          "" */
 
128
/*XML time_t         lastHourThptUpdate   Work          "" */
 
129
/*XML time_t         lastFiveMinsThptUpdate Work        "" */
 
130
/*XML n:f            throughput           Work          "" */
 
131
/*XML n:f            packetThroughput     Work          "" */
 
132
/*XML n:u            numThptSamples       Work          "" */
 
133
/*XML e              last60MinutesThpt    Work:Work2    "" */
 
134
/*XML n:u            last60MinutesThptIdx Work2         "" */
 
135
/*XMLFOR indexT 0 59 <= */
 
136
/*XML *              indexT               Work2:Work3   "" 
 
137
  if (snprintf(buf, sizeof(buf), "%d", indexT) < 0) BufferTooShort();
 
138
  elWork3 = newxml_simplestring(elWork2,
 
139
  "index",
 
140
  buf,
 
141
  "");
 
142
  XML*/
 
143
/*XMLIF input->last60MinutesThpt[indexT].trafficValue != 0.0 */
 
144
/*XML &thptentry     last60MinutesThpt[indexT] Work3         "" */
 
145
/*XMLFI */
 
146
/*XMLROF*/
 
147
/*XML e              last24HoursThpt      Work:Work2    "" */
 
148
/*XML n:u            last24HoursThptIdx   Work2         "" */
 
149
/*XMLFOR indexT 0 23 <= */
 
150
/*XML *              indexT               Work2:Work3   "" 
 
151
  if (snprintf(buf, sizeof(buf), "%d", indexT) < 0) BufferTooShort();
 
152
  elWork3 = newxml_simplestring(elWork2,
 
153
  "index",
 
154
  buf,
 
155
  "");
 
156
  XML*/
 
157
/*XMLIF input->last24HoursThpt[indexT].trafficValue != 0.0 */
 
158
/*XML &thptentry     last24HoursThpt[indexT] Work3         "" */
 
159
/*XMLFI */
 
160
/*XMLROF*/
 
161
/*XML e              last30daysThpr       Work:Work2    "" */
 
162
/*XML n:u            last30daysThptIdx    Work2         "" */
 
163
/*XMLFOR indexT 0 29 <= */
 
164
/*XMLIF input->last30daysThpt[indexT] != 0.0 */
 
165
/*XML *              indexT               Work2         "" 
 
166
  if (snprintf(buf, sizeof(buf), "%d", indexT) < 0) BufferTooShort();
 
167
  if (snprintf(buf2, sizeof(buf2), "%f", input->last30daysThpt[indexT]) < 0) BufferTooShort();
 
168
  newxml_simplestring(elWork2,
 
169
  "index",
 
170
  buf,
 
171
  "");
 
172
  XML*/
 
173
/*XMLFI*/
 
174
/*XMLROF*/
 
175
 
 
176
/*XML e              protocolStats        parent:Work   "" */
 
177
/*XML e              tcp                  Work:Work2    "" */
 
178
/*XML &simpleprototrafficinfo tcpGlobalTrafficStats  Work2 "" */
 
179
/*XML e              udp                  Work:Work2    "" */
 
180
/*XML &simpleprototrafficinfo udpGlobalTrafficStats  Work2 "" */
 
181
/*XML e              icmp                 Work:Work2    "" */
 
182
/*XML &simpleprototrafficinfo icmpGlobalTrafficStats Work2 "" */
 
183
/*XMLFOR iProtoIndex 0 myGlobals.numIpProtosToMonitor */
 
184
/*XMLPREFIX myGlobals */
 
185
/*XML s                      protoIPTrafficInfos[iProtoIndex]!ipprotocol Work:Work2 "" */
 
186
/*XMLPREFIX input */
 
187
/*XML &simpleprototrafficinfo ipProtoStats[iProtoIndex] Work2 "" */
 
188
/*XMLROF */
 
189
 
 
190
/*XML trafficcounter numEstablishedTCPConnections parent "" */
 
191
 
 
192
/*XML n:u            hostsno              parent        "" */
 
193
/*XML n:u            actualHashSize       parent        "" */
 
194
 
 
195
/*XMLNOTE Special handling for the big sub-structures */
 
196
/*XMLNOTE ipSession ... */
 
197
/*XMLNOTE ipTrafficMatrix ... */
 
198
/*XMLNOTE ipTrafficMatrixHosts ... */
 
199
 
 
200
/*XMLSECTIONEND */
 
201
 
 
202
// ntopGlobals
 
203
 
 
204
/*XMLNOTE
 
205
   *
 
206
   *  Technically, this is all one structure - literally EVERYTHING is in myGlobals, 
 
207
   *  so we can't really just dump it as one structure - it's huge, unwieldy, etc.
 
208
   *
 
209
   *  So we impose an arbitrary organization, grouping the sections into things 
 
210
   *  to request by switches on the dump.xml URL.  We do this based on the comments
 
211
   *  which split up the sections.
 
212
   *
 
213
   */
 
214
 
 
215
/*XMLSECTIONBEGIN xml_g_invoke.inc root myGlobals */
 
216
/*XML e Invoke               root:Invoke      "" */
 
217
/*XML e ExecutionEnvironment Invoke:Execenv   "" */
 
218
/*XML e paths                Invoke:Paths     "" */
 
219
/*XML e CommandLineOptions   Invoke:Options   "" */
 
220
 
 
221
  /* How is ntop run? */
 
222
 
 
223
/*XML s program_name         Execenv          "" */
 
224
/*XML n basentoppid          Execenv          "" */
 
225
 
 
226
/*XML s startedAs            Execenv          "" */
 
227
/*XML n ntop_argc            Execenv          "" */
 
228
/*XML e ntop_argv            Execenv:Arg      "" */
 
229
/*XML * ntop_argc            Arg              ""
 
230
                             for (i=0; i<myGlobals.ntop_argc; i++) {
 
231
                             if (snprintf(buf, sizeof(buf), "%d", i) < 0)
 
232
                             BufferTooShort();
 
233
                             newxml(GDOME_ELEMENT_NODE, elArg, "parameter",
 
234
                             "index", buf,
 
235
                             "value", myGlobals.ntop_argv[i]);
 
236
                             }
 
237
                             XML*/
 
238
 
 
239
/*XMLNOTE TODO dataFileDirs */
 
240
/*XMLNOTE TODO pluginDirs */
 
241
/*XMLNOTE TODO configFileDirs */
 
242
 
 
243
/*XML s accessLogFile        Options    "-a | --access-log-file" */
 
244
/*XML b enablePacketDecoding Options    "-b | --disable-decoders" */
 
245
/*XML b stickyHosts          Options    "-c | --sticky-hosts" */
 
246
/*XML b daemonMode           Options    "-d | --daemon: run as daemon flag" */
 
247
/*XML n maxNumLines          Options    "-e | --max-table-rows: maximum lines/page" */
 
248
/*XML s rFileName            Options    "-f | --traffic-dump-file: input packet capture file" */
 
249
/*XML s trackOnlyLocalHosts  Options    "-g | --track-local-hosts" */
 
250
/*XML s devices              Options    "-i | --interface" */
 
251
/*XML b enableOtherPacketDump Options "-j | --create-other-packets" */
 
252
/*XML s filterExpressionInExtraFrame Options "-k | --filter-expression-in-extra-frame" */
 
253
/*XML s pcapLog              Options    "-l | --pcap-log" */
 
254
/*XML s localAddresses       Options    "-m | --local-subnets" */
 
255
/*XML b numericFlag          Options    "-n | --numeric-ip-addresses" */
 
256
/*XML b dontTrustMACaddr     Options    "-o | --no-mac" */
 
257
/*XML s protoSpecs           Options    "-p | --protocols" */
 
258
/*XML b enableSuspiciousPacketDump Options "-q | --create-suspicious-packets" */
 
259
/*XML n refreshRate          Options    "-r | --refresh-time" */
 
260
/*XML b disablePromiscuousMode Options  "-s | --no-promiscuous" */
 
261
/*XML n traceLevel           Options    "-t | --trace-level" */
 
262
/*XML n maxNumHashEntries    Options    "-x  <max num hash entries>" */
 
263
/*XML n maxNumSessions       Options    "-X  <max num TCP sessions>" */
 
264
#ifndef WIN32
 
265
/*XML * effectiveUserName    Options    ""
 
266
                                       if (snprintf(buf, sizeof(buf), "(uid=%d, gid=%d)",
 
267
                                       myGlobals.userId,
 
268
                                       myGlobals.groupId) < 0)
 
269
                                       BufferTooShort();
 
270
                                       newxml(GDOME_ELEMENT_NODE, elOptions, "effectiveUserName",
 
271
                                       "value", myGlobals.effectiveUserName,
 
272
                                       "EffectiveId", buf,
 
273
                                       "description", "-u | --user");
 
274
                                       XML*/
 
275
#endif
 
276
/*XML n defaultVsan          Options    "-v | --default-vsan" */                               
 
277
/*XML s webAddr              Options    "-w | --http-server address"  */
 
278
/*XML n webPort              Options    "-w | --http-server :port" */
 
279
  //TODO int ipv4or6;                       /* '6/4' */ 
 
280
/*XML b enableSessionHandling Options   "-z | --disable-sessions" */
 
281
/*XML s currentFilterExpression Options "-B | --filter-expression" */
 
282
/*XML s domainName           Options    "-D | --domain" */
 
283
/*XML b flowSpecs            Options    "-F | --flow-spec" */
 
284
 
 
285
#ifndef WIN32
 
286
/*XML b debugMode            Options    "-K | --enable-debug" */
 
287
/*XML n useSyslog            Options    "-L | --use-syslog" */
 
288
#endif
 
289
 
 
290
/*XML b mergeInterfaces      Options    "-M | --no-interface-merge" */
 
291
/*XML s pcapLogBasePath      Options    "-O | --pcap-file-path" */
 
292
/*XML s fcNSCacheFile        Options    "-N | --wwn-map" */
 
293
/*XML s dbPath               Options    "-P | --db-file-path" */
 
294
/*XML s spoolPath            Options    "-Q | --spool-file-path" */
 
295
/*XML s printFcOnly          Options    "-S | --fc-only" */
 
296
/*XML s mapperURL            Options    "-U | --mapper" */
 
297
 
 
298
#ifdef HAVE_OPENSSL
 
299
/*XML s sslAddr              Options    "-W | --https-server address" */
 
300
/*XML n sslPort              Options    "-W | --https-server :port" */
 
301
#endif
 
302
 
 
303
#ifdef MAKE_WITH_SSLWATCHDOG_RUNTIME
 
304
/*XML b useSSLwatchdog       Options    "--ssl-watchdog" */
 
305
#endif
 
306
 
 
307
#if defined(CFG_MULTITHREADED) && defined(MAKE_WITH_SCHED_YIELD)
 
308
/*XML b disableSchedYield    Options    "--disable-schedyield" */
 
309
#endif
 
310
 
 
311
/*XML s P3Pcp                Options    "--p3p-cp" */
 
312
/*XML s P3Puri               Options    "--p3p-uri" */
 
313
 
 
314
/*XML b disableStopcap       Options    "--disable-stopcap" */
 
315
 
 
316
/*XML b disableInstantSessionPurge Options "--disable-instantsessionpurge" */
 
317
/*XML b noFc                 Options    "--no-fc" */
 
318
/*XML b noInvalidLunDisplay  Options    "--no-invalid-lun" */
 
319
 
 
320
/*XML b disableMutexExtraInfo Options   "--disable-mutexextrainfo" */
 
321
 
 
322
/*XML b skipVersionCheck     Options    "--skip-version-check" */
 
323
 
 
324
/*XML b enableFragmentHandling Options  "" */
 
325
/*XMLSECTIONEND */
 
326
 
 
327
// Physical and Logical network interfaces 
 
328
 
 
329
/*XMLSECTIONBEGIN xml_g_intf.inc root myGlobals  */
 
330
/*XML e Interfaces           root:Interfaces  "" */
 
331
 
 
332
/*XML n numDevices           Interfaces "" */
 
333
/*XMLFOR i 0 myGlobals.numDevices */
 
334
/*XML *   device          Interfaces            ""
 
335
    if (snprintf(buf, sizeof(buf), "%d", i) < 0)
 
336
    BufferTooShort();
 
337
    elWork = newxml(GDOME_ELEMENT_NODE,
 
338
    elInterfaces,
 
339
    "device",
 
340
    "index", buf, 
 
341
    "description", "");
 
342
    XML*/
 
343
/*XML &ntopinterface device[i] Work "" */
 
344
/*XMLROF */
 
345
/*XMLSECTIONEND */
 
346
 
 
347
#ifdef CFG_MULTITHREADED
 
348
/*XMLSECTIONBEGIN xml_g_multithread.inc root myGlobals */
 
349
/*XML e                      ThreadInfo                root:multithread "" */
 
350
/*XML n:u numThreads         multithread "" */
 
351
/*XML n:u numDequeueThreads  multithread "" */
 
352
/*XMLSECTIONEND */
 
353
#endif /* CFG_MULTITHREADED */
 
354