]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
sanitize away the DNS_OPT_NEWCODES stuff
authorAndreas Gustafsson <source@isc.org>
Sat, 2 Dec 2000 04:13:35 +0000 (04:13 +0000)
committerAndreas Gustafsson <source@isc.org>
Sat, 2 Dec 2000 04:13:35 +0000 (04:13 +0000)
lib/dns/Makefile.in
lib/dns/include/dns/opt.h
lib/dns/message.c
lib/dns/opt.c
util/sanitize.pl
util/sanitize_all.sh

index aff6c046a126f3ff59560da281debd318ce1f7a9..ca2a3c98901b274bd7d97429d4820c0d6382d634 100644 (file)
@@ -13,7 +13,7 @@
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: Makefile.in,v 1.114 2000/12/01 23:49:53 gson Exp $
+# $Id: Makefile.in,v 1.115 2000/12/02 04:13:29 gson Exp $
 
 srcdir =       @srcdir@
 VPATH =                @srcdir@
@@ -32,6 +32,11 @@ CWARNINGS =
 
 LIBS =         @LIBS@
 
+#ifdef DNS_OPT_NEWCODES
+OTHEROBJS = opt.@O@
+OTHERSRCS = opt.c
+#endif /* DNS_OPT_NEWCODES */
+
 # Alphabetically
 
 CONFOBJS =     config/confacl.@O@ config/confcache.@O@ config/confcommon.@O@ \
@@ -93,14 +98,14 @@ OBJS =              a6.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
                db.@O@ dbiterator.@O@ dbtable.@O@ dispatch.@O@ dnssec.@O@ \
                forward.@O@ journal.@O@ keytable.@O@ lib.@O@ log.@O@ \
                lookup.@O@ master.@O@ masterdump.@O@ message.@O@ \
-               name.@O@ ncache.@O@ nxt.@O@ opt.@O@ peer.@O@ \
+               name.@O@ ncache.@O@ nxt.@O@ peer.@O@ \
                rbt.@O@ rbtdb.@O@ rbtdb64.@O@ rdata.@O@ rdatalist.@O@ \
                rdataset.@O@ rdatasetiter.@O@ rdataslab.@O@ request.@O@ \
                resolver.@O@ result.@O@ rootns.@O@ sdb.@O@ ssu.@O@ \
                stats.@O@ tcpmsg.@O@ time.@O@ timer.@O@ tkey.@O@ \
                tsig.@O@ ttl.@O@ validator.@O@ \
                version.@O@ view.@O@ xfrin.@O@ zone.@O@ zt.@O@ \
-               ${DSTOBJS} @DST_OPENSSL_OBJS@ ${CONFOBJS}
+               ${OTHEROBJS} ${DSTOBJS} @DST_OPENSSL_OBJS@ ${CONFOBJS}
 
 # Alphabetically
 SRCS =         a6.c acl.c adb.c byaddr.c \
@@ -108,13 +113,13 @@ SRCS =            a6.c acl.c adb.c byaddr.c \
                db.c dbiterator.c dbtable.c dispatch.c dnssec.c \
                forward.c journal.c keytable.c lib.c log.c \
                lookup.c master.c masterdump.c message.c \
-               name.c ncache.c nxt.c opt.c peer.c \
+               name.c ncache.c nxt.c peer.c \
                rbt.c rbtdb.c rbtdb64.c rdata.c rdatalist.c \
                rdataset.c rdatasetiter.c rdataslab.c request.c \
                resolver.c result.c rootns.c sdb.c ssu.c \
                stats.c tcpmsg.c time.c timer.c tkey.c \
                tsig.c ttl.c validator.c \
-               version.c view.c xfrin.c zone.c zt.c
+               version.c view.c xfrin.c zone.c zt.c ${OTHERSRCS}
 
 SUBDIRS =      include sec config
 TARGETS =      include/dns/enumtype.h include/dns/enumclass.h \
index e831f3a3e0a0ebd2241fd12a997821187cb2861f..a2158ce434350f756c26dc6f92b69501ba1adf0f 100644 (file)
@@ -15,7 +15,9 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: opt.h,v 1.4 2000/11/18 03:01:07 bwelling Exp $ */
+/* $Id: opt.h,v 1.5 2000/12/02 04:13:33 gson Exp $ */
+
+/* DNS_OPT_NEWCODES_KEEP */
 
 #ifndef DNS_OPT_H
 #define DNS_OPT_H 1
