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

« back to all changes in this revision

Viewing changes to globals-defines.h

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon, Jordan Metzmeier, Ludovico Cavedon
  • Date: 2010-12-15 20:06:19 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101215200619-0ojz3iak95ihibun
Tags: 3:4.0.3+dfsg1-1
[ Jordan Metzmeier ]
* New upstream release (Closes: #522042)
* Move data files to /usr/share/ntop (Closes: #595450).
* Package architecture independent data in a separate ntop-data package.
* Use debhelper 7.
* Update Standards-Version to 3.9.1.
* Depend on python-mako.
* Do not include ntop.txt in binary packages as it is a copy of the man
  page.
* Do not include NEWS, as it is outdated.
* Switch to package source version 3.0 (quilt).
* Add password creation to debconf
* Changed init script to fix localization problems (thanks to Alejandro
  Varas <alej0varas@gmail.com>, LP: #257466)
* Remove manual update-rc.d calls from postrm and postinst. debhelper adds
  this for us.
* Add pre-depends on adduser for postinst script.
* Fix errors in the manpages: fix-manpage-errors.patch.
* Added fixes for matching active interfaces.
* Added a watch file.

[ Ludovico Cavedon ]
* Remove direct changes to upstream tree, and move them into specific patch
  files:
  - fix-manpage-errors.patch: fix typos in ntop.8.
  - dot-path.patch: fix path of /usr/bin/dot executable
* Add patches:
  - reduce-autogen-purged-files.patch: prevent agutogen.sh from reamoving
  too many files during cleanup.
  - Add build-without-ntop-darwin.patch, to fix compilation without
  ntop_darwin.c.
* No longer add faq.html, as it is not distributed in the upstream tarball.
* Use ${source:Version} in control file. Have ntop-data recommend
  ntop.
* Rename dirs to ntop.dirs and keep only empty directories that need
  to be created.
* Remove var/lib from ntop.install file, as it is empty (keeping it in
  ntop.dirs).
* Update po files.
* Breaks and Replaces instead of Conflitcs for ntop-data.
* Use a longer package description.
* Remove useless configure options from debian/rules.
* Move private shared libraries libraries in /usr/lib/ntop.
* Add change-plugin-dir.patch for adjusting plugin directory.
* Remove development files.
* Use system library for MochiKit.js.
* Rewrite DEP5 copyright file.
* Repackage upstream tarball in order to remove non-DFSG-compliant code. Add
  get-orig-source.sh script and get-orig-source target in debian/rules.
* Add explanation to README.Debian why geolocation is no longer working.
* Add avoid-copy-maxmind-db.patch to prevent copying of Geo*.dat
  files.
* Remove old unused patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3
3
 *                          http://www.ntop.org
4
4
 *
5
 
 * Copyright (C) 1998-2007 Luca Deri <deri@ntop.org>
 
5
 *            Copyright (C) 1998-2010 Luca Deri <deri@ntop.org>
6
6
 *
7
7
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
8
8
 *
111
111
#undef  PARM_USE_COLOR
112
112
 
113
113
/*
114
 
 * Define to allow processing of CGI scripts.
115
 
 */
116
 
#define PARM_USE_CGI
117
 
 
118
 
/*
119
114
 * This causes the hash functions in vendor.c to invert the mac address #s when
120
115
 * computing the hash.  This allows a lot fewer entries in the hash table.
121
116
 */
192
187
 */
193
188
#define PARM_MIN_WEBPAGE_AUTOREFRESH_TIME   15
194
189
 
195
 
/*
196
 
 * SSLWATCHDOG
197
 
 *
198
 
 * For PARM_SSLWATCHDOG_WAITWOKE_LIMIT and PARM_SSLWATCHDOG_WAIT_INTERVAL,
199
 
 * see below, after MAKE_WITH_SSLWATCHDOG is set
200
 
 */
201
 
 
202
190
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
203
191
/* M A K E option items                                                              */
204
192
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
251
239
#endif
252
240
 
253
241
/*
254
 
 * MAKE_WITH_SCHED_YIELD is shorthand
255
 
 */
256
 
#if ( defined(HAVE_SCHED_H) || defined(HAVE_SYS_SCHED_H) ) && defined(HAVE_SCHED_YIELD)
257
 
 #define MAKE_WITH_SCHED_YIELD
258
 
#else
259
 
 #undef MAKE_WITH_SCHED_YIELD
260
 
#endif
261
 
 
262
 
/*
263
 
 * Do we have the stuff we need for i18n?
264
 
 */
265
 
#ifdef MAKE_WITH_I18N
266
 
 #if !defined(HAVE_LOCALE_H) || !defined(HAVE_LANGINFO_H)
267
 
  #undef MAKE_WITH_I18N
268
 
 #endif
269
 
#endif
270
 
 
271
 
/*
272
242
 * This flag indicates that fork() is implemented with copy-on-write.
273
243
 * This means that the set of tables reported on in fork()ed processes
274
244
 * will be complete and unchanged as of the instant of the fork.
395
365
 */
396
366
/* #define INITWEB_DEBUG */
397
367
 
398
 
/* I18N_DEBUG logs the activities in and around internationalization (i18n).
399
 
 */
400
 
/* #define I18N_DEBUG */
401
 
 
402
368
/* LATENCY_DEBUG logs the acquisition of latency figures.
403
369
 */
404
370
/* #define LATENCY_DEBUG */
439
405
 *     #endif
440
406
 *
441
407
 */
442
 
/* #define MEMORY_DEBUG */
 
408
/* #define MEMORY_DEBUG 1 */
443
409
 
444
410
/*
445
411
 *  WARNING: Unless you also define MEMORY_DEBUG_UNLIMITED, there
500
466
 */
501
467
/* #define SESSION_TRACE_DEBUG */
502
468
 
503
 
/*
504
 
 * SSLWATCHDOG_DEBUG causes webInterface.c to log the activities of the
505
 
 * parent and child(watchdog) threads in exhaustive details.
506
 
 *
507
 
 *   Note the code below (in derived settings) to undef this if the MAKE_WITH_SSLWATCHDOG
508
 
 *        option isn't enabled.      Leave that alone!
509
 
 *
510
 
 */
511
 
/* #define SSLWATCHDOG_DEBUG */
512
 
 
513
469
/* STORAGE_DEBUG causes util.c to log the store/resurrection of host information,
514
470
 * i.e. the -S command line parameter.
515
471
 */
530
486
/* #define VENDOR_DEBUG */
531
487
 
532
488
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
533
 
/* SSLWATCHDOG - this crosses the line.                                            */
534
 
/*   If the required libraries exist (multithreaded, openSSL, pthreads and         */
535
 
/*     NOT WIN32, then the user can                                                */
536
 
/*                                                                                 */
537
 
/*          1) request it at ./configure time (which should really be a            */
538
 
/*             HAVE_, but PARM_ seems closer to what we're telling ntop to do).    */
539
 
/*          2) Build it for a run-time parameter (MAKE_)                           */
540
 
/*                                                                                 */
541
 
/*    SSLWATCHDOG_DEBUG is used in webInterface.c to determine if we               */
542
 
/*    report stuff, but it's also used in globals-core.h to make or not-make       */
543
 
/*    debuging code.                                                               */
544
 
/*                                                                                 */
545
 
/*  Who needs that complexity in multiple places, so we put it all here!           */
546
 
/*  (since we're potentially unsetting SSLWATCHDOG_DEBUG, it has to go after       */
547
 
/*   the place to uncomment it...)                                                 */
548
 
/*                                                                                 */
549
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
550
 
 
551
 
#if defined(HAVE_OPENSSL) && defined(HAVE_PTHREAD_H) && defined(HAVE_SETJMP_H) && !defined(WIN32)
552
 
 #define MAKE_WITH_SSLWATCHDOG
553
 
 #ifdef MAKE_WITH_SSLWATCHDOG_COMPILETIME
554
 
  /* Compile Time option */
555
 
  #undef  MAKE_WITH_SSLWATCHDOG_RUNTIME
556
 
 #else
557
 
  /* Run time option */
558
 
  #undef SSLWATCHDOG_DEBUG
559
 
  #define MAKE_WITH_SSLWATCHDOG_RUNTIME
560
 
 #endif
561
 
#else
562
 
 /* Neither - don't have the required headers */
563
 
 #undef MAKE_WITH_SSLWATCHDOG
564
 
 #undef MAKE_WITH_SSLWATCHDOG_COMPILETIME
565
 
 #undef MAKE_WITH_SSLWATCHDOG_RUNTIME
566
 
 #undef SSLWATCHDOG_DEBUG
567
 
#endif
568
 
 
569
 
/*
570
 
 *  PARM_SSLWATCHDOG_WAITWOKE_LIMIT
571
 
 *    This is the number of times we'll allow ourselves to be woken up
572
 
 *    (for reasons other than the expiration of the watchdog interval
573
 
 *    or completion of the ssl accept).
574
 
 *
575
 
 *  PARM_SSLWATCHDOG_WAIT_INTERVAL
576
 
 *    This is the number of seconds to wait in the watchdog for the
577
 
 *    ssl accept to finish.
578
 
 */
579
 
#ifdef MAKE_WITH_SSLWATCHDOG
580
 
 #define PARM_SSLWATCHDOG_WAITWOKE_LIMIT    5
581
 
 #define PARM_SSLWATCHDOG_WAIT_INTERVAL     3
582
 
#endif
583
 
 
584
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
585
489
/* L E N,  L I M,  M A X  items                                                    */
586
490
/*        Some are with the CONST_ items, below too                                */
587
491
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
612
516
/* Maximum number of queued addresses waiting to be resolved */
613
517
#define MAX_NUM_QUEUED_ADDRESSES          16384
614
518
 
 
519
/* Maximum length of network delay statistics */
 
520
#define MAX_NUM_NET_DELAY_STATS              16
 
521
 
615
522
/*
616
523
 * Number of (optional) "AR - Address Resolution" threads,
617
524
 *    i.e. dequeueAddressThreadId[] and numDequeueThreads in myGlobals.
619
526
 *  You might increase this if you have really slow dns resolution and are running
620
527
 *  asyncronously.
621
528
 */
622
 
#define MAX_NUM_DEQUEUE_ADDRESS_THREADS             3
 
529
#define MAX_NUM_DEQUEUE_ADDRESS_THREADS     3
623
530
 
624
531
/* Hash size */
625
532
#define CONST_HASH_INITIAL_SIZE             32*1024
626
533
 
 
534
/* Number of mutexes used for locking sessions */
 
535
#define NUM_SESSION_MUTEXES                 8     
 
536
 
627
537
/*
628
538
 * These change the break points for the "Network Traffic: xxxx" reports
629
539
 * (e.g. dataHostTraffic.html et al).  See getBgPctgColor() in reportUtils.c
635
545
#define CONST_PCTG_HIGH_COLOR               "BGCOLOR=#FF3118"
636
546
 
637
547
/*
638
 
 * How long should we use an entry in the dnsCache database.
639
 
 *  Default (in seconds) is 24 hours
640
 
 */
641
 
#define CONST_DNSCACHE_LIFETIME             24*3600
642
 
 
643
 
/*
644
548
 * The number of entries in the logView ring buffer - how many log messages
645
549
 * we can display in the GUI.
646
550
 */
731
635
 */
732
636
#define NETFLOW_DEVICE_NAME                 "NetFlow-device"
733
637
#define SFLOW_DEVICE_NAME                   "sFlow-device"
 
638
#define CPACKET_DEVICE_NAME                 "cPacket-device"
734
639
 
735
640
/*
736
641
 * This defines the maximum number of entries in the ntop pwFile
737
642
 * note that both 'users' and 'urls' are stored in here.
738
643
 */
739
 
#define MAX_NUM_PWFILE_ENTRIES              32
 
644
#define MAX_NUM_PWFILE_ENTRIES              64
740
645
 
741
646
/*
742
647
 * This is an IPv4 convention - it's the upper port # that is "officially assigned" (reserved)
834
739
 * It MUST be big enough to hold all of the addresses assigned to each interface, plus
835
740
 * any additional values set by -m.  Don't be stingy - it's 3 32bit integers per entry.
836
741
 */
837
 
#define MAX_NUM_NETWORKS                    32
 
742
#define MAX_NUM_NETWORKS                    64
838
743
 
839
744
/*
840
745
 * This defines the # of entries in hostsCache[] in myGlobals.
930
835
#define CONST_UNKNOWN_MTU                   65355
931
836
 
932
837
/*
933
 
 * Maximum age of the dnsCache.db file before it will be recreated upon ntop
934
 
 * restart.
935
 
 */
936
 
#define CONST_DNSCACHE_PERMITTED_AGE        15*60
937
 
 
938
 
/*
939
838
 * Interval to run the (background) fingerprint lookup scan
940
839
 */
941
840
#define CONST_FINGERPRINT_LOOP_INTERVAL     150 /* 2.5m */
957
856
#define CONST_ASLIST_FILE                   "AS-list.txt"
958
857
 
959
858
/*
960
 
 * IP to CountryCode file
961
 
 */
962
 
#define CONST_P2C_FILE                      "p2c.opt.table"
963
 
 
964
 
/*
965
859
 * libgd file name
966
860
 */
967
861
#define CONST_LIBGD_SO                      "libgd.so"
986
880
 * This is the URL to request the latest version information
987
881
 */
988
882
#define CONST_VERSIONCHECK_SITE             "version.ntop.org"
989
 
#define CONST_VERSIONCHECK_BACKUP_SITE      "www.burtonstrauss.com"
990
883
#define CONST_VERSIONCHECK_DOCUMENT         "version.xml"
991
884
#define CONST_VERSIONCHECK_URL              CONST_VERSIONCHECK_SITE "/" CONST_VERSIONCHECK_DOCUMENT
992
885
 
1041
934
#define CONST_INFOHTML_COL2_WIDTH   175
1042
935
#define CONST_INFOHTML_COL3_WIDTH   175
1043
936
#define CONST_INFOHTML_COL23_WIDTH  350  /* columns 2 + 3 */
1044
 
#define CONST_INFOHTML_WIDTH        600  /* columns 1 + 2 + 3 */
1045
937
 
1046
938
/*
1047
939
 * How many pathological cases (same IP/MAC different VLANs) to warn about
1068
960
/* #define MAX_NETFLOW_PACKET_BUFFER           16  */
1069
961
 
1070
962
/*
 
963
        http://code.google.com/apis/maps/
 
964
*/
 
965
#define GOOGLE_DEFAULT_MAP_KEY "ABQIAAAAfFZuochHQVROgoyQEe3_SBS6yewdwLQqdZ11GEdkGrSPz1gWRxTmFdYiXZrTS3LFawwiK5Pufj5j1Q"
 
966
 
 
967
/*
1071
968
 * FibreChannel/SCSI constants
1072
969
 */
1073
970
 
1127
1024
#define CONST_DO_ADD_USER                   "doAddUser"
1128
1025
#define CONST_DO_CHANGE_FILTER              "doChangeFilter"
1129
1026
#define CONST_DOMAIN_STATS_HTML             "domainStats.html"
1130
 
#define CONST_CLUSTER_STATS_HTML            "hostClusters.html"
 
1027
#define CONST_COMMUNITIES_STATS_HTML        "hostCommunities.html"
1131
1028
#define CONST_DUMP_DATA_HTML                "dumpData.html"
1132
1029
#define CONST_DUMP_HOSTS_INDEXES_HTML       "dumpDataIndexes.html"
1133
1030
#define CONST_DUMP_NTOP_FLOWS_HTML          "dumpFlows.html"
1181
1078
#define CONST_ACTIVE_TCP_SESSIONS_HTML      "NetNetstat.html"
1182
1079
#define CONST_NETWORK_IMAGE_MAP             "network_map.png"
1183
1080
#define CONST_CGI_HEADER                    "ntop-bin/"
 
1081
#define CONST_EMBEDDED_PYTHON_HEADER        "python/"
1184
1082
#define CONST_MAN_NTOP_HTML                 "ntop.html"
1185
1083
#define CONST_NTOP_P3P                      "ntop.p3p"
1186
1084
#define CONST_PROBLEMRPT_HTML               "ntopProblemReport.html"
1195
1093
#define CONST_PRIVACYFORCE_HTML             "privacyFlagForce.html"
1196
1094
#define CONST_PRIVACYNOTICE_HTML            "privacyNotice.html"
1197
1095
#define CONST_PURGE_HOST                    "purgeHost.html"
 
1096
#define CONST_HOST_MAP                      "hostMap.html"
 
1097
#define CONST_REGION_MAP                    "python/GeoPacketVisualizer.py"
1198
1098
#define CONST_RESET_STATS_HTML              "resetStats.html"
1199
1099
#define CONST_SCSI_BYTES_HTML               "ScsiBytes.html"
1200
1100
#define CONST_BAR_LUNSTATS_DIST             "ScsiBytesLunDistribution"
1229
1129
#define CONST_W3C_P3P_XML                   "w3c/p3p.xml"
1230
1130
#define CONST_XMLDUMP_PLUGIN_NAME           "xmldump"
1231
1131
 
1232
 
#define CONST_NTOP_LOGO_GIF                 "ntop_logo.gif"
 
1132
#define CONST_NTOP_LOGO                     "ntop_logo.png"
1233
1133
 
1234
1134
/*
1235
1135
 *  SSI names
1247
1147
#define CONST_MAILTO_OLIVIER                "<a class=mailto href=\"mailto:&#111;&#108;&#105;&#118;&#105;&#101;&#114;&#046;&#102;&#101;&#115;&#116;&#111;&#114;&#064;&#108;&#111;&#114;&#105;&#097;&#046;&#102;&#114;\" title=\"Send email to Olivier Festor\">Olivier Festor</a>"
1248
1148
#define CONST_MAILTO_DINESH                 "<a class=mailto href=\"mailto:&#100;&#100;&#117;&#116;&#116;&#064;&#099;&#105;&#115;&#099;&#111;&#046;&#099;&#111;&#109;\" title=\"Send email to Dinesh G. Dutt\">Dinesh G. Dutt</a>"
1249
1149
#define CONST_MAILTO_BURTON                 "<a class=mailto href=\"mailto:&#098;&#117;&#114;&#116;&#111;&#110;&#064;&#110;&#116;&#111;&#112;&#115;&#117;&#112;&#112;&#111;&#114;&#116;&#046;&#099;&#111;&#109;\" title=\"Send email to Burton Strauss\">Burton Strauss</a>"
 
1150
#define CONST_MAILTO_MEDICI                 "<a class=mailto href=\"mailto:gianluca_medici@tin.it\" title=\"Send email to Gianluca Medici\">Gianluca Medici</a>"
1250
1151
 
1251
1152
 
1252
1153
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1339
1240
/*
1340
1241
 * handleAddressLists() constants
1341
1242
 */
1342
 
#define CONST_HANDLEADDRESSLISTS_MAIN       0
1343
 
#define CONST_HANDLEADDRESSLISTS_RRD        1
1344
 
#define CONST_HANDLEADDRESSLISTS_NETFLOW    2
1345
 
#define CONST_HANDLEADDRESSLISTS_CLUSTERS   3
1346
 
#define CONST_HANDLEADDRESSLISTS_COMMUNITY  4
 
1243
#define CONST_HANDLEADDRESSLISTS_MAIN        0
 
1244
#define CONST_HANDLEADDRESSLISTS_RRD         1
 
1245
#define CONST_HANDLEADDRESSLISTS_NETFLOW     2
 
1246
#define CONST_HANDLEADDRESSLISTS_COMMUNITIES 3
1347
1247
 
1348
1248
/*
1349
1249
 * Protocol types
1620
1520
#define CONST_IMG_FIBRECHANNEL_SWITCH  "<img class=tooltip src=\"/switch.gif\" border=\"0\" alt=\"FibreChannel Switch\" title=\"FibreChannel Switch\">"
1621
1521
#define CONST_IMG_DHCP_CLIENT          "<img class=tooltip src=\"/bulb.gif\" border=\"0\" alt=\"DHCP Client\" title=\"DHCP Client\">"
1622
1522
#define CONST_IMG_DHCP_SERVER          "<img class=tooltip src=\"/antenna.gif\" border=\"0\" alt=\"DHCP Server\" title=\"DHCP Server\">"
1623
 
#define CONST_IMG_MULTIHOMED           "<img class=tooltip src=\"/multihomed.gif\" border=\"0\" alt=\"Multihomed\" title=\"Multihomed\">"
 
1523
#define CONST_IMG_MULTIHOMED           "<img class=tooltip src=\"/multihomed.png\" border=\"0\" alt=\"Multihomed\" title=\"Multihomed\">"
1624
1524
#define CONST_IMG_MULTIVLANED          "<img class=tooltip src=\"/multivlaned.gif\"\" border=\"0\" alt=\"Multivlaned\" title=\"Multivlaned\">"
1625
1525
#define CONST_IMG_BRIDGE               "<img class=tooltip src=\"/bridge.gif\" border=\"0\" alt=\"Bridge\" title=\"Bridge\">"
1626
1526
#define CONST_IMG_ROUTER               "<img class=tooltip src=\"/router.gif\" border=\"0\" alt=\"Router\" title=\"Router\">"
1647
1547
#define CONST_IMG_SCSI_DISK            "<img class=tooltip src=\"/disk.gif\" border=\"0\" alt=\"SCSI Block Device (disk)\" title=\"SCSI Block Device (disk)\">"
1648
1548
 
1649
1549
#define CONST_IMG_FC_VEN_BROCADE       "<img class=tooltip src=\"/brocade.gif\" border=\"0\" alt=\"Brocade Communications Systems, Inc.\" title=\"Brocade Communications Systems, Inc.\">"
1650
 
#define CONST_IMG_FC_VEN_EMC           "<img class=tooltip src=\"/emc.gif\" border=\"0\" alt=\"EMC Corporation\" title=\"EMC Corporation\">"
1651
1550
#define CONST_IMG_FC_VEN_EMULEX        "<img class=tooltip src=\"/emulex.gif\" border=\"0\" alt=\"Emulex Corporation\" title=\"Emulex Corporation\">"
1652
1551
#define CONST_IMG_FC_VEN_JNI           "<img class=tooltip src=\"/jni.gif\" border=\"0\" alt=\"JNI Corporation\" title=\"JNI Corporation\">"
1653
1552
#define CONST_IMG_FC_VEN_SEAGATE       "<img class=tooltip src=\"/seagate.gif\" border=\"0\" alt=\"Seagate Technology\" title=\"Seagate Technology\">"
1654
1553
 
1655
 
#define CONST_IMG_ARROW_UP             "<img class=tooltip src=\"/arrow_up.gif\" border=\"0\" alt=\"Ascending order, click to reverse\" title=\"Ascending order, click to reverse\">"
1656
 
#define CONST_IMG_ARROW_DOWN           "<img class=tooltip src=\"/arrow_down.gif\" border=\"0\" alt=\"Descending order, click to reverse\" title=\"Descending order, click to reverse\">"
 
1554
#define CONST_IMG_ARROW_UP             "<img class=tooltip src=\"/arrow_up.png\" border=\"0\" alt=\"Ascending order, click to reverse\" title=\"Ascending order, click to reverse\">"
 
1555
#define CONST_IMG_ARROW_DOWN           "<img class=tooltip src=\"/arrow_down.png\" border=\"0\" alt=\"Descending order, click to reverse\" title=\"Descending order, click to reverse\">"
1657
1556
 
1658
1557
#define CONST_IMG_OS_WINDOWS           "<img class=tooltip alt=\"OS: Windows\" title=\"OS: Windows\" align=\"middle\" src=\"/statsicons/os/windows.gif\">"
1659
1558
#define CONST_IMG_OS_IRIX              "<img class=tooltip alt=\"OS: Irix\" title=\"OS: Irix\" align=\"middle\" src=\"/statsicons/os/irix.gif\">"
1721
1620
 
1722
1621
 
1723
1622
/*
1724
 
 * Define for address resolution missing on Win32
1725
 
 */
1726
 
#ifndef NETDB_SUCCESS
1727
 
#define NETDB_SUCCESS                       0
1728
 
#endif
1729
 
 
1730
 
/*
1731
1623
 * Flags related to html and http types
1732
1624
 */
1733
1625
 
1749
1641
#define FLAG_HTTP_TYPE_P3P                  10
1750
1642
#define FLAG_HTTP_TYPE_SVG                  11
1751
1643
#define FLAG_HTTP_TYPE_JSON                 12
 
1644
#define FLAG_HTTP_TYPE_PDF                  13
1752
1645
 
1753
1646
#define BITFLAG_HTTP_IS_CACHEABLE           (1<<0)
1754
1647
#define BITFLAG_HTTP_NO_CACHE_CONTROL       (1<<1)
1769
1662
 
1770
1663
/*
1771
1664
 * Flags for fileFlags in typedef struct fileList {}
 
1665
 *
 
1666
 * If you change them please update event.c
1772
1667
 */
1773
1668
#define FLAG_THE_DOMAIN_HAS_BEEN_COMPUTED   1
1774
1669
#define FLAG_PRIVATE_IP_ADDRESS             2 /* the IP address is private (192.168..) */
1803
1698
#define FLAG_HOST_TYPE_SVC_VOIP_CLIENT      29
1804
1699
#define FLAG_HOST_TYPE_SVC_VOIP_GATEWAY     30
1805
1700
 
 
1701
#define MAX_FLAG_HOST_TYPE                  FLAG_HOST_TYPE_SVC_VOIP_GATEWAY
 
1702
 
1806
1703
/* Flags for possible error codes */
1807
1704
#define FLAG_HOST_WRONG_NETMASK             65
1808
1705
#define FLAG_HOST_DUPLICATED_MAC            66
1831
1728
 */
1832
1729
#define FLAG_P2P_GNUTELLA                   1
1833
1730
#define FLAG_P2P_KAZAA                      2
1834
 
#define FLAG_P2P_WINMX                      3
1835
 
#define FLAG_P2P_DIRECTCONNECT              4
1836
1731
/* new */
1837
 
#define FLAG_P2P_EDONKEY                    5
1838
 
#define FLAG_P2P_FASTTRACK                  6
1839
 
#define FLAG_P2P_BITTORRENT                 7
1840
 
#define FLAG_P2P_OTHER_PROTOCOL             8
1841
 
#define FLAG_VOIP                           9
 
1732
#define FLAG_P2P_EDONKEY                    3
 
1733
#define FLAG_P2P_BITTORRENT                 4
 
1734
#define FLAG_P2P_OTHER_PROTOCOL             5
 
1735
#define FLAG_VOIP                           6
1842
1736
 
1843
1737
#define UNKNOWN_P2P_FILE                    "&lt;unknown&nbsp;file&gt;"
1844
1738
 
1931
1825
#define FLAG_HOST_SYM_ADDR_TYPE_NETBIOS     27
1932
1826
#define FLAG_HOST_SYM_ADDR_TYPE_NAME        29
1933
1827
#define FLAG_HOST_SYM_ADDR_TYPE_MDNS        30 /* Multicast DNS */
1934
 
/*
1935
 
 * SSLWATCHDOG stuff
1936
 
 */
1937
 
#ifdef MAKE_WITH_SSLWATCHDOG
1938
 
 
1939
 
 #define FLAG_SSLWATCHDOG_PARENT            0
1940
 
 #define FLAG_SSLWATCHDOG_CHILD             1
1941
 
 #define FLAG_SSLWATCHDOG_BOTH              -1
1942
 
 
1943
 
 #define FLAG_SSLWATCHDOG_UNINIT            0  /* No child */
1944
 
 #define FLAG_SSLWATCHDOG_WAITINGREQUEST    1  /* waiting for request */
1945
 
 #define FLAG_SSLWATCHDOG_HTTPREQUEST       2  /* http request received */
1946
 
 #define FLAG_SSLWATCHDOG_HTTPCOMPLETE      3  /* Parent done w/ http */
1947
 
 #define FLAG_SSLWATCHDOG_FINISHED          9
1948
 
 
1949
 
 #define FLAG_SSLWATCHDOG_RETURN_LOCKED     1
1950
 
 #define FLAG_SSLWATCHDOG_ENTER_LOCKED      2
1951
 
#endif
1952
1828
 
1953
1829
/*
1954
1830
 * FibreChannel
1967
1843
#define FLAG_PHP_LANGUAGE                   2
1968
1844
#define FLAG_XML_LANGUAGE                   3
1969
1845
#define FLAG_PYTHON_LANGUAGE                4
1970
 
#define FLAG_NO_LANGUAGE                    5
 
1846
#define FLAG_JSON_LANGUAGE                  5
 
1847
#define FLAG_GOOGLE_LANGUAGE                6
 
1848
#define FLAG_NO_LANGUAGE                    7
1971
1849
#define MAX_FLAG_LANGUGE                    FLAG_NO_LANGUAGE
1972
1850
 
1973
1851
#define FLAG_NO_PEER                        UINT_MAX
2002
1880
 * Flags for sessionState in typedef struct ipSession {}
2003
1881
 */
2004
1882
#define FLAG_STATE_SYN                      0
2005
 
#define FLAG_FLAG_STATE_SYN_ACK             1
 
1883
#define FLAG_STATE_SYN_ACK                  1
2006
1884
#define FLAG_STATE_ACK                      2
2007
1885
#define FLAG_STATE_ACTIVE                   FLAG_STATE_ACK
2008
1886
#define FLAG_STATE_BEGIN                    FLAG_STATE_ACTIVE
2069
1947
#define DEFAULT_NTOP_OTHER_PKT_DUMP         0         /* -j */
2070
1948
#define DEFAULT_NTOP_PCAP_LOG_FILENAME      NULL      /* -l */
2071
1949
#define DEFAULT_NTOP_LOCAL_SUBNETS          NULL      /* -m */
2072
 
#define DEFAULT_NTOP_NUMERIC_IP_ADDRESSES   0         /* -n */
 
1950
#define DEFAULT_NTOP_NUMERIC_IP_ADDRESSES   dnsResolutionForAll   /* -n */
2073
1951
#define DEFAULT_NTOP_DONT_TRUST_MAC_ADDR    0         /* -o */
2074
1952
#define DEFAULT_NTOP_PROTO_SPECS            NULL      /* -p */
2075
1953
#define DEFAULT_NTOP_SUSPICIOUS_PKT_DUMP    0         /* -q */
2112
1990
 */
2113
1991
#define DEFAULT_TRACE_LEVEL                 3
2114
1992
 
 
1993
#if 0
2115
1994
#define DEFAULT_NTOP_MAPPER_URL             "http://www.ntop.org/cgi-bin/mapper.pl" /* -U -*/
2116
 
 
2117
 
#ifdef MAKE_WITH_SCHED_YIELD
2118
 
#define DEFAULT_NTOP_SCHED_YIELD            TRUE
 
1995
#else
 
1996
#define DEFAULT_NTOP_MAPPER_URL             "http://geotool.servehttp.com/" /* -U -*/
2119
1997
#endif
2120
1998
 
2121
1999
#define DEFAULT_NTOP_FCNS_FILE              NULL
2161
2039
/* #define MAX_HOSTS_PURGE_PER_CYCLE 512 */
2162
2040
 
2163
2041
/*
2164
 
 * TCP Wrapper defaults
2165
 
 */
2166
 
#ifdef HAVE_LIBWRAP
2167
 
 #ifdef MAKE_WITH_SYSLOG
2168
 
  #define DEFAULT_TCPWRAP_ALLOW             LOG_AUTHPRIV|LOG_INFO
2169
 
  #define DEFAULT_TCPWRAP_DENY              LOG_AUTHPRIV|LOG_WARNING
2170
 
 #else
2171
 
  #define DEFAULT_TCPWRAP_ALLOW             0
2172
 
  #define DEFAULT_TCPWRAP_DENY              0
2173
 
 #endif
2174
 
#endif
2175
 
 
2176
 
/*
2177
2042
 * Default port to use for netflow.
2178
2043
 */
2179
2044
#define DEFAULT_NETFLOW_PORT_STR   "2055"
2185
2050
#define DEFAULT_SFLOW_PORT        atoi(DEFAULT_SFLOW_COLLECTOR_PORT_STR)
2186
2051
 
2187
2052
/*
 
2053
 * Default port to use for cPacket.
 
2054
 */
 
2055
#define DEFAULT_CPACKET_PORT_STR   "20167"
 
2056
 
 
2057
/*
2188
2058
 *  Sampling rate - sflow samples every n-th packet
2189
2059
 */
2190
2060
#define DEFAULT_SFLOW_SAMPLING_RATE  "400"
2294
2164
 *  these ETHERTYPE_ constants aren't defined in <net/ethernet.h>
2295
2165
 */
2296
2166
#ifndef ETHERTYPE_IPv6
2297
 
 #define ETHERTYPE_IPv6       0x86DD
 
2167
#define ETHERTYPE_IPv6       0x86DD
2298
2168
#endif
2299
2169
 
2300
2170
#ifndef ETHERTYPE_802_1Q
2301
 
 #define ETHERTYPE_802_1Q     0x8100
2302
 
#endif
 
2171
#define ETHERTYPE_802_1Q     0x8100
 
2172
#endif
 
2173
 
 
2174
#ifndef ETHERTYPE_MPLS
 
2175
#define ETHERTYPE_MPLS          0x8847  /* MPLS protocol */
 
2176
#endif
 
2177
 
 
2178
#ifndef ETHERTYPE_MPLS_MULTI
 
2179
#define ETHERTYPE_MPLS_MULTI    0x8848  /* MPLS multicast packet */
 
2180
#endif
 
2181
 
 
2182
#define MAX_NUM_MPLS_LABELS     10
 
2183
#define MPLS_LABEL_LEN           3
2303
2184
 
2304
2185
#ifndef ETHERMTU
2305
 
 #define ETHERMTU             1500
 
2186
#define ETHERMTU             1500
2306
2187
#endif
2307
2188
 
2308
2189
/* Additional ethertypes for FC */
2511
2392
 
2512
2393
#endif /* MAKE_NTOP_PACKETSZ_DECLARATIONS */
2513
2394
 
2514
 
#ifndef INT16SZ
2515
 
 #define HFIXEDSZ      12              /* #/bytes of fixed data in header */
2516
 
 #define INT32SZ       4               /* for systems without 32-bit ints */
2517
 
 #define INT16SZ       2               /* for systems without 16-bit ints */
2518
 
 #define INADDRSZ      4               /* IPv4 T_A */
2519
 
 #define IN6ADDRSZ     16              /* IPv6 T_AAAA */
2520
 
#endif /* INT16SZ */
2521
 
 
2522
 
#ifndef NS_INT16SZ
2523
 
 #define NS_INT16SZ                         sizeof(u_int16_t)  /* #/bytes of data in a u_int16_t */
2524
 
#endif
2525
 
 
2526
 
#ifndef NS_CMPRSFLGS
2527
 
 #define NS_CMPRSFLGS                       0xc0
2528
 
#endif
2529
 
 
2530
 
#ifndef NS_MAXCDNAME
2531
 
 #define NS_MAXCDNAME                       255
2532
 
#endif
2533
 
 
2534
2395
/* End the <arpa/nameser_compat.h> stuff */
2535
2396
 
2536
2397
/* ******************************* */
2608
2469
 #define IPPROTO_OSPF                       89
2609
2470
#endif
2610
2471
 
 
2472
#ifndef IPPROTO_GRE
 
2473
 #define IPPROTO_GRE                       47
 
2474
#endif
 
2475
 
2611
2476
/* Internet Group Management Protocol */
2612
2477
#ifndef IPPROTO_IGMP
2613
 
 #define IPPROTO_IGMP                       2
 
2478
#define IPPROTO_IGMP                       2
 
2479
#endif
 
2480
 
 
2481
/* IPSec Encapsulating Security Protocol (ESP) */
 
2482
#ifndef IPPROTO_IPSEC_ESP
 
2483
#define IPPROTO_IPSEC_ESP 0x32
 
2484
#endif
 
2485
 
 
2486
/* IPSec Authentication Header (AH) */
 
2487
#ifndef IPPROTO_IPSEC_AH
 
2488
#define IPPROTO_IPSEC_AH  0x33
2614
2489
#endif
2615
2490
 
2616
2491
/* ******************************* */
2814
2689
#define IP_TCP_PORT_JETDIRECT      9100
2815
2690
#define IP_TCP_PORT_SKYPE          54045
2816
2691
 
 
2692
/* GeoIP - http://www.maxmind.com */
 
2693
#define GEO_IP_FILE                "GeoLiteCity.dat"
 
2694
#define GEO_IP_ASN_FILE            "GeoIPASNum.dat"
 
2695
 
2817
2696
#define NULL_VALUE                 "(null)"
2818
2697
 
2819
2698
/* NTOP preference names */
2820
2699
#define NTOP_PREF_DEVICES                "ntop.devices"
2821
 
#define NTOP_PREF_CAPFILE                "ntop.rFileName"
2822
2700
#define NTOP_PREF_FILTER                 "ntop.currentFilterExpression"
2823
2701
#define NTOP_PREF_SAMPLING               "ntop.sampleRate"
2824
2702
#define NTOP_PREF_WEBPORT                "ntop.webPort"
2827
2705
#define NTOP_PREF_EN_PROTO_DECODE        "ntop.enablePacketDecoding"
2828
2706
#define NTOP_PREF_FLOWSPECS              "ntop.flowSpecs"
2829
2707
#define NTOP_PREF_LOCALADDR              "ntop.localAddresses"
 
2708
#define NTOP_PREF_KNOWNSUBNETS           "ntop.knownSubnetworks"
2830
2709
#define NTOP_PREF_SPOOLPATH              "ntop.spoolPath"
2831
2710
#define NTOP_PREF_STICKY_HOSTS           "ntop.stickyHosts"
2832
2711
#define NTOP_PREF_TRACK_LOCAL            "ntop.trackOnlyLocalHosts"
2834
2713
#define NTOP_PREF_DAEMON                 "ntop.daemonMode"
2835
2714
#define NTOP_PREF_REFRESH_RATE           "ntop.refreshRate"
2836
2715
#define NTOP_PREF_MAXLINES               "ntop.maxNumLines"
2837
 
#define NTOP_PREF_PRINT_FCORIP           "ntop.printFcOrIp"
2838
 
#define NTOP_PREF_NO_INVLUN              "ntop.noInvalidLunDisplay"
2839
2716
#define NTOP_PREF_W3C                    "ntop.w3c"
2840
2717
#define NTOP_PREF_IPV4                   "ntop.ipv4"
2841
2718
#define NTOP_PREF_IPV6                   "ntop.ipv6"
2845
2722
#define NTOP_PREF_PROTOSPECS             "ntop.protoSpecs"
2846
2723
#define NTOP_PREF_P3PCP                  "ntop.P3Pcp"
2847
2724
#define NTOP_PREF_P3PURI                 "ntop.P3Puri"
 
2725
 
 
2726
#ifdef ENABLE_FC
2848
2727
#define NTOP_PREF_WWN_MAP                "ntop.fcNSCacheFile"
 
2728
#define NTOP_PREF_PRINT_FCORIP           "ntop.printFcOrIp"
 
2729
#define NTOP_PREF_NO_INVLUN              "ntop.noInvalidLunDisplay"
 
2730
#endif
 
2731
 
2849
2732
#define NTOP_PREF_MAXHASH                "ntop.maxNumHashEntries"
2850
2733
#define NTOP_PREF_SQL_DB_CONFIG          "ntop.sqlDbConfig"
2851
2734
#define NTOP_PREF_SQL_REC_LIFETIME       "ntop.sqlRecDaysLifetime"
2852
2735
#define NTOP_PREF_SAVE_REC_INTO_DB       "ntop.saveRecordsIntoDb"
2853
2736
#define NTOP_PREF_SAVE_SESSIONS_INTO_DB  "ntop.saveSessionsIntoDb"
2854
2737
#define NTOP_PREF_MAXSESSIONS            "ntop.maxNumSessions"
 
2738
#define NTOP_PREF_LIVE_MODE              "ntop.liveMode"
 
2739
#define NTOP_PREF_NET_EFFICIENCY         "ntop.netEfficiency"
2855
2740
#define NTOP_PREF_MERGEIF                "ntop.mergeInterfaces"
2856
2741
#define NTOP_PREF_ENABLE_L7PROTO         "ntop.enableL7Proto"
2857
2742
#define NTOP_PREF_NO_ISESS_PURGE         "ntop.disableInstantSessionPurge"
2858
2743
#define NTOP_PREF_NO_TRUST_MAC           "ntop.dontTrustMACaddr"
2859
2744
#define NTOP_PREF_PCAP_LOGBASE           "ntop.pcapLogBasePath"
2860
 
#define NTOP_PREF_USE_SSLWATCH           "ntop.useSSLwatchdog"
2861
 
#define NTOP_PREF_NO_SCHEDYLD            "ntop.schedYield"
2862
2745
#define NTOP_PREF_DBG_MODE               "ntop.debugMode"
2863
2746
#define NTOP_PREF_TRACE_LVL              "ntop.traceLevel"
2864
2747
#define NTOP_PREF_DUMP_OTHER             "ntop.enableOtherPacketDump"
2878
2761
#define NTOP_PREF_VALUE_AF_BOTH      AF_UNSPEC
2879
2762
 
2880
2763
#define COMMUNITY_PREFIX             "community."
 
2764
 
 
2765
#define UNKNOWN_SUBNET_ID ((int8_t)-1)
 
2766
#define ALL_SUBNET_IDS    ((int8_t)-2)
 
2767
 
 
2768
/* *************************** */
 
2769
 
 
2770
#define DEFAULT_NTOP_PLUGINS_INSTALL    "/usr/local/lib/ntop/plugins"
 
2771
#define DEFAULT_NTOP_HTML_INSTALL       "/usr/local/share/ntop"
 
2772
#define DEFAULT_NTOP_CFG_CONFIGFILE_DIR "/usr/local/etc/ntop"
 
2773
 
 
2774
#define DOMAIN_VIEW          0
 
2775
#define NETWORK_VIEW         1
 
2776
#define AS_VIEW              2
 
2777
#define AS_GRAPH_VIEW        3
 
2778
 
 
2779
#define EVENTS_MASK          "events.mask"
 
2780
#define EVENTS_LOG           "events.log"
 
2781
 
 
2782
/* *************************** */
 
2783
 
 
2784
#define MAX_NUM_INTERFACE_NETWORKS      128
 
2785
 
 
2786
#define quickLock(_a_, _b_) accessMutex(&myGlobals.device[_b_].counterMutex, "quickLock");
 
2787
#define quickUnlock(_a_, _b_) releaseMutex(&myGlobals.device[_b_].counterMutex);
 
2788
 
 
2789
#define incrementHostTrafficCounter(_a_, _b_, _c_) { \
 
2790
    quickLock(_a_, actualDeviceId); \
 
2791
    if((myGlobals.numKnownSubnets > 0) && (_a_->known_subnet_id != UNKNOWN_SUBNET_ID)) \
 
2792
      incrementTrafficCounter(&myGlobals.device[actualDeviceId].networkHost[_a_->known_subnet_id]._b_,_c_); \
 
2793
    incrementTrafficCounter(&_a_->_b_, _c_); \
 
2794
    quickUnlock(_a_, actualDeviceId); \
 
2795
}
 
2796
 
 
2797
#define allocHostTrafficCounterMemory(_a_, _b_, _c_) { \
 
2798
    quickLock(_a_, actualDeviceId); \
 
2799
    if((myGlobals.numKnownSubnets > 0) \
 
2800
       && (_a_->known_subnet_id != UNKNOWN_SUBNET_ID) \
 
2801
       && (myGlobals.device[actualDeviceId].networkHost[_a_->known_subnet_id]._b_ == NULL)) \
 
2802
      myGlobals.device[actualDeviceId].networkHost[_a_->known_subnet_id]._b_ = calloc(_c_, 1); \
 
2803
    if(_a_->_b_ == NULL) \
 
2804
      _a_->_b_ = calloc(_c_, 1); \
 
2805
    quickUnlock(_a_, actualDeviceId); \
 
2806
  }
 
2807
 
 
2808
/* *************************** */