head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.8 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.6 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.4 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.2 pkgsrc-2011Q2-base:1.5 pkgsrc-2010Q4:1.4.0.16 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.14 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.12 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.10 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.8 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.6 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.4 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.2 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.3.0.6 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.4 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.2 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.2.0.6 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.4 pkgsrc-2008Q1:1.2.0.2 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.1.0.6 pkgsrc-2007Q4-base:1.1 pkgsrc-2007Q3:1.1.0.4 pkgsrc-2007Q3-base:1.1 pkgsrc-2007Q2:1.1.0.2 pkgsrc-2007Q2-base:1.1; locks; strict; comment @# @; 1.5 date 2011.03.19.19.59.47; author spz; state dead; branches; next 1.4; 1.4 date 2009.02.14.22.19.52; author spz; state Exp; branches; next 1.3; 1.3 date 2008.08.03.22.43.39; author spz; state Exp; branches; next 1.2; 1.2 date 2008.03.08.11.00.35; author spz; state Exp; branches; next 1.1; 1.1 date 2007.05.22.12.18.01; author spz; state Exp; branches; next ; desc @@ 1.5 log @remove obsolete irrtoolset-nox11 @ text @$NetBSD: patch-cs,v 1.4 2009/02/14 22:19:52 spz Exp $ --- src/RtConfig/f_cisco.cc.orig 2007-01-23 01:45:16.000000000 +0100 +++ src/RtConfig/f_cisco.cc @@@@ -746,39 +746,39 @@@@ void CiscoConfig::printRE(ostream &s, //int lineLen = strlen(out.str()); int lineLen = out.str().length(); + const char *p = out.str().c_str(); + if (lineLen < 240 && ! hasTilda) { - const char *p = out.str().c_str(); for (char *q = strchr(p, '@@'); q; q = strchr(q, '@@')) *q = '('; - s << out.str(); + s << p; } else { // need to split into multiple lines if (hasTilda) { - const char *p = out.str().c_str(); for (char *q = strchr(p, '@@'); q; q = strchr(q, '@@')) *q = '('; for (char *q = strchr(p, '&'); q; q = strchr(q, '&')) *q = '@@'; } - char *p = strdup(out.str().c_str()); - char *q, *r2; + char *q, *q2; char *r = NULL; int size = 0; - for (p = strchr(p, '@@'); p; p = strchr(p, '@@')) { - q = strchr(p, ')'); - if (q - p > size) { - r = p; - size = q - p; + for (q = strchr(p, '@@'); q; q = strchr(q, '@@')) { + q2 = strchr(q, ')'); + if (q2 - q > size) { + r = q; + size = q2 - q; } - *p = '('; - p = q; + *q = '('; + q = q2; } if (!r) { s << out.str(); cerr << "Warning: ip as-path access-list is too long for cisco to handle" << endl; } else { - int inc = hasTilda ? 1 : (240 - lineLen + size) >? 5; - p = strdup(out.str().c_str()); + char *r2; + int inc = hasTilda ? 1 : + ( ( (240 - lineLen + size) > 5 ) ? (240 - lineLen + size) : 5 ); q = strchr(r, ')') + 1; *r = 0; r++; @@@@ -1246,8 +1246,31 @@@@ bool CiscoConfig::printNeighbor(int impo cout << " neighbor " << neighbor << " remote-as " << peerAS << "\n"; if (afi_activate && !peerGroup) { - cout << " address-family " << (AddressFamily &) *filter_afi << endl; - cout << indent <<" neighbor " << neighbor << " activate\n"; + if (strcmp(filter_afi->name(),"ipv6") == 0) { + cout << " address-family " << "ipv4" << endl; + cout << indent <<" no neighbor " << neighbor << " activate\n"; + cout << " address-family " << "ipv6 unicast" << endl; + cout << indent <<" neighbor " << neighbor << " activate\n"; + cout << " address-family " << "ipv6 multicast" << endl; + cout << indent <<" neighbor " << neighbor << " activate\n"; + } else if (strcmp(filter_afi->name(),"ipv6.unicast") == 0) { + cout << " address-family " << "ipv4" << endl; + cout << indent <<" no neighbor " << neighbor << " activate\n"; + cout << " address-family " << "ipv6 unicast" << endl; + cout << indent <<" neighbor " << neighbor << " activate\n"; + } else if (strcmp(filter_afi->name(),"ipv4.multicast") == 0) { + cout << " address-family " << "ipv4 multicast" << endl; + cout << indent <<" neighbor " << neighbor << " activate\n"; + } else if (strcmp(filter_afi->name(),"ipv6.multicast") == 0) { + cout << " address-family " << "ipv4" << endl; + cout << indent <<" no neighbor " << neighbor << " activate\n"; + cout << " address-family " << "ipv6 multicast" << endl; + cout << indent <<" neighbor " << neighbor << " activate\n"; + } else if (strcmp(filter_afi->name(),"ipv4.unicast") == 0) { + cout << " address-family " << "ipv4 unicast" << endl; + cout << indent <<" neighbor " << neighbor << " activate\n"; + } + // ought to handle afi any too, but that's not just done by naming it here } if (routeMapGenerated) @ 1.4 log @add the patch for the -no_default_afi option to RtConfig by David Croft @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @fix for IOS address-family syntax suggested by Daryl Collins (but revamped and expanded) @ text @d59 1 a59 1 @@@@ -1246,8 +1246,28 @@@@ bool CiscoConfig::printNeighbor(int impo d85 3 @ 1.2 log @- update DESCR to match reality - add patch to src/gnug++/int.defs.h for Solaris compatibility (by Ian Dickinson, iand@@eng.pipex.net) - move Errors manpage to a less general name (suggested by Ian Dickinson) - add patch to src/RtConfig/f_cisco.cc by Hagen Boehm (fixes up the string that gets output instead of a copy of said string) - improve src/Makefile.in some more @ text @d59 31 @ 1.1 log @new version, new patches: upstream adopted a bunch of ours, but gcc found new things to bitch about @ text @d3 45 a47 3 --- ./src/RtConfig/f_cisco.cc.orig 2007-01-23 01:45:16.000000000 +0100 +++ ./src/RtConfig/f_cisco.cc @@@@ -777,7 +777,8 @@@@ void CiscoConfig::printRE(ostream &s, d52 2 a55 1 p = strdup(out.str().c_str()); d58 1 @