index b1fad1705d23f43772e5d043f51d06b9acdf9d02..45829b63cc08d6503d3725412cf10f70023ef278 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: message.c,v 1.159 2000/11/22 23:09:58 gson Exp $ */
+/* $Id: message.c,v 1.160 2000/12/02 04:13:30 gson Exp $ */
 
 /***
  *** Imports
@@ -2814,7 +2814,23 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
                ps = dns_message_getopt(msg);
                if (ps == NULL)
                        return (ISC_R_SUCCESS);
+#ifdef DNS_OPT_NEWCODES
                result = dns_opt_totext(ps, target, flags);
+#else /* DNS_OPT_NEWCODES */
+               result = dns_opt_totext(ps, target, flags);
+               if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
+                       ADD_STRING(target, ";; OPT PSEUDOSECTION:\n");
+               ADD_STRING(target, "; EDNS: version: ");
+               sprintf(buf, "%4u",
+                       (unsigned int)((ps->ttl &
+                                       0x00ff0000 >> 16)));
+               ADD_STRING(target, buf);
+               ADD_STRING(target, ", udp=");
+               sprintf(buf, "%7u\n",
+                       (unsigned int)ps->rdclass);
+               ADD_STRING(target, buf);
+               result = ISC_R_SUCCESS;
+#endif /* DNS_OPT_NEWCODES */
                return (result);
        case DNS_PSEUDOSECTION_TSIG:
                ps = dns_message_gettsig(msg, &name);
index cfea60335778dc22267906ccd325180448ea6956..1c49e9b31cb789b47049c13536bf86603a8b2886 100644 (file)
@@ -15,7 +15,9 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: opt.c,v 1.9 2000/12/02 04:12:25 gson Exp $ */
+/* $Id: opt.c,v 1.10 2000/12/02 04:13:32 gson Exp $ */
+
+/* DNS_OPT_NEWCODES_KEEP */
 
 #include <config.h>
 
index 92ace622620410e1dddda1656a876ec3edb70452..b55156595f3f176520f9ef29902e9d37907ccf2f 100644 (file)
@@ -15,7 +15,7 @@
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: sanitize.pl,v 1.13 2000/10/10 23:12:54 bwelling Exp $
+# $Id: sanitize.pl,v 1.14 2000/12/02 04:13:34 gson Exp $
 
 # Don't try and sanitize this file: NOMINUM_IGNORE
 
 # in the file, and a warning is generated, unless the string
 # NOMINUM_IGNORE appears before NOMINUM_.
 
-# If the string key_DELETE is present, delete the file.
+# If the string key_DELETE is present, delete the file when the key
+# is present.
+
+# If the string key_KEEP is present, delete the file when the key
+# is absent.
 
 # Usage:
 #  ./sanitize.pl -c     - Check syntax only, don't change anything
@@ -110,6 +114,14 @@ sub runfile($) {
                                $deletefile = 1;
                                goto bailout;
                        }
+                       elsif ((/$key[$i]_KEEP/) &&
+                           ($showon[$i] == 2)) {
+                               close(INFILE);
+                               close(OUTFILE);
+                               unlink($_[1]);
+                               $deletefile = 1;
+                               goto bailout;
+                       }
                        elsif (/\#.*ifdef.+$key[$i]/) {
                                if ($state[$i] != 0) {
                                        print(STDERR "*** ERROR in file ".
index 1f4a32feb39f96ca94f20e0b493f7e4625ca0613..fdd1006843e6f60ef7d3d8211214d213ccb9b0cb 100755 (executable)
 # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: sanitize_all.sh,v 1.9 2000/11/22 23:28:27 bwelling Exp $
+# $Id: sanitize_all.sh,v 1.10 2000/12/02 04:13:35 gson Exp $
 
 PERL=perl5
 
 # Run this shell script from a CVS export'ed source tree, and it will
 # sanitize all of the files in that tree.
 
-find . -name '*.[ch]' | xargs $PERL util/sanitize.pl -kNOMINUM_PUBLIC \
-       -iNOMINUM_GNS $*
-find . -name '*.in' | xargs $PERL util/sanitize.pl -kNOMINUM_PUBLIC \
-       -iNOMINUM_GNS $*
+SANITIZE_FLAGS="-kNOMINUM_PUBLIC -iDNS_OPT_NEWCODES -iDNS_OPT_NEWCODES_LIVE"
+
+find . -name '*.[ch]' -o -name '*.in' |
+       xargs $PERL util/sanitize.pl $SANITIZE_FLAGS
+
 for file in `find . -name '*.dirty'`
 do
     clean=`echo $file | sed 's/\.dirty$//'`
-    $PERL util/sanitize.pl -kNOMINUM_PUBLIC - < $file > $clean
+    $PERL util/sanitize.pl $SANITIZE_FLAGS - < $file > $clean
     rm $file
 done