1/*
2 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (c) 1995,1999 by Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
--- 4 unchanged lines hidden (view full) ---
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef lint
19static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1.2.2.4.2 2004/03/16 12:34:17 marka Exp $";
20#endif
21
22#include "port_before.h"
23
24#include <sys/types.h>
25#include <arpa/nameser.h>
26#include <errno.h>
27#include <string.h>
28
29#include "port_after.h"
30
31/*
32 * int
33 * ns_samedomain(a, b)
34 * Check whether a name belongs to a domain.
35 * Inputs:
36 * a - the domain whose ancestory is being verified
37 * b - the potential ancestor we're checking against
38 * Return:
--- 105 unchanged lines hidden (view full) ---
144 * int
145 * ns_subdomain(a, b)
146 * is "a" a subdomain of "b"?
147 */
148int
149ns_subdomain(const char *a, const char *b) {
150 return (ns_samename(a, b) != 1 && ns_samedomain(a, b));
151}
152
153/*
154 * int
155 * ns_makecanon(src, dst, dstsize)
156 * make a canonical copy of domain name "src"
157 * notes:
158 * foo -> foo.
159 * foo. -> foo.
--- 47 unchanged lines hidden ---
2 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (c) 1995,1999 by Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
--- 4 unchanged lines hidden (view full) ---
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef lint
19static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1.2.2.4.2 2004/03/16 12:34:17 marka Exp $";
20#endif
21
22#include "port_before.h"
23
24#include <sys/types.h>
25#include <arpa/nameser.h>
26#include <errno.h>
27#include <string.h>
28
29#include "port_after.h"
30
31/*
32 * int
33 * ns_samedomain(a, b)
34 * Check whether a name belongs to a domain.
35 * Inputs:
36 * a - the domain whose ancestory is being verified
37 * b - the potential ancestor we're checking against
38 * Return:
--- 105 unchanged lines hidden (view full) ---
144 * int
145 * ns_subdomain(a, b)
146 * is "a" a subdomain of "b"?
147 */
148int
149ns_subdomain(const char *a, const char *b) {
150 return (ns_samename(a, b) != 1 && ns_samedomain(a, b));
151}
152
153/*
154 * int
155 * ns_makecanon(src, dst, dstsize)
156 * make a canonical copy of domain name "src"
157 * notes:
158 * foo -> foo.
159 * foo. -> foo.
--- 47 unchanged lines hidden ---