Browse code

AVP CLASS & TRACK specification in the script changed to following options:

-f. (or none) FROM USER
-t. TO USER
-fd. FROM DOMAIN
-td. TO DOMAIN
-g. GLOBAL (FROM by default)

Michal Matyska authored on 05/01/2006 10:59:27
Showing 2 changed files
... ...
@@ -199,11 +199,11 @@ MINUS	"-"
199 199
 /* Attribute specification */
200 200
 ATTR_MARK   "$"|"%"
201 201
 SELECT_MARK  "@"
202
-ATTR_FROM   "from"|"f"
203
-ATTR_TO     "to"|"t"
204
-ATTR_USER   "user"|"u"
205
-ATTR_DOMAIN "domain"|"d"
206
-ATTR_GLOBAL "global"|"g"
202
+ATTR_FROMUSER     "f"
203
+ATTR_TOUSER       "t"
204
+ATTR_FROMDOMAIN   "fd"
205
+ATTR_TODOMAIN     "td"
206
+ATTR_GLOBAL       "g"
207 207
 
208 208
 /* config vars. */
209 209
 DEBUG	debug
... ...
@@ -504,12 +504,10 @@ EAT_ABLE	[\ \t\b\r]
504 504
 
505 505
 
506 506
 <INITIAL>{ATTR_MARK}    { count(); state = ATTR_S; BEGIN(ATTR); return ATTR_MARK; }
507
-<ATTR>{ATTR_FROM}       { count(); return ATTR_FROM; }
508
-<ATTR>{ATTR_TO}         { count(); return ATTR_TO; }
509
-<ATTR>{LBRACK}          { count(); return LBRACK; }
510
-<ATTR>{RBRACK}          { count(); return RBRACK; }
511
-<ATTR>{ATTR_USER}       { count(); return ATTR_USER; }
512
-<ATTR>{ATTR_DOMAIN}     { count(); return ATTR_DOMAIN; }
507
+<ATTR>{ATTR_FROMUSER}   { count(); return ATTR_FROMUSER; }
508
+<ATTR>{ATTR_TOUSER}     { count(); return ATTR_TOUSER; }
509
+<ATTR>{ATTR_FROMDOMAIN} { count(); return ATTR_FROMDOMAIN; }
510
+<ATTR>{ATTR_TODOMAIN}   { count(); return ATTR_TODOMAIN; }
513 511
 <ATTR>{ATTR_GLOBAL}     { count(); return ATTR_GLOBAL; }
514 512
 <ATTR>{DOT}             { count(); return DOT; }
