summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/res_debug.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2005-03-25 13:24:11 +0000
committerotto <otto@openbsd.org>2005-03-25 13:24:11 +0000
commitdb5b349cf7aa19c2b6169fbb65597f2e741714ab (patch)
tree3225f0ae035a80a4448da2c70fd7f41f085c275b /lib/libc/net/res_debug.c
parentwhitespace (diff)
downloadwireguard-openbsd-db5b349cf7aa19c2b6169fbb65597f2e741714ab.tar.xz
wireguard-openbsd-db5b349cf7aa19c2b6169fbb65597f2e741714ab.zip
ansify. ok deraadt@ moritz@
Diffstat (limited to 'lib/libc/net/res_debug.c')
-rw-r--r--lib/libc/net/res_debug.c132
1 files changed, 40 insertions, 92 deletions
diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c
index e0f2a894186..02f9e4a1ea1 100644
--- a/lib/libc/net/res_debug.c
+++ b/lib/libc/net/res_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_debug.c,v 1.18 2005/03/06 16:17:23 moritz Exp $ */
+/* $OpenBSD: res_debug.c,v 1.19 2005/03/25 13:24:12 otto Exp $ */
/*
* ++Copyright++ 1985, 1990, 1993
@@ -78,7 +78,7 @@
static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_debug.c,v 1.18 2005/03/06 16:17:23 moritz Exp $";
+static char rcsid[] = "$OpenBSD: res_debug.c,v 1.19 2005/03/25 13:24:12 otto Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -107,8 +107,7 @@ static const char *loc_ntoal(const u_char *binary, char *ascii, int ascii_len);
/* XXX: we should use getservbyport() instead. */
static const char *
-dewks(wks)
- int wks;
+dewks(int wks)
{
static char nbuf[20];
@@ -167,8 +166,7 @@ dewks(wks)
/* XXX: we should use getprotobynumber() instead. */
static const char *
-deproto(protonum)
- int protonum;
+deproto(int protonum)
{
static char nbuf[20];
@@ -192,11 +190,8 @@ deproto(protonum)
}
static const u_char *
-do_rrset(msg, len, cp, cnt, pflag, file, hs)
- int cnt, pflag, len;
- const u_char *cp, *msg;
- const char *hs;
- FILE *file;
+do_rrset(const u_char *msg, int len, const u_char *cp, int cnt, int pflag,
+ FILE *file, const char *hs)
{
struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res);
int n;
@@ -234,8 +229,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs)
}
void
-__p_query(msg)
- const u_char *msg;
+__p_query(const u_char *msg)
{
__fp_query(msg, stdout);
}
@@ -245,11 +239,9 @@ __p_query(msg)
* This is intended to be primarily a debugging routine.
*/
void
-__fp_resstat(statp, file)
- struct __res_state *statp;
- FILE *file;
+__fp_resstat(struct __res_state *statp, FILE *file)
{
- register u_long mask;
+ u_long mask;
fprintf(file, ";; res options:");
if (!statp)
@@ -265,15 +257,12 @@ __fp_resstat(statp, file)
* This is intended to be primarily a debugging routine.
*/
void
-__fp_nquery(msg, len, file)
- const u_char *msg;
- int len;
- FILE *file;
+__fp_nquery(const u_char *msg, int len, FILE *file)
{
struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res);
- register const u_char *cp, *endMark;
- register const HEADER *hp;
- register int n;
+ const u_char *cp, *endMark;
+ const HEADER *hp;
+ int n;
if ((_resp->options & RES_INIT) == 0 && res_init() == -1)
return;
@@ -394,18 +383,13 @@ __fp_nquery(msg, len, file)
}
void
-__fp_query(msg, file)
- const u_char *msg;
- FILE *file;
+__fp_query(const u_char *msg, FILE *file)
{
fp_nquery(msg, PACKETSZ, file);
}
const u_char *
-__p_cdnname(cp, msg, len, file)
- const u_char *cp, *msg;
- int len;
- FILE *file;
+__p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file)
{
char name[MAXDNAME];
int n;
@@ -420,9 +404,7 @@ __p_cdnname(cp, msg, len, file)
}
const u_char *
-__p_cdname(cp, msg, file)
- const u_char *cp, *msg;
- FILE *file;
+__p_cdname(const u_char *cp, const u_char *msg, FILE *file)
{
return (p_cdnname(cp, msg, PACKETSZ, file));
}
@@ -432,11 +414,7 @@ __p_cdname(cp, msg, file)
length supplied). */
const u_char *
-__p_fqnname(cp, msg, msglen, name, namelen)
- const u_char *cp, *msg;
- int msglen;
- char *name;
- int namelen;
+__p_fqnname(const u_char *cp, const u_char *msg, int msglen, char *name, int namelen)
{
int n, newlen;
@@ -456,9 +434,7 @@ __p_fqnname(cp, msg, msglen, name, namelen)
*/
const u_char *
-__p_fqname(cp, msg, file)
- const u_char *cp, *msg;
- FILE *file;
+__p_fqname(const u_char *cp, const u_char *msg, FILE *file)
{
char name[MAXDNAME];
const u_char *n;
@@ -474,9 +450,7 @@ __p_fqname(cp, msg, file)
* Print resource record fields in human readable form.
*/
const u_char *
-__p_rr(cp, msg, file)
- const u_char *cp, *msg;
- FILE *file;
+__p_rr(const u_char *cp, const u_char *msg, FILE *file)
{
struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res);
int type, class, dlen, n, c;
@@ -932,10 +906,7 @@ const struct res_sym __p_type_syms[] = {
};
int
-__sym_ston(syms, name, success)
- const struct res_sym *syms;
- char *name;
- int *success;
+__sym_ston(const struct res_sym *syms, char *name, int *success)
{
for (; syms->name != 0; syms++) {
if (strcasecmp (name, syms->name) == 0) {
@@ -950,10 +921,7 @@ __sym_ston(syms, name, success)
}
const char *
-__sym_ntos(syms, number, success)
- const struct res_sym *syms;
- int number;
- int *success;
+__sym_ntos(const struct res_sym *syms, int number, int *success)
{
static char unname[20];
@@ -973,10 +941,7 @@ __sym_ntos(syms, number, success)
const char *
-__sym_ntop(syms, number, success)
- const struct res_sym *syms;
- int number;
- int *success;
+__sym_ntop(const struct res_sym *syms, int number, int *success)
{
static char unname[20];
@@ -997,8 +962,7 @@ __sym_ntop(syms, number, success)
* Return a string for the type
*/
const char *
-__p_type(type)
- int type;
+__p_type(int type)
{
return (__sym_ntos (__p_type_syms, type, (int *)0));
}
@@ -1007,8 +971,7 @@ __p_type(type)
* Return a mnemonic for class
*/
const char *
-__p_class(class)
- int class;
+__p_class(int class)
{
return (__sym_ntos (__p_class_syms, class, (int *)0));
}
@@ -1017,8 +980,7 @@ __p_class(class)
* Return a mnemonic for an option
*/
const char *
-__p_option(option)
- u_long option;
+__p_option(u_long option)
{
static char nbuf[40];
@@ -1047,13 +1009,12 @@ __p_option(option)
* Return a mnemonic for a time to live
*/
const char *
-p_time(value)
- u_int32_t value;
+p_time(u_int32_t value)
{
static char nbuf[40];
char *ebuf;
int secs, mins, hours, days;
- register char *p;
+ char *p;
int tmp;
if (value == 0) {
@@ -1129,8 +1090,7 @@ static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
/* takes an XeY precision/size value, returns a string representation. */
static const char *
-precsize_ntoa(prec)
- u_int8_t prec;
+precsize_ntoa(u_int8_t prec)
{
static char retbuf[sizeof "90000000.00"];
unsigned long val;
@@ -1147,14 +1107,13 @@ precsize_ntoa(prec)
/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
static u_int8_t
-precsize_aton(strptr)
- char **strptr;
+precsize_aton(char **strptr)
{
unsigned int mval = 0, cmval = 0;
u_int8_t retval = 0;
- register char *cp;
- register int exponent;
- register int mantissa;
+ char *cp;
+ int exponent;
+ int mantissa;
cp = *strptr;
@@ -1189,11 +1148,9 @@ precsize_aton(strptr)
/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
static u_int32_t
-latlon2ul(latlonstrptr,which)
- char **latlonstrptr;
- int *which;
+latlon2ul(char **latlonstrptr, int *which)
{
- register char *cp;
+ char *cp;
u_int32_t retval;
int deg = 0, min = 0, secs = 0, secsfrac = 0;
@@ -1288,9 +1245,7 @@ latlon2ul(latlonstrptr,which)
/* converts a zone file representation in a string to an RDATA on-the-wire
* representation. */
int
-loc_aton(ascii, binary)
- const char *ascii;
- u_char *binary;
+loc_aton(const char *ascii, u_char *binary)
{
const char *maxcp;
u_char *bcp;
@@ -1399,22 +1354,17 @@ loc_aton(ascii, binary)
}
const char *
-loc_ntoa(binary, ascii)
- const u_char *binary;
- char *ascii;
+loc_ntoa(const u_char *binary, char *ascii)
{
return loc_ntoal(binary, ascii, 255);
}
/* takes an on-the-wire LOC RR and formats it in a human readable format. */
static const char *
-loc_ntoal(binary, ascii, ascii_len)
- const u_char *binary;
- char *ascii;
- int ascii_len;
+loc_ntoal(const u_char *binary, char *ascii, int ascii_len)
{
static char *error = "?";
- register const u_char *cp = binary;
+ const u_char *cp = binary;
int latdeg, latmin, latsec, latsecfrac;
int longdeg, longmin, longsec, longsecfrac;
@@ -1513,8 +1463,7 @@ loc_ntoal(binary, ascii, ascii_len)
/* Return the number of DNS hierarchy levels in the name. */
int
-__dn_count_labels(name)
- char *name;
+__dn_count_labels(char *name)
{
int i, len, count;
@@ -1544,8 +1493,7 @@ __dn_count_labels(name)
* SIG records are required to be printed like this, by the Secure DNS RFC.
*/
char *
-__p_secstodate (secs)
- unsigned long secs;
+__p_secstodate (long unsigned int secs)
{
static char output[15]; /* YYYYMMDDHHMMSS and null */
time_t clock = secs;