Hi List!
I had a short look, how to implement the name resolution in Conversation/Endpoint lists.
I've changed the following sequence to the add_ett_table_data function in endpoint_talkers_table.c:
switch(talker->src_address.type) {
case(AT_IPv4):
entries[0]=get_hostname((*(guint *)talker->src_address.data));
break;
/* XXX - don't use get_ether_name(), it might resolve to an IP address */
/* case(AT_ETHER):
entries[0]=get_ether_name(talker->src_address.data);
break;*/
default:
entries[0]=address_to_str(&talker->src_address);
}
switch(talker->port_type) {
case(PT_TCP):
entries[1]=get_tcp_port(talker->src_port);
break;
case(PT_UDP):
entries[1]=get_udp_port(talker->src_port);
break;
default:
sport=ett_port_to_str(talker->port_type, talker->src_port);
entries[1]=sport?sport:"";
}
It seems to be working fine with this stuff. However, I'm very unsure, if this will produce any memory leaks, as I have currently very limited knowledge of the name resolution functions.
So my question: is it ok to use get_hostname() and alike functions without freeing any memory later?
Regards, ULFL
_____________________________________________________________________
Der WEB.DE Virenschutz schuetzt Ihr Postfach vor dem Wurm Netsky.A-P!
Kostenfrei fuer alle FreeMail Nutzer. http://f.web.de/?mc=021157