revised extended autnum patch, was: Re: Bit of tweaking to IRRToolSet web site

S.P.Zeidler spz at serpens.de
Tue Mar 17 08:02:19 UTC 2009


Hi,

Thus wrote Nick Hilliard (nick at inex.ie):

> On 15/03/2009 22:02, S.P.Zeidler wrote:
>> ok, this did take a bit longer. The diff attached works against svn trunk
>> version 222 (but mind that you need a new rpsl.l.cc but object_log.l.cc
>> doesn't work for me when I regenerate it (not touched by me)).
>
> Ok, getting there.  peval seems to have sorted itself out, but there are  
> still some peculiarities in RtConfig.  I think these should be solved by  
> the attached patch, which produces:
>
>> RtConfig> @RtConfig networks AS6.4
>> !
>> network 205.233.56.0 mask 255.255.252.0
>> RtConfig>

eh right, I forgot to include patch-ef, which reads:
--- src/RtConfig/command.l.orig 2006-06-08 17:16:26.000000000 +0200
+++ src/RtConfig/command.l
@@ -205,8 +205,12 @@ int yywrap () {
 }
 
 
-<USEFUL_LINE>[Aa][Ss][0-9]+ {
-   yylval.as = atoi(yytext+2);
+<USEFUL_LINE>[Aa][Ss]([0-9]+|[0-9]+\.[0-9]+) {
+   const char *dot = strchr(yytext,'.');
+   if (dot)
+      yylval.as = atoi(yytext+2)<<16 | atoi(dot+1);
+   else
+      yylval.as = atoi(yytext+2);
    LEXER_RETURN(TKN_ASNUM);
 }

I've re-uploaded the patch with this one added to Ticket #17.

> There's a similar problem in the parser in roe, for which:
>
> --- roe.l.old   2009-03-16 15:40:29.000000000 +0000
> +++ roe.l       2009-03-16 15:41:26.000000000 +0000
> @@ -197,7 +197,7 @@
>     LEXER_RETURN((int) *yytext);
>  }
>
> -<USEFUL_LINE>AS[0-9]+ {
> +<USEFUL_LINE>[Aa][Ss][:digit:]+(\.[:digit:]+){0,1} {
>     LEXER_RETURN(TKN_ASNUM);
>  }
>
> I've no idea if the roe patch works, or even compiles.

I'm pretty certain that roe didn't compile before either. The patching I
do against it is just to make the work of someone who wants to make it
work again not lots worse. I missed roe.l and will include it when I get
Round Tuits next.

> Could I suggest that in your patch for src/rpsl/rpsl/rpsl.l, that you use 
> '[Aa][Ss]' instead of 'AS'?  This case sensitivity has caught me on 
> several occasions, and is a violation of the principle of least 
> astonishment.

As far as I'm aware this parser only hits the registry contents, and I'd
be surprised if these weren't fixed case? Do you have an example for me?

regards,
	spz
-- 
spz at serpens.de (S.P.Zeidler)



More information about the irrtoolset mailing list