1
/* Created by xmldump.awk
3
* part of and licensed the same as ntop, http://www.ntop.org
5
* WARNING: Changes made here will be lost the next time this
6
* file is recreated, which can happen automatically during
7
* a 'make'. Y'all been warned, now!
12
if (input == NULL) { return NULL; };
13
if (parent == NULL) { return NULL; };
16
/*XML s name parent "" */
17
newxml_simplestring(parent,
22
/*XML s humanFriendlyName parent "" */
23
newxml_simplestring(parent,
25
input->humanFriendlyName,
28
/*XML h flags parent "status of the interface" */
29
newxml_simplehex(parent,
32
"status of the interface");
34
/*XML h addr parent "" */
35
newxml_simplehex(parent,
40
/*XML s ipdot parent "" */
41
newxml_simplestring(parent,
46
/*XML s fqdn parent "" */
47
newxml_simplestring(parent,
52
/*XML in_addr network parent "" */
53
newxml_in_addr(parent,
58
/*XML in_addr netmask parent "" */
59
newxml_in_addr(parent,
64
/*XML n:u numHosts parent "" */
65
newxml_simplenumeric(parent,
71
/*XML in_addr ifAddr parent "" */
72
newxml_in_addr(parent,
77
/*XML time_t started parent "" */
83
/*XML time_t firstpkt parent "" */
89
/*XML time_t lastpkt parent "" */
95
/*XML b virtualDevice parent "" */
96
newxml_simplenoyes(parent,
101
/*XML b dummyDevice parent "" */
102
newxml_simplenoyes(parent,
107
/*XML n snaplen parent "" */
108
newxml_simplenumeric(parent,
114
/*XML h datalink parent "" */
115
newxml_simplehex(parent,
120
/*XML s filter parent "" */
121
newxml_simplestring(parent,
126
/*XML n fd parent "" */
127
newxml_simplenumeric(parent,
133
/*XML e packetStats parent:Work "" */
134
elWork = newxml_empty(parent,
138
/*XML trafficcounter receivedPkts Work "" */
139
newxml_trafficcounter(elWork,
144
/*XML trafficcounter droppedPkts Work "" */
145
newxml_trafficcounter(elWork,
150
/*XML trafficcounter ethernetPkts Work "" */
151
newxml_trafficcounter(elWork,
156
/*XML trafficcounter broadcastPkts Work "" */
157
newxml_trafficcounter(elWork,
159
input->broadcastPkts,
162
/*XML trafficcounter multicastPkts Work "" */
163
newxml_trafficcounter(elWork,
165
input->multicastPkts,
168
/*XML trafficcounter ipPkts Work "" */
169
newxml_trafficcounter(elWork,
174
/*XML trafficcounter lastMinEthernetPkts Work "" */
175
newxml_trafficcounter(elWork,
176
"lastMinEthernetPkts",
177
input->lastMinEthernetPkts,
180
/*XML trafficcounter lastFiveMinsEthernetPkts Work "" */
181
newxml_trafficcounter(elWork,
182
"lastFiveMinsEthernetPkts",
183
input->lastFiveMinsEthernetPkts,
186
/*XML trafficcounter lastNumEthernetPkts Work "" */
187
newxml_trafficcounter(elWork,
188
"lastNumEthernetPkts",
189
input->lastNumEthernetPkts,
192
/*XML trafficcounter lastEthernetPkts Work "" */
193
newxml_trafficcounter(elWork,
195
input->lastEthernetPkts,
198
/*XML trafficcounter lastTotalPkts Work "" */
199
newxml_trafficcounter(elWork,
201
input->lastTotalPkts,
204
/*XML trafficcounter lastBroadcastPkts Work "" */
205
newxml_trafficcounter(elWork,
207
input->lastBroadcastPkts,
210
/*XML trafficcounter lastMulticastPkts Work "" */
211
newxml_trafficcounter(elWork,
213
input->lastMulticastPkts,
216
/*XML e byteStats parent:Work "" */
217
elWork = newxml_empty(parent,
221
/*XML trafficcounter ethernetBytes Work "" */
222
newxml_trafficcounter(elWork,
224
input->ethernetBytes,
227
/*XML trafficcounter ipBytes Work "" */
228
newxml_trafficcounter(elWork,
233
/*XML trafficcounter fragmentedIpBytes Work "" */
234
newxml_trafficcounter(elWork,
236
input->fragmentedIpBytes,
239
/*XML trafficcounter tcpBytes Work "" */
240
newxml_trafficcounter(elWork,
245
/*XML trafficcounter udpBytes Work "" */
246
newxml_trafficcounter(elWork,
251
/*XML trafficcounter otherIpBytes Work "" */
252
newxml_trafficcounter(elWork,
257
/*XML trafficcounter icmpBytes Work "" */
258
newxml_trafficcounter(elWork,
263
/*XML trafficcounter dlcBytes Work "" */
264
newxml_trafficcounter(elWork,
269
/*XML trafficcounter ipxBytes Work "" */
270
newxml_trafficcounter(elWork,
275
/*XML trafficcounter stpBytes Work "" */
276
newxml_trafficcounter(elWork,
281
/*XML trafficcounter decnetBytes Work "" */
282
newxml_trafficcounter(elWork,
287
/*XML trafficcounter netbiosBytes Work "" */
288
newxml_trafficcounter(elWork,
293
/*XML trafficcounter arpRarpBytes Work "" */
294
newxml_trafficcounter(elWork,
299
/*XML trafficcounter atalkBytes Work "" */
300
newxml_trafficcounter(elWork,
305
/*XML trafficcounter egpBytes Work "" */
306
newxml_trafficcounter(elWork,
311
/*XML trafficcounter osiBytes Work "" */
312
newxml_trafficcounter(elWork,
317
/*XML trafficcounter ipv6Bytes Work "" */
318
newxml_trafficcounter(elWork,
323
/*XML trafficcounter otherBytes Work "" */
324
newxml_trafficcounter(elWork,
329
/*XML trafficcounter lastMinEthernetBytes Work "" */
330
newxml_trafficcounter(elWork,
331
"lastMinEthernetBytes",
332
input->lastMinEthernetBytes,
335
/*XML trafficcounter lastFiveMinsEthernetBytes Work "" */
336
newxml_trafficcounter(elWork,
337
"lastFiveMinsEthernetBytes",
338
input->lastFiveMinsEthernetBytes,
341
/*XML trafficcounter lastEthernetBytes Work "" */
342
newxml_trafficcounter(elWork,
344
input->lastEthernetBytes,
347
/*XML trafficcounter lastIpBytes Work "" */
348
newxml_trafficcounter(elWork,
353
/*XML trafficcounter lastNonIpBytes Work "" */
354
newxml_trafficcounter(elWork,
356
input->lastNonIpBytes,
359
/*XML &packetstats rcvdPktStats parent "" */
360
newxml_packetstats(parent,
362
&(input->rcvdPktStats),
365
/*XML &ttlstats rcvdPktTTLStats parent "" */
366
newxml_ttlstats(parent,
368
&(input->rcvdPktTTLStats),
371
/*XML e throughputStats parent:Work "" */
372
elWork = newxml_empty(parent,
376
/*XML n:f peakThroughput Work "" */
377
newxml_simplenumeric(elWork,
379
input->peakThroughput,
383
/*XML n:f actualThpt Work "" */
384
newxml_simplenumeric(elWork,
390
/*XML n:f lastMinThpt Work "" */
391
newxml_simplenumeric(elWork,
397
/*XML n:f lastFiveMinsThpt Work "" */
398
newxml_simplenumeric(elWork,
400
input->lastFiveMinsThpt,
404
/*XML n:f peakPacketThroughput Work "" */
405
newxml_simplenumeric(elWork,
406
"peakPacketThroughput",
407
input->peakPacketThroughput,
411
/*XML n:f actualPktsThpt Work "" */
412
newxml_simplenumeric(elWork,
414
input->actualPktsThpt,
418
/*XML n:f lastMinPktsThpt Work "" */
419
newxml_simplenumeric(elWork,
421
input->lastMinPktsThpt,
425
/*XML n:f lastFiveMinsPktsThpt Work "" */
426
newxml_simplenumeric(elWork,
427
"lastFiveMinsPktsThpt",
428
input->lastFiveMinsPktsThpt,
432
/*XML time_t lastThptUpdate Work "" */
433
newxml_time_t(elWork,
435
input->lastThptUpdate,
438
/*XML time_t lastMinThptUpdate Work "" */
439
newxml_time_t(elWork,
441
input->lastMinThptUpdate,
444
/*XML time_t lastHourThptUpdate Work "" */
445
newxml_time_t(elWork,
446
"lastHourThptUpdate",
447
input->lastHourThptUpdate,
450
/*XML time_t lastFiveMinsThptUpdate Work "" */
451
newxml_time_t(elWork,
452
"lastFiveMinsThptUpdate",
453
input->lastFiveMinsThptUpdate,
456
/*XML n:f throughput Work "" */
457
newxml_simplenumeric(elWork,
463
/*XML n:f packetThroughput Work "" */
464
newxml_simplenumeric(elWork,
466
input->packetThroughput,
470
/*XML n:u numThptSamples Work "" */
471
newxml_simplenumeric(elWork,
473
input->numThptSamples,
477
/*XML e last60MinutesThpt Work:Work2 "" */
478
elWork2 = newxml_empty(elWork,
482
/*XML n:u last60MinutesThptIdx Work2 "" */
483
newxml_simplenumeric(elWork2,
484
"last60MinutesThptIdx",
485
input->last60MinutesThptIdx,
490
for (indexT=0; indexT <= 59; indexT++) {
491
/*XML * indexT Work2:Work3 "" */
493
/* copied from globals-structtypes.xml at line 136 */
494
if (snprintf(buf, sizeof(buf), "%d", indexT) < 0) BufferTooShort();
495
elWork3 = newxml_simplestring(elWork2,
499
/* end copy from globals-structtypes.xml */
501
if (input->last60MinutesThpt[indexT].trafficValue != 0.0) {
502
/*XML &thptentry last60MinutesThpt[indexT] Work3 "" */
503
newxml_thptentry(elWork3,
505
&(input->last60MinutesThpt[indexT]),
512
/*XML e last24HoursThpt Work:Work2 "" */
513
elWork2 = newxml_empty(elWork,
517
/*XML n:u last24HoursThptIdx Work2 "" */
518
newxml_simplenumeric(elWork2,
519
"last24HoursThptIdx",
520
input->last24HoursThptIdx,
525
for (indexT=0; indexT <= 23; indexT++) {
526
/*XML * indexT Work2:Work3 "" */
528
/* copied from globals-structtypes.xml at line 144 */
529
if (snprintf(buf, sizeof(buf), "%d", indexT) < 0) BufferTooShort();
530
elWork3 = newxml_simplestring(elWork2,
534
/* end copy from globals-structtypes.xml */
536
if (input->last24HoursThpt[indexT].trafficValue != 0.0) {
537
/*XML &thptentry last24HoursThpt[indexT] Work3 "" */
538
newxml_thptentry(elWork3,
540
&(input->last24HoursThpt[indexT]),
547
/*XML e last30daysThpr Work:Work2 "" */
548
elWork2 = newxml_empty(elWork,
552
/*XML n:u last30daysThptIdx Work2 "" */
553
newxml_simplenumeric(elWork2,
555
input->last30daysThptIdx,
560
for (indexT=0; indexT <= 29; indexT++) {
561
if (input->last30daysThpt[indexT] != 0.0) {
562
/*XML * indexT Work2 "" */
564
/* copied from globals-structtypes.xml at line 153 */
565
if (snprintf(buf, sizeof(buf), "%d", indexT) < 0) BufferTooShort();
566
if (snprintf(buf2, sizeof(buf2), "%f", input->last30daysThpt[indexT]) < 0) BufferTooShort();
567
newxml_simplestring(elWork2,
571
/* end copy from globals-structtypes.xml */
577
/*XML e protocolStats parent:Work "" */
578
elWork = newxml_empty(parent,
582
/*XML e tcp Work:Work2 "" */
583
elWork2 = newxml_empty(elWork,
587
/*XML &simpleprototrafficinfo tcpGlobalTrafficStats Work2 "" */
588
newxml_simpleprototrafficinfo(elWork2,
589
"tcpGlobalTrafficStats",
590
&(input->tcpGlobalTrafficStats),
593
/*XML e udp Work:Work2 "" */
594
elWork2 = newxml_empty(elWork,
598
/*XML &simpleprototrafficinfo udpGlobalTrafficStats Work2 "" */
599
newxml_simpleprototrafficinfo(elWork2,
600
"udpGlobalTrafficStats",
601
&(input->udpGlobalTrafficStats),
604
/*XML e icmp Work:Work2 "" */
605
elWork2 = newxml_empty(elWork,
609
/*XML &simpleprototrafficinfo icmpGlobalTrafficStats Work2 "" */
610
newxml_simpleprototrafficinfo(elWork2,
611
"icmpGlobalTrafficStats",
612
&(input->icmpGlobalTrafficStats),
616
for (iProtoIndex=0; iProtoIndex<myGlobals.numIpProtosToMonitor; iProtoIndex++) {
617
/*XML s protoIPTrafficInfos[iProtoIndex]!ipprotocol Work:Work2 "" */
618
elWork2 = newxml_simplestring(elWork,
620
myGlobals.protoIPTrafficInfos[iProtoIndex],
623
/*XML &simpleprototrafficinfo ipProtoStats[iProtoIndex] Work2 "" */
624
newxml_simpleprototrafficinfo(elWork2,
626
&(input->ipProtoStats[iProtoIndex]),
631
/*XML trafficcounter numEstablishedTCPConnections parent "" */
632
newxml_trafficcounter(parent,
633
"numEstablishedTCPConnections",
634
input->numEstablishedTCPConnections,
637
/*XML n:u hostsno parent "" */
638
newxml_simplenumeric(parent,
644
/*XML n:u actualHashSize parent "" */
645
newxml_simplenumeric(parent,
647
input->actualHashSize,