Update of /export/home/ntop/ntop
In directory jabber:/tmp/cvs-serv12983

Modified Files:
        Makefile.am Makefile.in address.c admin.c config.h.in 
        configure configure.in dataFormat.c emitter.c globals-core.c 
        globals-core.h globals-report.h globals.h graph.c hash.c 
        http.c initialize.c leaks.c main.c netflow.c ntop.c ntop.h 
        ntop_win32.c ntop_win32.h pbuf.c plugin.c protocols.c report.c 
        reportUtils.c sessions.c ssl.c term.c traffic.c util.c 
        vendor.c webInterface.c 
Added Files:
        globals-defines.h globals-structtypes.h 
Log Message:

This is a MASSIVE change - albeit one that should have close to zero functional impact.
I didn't succeed, there are a couple of really minor items, such as eliminating the 
doubling of _DEBUG reports in info.html and better statistics on the hash table 
loads/collisions.

But ntop 2.1.55 should function exactly like 2.1.54.

If it doesn't well, then there's a problem somewhere.

While this change SHOULD have no affect on ntop, there is always the possibility of a 
problem, so I'm alerting you to be on the look out...  mostly for compile (make) 
problems.


What this change does is to break up and reorganize the ntop.h and globals.h files 
into 
the following (this is taken from the comments in the new ntop.h):

ntop's defines - what's what and what's where

ntop.h
  This is the 'control' for the various globals-*.h files.  It's a single
  include to drag in the necessary headers, defines ntop data structures
  (e.g. the structs), etc.

  A few globally #defined items which control expansion of the standard
  and system headers MUST be here.

  Any tests - #if () #error #endif type stuff goes here at the bottom.

  ntop.h includes
     config.h -- generated by ./configure

     various standard and system headers

     globals-defines.h
          All of the #defines used by ntop should be here, except for those
          explicitly discussed below.

     globals-structtypes.h
          Every struct and typedef, including #define used instead of typedef.

   and

     globals-core.h
          This defines the extern functions, exported from one ntop source file to
          the others.
          "function" which are actually #define macros are here.

  All programs must include ntop.h.  Any program which requires the "reporting"
  functions also have to include globals-report.h.


All of the struct and typedef declarations were placed into the globals-structtypes.h,
unchanged except to sequence them so that no forward declarations were required.

As part of the reorg, almost all of the #define values in ntop have been moved into 
globals-defines.h renamed into what I hope is a logical naming convention AND 
DOCUMENTED:

/*
 *
 *  This file, included from ntop.h, contains ALL common #define statements.
 *
 *     Changes here affect how ntop compiles.  This includes features that are
 *     enabled, etc.
 *
 *  Names have at least one part that defines their "type".  Listed below in the order
 *  they are most frequently changed.
 *
 *  PARM -- any "PARM" item is an internal tuning item, e.g. one that must be set at
 *  compile time and can not be overridden at run time.
 *
 *  MAKE -- MAKEs are like PARM, but set based on other factors like the os, absence
 *  of other values, etc.
 *
 *  DEBUG -- any "DEBUG" item is not normally set, but if #define(d) causes additional
 *  output fron ntop of a debugging nature.
 *
 *  CONST, LEN and MAX - these are arbitrary values, limits and lengths of fields
 *  (buffer size, ethernet address, et al) and arrays.
 *
 *  FLAG and BITFLAG -- are various constants and flags.
 *           FLAG is a numeric/char value used to mean something
 *           BITFLAG is a value used to test/set a specific bit in a value
 *
 *  HTML -- an "HTML" item is the name of a page produced by the ntop web server.  
Using
 *  these constants ensures that the same name is used for testing and for including in
 *  generated html.  Note that this includes the graphics we use (.jpg, .gif and .png)
 *  regardless of whether it's a generated "page" or just a static included image.
 *
 *  CFG -- any "CFG" item is set in config.h by ./configure indicating that ntop was
 *  requested to be compiled with a particular configuration.  These are not defined in
 *  this file.
 *
 *  HAVE -- any "HAVE" item is set in config.h by ./configure indicating that the .h 
and
 *  .a/.so tests found we have a particular file or library during the testing process.
 *  HAVE items are not defined in this file (they're in config.h).  However -
 *  Note that we don't differentiate in the code between the automatically generated
 *  singular items (HAVE_SSL_H) and the composite ones (generated from a bunch of 
tests,
 *  HAVE_OPENSSL).  Forced and/or Composite items should be defined here.
 *
 *  DEFAULT -- any "DEFAULT" item is the standard, default value of a global data item.
 *  This can be over-ridden (usually) by a command-line pararameter at run-time.
 *  These go pretty much last so they can use values from other classes.
 *
 *  -- any MISSING or EXTERNALLY named item, obviously, has to have the proper missing
 *     or externally named name.  These are grouped after the ntop stuff...
 *
 *  Note that with this initial version (01-2003), there is something less than 100%
 *  adherence to this.  Any corrections, comments, (hopefully) documentation would be
 *  greatly appreciated.
 *
 */

A few #defines, internal to a particular source file were retained in their locations.

The biggest risks from this change are that a number of the OS specific test have been 
rationalised under the -D${OSNAME} value generated from ./configure (e.g. #ifdef 
LINUX, 
#ifdef DARWIN, etc.) vs. the smattering of stuff used previously.

Note that globals.h is gone, except as a place holder file, with a comment telling you 
to look elsewhere.

I've tested this under Linux (extensively), Solaris and FreeBSD 4.6.3.  I've also 
tested 
that it compiles (at least with ./configure --prefix=/usr) under Darwin and MinGW.


Exceptions:

  regex.c - this code comes from ngrep and was not altered.
  qsort.c - this code comes from Bentley & McIlroy's "Engineering a Sort Function" and
             was not altered.

Note - ntop_darwin.h has not been touched.
       globals-report.h is minimally altered.
       ntop_win32.h has had just a few items pulled out where it caused problems 
            compiling due to the sequence of #include statements.



As always, comments et al to the lists...



-----Burton (ref 175)




_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to