diff options
author | ume <ume@FreeBSD.org> | 2006-03-30 20:15:53 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2006-03-30 20:15:53 +0000 |
commit | 3a893e11a7a11a71f7c387d15943b98cb1d40797 (patch) | |
tree | 301a2d20516db1ef585fb63207881444f480edae /include | |
parent | 19c7a1894198c99124d609f45f5c4fb3e5262143 (diff) | |
download | FreeBSD-src-3a893e11a7a11a71f7c387d15943b98cb1d40797.zip FreeBSD-src-3a893e11a7a11a71f7c387d15943b98cb1d40797.tar.gz |
Expose res_update and friends again. At least, ports/mail/spamilter
uses them.
Now, we have res_nupdate and res_nmkupdate as well, but they are
still based on our old resolver for binary backward compatibility.
So, they don't provide new features such as TSIG support.
Reported by: pointyhat via kris
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile | 2 | ||||
-rw-r--r-- | include/res_update.h | 79 |
2 files changed, 80 insertions, 1 deletions
diff --git a/include/Makefile b/include/Makefile index ad37ab6..b274a54 100644 --- a/include/Makefile +++ b/include/Makefile @@ -18,7 +18,7 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h paths.h \ printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ - resolv.h runetype.h search.h setjmp.h sgtty.h \ + res_update.h resolv.h runetype.h search.h setjmp.h sgtty.h \ signal.h stab.h \ stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h tgmath.h \ diff --git a/include/res_update.h b/include/res_update.h new file mode 100644 index 0000000..b6675b2 --- /dev/null +++ b/include/res_update.h @@ -0,0 +1,79 @@ +/*- + * Copyright (c) 1983, 1987, 1989, 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 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 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _RES_UPDATE_H_ +#define _RES_UPDATE_H_ + +/* + * This RR-like structure is particular to UPDATE. + */ +struct ns_updrec { + struct ns_updrec *r_prev; /* prev record */ + struct ns_updrec *r_next; /* next record */ + u_int8_t r_section; /* ZONE/PREREQUISITE/UPDATE */ + char * r_dname; /* owner of the RR */ + u_int16_t r_class; /* class number */ + u_int16_t r_type; /* type number */ + u_int32_t r_ttl; /* time to live */ + u_char * r_data; /* rdata fields as text string */ + u_int16_t r_size; /* size of r_data field */ + int r_opcode; /* type of operation */ + /* following fields for private use by the resolver/server routines */ + struct ns_updrec *r_grpnext; /* next record when grouped */ + struct databuf *r_dp; /* databuf to process */ + struct databuf *r_deldp; /* databuf's deleted/overwritten */ + u_int16_t r_zone; /* zone number on server */ +}; +typedef struct ns_updrec ns_updrec; + +#define res_freeupdrec __res_freeupdrec +#define res_mkupdate __res_mkupdate +#define res_mkupdrec __res_mkupdrec +#define res_nmkupdate __res_nmkupdate +#define res_nupdate __res_nupdate +#if 0 +#define res_update __res_update +#endif + +__BEGIN_DECLS +void res_freeupdrec(ns_updrec *); +int res_mkupdate(ns_updrec *, u_char *, int); +ns_updrec * res_mkupdrec(int, const char *, u_int, u_int, u_long); +int res_nmkupdate(res_state, ns_updrec *, u_char *, int); +int res_nupdate(res_state, ns_updrec *, ns_tsig_key *); +int res_update(ns_updrec *); +__END_DECLS + +#endif /* _RES_UPDATE_H_ */ |