+2004-10-17 Ulrich Drepper <drepper@redhat.com>
+
+ * include/libc-symbols.h: Define libresolv_hidden_proto and friends.
+ * include/resolv.h: Add libresolv_hidden_proto for symbols defined,
+ used, and exported in libresolv.
+ * resolv/base64.c: Add libresolv_hidden_def.
+ * resolv/gethnamaddr.c: Likewise.
+ * resolv/ns_name.c: Likewise.
+ * resolv/ns_netint.c: Likewise.
+ * resolv/res_comp.c: Likewise.
+ * resolv/res_data.c: Likewise.
+ * resolv/res_debug.c: Likewise.
+ * resolv/res_mkquery.c: Likewise.
+ * resolv/res_query.c: Likewise.
+ * resolv/res_send.c: Likewise.
+
2004-10-15 Jakub Jelinek <jakub@redhat.com>
* elf/dl-minimal.c (__chk_fail): New. Add rtld_hidden_def.
# define libm_hidden_data_ver(local, name)
#endif
+#if defined NOT_IN_libc && defined IS_IN_libresolv
+# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libresolv_hidden_def(name) hidden_def (name)
+# define libresolv_hidden_weak(name) hidden_weak (name)
+# define libresolv_hidden_ver(local, name) hidden_ver (local, name)
+# define libresolv_hidden_data_def(name) hidden_data_def (name)
+# define libresolv_hidden_data_weak(name) hidden_data_weak (name)
+# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libresolv_hidden_proto(name, attrs...)
+# define libresolv_hidden_def(name)
+# define libresolv_hidden_weak(name)
+# define libresolv_hidden_ver(local, name)
+# define libresolv_hidden_data_def(name)
+# define libresolv_hidden_data_weak(name)
+# define libresolv_hidden_data_ver(local, name)
+#endif
+
#ifdef HAVE_BUILTIN_REDIRECTION
# define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
# define libc_hidden_builtin_def(name) libc_hidden_def (name)
u_char **)
attribute_hidden;
+libresolv_hidden_proto (_sethtent)
+libresolv_hidden_proto (_gethtent)
+libresolv_hidden_proto (_gethtbyaddr)
+libresolv_hidden_proto (_gethtbyname2)
+libresolv_hidden_proto (__dn_expand)
+libresolv_hidden_proto (__dn_comp)
+libresolv_hidden_proto (__dn_skipname)
+libresolv_hidden_proto (__res_hnok)
+libresolv_hidden_proto (__res_dnok)
+libresolv_hidden_proto (__putlong)
+libresolv_hidden_proto (__putshort)
+libresolv_hidden_proto (__p_cdnname)
+libresolv_hidden_proto (__p_fqnname)
+libresolv_hidden_proto (__p_option)
+libresolv_hidden_proto (__sym_ntos)
+libresolv_hidden_proto (__p_rcode)
+libresolv_hidden_proto (__p_class)
+libresolv_hidden_proto (__p_type)
+libresolv_hidden_proto (__loc_ntoa)
+libresolv_hidden_proto (__fp_nquery)
+libresolv_hidden_proto (__fp_query)
+libresolv_hidden_proto (__hostalias)
+libresolv_hidden_proto (__res_nmkquery)
+libresolv_hidden_proto (__libc_res_nquery)
+libresolv_hidden_proto (__res_nquery)
+libresolv_hidden_proto (__res_nquerydomain)
+libresolv_hidden_proto (__res_hostalias)
+libresolv_hidden_proto (__libc_res_nsearch)
+libresolv_hidden_proto (__res_nsearch)
+libresolv_hidden_proto (__res_nameinquery)
+libresolv_hidden_proto (__res_queriesmatch)
+libresolv_hidden_proto (__res_nsend)
+libresolv_hidden_proto (__b64_ntop)
+libresolv_hidden_proto (__ns_name_ntop)
+libresolv_hidden_proto (__ns_name_unpack)
+libresolv_hidden_proto (__ns_get16)
+libresolv_hidden_proto (__ns_get32)
+
#endif
#endif
end of the data is performed using the '=' character.
Since all base64 input is an integral number of octets, only the
- -------------------------------------------------
+ -------------------------------------------------
following cases can arise:
-
+
(1) the final quantum of encoding input is an integral
multiple of 24 bits; here, the final unit of encoded
output will be an integral multiple of 4 characters
target[datalength++] = Base64[output[2]];
target[datalength++] = Base64[output[3]];
}
-
+
/* Now we worry about padding. */
if (0 != srclength) {
/* Get what's left. */
input[0] = input[1] = input[2] = '\0';
for (i = 0; i < srclength; i++)
input[i] = *src++;
-
+
output[0] = input[0] >> 2;
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
target[datalength] = '\0'; /* Returned value doesn't count \0. */
return (datalength);
}
+libresolv_hidden_def (b64_ntop)
/* skips all whitespace anywhere.
converts characters, four at a time, starting at (or after)
return (NULL);
}
+extern struct hostent *gethostbyname2(const char *name, int af);
+libresolv_hidden_proto (gethostbyname2)
+
struct hostent *
gethostbyname(name)
const char *name;
free (buf.buf);
return ret;
}
+libresolv_hidden_def (gethostbyname2)
struct hostent *
gethostbyaddr(addr, len, af)
rewind(hostf);
stayopen = f;
}
+libresolv_hidden_def (_sethtent)
void
_endhtent()
__set_h_errno (NETDB_SUCCESS);
return (&host);
}
+libresolv_hidden_def (_gethtent)
struct hostent *
_gethtbyname(name)
_endhtent();
return (p);
}
+libresolv_hidden_def (_gethtbyname2)
struct hostent *
_gethtbyaddr(addr, len, af)
_endhtent();
return (p);
}
+libresolv_hidden_def (_gethtbyaddr)
static void
map_v4v6_address(src, dst)
*dn++ = '\0';
return (dn - dst);
}
+libresolv_hidden_def (ns_name_ntop)
/*
* ns_name_pton(src, dst, dstsiz)
len = srcp - src;
return (len);
}
+libresolv_hidden_def (ns_name_unpack)
/*
* ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
/* Import. */
#include <arpa/nameser.h>
+#include <resolv.h>
/* Public. */
NS_GET16(dst, src);
return (dst);
}
+libresolv_hidden_def (ns_get16)
u_long
ns_get32(const u_char *src) {
NS_GET32(dst, src);
return (dst);
}
+libresolv_hidden_def (ns_get32)
void
ns_put16(u_int src, u_char *dst) {
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
+ *
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
dst[0] = '\0';
return (n);
}
+libresolv_hidden_def (dn_expand)
/*
* Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
(const u_char **)dnptrs,
(const u_char **)lastdnptr));
}
+libresolv_hidden_def (dn_comp)
/*
* Skip over a compressed domain name. Return the size or -1.
return (-1);
return (ptr - saveptr);
}
+libresolv_hidden_def (dn_skipname)
/*
* Verify that a domain name uses an acceptable character set.
}
return (1);
}
+libresolv_hidden_def (res_hnok)
/*
* hostname-like (A, MX, WKS) owners can have "*" as their first label
return (0);
return (1);
}
+libresolv_hidden_def (res_dnok)
#ifdef BIND_4_COMPAT
/*
* Note that one _ comes from C and the others come from us.
*/
void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
+libresolv_hidden_def (__putlong)
void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
+libresolv_hidden_def (__putshort)
#ifndef __ultrix__
u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
#include <string.h>
#include <unistd.h>
-const char *_res_opcodes[] = {
+const char *_res_opcodes[] attribute_hidden = {
"QUERY",
"IQUERY",
"CQUERYM",
};
#ifdef BIND_UPDATE
-const char *_res_sectioncodes[] = {
+const char *_res_sectioncodes[] attribute_hidden = {
"ZONE",
"PREREQUISITES",
"UPDATE",
fp_query(const u_char *msg, FILE *file) {
fp_nquery(msg, PACKETSZ, file);
}
+libresolv_hidden_def (fp_query)
void
fp_nquery(const u_char *msg, int len, FILE *file) {
res_pquery(&_res, msg, len, file);
}
+libresolv_hidden_def (fp_nquery)
int
res_mkquery(int op, /* opcode of query */
return (res_hostalias(&_res, name, abuf, sizeof abuf));
}
+libresolv_hidden_def (hostalias)
#ifdef ultrix
int
# define SPRINTF(x) sprintf x
#endif
-extern const char *_res_opcodes[];
-extern const char *_res_sectioncodes[];
+extern const char *_res_opcodes[] attribute_hidden;
+extern const char *_res_sectioncodes[] attribute_hidden;
/*
* Print the current options.
fputs(name, file);
return (cp + n);
}
+libresolv_hidden_def (p_cdnname)
const u_char *
p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
}
return (cp + n);
}
+libresolv_hidden_def (p_fqnname)
/* XXX: the rest of these functions need to become length-limited, too. */
* that C_ANY is a qclass but not a class. (You can ask for records of class
* C_ANY, but you can't have any records of that class in the database.)
*/
-const struct res_sym __p_class_syms[] = {
+const struct res_sym __p_class_syms[] attribute_hidden = {
{C_IN, "IN"},
{C_CHAOS, "CHAOS"},
{C_HS, "HS"},
/*
* Names of message sections.
*/
-const struct res_sym __p_default_section_syms[] = {
+const struct res_sym __p_default_section_syms[] attribute_hidden = {
{ns_s_qd, "QUERY"},
{ns_s_an, "ANSWER"},
{ns_s_ns, "AUTHORITY"},
{0, (char *)0}
};
-const struct res_sym __p_update_section_syms[] = {
+const struct res_sym __p_update_section_syms[] attribute_hidden = {
{S_ZONE, "ZONE"},
{S_PREREQ, "PREREQUISITE"},
{S_UPDATE, "UPDATE"},
{0, (char *)0}
};
-const struct res_sym __p_key_syms[] = {
+const struct res_sym __p_key_syms[] attribute_hidden = {
{NS_ALG_MD5RSA, "RSA", "RSA KEY with MD5 hash"},
{NS_ALG_DH, "DH", "Diffie Hellman"},
{NS_ALG_DSA, "DSA", "Digital Signature Algorithm"},
{0, NULL, NULL}
};
-const struct res_sym __p_cert_syms[] = {
+const struct res_sym __p_cert_syms[] attribute_hidden = {
{cert_t_pkix, "PKIX", "PKIX (X.509v3) Certificate"},
{cert_t_spki, "SPKI", "SPKI certificate"},
{cert_t_pgp, "PGP", "PGP certificate"},
* that T_ANY is a qtype but not a type. (You can ask for records of type
* T_ANY, but you can't have any records of that type in the database.)
*/
-const struct res_sym __p_type_syms[] = {
+const struct res_sym __p_type_syms[] attribute_hidden = {
{ns_t_a, "A", "address"},
{ns_t_ns, "NS", "name server"},
{ns_t_md, "MD", "mail destination (deprecated)"},
/*
* Names of DNS rcodes.
*/
-const struct res_sym __p_rcode_syms[] = {
+const struct res_sym __p_rcode_syms[] attribute_hidden = {
{ns_r_noerror, "NOERROR", "no error"},
{ns_r_formerr, "FORMERR", "format error"},
{ns_r_servfail, "SERVFAIL", "server failed"},
*success = 0;
return (unname);
}
+libresolv_hidden_def (sym_ntos)
const char *
sym_ntop(const struct res_sym *syms, int number, int *success) {
p_type(int type) {
return (sym_ntos(__p_type_syms, type, (int *)0));
}
+libresolv_hidden_def (p_type)
/*
* Return a string for the type.
p_class(int class) {
return (sym_ntos(__p_class_syms, class, (int *)0));
}
+libresolv_hidden_def (p_class)
/*
* Return a mnemonic for an option
return (nbuf);
}
}
+libresolv_hidden_def (p_option)
/*
* Return a mnemonic for a time to live.
p_rcode(int rcode) {
return (sym_ntos(__p_rcode_syms, rcode, (int *)0));
}
+libresolv_hidden_def (p_rcode)
/*
* routines to convert between on-the-wire RR format and zone file format.
* by 60*60*1000 for that.
*/
-static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
- 1000000,10000000,100000000,1000000000};
+static const unsigned int poweroften[10]=
+ { 1, 10, 100, 1000, 10000, 100000,
+ 1000000,10000000,100000000,1000000000};
/* takes an XeY precision/size value, returns a string representation. */
static const char *
return (ascii);
}
+libresolv_hidden_def (loc_ntoa)
/* Return the number of DNS hierarchy levels in the name. */
}
return (cp - buf);
}
+libresolv_hidden_def (res_nmkquery)
}
return (n);
}
+libresolv_hidden_def (__libc_res_nquery)
int
res_nquery(res_state statp,
return __libc_res_nquery(statp, name, class, type, answer, anslen,
NULL);
}
+libresolv_hidden_def (res_nquery)
/*
* Formulate a normal query, send, and retrieve answer in supplied buffer.
RES_SET_H_ERRNO(statp, TRY_AGAIN);
return (-1);
}
+libresolv_hidden_def (__libc_res_nsearch)
int
res_nsearch(res_state statp,
return __libc_res_nsearch(statp, name, class, type, answer,
anslen, NULL);
}
+libresolv_hidden_def (res_nsearch)
/*
* Perform a call on res_query on the concatenation of name and domain,
return __libc_res_nquerydomain(statp, name, domain, class, type,
answer, anslen, NULL);
}
+libresolv_hidden_def (res_nquerydomain)
const char *
res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
fclose(fp);
return (NULL);
}
+libresolv_hidden_def (res_hostalias)
}
return (0);
}
+libresolv_hidden_def (res_nameinquery)
/* int
* res_queriesmatch(buf1, eom1, buf2, eom2)
}
return (1);
}
+libresolv_hidden_def (res_queriesmatch)
int
__libc_res_nsend(res_state statp, const u_char *buf, int buflen,
{
return __libc_res_nsend(statp, buf, buflen, ans, anssiz, NULL);
}
+libresolv_hidden_def (res_nsend)
/* Private */