Hi,
I have implemented network object name resolving. The current
implemented objects are : IP addresses, UDP and TCP ports.
All name resolutions use a hash table to optimize lookup time
and a mechanism is implemented to avoid long DNS timeout for
hostname lookups.
In attachment, you can see the function prototypes (resolv.h),
the 3 exported functions return the name of the object if found
or the appropriate decimal notation (if not found or if the
name resolution is not actif (g_resolving_actif = 0)).
This global variable controls the module activation, I need
some advices for its use, should I add a process argument or
should I add an option window with a name resolution option
checkbox ... In the last case, can someone help me (I am not
yet familiar with GTK :-)
This module works fine on Linux, I will test it on other platforms,
next week. So expect a patch soon.
Laurent.
--
Laurent DENIEL | E-mail: deniel@xxxxxxxxxxx
Paris, FRANCE | deniel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
| WWW : http://www.worldnet.fr/~deniel
All above opinions are personal, unless stated otherwise.
/* resolv.h
* Definitions for network object lookup
*
* Laurent Deniel <deniel@xxxxxxxxxxx>
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@xxxxxxxx>
* Copyright 1998 Gerald Combs
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __RESOLV_H__
#define __RESOLV_H__
/* global variable */
extern int g_resolving_actif;
/* Functions in resolv.h */
extern u_char *get_udp_port(u_int port);
extern u_char *get_tcp_port(u_int port);
extern u_char *get_hostname(u_int addr);
#endif /* __RESOLV_H__ */