tcpdump mailing list archives

Re: tok2str() patch


From: Michael Richardson <mcr () sandelman ottawa on ca>
Date: Thu, 29 Apr 2004 09:14:12 -0400

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


I noticed that the tok2str() patch was applied.

I modified it slightly. Instead of just rotating buffers, I introduced a
new API that provides the buffer itself. I changed tok2str() to allocate
a new buffer as it did before, and call tok2strbuf().

Please use tok2strbuf() in all new code.  I did print-bgp.c.

I will be doing the netdissect changes to more files in the next few
weeks.  I will write an email giving a cookbook on what is going on.

The goal here is to be able to use the tcpdump dissectors as a library,
sending the output to an arbitrary place.  Perhaps we can trivially use
this initially as part of a priveledge seperation effort.  

Are there major concerns about performance while printing stuff?  I am
thinking that the best way to get packets *to* the printer is to
allocate X-many buffers and put the data there. I think that some pcap
drivers support doing this. One would just inform the child which buffer
is active by writing a single byte down a pipe.  In this case, the child
would just fprintf() to a shared stdio, I think.

My opinion is that we should not privsep for -w option. Since -w causes
no printing at all, it shouldn't be an issue, I think.

- --
]       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

iQCVAwUBQJD/ooqHRg3pndX9AQGeBAQAwfZd165lOjEkxC8JxBEpwFALVtH8euSS
+Wlfo+YFfVO8cp4/FUp9yD37uDF4tZkgeCu2qTOqJ34XFpD1KrVzbcYA8af5z6ur
6nOtN/D02nLzAt8Ayoe5YgLzOo9KEAZEWME5b42ZAnTbSPXvJC8SVvVJKiCvGAE7
9Jp6VHoPiak=
=KYHo
-----END PGP SIGNATURE-----
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.


Current thread: