1 |
|
/* |
2 |
|
* Copyright (c) 1985, 1993 |
3 |
|
* The Regents of the University of California. All rights reserved. |
4 |
< |
* |
4 |
> |
* |
5 |
|
* Redistribution and use in source and binary forms, with or without |
6 |
|
* modification, are permitted provided that the following conditions |
7 |
|
* are met: |
13 |
|
* 4. Neither the name of the University nor the names of its contributors |
14 |
|
* may be used to endorse or promote products derived from this software |
15 |
|
* without specific prior written permission. |
16 |
< |
* |
16 |
> |
* |
17 |
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
18 |
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 |
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
29 |
|
|
30 |
|
/* |
31 |
|
* Portions Copyright (c) 1993 by Digital Equipment Corporation. |
32 |
< |
* |
32 |
> |
* |
33 |
|
* Permission to use, copy, modify, and distribute this software for any |
34 |
|
* purpose with or without fee is hereby granted, provided that the above |
35 |
|
* copyright notice and this permission notice appear in all copies, and that |
36 |
|
* the name of Digital Equipment Corporation not be used in advertising or |
37 |
|
* publicity pertaining to distribution of the document or software without |
38 |
|
* specific, written prior permission. |
39 |
< |
* |
39 |
> |
* |
40 |
|
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL |
41 |
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES |
42 |
|
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT |
64 |
|
* SOFTWARE. |
65 |
|
*/ |
66 |
|
|
67 |
< |
/* Original copyright ISC as above. |
67 |
> |
/* Original copyright ISC as above. |
68 |
|
* Code modified specifically for ircd use from the following orginal files |
69 |
|
* in bind ... |
70 |
|
* |
72 |
|
* ns_name.c |
73 |
|
* ns_netint.c |
74 |
|
* res_init.c |
75 |
< |
* |
75 |
> |
* |
76 |
|
* - Dianora |
77 |
|
*/ |
78 |
|
|
119 |
|
const unsigned char **dnptrs, const unsigned char **lastdnptr); |
120 |
|
static int irc_dn_find(const unsigned char *, const unsigned char *, const unsigned char * const *, |
121 |
|
const unsigned char * const *); |
122 |
< |
static int irc_encode_bitsring(const char **, const char *, unsigned char **, unsigned char **, |
122 |
> |
static int irc_encode_bitsring(const char **, const char *, unsigned char **, unsigned char **, |
123 |
|
const unsigned char *); |
124 |
|
static int irc_ns_name_uncompress(const unsigned char *, const unsigned char *, |
125 |
|
const unsigned char *, char *, size_t); |
129 |
|
static int irc_ns_name_ntop(const unsigned char *, char *, size_t); |
130 |
|
static int irc_ns_name_skip(const unsigned char **, const unsigned char *); |
131 |
|
static int mklower(int ch); |
132 |
– |
|
132 |
|
|
133 |
|
/* add_nameserver() |
134 |
|
* |
351 |
|
srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff)); |
352 |
|
|
353 |
|
if (srcp < msg || srcp >= eom) |
354 |
< |
{ |
354 |
> |
{ |
355 |
|
/* Out of range. */ |
356 |
|
errno = EMSGSIZE; |
357 |
|
return -1; |
442 |
|
errno = EMSGSIZE; |
443 |
|
return(-1); |
444 |
|
} |
445 |
< |
dn += m; |
445 |
> |
dn += m; |
446 |
|
continue; |
447 |
|
} |
448 |
|
for ((void)NULL; l > 0; l--) { |
614 |
|
|
615 |
|
static int |
616 |
|
labellen(const unsigned char *lp) |
617 |
< |
{ |
617 |
> |
{ |
618 |
|
int bitlen; |
619 |
|
unsigned char l = *lp; |
620 |
|
|
1144 |
|
* * convert this character to lower case if it's upper case. |
1145 |
|
* */ |
1146 |
|
static int |
1147 |
< |
mklower(int ch) |
1147 |
> |
mklower(int ch) |
1148 |
|
{ |
1149 |
|
if (ch >= 0x41 && ch <= 0x5A) |
1150 |
|
return(ch + 0x20); |