RE: little awk question

"Howard C. Berkowitz" <[email protected]> Sun, 30 Jul 2006 08:42:38 -0500
Newsgroups gmane.network.toolmakers
Message-ID <[email protected]>
Quoting Yuval Ben-Ari <[email protected]>:

> Thanks!
> more or less I made the same changes, I will see if I am missing
> something and add.
> I will send the diffs to Joe once done.
>=20
> Yuval

Joe, do you have a guess on when a new version would be available? I'm de=
bating
whether to start coding anything now, or learn from the examples and then=
 work
in the extensions I have in mind.=20

Just to be clear, I have more than one goal in mind. The first is probabl=
y to be
sure that all necessary components are in place to apply MQC on an interf=
ace.
The cross-reference is a second and perhaps third step, depending on whet=
her the
first version has a single-router scope and the second the set of routers=
.
>=20
> > -----Original Message-----
> > From: Jon Ruano [mailto:[email protected]]=20
> > Sent: Sunday, July 30, 2006 3:26 PM
> > To: Yuval Ben-Ari
> > Cc: [email protected]
> > Subject: Re: little awk question
> >=20
> >=20
> > Hey, your solution is *way* more elegant.
> >=20
> > Regarding my changes to the main file, most of them are related to =20
> > route-map and distribute-list, and some for snmp-server and ntp lines=
.
> >=20
> > These are the ones not explicitely route-map related (some of these =20
> > could be grouped too):
> >=20
> > # ruanoj: found a route-map reference (unsuppress-map)
> > /^ neighbor [a-z0-9\.-]+ unsuppress-map / {
> >    ref[router " route-map " $4] =3D 1;
> >    next;
> > }
> >=20
> > # ruanoj: found a route-map in aggregation
> > # aggregate-address a.a.a.a b.b.b.b summary-only attribute-map =20
> > routemap001
> > /^ aggregate-address [0-9.]+ [0-9.]+ summary-only attribute-map / {
> >    ref[router " route-map " $6] =3D 1;
> >    next;
> > }
> >=20
> > # ruanoj distribute-list prefix reference into router
> > /^ distribute-list prefix / {
> >    ref[router " prefix-list " $3] =3D 1;
> >    next;
> > }
> >=20
> > # ruanoj distribute-list (simple) reference
> > /^ distribute-list / {
> >    ref[router " access-list " $2] =3D 1;
> >    next;
> > }
> >=20
> > # ruanoj
> > #snmp-server community mycommunity view saveconfig RW 61
> > /^snmp-server community [a-z0-9\.-]+ view [a-z0-9\.-]+ R. / {
> >    ref[router " access-list " $7] =3D 1;
> >    next;
> > }
> >=20
> > # ruanoj
> > #snmp-server community mycommunity RO 7
> > /^snmp-server community [a-z0-9-]+ R. / {
> >    ref[router " access-list " $5] =3D 1;
> >    next;
> > }
> >=20
> > # ruanoj
> > # ntp access-group peer
> > /^ntp access-group peer / {
> >    ref[router " access-list " $4] =3D 1;
> >    next;
> > }
> >=20
> >=20
> > # ruanoj: found a community-list reference
> > /^ match community / {
> >    cur =3D 3;
> >    while ( cur <=3D NF ) {
> >       ref[router " community-list " $cur] =3D 1;
> >       cur++;
> >    }
> >    next;
> > }
> >=20
> >=20
> > On Jul 30, 2006, at 4:10 PM, Yuval Ben-Ari wrote:
> > >
> > > Yes, that should work.
> > > I think I found another way:
> > >
> > > /^ .* route-map / {
> > >   match($0, /route-map ([A-Za-z0-9_\-]+)/, arr);
> > >   ref[router " route-map " arr[1]] =3D 1;
> > >   next;
> > > }
> > >
> > > P.S
> > > It is a shame that we will each do the same work on his own.
> > > Did you do many changes in filter_audit.awk file ?
> > > I plan to finish my changes and send to the author so it can be
> > > published as newer version.
> > > I also try to be as reliable to the original as possible.
> > >
> > > Yuval
> > >
> >=20
> >=20
>=20