projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
flag fields are u_int's
[unix-history]
/
usr
/
src
/
lib
/
libc
/
net
/
res_debug.c
diff --git
a/usr/src/lib/libc/net/res_debug.c
b/usr/src/lib/libc/net/res_debug.c
index
dc8883a
..
bac8d0b
100644
(file)
--- a/
usr/src/lib/libc/net/res_debug.c
+++ b/
usr/src/lib/libc/net/res_debug.c
@@
-4,20
+4,24
@@
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)res_debug.c 5.3
0
(Berkeley) %G%
+ * @(#)res_debug.c 5.3
6
(Berkeley) %G%
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c 5.3
0
(Berkeley) %G%";
+static char sccsid[] = "@(#)res_debug.c 5.3
6
(Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#endif /* LIBC_SCCS and not lint */
-#include <sys/
types
.h>
+#include <sys/
param
.h>
#include <netinet/in.h>
#include <netinet/in.h>
-#include <
stdio
.h>
+#include <
arpa/inet
.h>
#include <arpa/nameser.h>
#include <arpa/nameser.h>
+#include <resolv.h>
+#include <stdio.h>
+#include <string.h>
-extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time();
-extern char *inet_ntoa();
+void __fp_query();
+char *__p_class(), *__p_time(), *__p_type();
+static char *p_cdname(), *p_rr();
char *_res_opcodes[] = {
"QUERY",
char *_res_opcodes[] = {
"QUERY",
@@
-57,17
+61,18
@@
char *_res_resultcodes[] = {
"NOCHANGE",
};
"NOCHANGE",
};
-p_query(msg)
+
__
p_query(msg)
char *msg;
{
char *msg;
{
- fp_query(msg,stdout);
+
__
fp_query(msg,stdout);
}
/*
* Print the contents of a query.
* This is intended to be primarily a debugging routine.
*/
}
/*
* Print the contents of a query.
* This is intended to be primarily a debugging routine.
*/
-fp_query(msg,file)
+void
+__fp_query(msg,file)
char *msg;
FILE *file;
{
char *msg;
FILE *file;
{
@@
-111,9
+116,10
@@
fp_query(msg,file)
cp = p_cdname(cp, msg, file);
if (cp == NULL)
return;
cp = p_cdname(cp, msg, file);
if (cp == NULL)
return;
- fprintf(file,", type = %s", p_type(_getshort(cp)));
+ fprintf(file,", type = %s",
__
p_type(_getshort(cp)));
cp += sizeof(u_short);
cp += sizeof(u_short);
- fprintf(file,", class = %s\n\n", p_class(_getshort(cp)));
+ fprintf(file,
+ ", class = %s\n\n", __p_class(_getshort(cp)));
cp += sizeof(u_short);
}
}
cp += sizeof(u_short);
}
}
@@
-155,7
+161,7
@@
fp_query(msg,file)
}
}
}
}
-char *
+
static
char *
p_cdname(cp, msg, file)
char *cp, *msg;
FILE *file;
p_cdname(cp, msg, file)
char *cp, *msg;
FILE *file;
@@
-163,7
+169,8
@@
p_cdname(cp, msg, file)
char name[MAXDNAME];
int n;
char name[MAXDNAME];
int n;
- if ((n = dn_expand(msg, msg + 512, cp, name, sizeof(name))) < 0)
+ if ((n = dn_expand((u_char *)msg, (u_char *)msg + 512, (u_char *)cp,
+ (u_char *)name, sizeof(name))) < 0)
return (NULL);
if (name[0] == '\0') {
name[0] = '.';
return (NULL);
if (name[0] == '\0') {
name[0] = '.';
@@
-176,7
+183,7
@@
p_cdname(cp, msg, file)
/*
* Print resource record fields in human readable form.
*/
/*
* Print resource record fields in human readable form.
*/
-char *
+
static
char *
p_rr(cp, msg, file)
char *cp, *msg;
FILE *file;
p_rr(cp, msg, file)
char *cp, *msg;
FILE *file;
@@
-187,11
+194,11
@@
p_rr(cp, msg, file)
if ((cp = p_cdname(cp, msg, file)) == NULL)
return (NULL); /* compression error */
if ((cp = p_cdname(cp, msg, file)) == NULL)
return (NULL); /* compression error */
- fprintf(file,"\n\ttype = %s", p_type(type = _getshort(cp)));
+ fprintf(file,"\n\ttype = %s",
__
p_type(type = _getshort(cp)));
cp += sizeof(u_short);
cp += sizeof(u_short);
- fprintf(file,", class = %s", p_class(class = _getshort(cp)));
+ fprintf(file,", class = %s",
__
p_class(class = _getshort(cp)));
cp += sizeof(u_short);
cp += sizeof(u_short);
- fprintf(file,", ttl = %s", p_time(_getlong(cp)));
+ fprintf(file,", ttl = %s",
__
p_time(_getlong(cp)));
cp += sizeof(u_long);
fprintf(file,", dlen = %d\n", dlen = _getshort(cp));
cp += sizeof(u_short);
cp += sizeof(u_long);
fprintf(file,", dlen = %d\n", dlen = _getshort(cp));
cp += sizeof(u_short);
@@
-251,13
+258,13
@@
p_rr(cp, msg, file)
cp = p_cdname(cp, msg, file);
fprintf(file,"\n\tserial = %ld", _getlong(cp));
cp += sizeof(u_long);
cp = p_cdname(cp, msg, file);
fprintf(file,"\n\tserial = %ld", _getlong(cp));
cp += sizeof(u_long);
- fprintf(file,"\n\trefresh = %s", p_time(_getlong(cp)));
+ fprintf(file,"\n\trefresh = %s",
__
p_time(_getlong(cp)));
cp += sizeof(u_long);
cp += sizeof(u_long);
- fprintf(file,"\n\tretry = %s", p_time(_getlong(cp)));
+ fprintf(file,"\n\tretry = %s",
__
p_time(_getlong(cp)));
cp += sizeof(u_long);
cp += sizeof(u_long);
- fprintf(file,"\n\texpire = %s", p_time(_getlong(cp)));
+ fprintf(file,"\n\texpire = %s",
__
p_time(_getlong(cp)));
cp += sizeof(u_long);
cp += sizeof(u_long);
- fprintf(file,"\n\tmin = %s\n", p_time(_getlong(cp)));
+ fprintf(file,"\n\tmin = %s\n",
__
p_time(_getlong(cp)));
cp += sizeof(u_long);
break;
cp += sizeof(u_long);
break;
@@
-359,7
+366,7
@@
static char nbuf[40];
* Return a string for the type
*/
char *
* Return a string for the type
*/
char *
-p_type(type)
+
__
p_type(type)
int type;
{
switch (type) {
int type;
{
switch (type) {
@@
-419,7
+426,7
@@
p_type(type)
* Return a mnemonic for class
*/
char *
* Return a mnemonic for class
*/
char *
-p_class(class)
+
__
p_class(class)
int class;
{
int class;
{
@@
-440,7
+447,7
@@
p_class(class)
* Return a mnemonic for a time to live
*/
char *
* Return a mnemonic for a time to live
*/
char *
-p_time(value)
+
__
p_time(value)
u_long value;
{
int secs, mins, hours;
u_long value;
{
int secs, mins, hours;