Author: andrews
Date: 2008-06-07 13:12:00 +0200 (Sat, 07 Jun 2008)
New Revision: 3531

Modified:
   trunk/n2n/edge.c
   trunk/n2n/n2n.c
   trunk/n2n/n2n.h
   trunk/n2n/supernode.c
Log:
Summary: Removed global variables from edge.

--------
ABC    edge.c
 BC    n2n.h
  C    supernode.c
  C    n2n.c
--------

A: Remove use of global variables from edge operation.

B: Add n2n_edge_t for edge instances and some other types for recurring
patterns.

C: Modify function parameter passing to use new structure types for common
patterns.

--------

Testing

Tested on x86 Fedora 4 and Debian. Tested against refernce edge to ensure
complete interoperability. Load tested via flood ping and scp of 100 MB file.


Commentary

The driving reason behind these changes is to make it easier to make edge into a
library which can be used in other programs. An example which comes to mind is a
python extension which would allow python to start/stop/control/monitor edge
instances. The final step is to remove main() to a separate implementation unit
and provide edge functionality via libedge.

Note: Some global variables are still used in the tracing code. This needs to be
re-examined at some stage but it is not sufficient to prevent multiple instances
from operating in one program, but they must all have the same tracing level and
useSyslog value.

Although it was intended that supernode would also be modified in a similar
fashion, the HTTP tunneling code in supernode makes this change very
difficult. Thankfully supernode is not as critical because the supernode should
be well removed from user interaction and so the driver for making it a library
is not there.


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

Reply via email to