Index: validator/libsres/ns_parse.c
===================================================================
--- validator/libsres/ns_parse.c (revision 4295)
+++ validator/libsres/ns_parse.c (revision 4295)
@@ -54,7 +54,7 @@
/*
* These need to be in the same order as the nres.h:ns_flag enum.
*/
-struct _ns_flagdata _ns_flagdata[16] = {
+struct _ns_flagdata _ns_flagdata_flags[16] = {
{0x8000, 15}, /* qr. */
{0x7800, 11}, /* opcode. */
{0x0400, 10}, /* aa. */
@@ -77,15 +77,15 @@
* ns_msg_getflag is a macro on linux, but Solaris and Darwin
* both use defines of the function to map to other function
* names.
+ *
+ * We completely rename the function for internal usage just to independent
*/
-#if !defined(ns_msg_getflag) || defined(sun) || defined(__APPLE__)
int
-ns_msg_getflag(ns_msg han, int flag)
+libsres_msg_getflag(ns_msg han, int flag)
{
- return (((han)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].
+ return (((han)._flags & _ns_flagdata_flags[flag].mask) >> _ns_flagdata_flags[flag].
shift);
}
-#endif
int
ns_skiprr(const u_char * ptr, const u_char * eom, ns_sect section,
--- validator/libsres/res_support.h 2008-07-22 20:24:09.000000000 -0700
+++ validator/libsres/res_support.h 2009-01-22 13:25:46.000000000 -0800
@@ -79,5 +79,6 @@
int name_length);
u_int16_t retrieve_type(const u_int8_t * rr);
u_int16_t libsres_random(void);
+int libsres_msg_getflag(ns_msg han, int flag);
#endif /* RES_SUPPORT_H */
--- validator/libsres/res_debug.c 2008-07-22 20:07:30.000000000 -0700
+++ validator/libsres/res_debug.c 2009-01-22 13:25:46.000000000 -0800
@@ -191,7 +191,7 @@
return;
}
- opcode = (ns_opcode) ns_msg_getflag(*handle, ns_f_opcode);
+ opcode = (ns_opcode) libsres_msg_getflag(*handle, ns_f_opcode);
rrnum = 0;
for (;;) {
if (ns_parserr(handle, section, rrnum, &rr)) {
@@ -278,8 +278,8 @@
return;
}
- opcode = ns_msg_getflag(handle, ns_f_opcode);
- rcode = ns_msg_getflag(handle, ns_f_rcode);
+ opcode = libsres_msg_getflag(handle, ns_f_opcode);
+ rcode = libsres_msg_getflag(handle, ns_f_rcode);
id = ns_msg_id(handle);
qdcount = ns_msg_count(handle, ns_s_qd);
ancount = ns_msg_count(handle, ns_s_an);
@@ -294,21 +294,21 @@
_libsres_opcodes[opcode], p_rcode(rcode), id);
putc(';', file);
fprintf(file, "; flags:");
- if (ns_msg_getflag(handle, ns_f_qr))
+ if (libsres_msg_getflag(handle, ns_f_qr))
fprintf(file, " qr");
- if (ns_msg_getflag(handle, ns_f_aa))
+ if (libsres_msg_getflag(handle, ns_f_aa))
fprintf(file, " aa");
- if (ns_msg_getflag(handle, ns_f_tc))
+ if (libsres_msg_getflag(handle, ns_f_tc))
fprintf(file, " tc");
- if (ns_msg_getflag(handle, ns_f_rd))
+ if (libsres_msg_getflag(handle, ns_f_rd))
fprintf(file, " rd");
- if (ns_msg_getflag(handle, ns_f_ra))
+ if (libsres_msg_getflag(handle, ns_f_ra))
fprintf(file, " ra");
- if (ns_msg_getflag(handle, ns_f_z))
+ if (libsres_msg_getflag(handle, ns_f_z))
fprintf(file, " ??");
- if (ns_msg_getflag(handle, ns_f_ad))
+ if (libsres_msg_getflag(handle, ns_f_ad))
fprintf(file, " ad");
- if (ns_msg_getflag(handle, ns_f_cd))
+ if (libsres_msg_getflag(handle, ns_f_cd))
fprintf(file, " cd");
fprintf(file, "; %s: %d", p_section(ns_s_qd, opcode), qdcount);