Replace guchar * with gchar * and get rid of many signedness warnings.

svn path=/trunk/; revision=9643
This commit is contained in:
Olivier Biot 2004-01-10 17:31:40 +00:00
parent a6ff7799a2
commit 40a74b1ff5
2 changed files with 42 additions and 42 deletions

View File

@ -1,7 +1,7 @@
/* resolv.c /* resolv.c
* Routines for network object lookup * Routines for network object lookup
* *
* $Id: resolv.c,v 1.40 2004/01/05 18:10:02 ulfl Exp $ * $Id: resolv.c,v 1.41 2004/01/10 17:31:40 obiot Exp $
* *
* Laurent Deniel <laurent.deniel@free.fr> * Laurent Deniel <laurent.deniel@free.fr>
* *
@ -124,7 +124,7 @@
typedef struct hashname { typedef struct hashname {
guint addr; guint addr;
guchar name[MAXNAMELEN]; gchar name[MAXNAMELEN];
gboolean is_dummy_entry; /* name is IP address in dot format */ gboolean is_dummy_entry; /* name is IP address in dot format */
struct hashname *next; struct hashname *next;
} hashname_t; } hashname_t;
@ -186,7 +186,7 @@ static hashipxnet_t *ipxnet_table[HASHIPXNETSIZE];
static int eth_resolution_initialized = 0; static int eth_resolution_initialized = 0;
static int ipxnet_resolution_initialized = 0; static int ipxnet_resolution_initialized = 0;
static hashether_t *add_eth_name(const guint8 *addr, const guchar *name); static hashether_t *add_eth_name(const guint8 *addr, const gchar *name);
/* /*
* Flag controlling what names to resolve. * Flag controlling what names to resolve.
@ -230,7 +230,7 @@ GList *adns_queue_head = NULL;
* Local function definitions * Local function definitions
*/ */
static guchar *serv_name_lookup(guint port, port_type proto) static gchar *serv_name_lookup(guint port, port_type proto)
{ {
int hash_idx; int hash_idx;
hashname_t *tp; hashname_t *tp;
@ -307,7 +307,7 @@ static void abort_network_query(int sig _U_)
} }
#endif /* AVOID_DNS_TIMEOUT */ #endif /* AVOID_DNS_TIMEOUT */
static guchar *host_name_lookup(guint addr, gboolean *found) static gchar *host_name_lookup(guint addr, gboolean *found)
{ {
int hash_idx; int hash_idx;
hashname_t * volatile tp; hashname_t * volatile tp;
@ -408,9 +408,9 @@ static guchar *host_name_lookup(guint addr, gboolean *found)
} /* host_name_lookup */ } /* host_name_lookup */
static guchar *host_name_lookup6(struct e_in6_addr *addr, gboolean *found) static gchar *host_name_lookup6(struct e_in6_addr *addr, gboolean *found)
{ {
static guchar name[MAXNAMELEN]; static gchar name[MAXNAMELEN];
#ifdef INET6 #ifdef INET6
struct hostent *hostp; struct hostent *hostp;
@ -683,7 +683,7 @@ static ether_t *get_ethent(unsigned int *mask, gboolean manuf_file)
} /* get_ethent */ } /* get_ethent */
static ether_t *get_ethbyname(const guchar *name) static ether_t *get_ethbyname(const gchar *name)
{ {
ether_t *eth; ether_t *eth;
@ -771,7 +771,7 @@ static int hash_eth_wka(const guint8 *addr, unsigned int mask)
(HASHETHSIZE - 1); (HASHETHSIZE - 1);
} }
static void add_manuf_name(guint8 *addr, unsigned int mask, guchar *name) static void add_manuf_name(guint8 *addr, unsigned int mask, gchar *name)
{ {
int hash_idx; int hash_idx;
hashmanuf_t *tp; hashmanuf_t *tp;
@ -945,7 +945,7 @@ static void initialize_ethers(void)
} /* initialize_ethers */ } /* initialize_ethers */
static hashether_t *add_eth_name(const guint8 *addr, const guchar *name) static hashether_t *add_eth_name(const guint8 *addr, const gchar *name)
{ {
int hash_idx; int hash_idx;
hashether_t *tp; hashether_t *tp;
@ -986,7 +986,7 @@ static hashether_t *add_eth_name(const guint8 *addr, const guchar *name)
} /* add_eth_name */ } /* add_eth_name */
static guchar *eth_name_lookup(const guint8 *addr) static gchar *eth_name_lookup(const guint8 *addr)
{ {
int hash_idx; int hash_idx;
hashmanuf_t *manufp; hashmanuf_t *manufp;
@ -1130,7 +1130,7 @@ static guchar *eth_name_lookup(const guint8 *addr)
} /* eth_name_lookup */ } /* eth_name_lookup */
static guint8 *eth_addr_lookup(const guchar *name) static guint8 *eth_addr_lookup(const gchar *name)
{ {
ether_t *eth; ether_t *eth;
hashether_t *tp; hashether_t *tp;
@ -1251,7 +1251,7 @@ static ipxnet_t *get_ipxnetent(void)
} /* get_ipxnetent */ } /* get_ipxnetent */
static ipxnet_t *get_ipxnetbyname(const guchar *name) static ipxnet_t *get_ipxnetbyname(const gchar *name)
{ {
ipxnet_t *ipxnet; ipxnet_t *ipxnet;
@ -1323,7 +1323,7 @@ static void initialize_ipxnets(void)
} /* initialize_ipxnets */ } /* initialize_ipxnets */
static hashipxnet_t *add_ipxnet_name(guint addr, const guchar *name) static hashipxnet_t *add_ipxnet_name(guint addr, const gchar *name)
{ {
int hash_idx; int hash_idx;
hashipxnet_t *tp; hashipxnet_t *tp;
@ -1354,7 +1354,7 @@ static hashipxnet_t *add_ipxnet_name(guint addr, const guchar *name)
} /* add_ipxnet_name */ } /* add_ipxnet_name */
static guchar *ipxnet_name_lookup(const guint addr) static gchar *ipxnet_name_lookup(const guint addr)
{ {
int hash_idx; int hash_idx;
hashipxnet_t *tp; hashipxnet_t *tp;
@ -1398,7 +1398,7 @@ static guchar *ipxnet_name_lookup(const guint addr)
} /* ipxnet_name_lookup */ } /* ipxnet_name_lookup */
static guint ipxnet_addr_lookup(const guchar *name, gboolean *success) static guint ipxnet_addr_lookup(const gchar *name, gboolean *success)
{ {
ipxnet_t *ipxnet; ipxnet_t *ipxnet;
hashipxnet_t *tp; hashipxnet_t *tp;
@ -1533,7 +1533,7 @@ host_name_lookup_cleanup(void) {
#endif /* HAVE_GNU_ADNS */ #endif /* HAVE_GNU_ADNS */
extern guchar *get_hostname(guint addr) extern gchar *get_hostname(guint addr)
{ {
gboolean found; gboolean found;
@ -1543,7 +1543,7 @@ extern guchar *get_hostname(guint addr)
return host_name_lookup(addr, &found); return host_name_lookup(addr, &found);
} }
extern const guchar *get_hostname6(struct e_in6_addr *addr) extern const gchar *get_hostname6(struct e_in6_addr *addr)
{ {
gboolean found; gboolean found;
@ -1561,7 +1561,7 @@ extern const guchar *get_hostname6(struct e_in6_addr *addr)
return host_name_lookup6(addr, &found); return host_name_lookup6(addr, &found);
} }
extern void add_host_name(guint addr, const guchar *name) extern void add_host_name(guint addr, const gchar *name)
{ {
int hash_idx; int hash_idx;
hashname_t *tp; hashname_t *tp;
@ -1600,7 +1600,7 @@ extern void add_host_name(guint addr, const guchar *name)
} /* add_host_name */ } /* add_host_name */
extern guchar *get_udp_port(guint port) extern gchar *get_udp_port(guint port)
{ {
static gchar str[3][MAXNAMELEN]; static gchar str[3][MAXNAMELEN];
static gchar *cur; static gchar *cur;
@ -1621,7 +1621,7 @@ extern guchar *get_udp_port(guint port)
} /* get_udp_port */ } /* get_udp_port */
extern guchar *get_tcp_port(guint port) extern gchar *get_tcp_port(guint port)
{ {
static gchar str[3][MAXNAMELEN]; static gchar str[3][MAXNAMELEN];
static gchar *cur; static gchar *cur;
@ -1642,7 +1642,7 @@ extern guchar *get_tcp_port(guint port)
} /* get_tcp_port */ } /* get_tcp_port */
extern guchar *get_sctp_port(guint port) extern gchar *get_sctp_port(guint port)
{ {
static gchar str[3][MAXNAMELEN]; static gchar str[3][MAXNAMELEN];
static gchar *cur; static gchar *cur;
@ -1663,7 +1663,7 @@ extern guchar *get_sctp_port(guint port)
} /* get_sctp_port */ } /* get_sctp_port */
extern guchar *get_ether_name(const guint8 *addr) extern gchar *get_ether_name(const guint8 *addr)
{ {
if (!(g_resolv_flags & RESOLV_MAC)) if (!(g_resolv_flags & RESOLV_MAC))
return ether_to_str(addr); return ether_to_str(addr);
@ -1681,7 +1681,7 @@ extern guchar *get_ether_name(const guint8 *addr)
* If it's not found, simply return NULL. We DO NOT make a new * If it's not found, simply return NULL. We DO NOT make a new
* hash entry for it with the hex digits turned into a string. * hash entry for it with the hex digits turned into a string.
*/ */
guchar *get_ether_name_if_known(const guint8 *addr) gchar *get_ether_name_if_known(const guint8 *addr)
{ {
int hash_idx; int hash_idx;
hashether_t *tp; hashether_t *tp;
@ -1736,7 +1736,7 @@ guchar *get_ether_name_if_known(const guint8 *addr)
} }
extern guint8 *get_ether_addr(const guchar *name) extern guint8 *get_ether_addr(const gchar *name)
{ {
/* force resolution (do not check g_resolv_flags) */ /* force resolution (do not check g_resolv_flags) */
@ -1753,7 +1753,7 @@ extern guint8 *get_ether_addr(const guchar *name)
extern void add_ether_byip(guint ip, const guint8 *eth) extern void add_ether_byip(guint ip, const guint8 *eth)
{ {
guchar *host; gchar *host;
gboolean found; gboolean found;
/* first check that IP address can be resolved */ /* first check that IP address can be resolved */
@ -1768,7 +1768,7 @@ extern void add_ether_byip(guint ip, const guint8 *eth)
} /* add_ether_byip */ } /* add_ether_byip */
extern const guchar *get_ipxnet_name(const guint32 addr) extern const gchar *get_ipxnet_name(const guint32 addr)
{ {
if (!(g_resolv_flags & RESOLV_NETWORK)) { if (!(g_resolv_flags & RESOLV_NETWORK)) {
@ -1784,7 +1784,7 @@ extern const guchar *get_ipxnet_name(const guint32 addr)
} /* get_ipxnet_name */ } /* get_ipxnet_name */
extern guint32 get_ipxnet_addr(const guchar *name, gboolean *known) extern guint32 get_ipxnet_addr(const gchar *name, gboolean *known)
{ {
guint32 addr; guint32 addr;
gboolean success; gboolean success;
@ -1803,7 +1803,7 @@ extern guint32 get_ipxnet_addr(const guchar *name, gboolean *known)
} /* get_ipxnet_addr */ } /* get_ipxnet_addr */
extern const guchar *get_manuf_name(const guint8 *addr) extern const gchar *get_manuf_name(const guint8 *addr)
{ {
static gchar str[3][MAXMANUFLEN]; static gchar str[3][MAXMANUFLEN];
static gchar *cur; static gchar *cur;

View File

@ -1,7 +1,7 @@
/* resolv.h /* resolv.h
* Definitions for network object lookup * Definitions for network object lookup
* *
* $Id: resolv.h,v 1.14 2003/07/22 03:14:30 gerald Exp $ * $Id: resolv.h,v 1.15 2004/01/10 17:31:40 obiot Exp $
* *
* Laurent Deniel <laurent.deniel@free.fr> * Laurent Deniel <laurent.deniel@free.fr>
* *
@ -59,13 +59,13 @@ extern gchar *g_pipxnets_path;
extern void resolv_set_flags(guint32 flags); extern void resolv_set_flags(guint32 flags);
/* get_tcp_port returns the UDP port name or "%u" if not found */ /* get_tcp_port returns the UDP port name or "%u" if not found */
extern guchar *get_udp_port(guint port); extern gchar *get_udp_port(guint port);
/* get_tcp_port returns the TCP port name or "%u" if not found */ /* get_tcp_port returns the TCP port name or "%u" if not found */
extern guchar *get_tcp_port(guint port); extern gchar *get_tcp_port(guint port);
/* get_sctp_port returns the SCTP port name or "%u" if not found */ /* get_sctp_port returns the SCTP port name or "%u" if not found */
extern guchar *get_sctp_port(guint port); extern gchar *get_sctp_port(guint port);
/* /*
* Asynchronous host name lookup initialization, processing, and cleanup * Asynchronous host name lookup initialization, processing, and cleanup
@ -82,37 +82,37 @@ extern gint host_name_lookup_process(gpointer data);
extern void host_name_lookup_cleanup(void); extern void host_name_lookup_cleanup(void);
/* get_hostname returns the host name or "%d.%d.%d.%d" if not found */ /* get_hostname returns the host name or "%d.%d.%d.%d" if not found */
extern guchar *get_hostname(guint addr); extern gchar *get_hostname(guint addr);
/* get_hostname6 returns the host name, or numeric addr if not found */ /* get_hostname6 returns the host name, or numeric addr if not found */
struct e_in6_addr; struct e_in6_addr;
const guchar* get_hostname6(struct e_in6_addr *ad); const gchar* get_hostname6(struct e_in6_addr *ad);
/* get_ether_name returns the logical name if found in ethers files else /* get_ether_name returns the logical name if found in ethers files else
"<vendor>_%02x:%02x:%02x" if the vendor code is known else "<vendor>_%02x:%02x:%02x" if the vendor code is known else
"%02x:%02x:%02x:%02x:%02x:%02x" */ "%02x:%02x:%02x:%02x:%02x:%02x" */
extern guchar *get_ether_name(const guint8 *addr); extern gchar *get_ether_name(const guint8 *addr);
/* get_ether_name returns the logical name if found in ethers files else NULL */ /* get_ether_name returns the logical name if found in ethers files else NULL */
extern guchar *get_ether_name_if_known(const guint8 *addr); extern gchar *get_ether_name_if_known(const guint8 *addr);
/* get_manuf_name returns the vendor name or "%02x:%02x:%02x" if not known */ /* get_manuf_name returns the vendor name or "%02x:%02x:%02x" if not known */
extern const guchar *get_manuf_name(const guint8 *addr); extern const gchar *get_manuf_name(const guint8 *addr);
/* get_ipxnet_name returns the logical name if found in an ipxnets file, /* get_ipxnet_name returns the logical name if found in an ipxnets file,
* or a string formatted with "%X" if not */ * or a string formatted with "%X" if not */
extern const guchar *get_ipxnet_name(const guint32 addr); extern const gchar *get_ipxnet_name(const guint32 addr);
/* returns the ethernet address corresponding to name or NULL if not known */ /* returns the ethernet address corresponding to name or NULL if not known */
extern guint8 *get_ether_addr(const guchar *name); extern guint8 *get_ether_addr(const gchar *name);
/* returns the ipx network corresponding to name. If name is unknown, /* returns the ipx network corresponding to name. If name is unknown,
* 0 is returned and 'known' is set to FALSE. On success, 'known' * 0 is returned and 'known' is set to FALSE. On success, 'known'
* is set to TRUE. */ * is set to TRUE. */
guint32 get_ipxnet_addr(const guchar *name, gboolean *known); guint32 get_ipxnet_addr(const gchar *name, gboolean *known);
/* adds a hostname/IP in the hash table */ /* adds a hostname/IP in the hash table */
extern void add_host_name(guint addr, const guchar *name); extern void add_host_name(guint addr, const gchar *name);
/* add ethernet address / name corresponding to IP address */ /* add ethernet address / name corresponding to IP address */
extern void add_ether_byip(guint ip, const guint8 *eth); extern void add_ether_byip(guint ip, const guint8 *eth);