tcpdump mailing list archives
Re: significance of init_addrtoname()
From: alex medvedev <alexm () pycckue org>
Date: Sun, 23 Nov 2003 18:27:26 -0600 (CST)
Hi, no, no problem is caused by calling init_addrtoname(). i am trying to change a tcpdump-like tool that uses proprietary format for dumping packets to a file to use libpcap. the tool uses really old tcpdump code with sf_write_init, sf_write, sf_read and friends when reading from bpf and writing to a file. at some point it calls init_addrtoname(). what i wanted to do is to make this tool's code independent of the old tcpdump code and use the new pcap interface. init_addrtoname() is staying in my way :) omitting it from the code did not make any difference for the tool operation. therefore, i was wondering if i am seriously breaking smth by omitting init_addrtoname(). thank! -alexm 18:19 23/11/2003 On Sun, 23 Nov 2003, Guy Harris wrote:
On Sun, Nov 23, 2003 at 01:55:16PM -0600, alex medvedev wrote:why do we need to call init_addrtoname() function in tcpdump.c?Because, otherwise, the hash tables used to look up the values in the tables aren't constructed, and the "f_localnet" and "f_netmask" global variables used for the "-f" flag aren't initialized.what happens if we don't call it? :)The same thing that happens if you run tcpdump with "-n", except that the "-f" flag won't work correctly if you don't call "init_addrtoname()". What problem is caused by calling it? - This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe
- This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe
Current thread:
- significance of init_addrtoname() alex medvedev (Nov 23)
- Re: significance of init_addrtoname() Guy Harris (Nov 23)
- Re: significance of init_addrtoname() alex medvedev (Nov 23)
- Re: significance of init_addrtoname() Guy Harris (Nov 23)
- Re: significance of init_addrtoname() alex medvedev (Nov 23)
- Re: significance of init_addrtoname() Guy Harris (Nov 23)