515 513
 <ATTR>{ID}		{ count(); addstr(&s_buf, yytext, yyleng); 
... ...
@@ -277,10 +277,10 @@ static struct socket_id* mk_listen_id(char*, int, int);
277 277
 
278 278
 %token ATTR_MARK
279 279
 %token SELECT_MARK
280
-%token ATTR_FROM
281
-%token ATTR_TO
282
-%token ATTR_USER
283
-%token ATTR_DOMAIN
280
+%token ATTR_FROMUSER
281
+%token ATTR_TOUSER
282
+%token ATTR_FROMDOMAIN
283
+%token ATTR_TODOMAIN
284 284
 %token ATTR_GLOBAL
285 285
 %token ADDEQ
286 286
 
... ...
@@ -336,7 +336,7 @@ static struct socket_id* mk_listen_id(char*, int, int);
336 336
 %type <strval> host_sep
337 337
 %type <intval> uri_type
338 338
 %type <attr> attr_id
339
-%type <intval> class_id
339
+//%type <intval> class_id
340 340
 %type <intval> assign_op
341 341
 %type <select> select_id
342 342
 /*%type <route_el> rules;
... ...
@@ -1292,10 +1292,10 @@ if_cmd:		IF exp stm				{ $$=mk_action3( IF_T,
1292 1292
 									}
1293 1293
 	;
1294 1294
 
1295
-class_id : LBRACK ATTR_USER RBRACK { $$ = AVP_CLASS_USER; }
1296
-         | LBRACK ATTR_DOMAIN RBRACK { $$ = AVP_CLASS_DOMAIN; }
1297
-         | LBRACK ATTR_GLOBAL RBRACK { $$ = AVP_CLASS_GLOBAL; }
1298
-;
1295
+//class_id : LBRACK ATTR_USER RBRACK { $$ = AVP_CLASS_USER; }
1296
+//         | LBRACK ATTR_DOMAIN RBRACK { $$ = AVP_CLASS_DOMAIN; }
1297
+//         | LBRACK ATTR_GLOBAL RBRACK { $$ = AVP_CLASS_GLOBAL; }
1298
+//;
1299 1299
 
1300 1300
 select_param : ID { 
1301 1301
 		    if (sel.n >= MAX_SELECT_PARAMS-1) {
... ...
@@ -1341,37 +1341,48 @@ attr_id : ATTR_MARK ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp
1341 1341
                          s_attr->name.s.s = $2; s_attr->name.s.len = strlen($2); 
1342 1342
                          $$ = s_attr; 
1343 1343
                        }
1344
-        | ATTR_MARK class_id DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1345
-                                      if (!s_attr) { yyerror("No memory left"); }
1346
-                                      s_attr->type = AVP_NAME_STR | $2;
1347
-                                      s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4); 
1348
-                                      $$ = s_attr; 
1349
-                                    }
1350
-        | ATTR_MARK ATTR_FROM DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1344
+//        | ATTR_MARK class_id DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1345
+//                                      if (!s_attr) { yyerror("No memory left"); }
1346
+//                                      s_attr->type = AVP_NAME_STR | $2;
1347
+//                                      s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4); 
1348
+//                                      $$ = s_attr; 
1349
+//                                    }
1350
+        | ATTR_MARK ATTR_FROMUSER DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1351
+                                       if (!s_attr) { yyerror("No memory left"); }
1352
+                                       s_attr->type = AVP_NAME_STR | AVP_TRACK_FROM | AVP_CLASS_USER;
1353
+                                       s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4);
1354
+                                       $$ = s_attr;
1355
+                                     }
1356
+        | ATTR_MARK ATTR_TOUSER DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1357
+                                       if (!s_attr) { yyerror("No memory left"); }
1358
+                                       s_attr->type = AVP_NAME_STR | AVP_TRACK_TO | AVP_CLASS_USER;
1359
+                                       s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4);
1360
+                                       $$ = s_attr;
1361
+                                     }
1362
+        | ATTR_MARK ATTR_FROMDOMAIN DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1363
+                                       if (!s_attr) { yyerror("No memory left"); }
1364
+                                       s_attr->type = AVP_NAME_STR | AVP_TRACK_FROM | AVP_CLASS_DOMAIN;
1365
+                                       s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4);
1366
+                                       $$ = s_attr;
1367
+                                     }
1368
+        | ATTR_MARK ATTR_TODOMAIN DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1369
+                                       if (!s_attr) { yyerror("No memory left"); }
1370
+                                       s_attr->type = AVP_NAME_STR | AVP_TRACK_TO | AVP_CLASS_DOMAIN;
1371
+                                       s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4);
1372
+                                       $$ = s_attr;
1373
+                                     }
1374
+        | ATTR_MARK ATTR_GLOBAL DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1351 1375
                                        if (!s_attr) { yyerror("No memory left"); }
1352
-                                       s_attr->type = AVP_NAME_STR | AVP_TRACK_FROM;
1376
+                                       s_attr->type = AVP_NAME_STR | AVP_CLASS_GLOBAL;
1353 1377
                                        s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4);
1354 1378
                                        $$ = s_attr;
1355 1379
                                      }
1356
-        | ATTR_MARK ATTR_TO DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1357
-                                     if (!s_attr) { yyerror("No memory left"); }
1358
-                                     s_attr->type = AVP_NAME_STR | AVP_TRACK_TO; 
1359
-                                     s_attr->name.s.s = $4; s_attr->name.s.len = strlen($4); 
1360
-                                     $$ = s_attr;
1361
-                                   }
1362
-        | ATTR_MARK ATTR_FROM class_id DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1363
-                                               if (!s_attr) { yyerror("No memory left"); }
1364
-                                               s_attr->type = AVP_NAME_STR | AVP_TRACK_FROM | $3; 
1365
-                                               s_attr->name.s.s = $5; 
1366
-                                               s_attr->name.s.len = strlen($5);
1367
-                                               $$ = s_attr;
1368
-                                              }
1369
-        | ATTR_MARK ATTR_TO class_id DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1370
-                                              if (!s_attr) { yyerror("No memory left"); }
1371
-                                              s_attr->type = AVP_NAME_STR | AVP_TRACK_TO | $3;
1372
-                                              s_attr->name.s.s = $5; s_attr->name.s.len = strlen($5);
1373
-                                             $$ = s_attr;
1374
-                                            }
1380
+//        | ATTR_MARK ATTR_TO class_id DOT ID { s_attr = (struct avp_spec*)pkg_malloc(sizeof(struct avp_spec));
1381
+//                                              if (!s_attr) { yyerror("No memory left"); }
1382
+//                                              s_attr->type = AVP_NAME_STR | AVP_TRACK_TO | $3;
1383
+//                                              s_attr->name.s.s = $5; s_attr->name.s.len = strlen($5);
1384
+//                                             $$ = s_attr;
1385
+//                                            }
1375 1386
 ;
1376 1387
 
1377 1388
 assign_op : ADDEQ { $$ = ADD_T; }