]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/names-net.c
Fixed compilation of GNU/kFreeBSD
[pciutils.git] / lib / names-net.c
index 9de73a7271dccbb486d5e1a1d5784390a3ff5f3d..a1a6e275dd4bcf6c2c4966b4255c6c883dd73420 100644 (file)
@@ -17,6 +17,7 @@
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
+#include <netdb.h>
 
 /*
  * Unfortunately, there are no portable functions for DNS RR parsing,
@@ -36,19 +37,19 @@ enum dns_section {
 
 struct dns_state {
   u16 counts[DNS_NUM_SECTIONS];
-  u8 *sections[DNS_NUM_SECTIONS+1];
-  u8 *sec_ptr, *sec_end;
+  byte *sections[DNS_NUM_SECTIONS+1];
+  byte *sec_ptr, *sec_end;
 
   /* Result of dns_parse_rr(): */
   u16 rr_type;
   u16 rr_class;
   u32 rr_ttl;
   u16 rr_len;
-  u8 *rr_data;
+  byte *rr_data;
 };
 
-static u8 *
-dns_skip_name(u8 *p, u8 *end)
+static byte *
+dns_skip_name(byte *p, byte *end)
 {
   while (p < end)
     {
@@ -71,9 +72,9 @@ dns_skip_name(u8 *p, u8 *end)
 }
 
 static int
-dns_parse_packet(struct dns_state *s, u8 *p, unsigned int plen)
+dns_parse_packet(struct dns_state *s, byte *p, unsigned int plen)
 {
-  u8 *end = p + plen;
+  byte *end = p + plen;
   unsigned int i, j, x, len;
 
 #if 0
@@ -196,7 +197,7 @@ char
   res = res_query(dnsname, ns_c_in, ns_t_txt, answer, sizeof(answer));
   if (res < 0)
     {
-      a->debug("\tfailed, h_errno=%d\n", _res.res_h_errno);
+      a->debug("\tfailed, h_errno=%d\n", h_errno);
       return NULL;
     }
   if (dns_parse_packet(&ds, answer, res) < 0)