http://gimel.esc.cam.ac.uk/james/rpld/src/rpld-1.5.tar.gz
[rpld.git] / rpld_conf.tab.c
index 4e07d3e..12a226e 100644 (file)
@@ -8,9 +8,9 @@ static char yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93";
 #define yyerrok (yyerrflag=0)
 #define YYRECOVERING (yyerrflag!=0)
 #define YYPREFIX "yy"
-#line 34 "rpld_conf.y"
+#line 77 "rpld_conf.y"
 
-static char rcsid[]="$Id: rpld_conf.y,v 1.3 1999/09/26 10:46:56 root Exp root $";
+static char rcsid[]="$Id: rpld_conf.y,v 1.7 2000/07/23 19:14:19 root Exp $";
 
 #include "project.h"
 
@@ -21,7 +21,7 @@ typedef enum {INIT, GLOBALBLOCK, HOSTBLOCK, FILEBLOCK} STATE ;
 
 /*void process_thing(THING thing, char *name, int type, YYSTYPE *pvalue);*/
 
-#line 50 "rpld_conf.y"
+#line 93 "rpld_conf.y"
 typedef union {
                long number;
                char *name;
@@ -172,7 +172,7 @@ YYSTYPE yylval;
 short yyss[YYSTACKSIZE];
 YYSTYPE yyvs[YYSTACKSIZE];
 #define yystacksize YYSTACKSIZE
-#line 88 "rpld_conf.y"
+#line 131 "rpld_conf.y"
 
 //
 // ERROR REPORTING
@@ -211,6 +211,8 @@ struct clientinfo
        // optional
        int have_framesize;
        int have_blocksize;
+       int have_pacing;
+       int have_nospew;
 };
 
 struct clfileinfo
@@ -263,6 +265,7 @@ void process_thing(THING thing, char *name, int type, YYSTYPE *pvalue)
 
                                pc->blocklen=MY_BLOCK_LEN;
                                pc->framelen=MY_FRAME_LEN;
+                               pc->pacing=MY_PACING;
                                
                                state = HOSTBLOCK;
                                break;
@@ -338,7 +341,12 @@ void process_thing(THING thing, char *name, int type, YYSTYPE *pvalue)
                        THROW_ERROR("Unknown directive");
                } else if (state == HOSTBLOCK) {
                        // no host assertions ATM
-                       THROW_ERROR("Unknown directive");
+                       if (strsame(name,"nospew")) {
+                               if (ci.have_pacing) THROW_ERROR("Directive nospew incompatible with pacing ");
+                               if (ci.have_nospew) THROW_ERROR("Repeated directive");
+                               ci.have_nospew=1;
+                               pc->nospew++;
+                       } else THROW_ERROR("Unknown directive");
                } else if (state == FILEBLOCK) {
                        if (strsame(name,"linux")) {
                                if (!cfi.have_path) THROW_ERROR("A path to a
@@ -349,7 +357,7 @@ valid kernel must precede linux");
                                cfi.have_offset=1;
                                cfi.have_length=1;
                                ci.have_run_addr=1;
-                       } else{
+                       }else{
                        THROW_ERROR("Unknown directive");
                        }
                } else THROW_ERROR("Unknown directive");
@@ -402,6 +410,13 @@ valid kernel must precede linux");
                                pc->framelen = pvalue->number;
                                ci.have_framesize = 1;
                        }
+                       else if (strsame(name,"pacing")) {
+                               if (type != NUMBER) THROW_ERROR("Directive must be followed by an integer ");
+                               if (ci.have_nospew) THROW_ERROR("Directive pacing incompatible with nospew ");
+                               if (ci.have_pacing) THROW_ERROR("Repeated directive");
+                               pc->pacing = pvalue->number;
+                               ci.have_pacing =1;
+                       }
                        else THROW_ERROR("Unknown directive");
                } else if (state == FILEBLOCK) {
                        // path
@@ -449,7 +464,7 @@ valid kernel must precede linux");
        
 
 }
-#line 453 "rpld_conf.tab.c"
+#line 468 "rpld_conf.tab.c"
 #define YYABORT goto yyabort
 #define YYREJECT goto yyabort
 #define YYACCEPT goto yyaccept
@@ -591,42 +606,42 @@ yyreduce:
     switch (yyn)
     {
 case 3:
-#line 69 "rpld_conf.y"
+#line 112 "rpld_conf.y"
 { process_thing(BLOCK_END, "", 0, NULL); }
 break;
 case 4:
-#line 70 "rpld_conf.y"
+#line 113 "rpld_conf.y"
 { process_thing(BLOCK_END, "", 0, NULL); }
 break;
 case 5:
-#line 72 "rpld_conf.y"
+#line 115 "rpld_conf.y"
 { process_thing(BLOCK_START, yyvsp[-1].name, 0, NULL); }
 break;
 case 6:
-#line 73 "rpld_conf.y"
+#line 116 "rpld_conf.y"
 { process_thing(BLOCK_START, "", 0, NULL); }
 break;
 case 10:
-#line 80 "rpld_conf.y"
+#line 123 "rpld_conf.y"
 { process_thing(ASSERTION, yyvsp[0].name, 0, NULL); }
 break;
 case 11:
-#line 81 "rpld_conf.y"
+#line 124 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, TEXT, &yyvsp[0]); }
 break;
 case 12:
-#line 82 "rpld_conf.y"
+#line 125 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, NUMBER, &yyvsp[0]); }
 break;
 case 13:
-#line 83 "rpld_conf.y"
+#line 126 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, MACADDR, &yyvsp[0]); }
 break;
 case 14:
-#line 84 "rpld_conf.y"
+#line 127 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, MACADDR_PARTIAL, &yyvsp[0]); }
 break;
-#line 630 "rpld_conf.tab.c"
+#line 645 "rpld_conf.tab.c"
     }
     yyssp -= yym;
     yystate = *yyssp;