Added sample rpld.conf file to load gPXE
[rpld.git] / rpld_conf.tab.c
index 4e07d3e..82cc76b 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
-static char yysccsid[] = "@(#)yaccpar  1.9 (Berkeley) 02/21/93";
+static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
 #endif
 #define YYBYACC 1
 #define YYMAJOR 1
@@ -7,13 +7,16 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
 #define yyclearin (yychar=(-1))
 #define yyerrok (yyerrflag=0)
 #define YYRECOVERING (yyerrflag!=0)
+extern int yyparse(void);
 #define YYPREFIX "yy"
-#line 34 "rpld_conf.y"
+#line 80 "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.8 2001/11/01 15:23:59 root Exp $";
 
 #include "project.h"
 
+#include <stdlib.h>
+
 /* state machine stuff*/
 
 typedef enum {START, BLOCK_START, BLOCK_END, ASSERTION, ASSIGNMENT} THING ;
@@ -21,7 +24,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 98 "rpld_conf.y"
 typedef union {
                long number;
                char *name;
@@ -32,7 +35,7 @@ typedef union {
                        int mac_len;
                } pm;
        } YYSTYPE;
-#line 36 "rpld_conf.tab.c"
+#line 39 "rpld_conf.tab.c"
 #define BLOCK_START 257
 #define BLOCK_END 258
 #define NAME 259
@@ -172,7 +175,7 @@ YYSTYPE yylval;
 short yyss[YYSTACKSIZE];
 YYSTYPE yyvs[YYSTACKSIZE];
 #define yystacksize YYSTACKSIZE
-#line 88 "rpld_conf.y"
+#line 136 "rpld_conf.y"
 
 //
 // ERROR REPORTING
@@ -211,6 +214,8 @@ struct clientinfo
        // optional
        int have_framesize;
        int have_blocksize;
+       int have_pacing;
+       int have_nospew;
 };
 
 struct clfileinfo
@@ -263,6 +268,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,18 +344,22 @@ 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
-valid kernel must precede linux");
+                               if (!cfi.have_path) THROW_ERROR("A path to a valid kernel must precede linux");
 
                                do_linux_kernel(pc,pcf);
                                cfi.have_load_addr=1;
                                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 +412,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,13 +466,13 @@ valid kernel must precede linux");
        
 
 }
-#line 453 "rpld_conf.tab.c"
+#line 470 "rpld_conf.tab.c"
 #define YYABORT goto yyabort
 #define YYREJECT goto yyabort
 #define YYACCEPT goto yyaccept
 #define YYERROR goto yyerrlab
 int
-yyparse()
+yyparse(void)
 {
     register int yym, yyn, yystate;
 #if YYDEBUG
@@ -479,7 +496,7 @@ yyparse()
     *yyssp = yystate = 0;
 
 yyloop:
-    if (yyn = yydefred[yystate]) goto yyreduce;
+    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
         if ((yychar = yylex()) < 0) yychar = 0;
@@ -591,42 +608,42 @@ yyreduce:
     switch (yyn)
     {
 case 3:
-#line 69 "rpld_conf.y"
+#line 117 "rpld_conf.y"
 { process_thing(BLOCK_END, "", 0, NULL); }
 break;
 case 4:
-#line 70 "rpld_conf.y"
+#line 118 "rpld_conf.y"
 { process_thing(BLOCK_END, "", 0, NULL); }
 break;
 case 5:
-#line 72 "rpld_conf.y"
+#line 120 "rpld_conf.y"
 { process_thing(BLOCK_START, yyvsp[-1].name, 0, NULL); }
 break;
 case 6:
-#line 73 "rpld_conf.y"
+#line 121 "rpld_conf.y"
 { process_thing(BLOCK_START, "", 0, NULL); }
 break;
 case 10:
-#line 80 "rpld_conf.y"
+#line 128 "rpld_conf.y"
 { process_thing(ASSERTION, yyvsp[0].name, 0, NULL); }
 break;
 case 11:
-#line 81 "rpld_conf.y"
+#line 129 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, TEXT, &yyvsp[0]); }
 break;
 case 12:
-#line 82 "rpld_conf.y"
+#line 130 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, NUMBER, &yyvsp[0]); }
 break;
 case 13:
-#line 83 "rpld_conf.y"
+#line 131 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, MACADDR, &yyvsp[0]); }
 break;
 case 14:
-#line 84 "rpld_conf.y"
+#line 132 "rpld_conf.y"
 { process_thing(ASSIGNMENT, yyvsp[-2].name, MACADDR_PARTIAL, &yyvsp[0]); }
 break;
-#line 630 "rpld_conf.tab.c"
+#line 647 "rpld_conf.tab.c"
     }
     yyssp -= yym;
     yystate = *yyssp;