head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.8 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.6 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.4.0.4 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q2:1.4.0.2 pkgsrc-2011Q2-base:1.4 pkgsrc-2010Q4:1.3.0.16 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.14 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.12 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.10 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.8 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.6 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.4 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.2 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.2.0.14 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.12 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.10 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.8 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.6 pkgsrc-2008Q1:1.2.0.4 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.2 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.1.0.2 pkgsrc-2007Q3-base:1.1; locks; strict; comment @# @; 1.4 date 2011.03.19.19.59.47; author spz; state dead; branches; next 1.3; 1.3 date 2009.03.15.20.10.36; author spz; state Exp; branches; next 1.2; 1.2 date 2007.12.31.09.15.15; author spz; state Exp; branches; next 1.1; 1.1 date 2007.09.07.21.26.32; author spz; state Exp; branches; next ; desc @@ 1.4 log @remove obsolete irrtoolset-nox11 @ text @$NetBSD: patch-cx,v 1.3 2009/03/15 20:10:36 spz Exp $ --- src/irr/irr.cc.orig 2006-10-01 13:23:32.000000000 +0200 +++ src/irr/irr.cc @@@@ -210,6 +210,10 @@@@ Cache expandASC Cache expandRSSetCache; Cache expandRtrSetCache; +bool IRR::queryCache(SymID setID, Set *&set) { + return (SetCache.query(setID, set)); +} + void IRR::initCache(char *objectText, int objectLength, char *clss) { Buffer b(objectText, objectLength); Set *o = new Set(b); @@@@ -312,13 +316,20 @@@@ const AutNum *IRR::getAutNum(ASt as) { AutNum *result = NULL; if (! AutNumCache.query(as, result)) { - sprintf(buffer, "AS%d", as); + asnum_string_dot(buffer, as); // try asdotted if (getAutNum(buffer, text, len)) { Buffer b(text, len); result = new AutNum(b); AutNumCache.add(as, result); - } else - AutNumCache.add(as, NULL); // a negative object + } else { + asnum_string_plain(buffer, as); // try asplain before giving up + if (getAutNum(buffer, text, len)) { + Buffer b(text, len); + result = new AutNum(b); + AutNumCache.add(as, result); + } else + AutNumCache.add(as, NULL); // a negative object + } } return result; @@@@ -365,7 +376,7 @@@@ void IRR::getRoute(Route *&route, Prefix char *text; int len; - sprintf(buffer, "AS%d", as); + asnum_string_dot(buffer, as); if (getRoute(rt->get_text(), buffer, text, len)) { Buffer b(text, len); route = new Route(b); @@@@ -379,12 +390,18 @@@@ void IRR::getRoute(Route *&route, char * char *text; int len; - sprintf(buffer, "AS%d", as); + asnum_string_dot(buffer, as); if (getRoute(rt, buffer, text, len)) { Buffer b(text, len); route = new Route(b); - } else - route = NULL; + } else { + asnum_string_plain(buffer, as); + if (getRoute(rt, buffer, text, len)) { + Buffer b(text, len); + route = new Route(b); + } else + route = NULL; + } } const InetRtr *IRR::getInetRtr(SymID inetRtr) @@@@ -419,11 +436,14 @@@@ const MPPrefixRanges *IRR::expandAS(ASt // we insert the set to the cache before expanding // this is needed to avoid recursion if sets are recursively defined expandASCache.add(as, result); - sprintf(buffer, "AS%d", as); + asnum_string_dot(buffer, as); // try asdotted if (!expandAS(buffer, result)) { - expandASCache.nullify(as); - delete result; - result = NULL; // A negative cache + asnum_string_plain(buffer, as); // that failed, try asplained + if (!expandAS(buffer, result)) { + expandASCache.nullify(as); + delete result; + result = NULL; // A negative cache + } } } @ 1.3 log @fix the asplain patch: since the routing registries currently won't find asplained autnums, make asdot the default, but prepare for them switching by asking the asplained format before giving up, independently of any command line settings. Bump pkgrev, too. @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @sneaking in an update for a quite leafy package :) - remove patches/patch-bv since if you use gmake it's for a generated file, even if the original tar contains it (and the diff grows rather large due to differing yacc versions) - add irrd-cache-usage-patch by Hagen Boehm - add JunOS @@RtConfig import patch by Stan Barber - add IPv6 ACL list numbers patch by Timo Koehler @ text @d16 1 a16 1 @@@@ -312,7 +316,7 @@@@ const AutNum *IRR::getAutNum(ASt as) { d21 1 a21 1 + asnum_string(buffer, as); d25 16 a40 1 @@@@ -365,7 +369,7 @@@@ void IRR::getRoute(Route *&route, Prefix d45 1 a45 1 + asnum_string(buffer, as); d49 1 a49 1 @@@@ -379,7 +383,7 @@@@ void IRR::getRoute(Route *&route, char * d54 1 a54 1 + asnum_string(buffer, as); d58 14 a71 1 @@@@ -419,7 +423,7 @@@@ const MPPrefixRanges *IRR::expandAS(ASt d76 1 a76 1 + asnum_string(buffer, as); d78 12 a89 2 expandASCache.nullify(as); delete result; @ 1.1 log @patches irrtoolset to handle extended autnums most changes supplied by mlelstv@@NetBSD.org (Michael van Elst) patch to src/rpsl/rpsl/rptype.cc supplied by he@@NetBSD.org (Havard Eidnes) also fixes PR pkg/36807 @ text @d5 12 a16 1 @@@@ -312,7 +312,7 @@@@ const AutNum *IRR::getAutNum(ASt as) { d25 1 a25 1 @@@@ -365,7 +365,7 @@@@ void IRR::getRoute(Route *&route, Prefix d34 1 a34 1 @@@@ -379,7 +379,7 @@@@ void IRR::getRoute(Route *&route, char * d43 1 a43 1 @@@@ -419,7 +419,7 @@@@ const MPPrefixRanges *IRR::expandAS(ASt @