[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tcpdump-workers
Subject:    [tcpdump-workers] netdissect.h
From:       Michael Richardson <mcr () sandelman ! ottawa ! on ! ca>
Date:       2004-04-30 19:04:38
Message-ID: 31053.1083351878 () marajade ! sandelman ! ottawa ! on ! ca
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----


To switch a file to "netdissect.h" interface, do the following:

1) change #include "interface.h" -> #include "netdisssect.h"

2) add "netdisssect_options *ndo" as the first argument to the print
   routine.

3) move the prototype for the routine in netdissect.h from out of the
   #if 0, and remove it from interface.h

4) change all calls like
   (void)printf(STUFF);

to:
   ND_PRINT((ndo, STUFF));

5) change all calls like:
   default_print(A,B)

to:
   ND_DEFAULT_PRINT(A,B);

(later has implicit reference to "ndo" variable)

6) change all places that call blah_print() to call it as:
   blah_print(gndo, ...)

   (later are easily found by compiling and looking for mis-matches
   against prototypes)

   Except is that if the call is already in a netdissect.h'ified
   routine, then it should be "ndo" rather than "gndo".

Once we are done all of the files, there will be some dead code in
tcpdump.c that we can get rid of, and then we can refactor some of the
remaining code a bit more.

I hope everyone can see the point of this effort.

- --
]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls  [
]   Michael Richardson,    Xelerance Corporation, Ottawa, ON    |net architect[
] mcr@xelerance.com      http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [


	
	




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Finger me for keys

iQCVAwUBQJKjQ4qHRg3pndX9AQHmuAP+O0CgIO3hQn7XaiAwoXTIpvpwWAkdxJ82
xbfnn6Gn6SLpMASAvZMW5uQpyOtlRwGn8gUdDgMhnNd0XJe1CgVl1qrYi1NmrQIm
Sf6Ol4axeVpfeegNJrkiT7aqbpKmWLTVE7sibltRMjh5vQHsiHZQATXN4tc7XJul
NioY0BeOfA0=
=riAM
-----END PGP SIGNATURE-----
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic