Browse code

core: action struct holds cfg file name and line

- useful to print cfg file position for runtime action errors

Daniel-Constantin Mierla authored on 26/08/2009 08:51:51
Showing 2 changed files
... ...
@@ -236,6 +236,21 @@ static int case_check_type(struct case_stms* stms);
236 236
 static int case_check_default(struct case_stms* stms);
237 237
 
238 238
 
239
+extern int line;
240
+extern int column;
241
+extern int startcolumn;
242
+extern int startline;
243
+extern char *finame;
244
+
245
+#define set_cfg_pos(x) \
246
+	do{\
247
+		if(x) {\
248
+		(x)->cline = line;\
249
+		(x)->cfile = (finame!=0)?finame:((cfg_file!=0)?cfg_file:"default");\
250
+		}\
251
+	}while(0)
252
+
253
+
239 254
 %}
240 255
 
241 256
 %union {
... ...
@@ -2077,6 +2092,7 @@ if_cmd:
2077 2092
 		if ($2 && rval_expr_int_check($2)>=0){
2078 2093
 			warn_ct_rve($2, "if");
2079 2094
 			$$=mk_action( IF_T, 3, RVE_ST, $2, ACTIONS_ST, $3, NOSUBTYPE, 0);
2095
+			set_cfg_pos($$);
2080 2096
 		}else
2081 2097
 			YYERROR;
2082 2098
 	}
... ...
@@ -2084,6 +2100,7 @@ if_cmd:
2084 2100
 		if ($2 && rval_expr_int_check($2)>=0){
2085 2101
 			warn_ct_rve($2, "if");
2086 2102
 			$$=mk_action( IF_T, 3, RVE_ST, $2, ACTIONS_ST, $3, ACTIONS_ST, $5);
2103
+			set_cfg_pos($$);
2087 2104
 		}else
2088 2105
 			YYERROR;
2089 2106
 	}
... ...
@@ -2184,6 +2201,7 @@ switch_cmd:
2184 2201
 				yyerror("internal error");
2185 2202
 				YYABORT;
2186 2203
 			}
2204
+			set_cfg_pos($$);
2187 2205
 		}
2188 2206
 	}
2189 2207
 	| SWITCH rval_expr LBRACE RBRACE {
... ...
@@ -2199,6 +2217,7 @@ switch_cmd:
2199 2217
 				yyerror("internal error");
2200 2218
 				YYABORT;
2201 2219
 			}
2220
+			set_cfg_pos($$);
2202 2221
 		}
2203 2222
 	}
2204 2223
 	| SWITCH error { $$=0; yyerror ("bad expression in switch(...)"); }
... ...
@@ -2211,6 +2230,7 @@ while_cmd:
2211 2230
 		if ($2 && rval_expr_int_check($2)>=0){
2212 2231
 			warn_ct_rve($2, "while");
2213 2232
 			$$=mk_action( WHILE_T, 2, RVE_ST, $2, ACTIONS_ST, $3);
2233
+			set_cfg_pos($$);
2214 2234
 		}else{
2215 2235
 			yyerror_at(&$2->fpos, "bad while(...) expression");
2216 2236
 			YYERROR;
... ...
@@ -2549,6 +2569,7 @@ rval_expr: rval						{ $$=$1;
2549 2569
 
2550 2570
 assign_action: lval assign_op  rval_expr	{ $$=mk_action($2, 2, LVAL_ST, $1, 
2551 2571
 														 	  RVE_ST, $3);
2572
+											set_cfg_pos($$);
2552 2573
 										}
2553 2574
 	;
2554 2575
 
... ...
@@ -2569,42 +2590,42 @@ avpflag_oper:
2569 2590
 	| ISAVPFLAGSET { $$ = -1; }
2570 2591
 	;
2571 2592
 cmd:
2572
-	FORWARD LPAREN host RPAREN	{ $$=mk_action(	FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2573
-	| FORWARD LPAREN STRING RPAREN	{ $$=mk_action(	FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2574
-	| FORWARD LPAREN ip RPAREN	{ $$=mk_action(	FORWARD_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); }
2575
-	| FORWARD LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2576
-	| FORWARD LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2577
-	| FORWARD LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); }
2578
-	| FORWARD LPAREN URIHOST COMMA URIPORT RPAREN { $$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); }
2579
-	| FORWARD LPAREN URIHOST COMMA NUMBER RPAREN {$$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); }
2580
-	| FORWARD LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); }
2593
+	FORWARD LPAREN host RPAREN	{ $$=mk_action(	FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2594
+	| FORWARD LPAREN STRING RPAREN	{ $$=mk_action(	FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2595
+	| FORWARD LPAREN ip RPAREN	{ $$=mk_action(	FORWARD_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2596
+	| FORWARD LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2597
+	| FORWARD LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2598
+	| FORWARD LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2599
+	| FORWARD LPAREN URIHOST COMMA URIPORT RPAREN { $$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$); }
2600
+	| FORWARD LPAREN URIHOST COMMA NUMBER RPAREN {$$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2601
+	| FORWARD LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$); }
2581 2602
 	| FORWARD error { $$=0; yyerror("missing '(' or ')' ?"); }
2582 2603
 	| FORWARD LPAREN error RPAREN { $$=0; yyerror("bad forward argument"); }
2583
-	| FORWARD_UDP LPAREN host RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2584
-	| FORWARD_UDP LPAREN STRING RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2585
-	| FORWARD_UDP LPAREN ip RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); }
2586
-	| FORWARD_UDP LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2587
-	| FORWARD_UDP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2588
-	| FORWARD_UDP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); }
2589
-	| FORWARD_UDP LPAREN URIHOST COMMA URIPORT RPAREN {$$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); }
2590
-	| FORWARD_UDP LPAREN URIHOST COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); }
2591
-	| FORWARD_UDP LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); }
2604
+	| FORWARD_UDP LPAREN host RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2605
+	| FORWARD_UDP LPAREN STRING RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2606
+	| FORWARD_UDP LPAREN ip RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2607
+	| FORWARD_UDP LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2608
+	| FORWARD_UDP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2609
+	| FORWARD_UDP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2610
+	| FORWARD_UDP LPAREN URIHOST COMMA URIPORT RPAREN {$$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$); }
2611
+	| FORWARD_UDP LPAREN URIHOST COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2612
+	| FORWARD_UDP LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$); }
2592 2613
 	| FORWARD_UDP error { $$=0; yyerror("missing '(' or ')' ?"); }
2593 2614
 	| FORWARD_UDP LPAREN error RPAREN { $$=0; yyerror("bad forward_udp argument"); }
2594
-	| FORWARD_TCP LPAREN host RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2595
-	| FORWARD_TCP LPAREN STRING RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2596
-	| FORWARD_TCP LPAREN ip RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); }
2597
-	| FORWARD_TCP LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2598
-	| FORWARD_TCP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2599
-	| FORWARD_TCP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); }
2600
-	| FORWARD_TCP LPAREN URIHOST COMMA URIPORT RPAREN {$$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); }
2601
-	| FORWARD_TCP LPAREN URIHOST COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); }
2602
-	| FORWARD_TCP LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); }
2615
+	| FORWARD_TCP LPAREN host RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2616
+	| FORWARD_TCP LPAREN STRING RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2617
+	| FORWARD_TCP LPAREN ip RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2618
+	| FORWARD_TCP LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2619
+	| FORWARD_TCP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2620
+	| FORWARD_TCP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2621
+	| FORWARD_TCP LPAREN URIHOST COMMA URIPORT RPAREN {$$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$); }
2622
+	| FORWARD_TCP LPAREN URIHOST COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2623
+	| FORWARD_TCP LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$); }
2603 2624
 	| FORWARD_TCP error { $$=0; yyerror("missing '(' or ')' ?"); }
2604 2625
 	| FORWARD_TCP LPAREN error RPAREN { $$=0; yyerror("bad forward_tcp argument"); }
2605 2626
 	| FORWARD_TLS LPAREN host RPAREN {
2606 2627
 		#ifdef USE_TLS
2607
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2628
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2608 2629
 		#else
2609 2630
 			$$=0;
2610 2631
 			yyerror("tls support not compiled in");
... ...
@@ -2612,7 +2633,7 @@ cmd:
2612 2633
 	}
2613 2634
 	| FORWARD_TLS LPAREN STRING RPAREN {
2614 2635
 		#ifdef USE_TLS
2615
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2636
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2616 2637
 		#else
2617 2638
 			$$=0;
2618 2639
 			yyerror("tls support not compiled in");
... ...
@@ -2620,7 +2641,7 @@ cmd:
2620 2641
 	}
2621 2642
 	| FORWARD_TLS LPAREN ip RPAREN	{
2622 2643
 		#ifdef USE_TLS
2623
-			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0);
2644
+			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$);
2624 2645
 		#else
2625 2646
 			$$=0;
2626 2647
 			yyerror("tls support not compiled in");
... ...
@@ -2628,7 +2649,7 @@ cmd:
2628 2649
 	}
2629 2650
 	| FORWARD_TLS LPAREN host COMMA NUMBER RPAREN {
2630 2651
 		#ifdef USE_TLS
2631
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5);
2652
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2632 2653
 		#else
2633 2654
 			$$=0;
2634 2655
 			yyerror("tls support not compiled in");
... ...
@@ -2636,7 +2657,7 @@ cmd:
2636 2657
 	}
2637 2658
 	| FORWARD_TLS LPAREN STRING COMMA NUMBER RPAREN {
2638 2659
 		#ifdef USE_TLS
2639
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5);
2660
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2640 2661
 		#else
2641 2662
 			$$=0;
2642 2663
 			yyerror("tls support not compiled in");
... ...
@@ -2644,7 +2665,7 @@ cmd:
2644 2665
 	}
2645 2666
 	| FORWARD_TLS LPAREN ip COMMA NUMBER RPAREN {
2646 2667
 		#ifdef USE_TLS
2647
-			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5);
2668
+			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2648 2669
 		#else
2649 2670
 			$$=0;
2650 2671
 			yyerror("tls support not compiled in");
... ...
@@ -2652,7 +2673,7 @@ cmd:
2652 2673
 					}
2653 2674
 	| FORWARD_TLS LPAREN URIHOST COMMA URIPORT RPAREN {
2654 2675
 		#ifdef USE_TLS
2655
-			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, URIPORT_ST, 0);
2676
+			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$);
2656 2677
 		#else
2657 2678
 			$$=0;
2658 2679
 			yyerror("tls support not compiled in");
... ...
@@ -2660,7 +2681,7 @@ cmd:
2660 2681
 	}
2661 2682
 	| FORWARD_TLS LPAREN URIHOST COMMA NUMBER RPAREN {
2662 2683
 		#ifdef USE_TLS
2663
-			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5);
2684
+			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2664 2685
 		#else
2665 2686
 			$$=0;
2666 2687
 			yyerror("tls support not compiled in");
... ...
@@ -2668,7 +2689,7 @@ cmd:
2668 2689
 	}
2669 2690
 	| FORWARD_TLS LPAREN URIHOST RPAREN {
2670 2691
 		#ifdef USE_TLS
2671
-			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, 0);
2692
+			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$);
2672 2693
 		#else
2673 2694
 			$$=0;
2674 2695
 			yyerror("tls support not compiled in");
... ...
@@ -2679,7 +2700,7 @@ cmd:
2679 2700
 									yyerror("bad forward_tls argument"); }
2680 2701
 	| FORWARD_SCTP LPAREN host RPAREN {
2681 2702
 		#ifdef USE_SCTP
2682
-			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2703
+			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2683 2704
 		#else
2684 2705
 			$$=0;
2685 2706
 			yyerror("sctp support not compiled in");
... ...
@@ -2687,7 +2708,7 @@ cmd:
2687 2708
 	}
2688 2709
 	| FORWARD_SCTP LPAREN STRING RPAREN {
2689 2710
 		#ifdef USE_SCTP
2690
-			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2711
+			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2691 2712
 		#else
2692 2713
 			$$=0;
2693 2714
 			yyerror("sctp support not compiled in");
... ...
@@ -2695,7 +2716,7 @@ cmd:
2695 2716
 	}
2696 2717
 	| FORWARD_SCTP LPAREN ip RPAREN	{
2697 2718
 		#ifdef USE_SCTP
2698
-			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0);
2719
+			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$);
2699 2720
 		#else
2700 2721
 			$$=0;
2701 2722
 			yyerror("sctp support not compiled in");
... ...
@@ -2704,7 +2725,7 @@ cmd:
2704 2725
 	| FORWARD_SCTP LPAREN host COMMA NUMBER RPAREN {
2705 2726
 		#ifdef USE_SCTP
2706 2727
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
2707
-							(void*)$5);
2728
+							(void*)$5); set_cfg_pos($$);
2708 2729
 		#else
2709 2730
 			$$=0;
2710 2731
 			yyerror("sctp support not compiled in");
... ...
@@ -2713,7 +2734,7 @@ cmd:
2713 2734
 	| FORWARD_SCTP LPAREN STRING COMMA NUMBER RPAREN {
2714 2735
 		#ifdef USE_SCTP
2715 2736
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
2716
-							(void*)$5);
2737
+							(void*)$5); set_cfg_pos($$);
2717 2738
 		#else
2718 2739
 			$$=0;
2719 2740
 			yyerror("sctp support not compiled in");
... ...
@@ -2722,7 +2743,7 @@ cmd:
2722 2743
 	| FORWARD_SCTP LPAREN ip COMMA NUMBER RPAREN {
2723 2744
 		#ifdef USE_SCTP
2724 2745
 			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 
2725
-							(void*)$5);
2746
+							(void*)$5); set_cfg_pos($$);
2726 2747
 		#else
2727 2748
 			$$=0;
2728 2749
 			yyerror("sctp support not compiled in");
... ...
@@ -2730,7 +2751,7 @@ cmd:
2730 2751
 					}
2731 2752
 	| FORWARD_SCTP LPAREN URIHOST COMMA URIPORT RPAREN {
2732 2753
 		#ifdef USE_SCTP
2733
-			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0);
2754
+			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$);
2734 2755
 		#else
2735 2756
 			$$=0;
2736 2757
 			yyerror("sctp support not compiled in");
... ...
@@ -2739,7 +2760,7 @@ cmd:
2739 2760
 	| FORWARD_SCTP LPAREN URIHOST COMMA NUMBER RPAREN {
2740 2761
 		#ifdef USE_SCTP
2741 2762
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST,
2742
-							(void*)$5);
2763
+							(void*)$5); set_cfg_pos($$);
2743 2764
 		#else
2744 2765
 			$$=0;
2745 2766
 			yyerror("sctp support not compiled in");
... ...
@@ -2747,7 +2768,7 @@ cmd:
2747 2768
 	}
2748 2769
 	| FORWARD_SCTP LPAREN URIHOST RPAREN {
2749 2770
 		#ifdef USE_SCTP
2750
-			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0);
2771
+			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$);
2751 2772
 		#else
2752 2773
 			$$=0;
2753 2774
 			yyerror("tls support not compiled in");
... ...
@@ -2756,25 +2777,26 @@ cmd:
2756 2777
 	| FORWARD_SCTP error { $$=0; yyerror("missing '(' or ')' ?"); }
2757 2778
 	| FORWARD_SCTP LPAREN error RPAREN { $$=0; 
2758 2779
 									yyerror("bad forward_tls argument"); }
2759
-	| SEND LPAREN host RPAREN	{ $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2760
-	| SEND LPAREN STRING RPAREN { $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2761
-	| SEND LPAREN ip RPAREN		{ $$=mk_action(SEND_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); }
2762
-	| SEND LPAREN host COMMA NUMBER RPAREN	{ $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2763
-	| SEND LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2764
-	| SEND LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(SEND_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); }
2780
+	| SEND LPAREN host RPAREN	{ $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2781
+	| SEND LPAREN STRING RPAREN { $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2782
+	| SEND LPAREN ip RPAREN		{ $$=mk_action(SEND_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2783
+	| SEND LPAREN host COMMA NUMBER RPAREN	{ $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2784
+	| SEND LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2785
+	| SEND LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(SEND_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2765 2786
 	| SEND error { $$=0; yyerror("missing '(' or ')' ?"); }
2766 2787
 	| SEND LPAREN error RPAREN { $$=0; yyerror("bad send argument"); }
2767
-	| SEND_TCP LPAREN host RPAREN	{ $$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2768
-	| SEND_TCP LPAREN STRING RPAREN { $$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); }
2769
-	| SEND_TCP LPAREN ip RPAREN	{ $$=mk_action(SEND_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); }
2770
-	| SEND_TCP LPAREN host COMMA NUMBER RPAREN	{ $$=mk_action(	SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5);}
2771
-	| SEND_TCP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); }
2772
-	| SEND_TCP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(SEND_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); }
2788
+	| SEND_TCP LPAREN host RPAREN	{ $$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2789
+	| SEND_TCP LPAREN STRING RPAREN { $$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2790
+	| SEND_TCP LPAREN ip RPAREN	{ $$=mk_action(SEND_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2791
+	| SEND_TCP LPAREN host COMMA NUMBER RPAREN	{ $$=mk_action(	SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$);}
2792
+	| SEND_TCP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2793
+	| SEND_TCP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(SEND_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2773 2794
 	| SEND_TCP error { $$=0; yyerror("missing '(' or ')' ?"); }
2774 2795
 	| SEND_TCP LPAREN error RPAREN { $$=0; yyerror("bad send_tcp argument"); }
2775 2796
 	| LOG_TOK LPAREN STRING RPAREN	{$$=mk_action(LOG_T, 2, NUMBER_ST,
2776
-										(void*)(L_DBG+1), STRING_ST, $3); }
2777
-	| LOG_TOK LPAREN NUMBER COMMA STRING RPAREN	{$$=mk_action(LOG_T, 2, NUMBER_ST, (void*)$3, STRING_ST, $5); }
2797
+										(void*)(L_DBG+1), STRING_ST, $3);
2798
+									set_cfg_pos($$); }
2799
+	| LOG_TOK LPAREN NUMBER COMMA STRING RPAREN	{$$=mk_action(LOG_T, 2, NUMBER_ST, (void*)$3, STRING_ST, $5); set_cfg_pos($$); }
2778 2800
 	| LOG_TOK error 		{ $$=0; yyerror("missing '(' or ')' ?"); }
2779 2801
 	| LOG_TOK LPAREN error RPAREN	{ $$=0; yyerror("bad log argument"); }
2780 2802
 	| SETFLAG LPAREN NUMBER RPAREN	{
... ...
@@ -2782,42 +2804,49 @@ cmd:
2782 2804
 								yyerror("bad flag value");
2783 2805
 							$$=mk_action(SETFLAG_T, 1, NUMBER_ST,
2784 2806
 													(void*)$3);
2807
+							set_cfg_pos($$);
2785 2808
 									}
2786 2809
 	| SETFLAG LPAREN flag_name RPAREN	{
2787 2810
 							i_tmp=get_flag_no($3, strlen($3));
2788 2811
 							if (i_tmp<0) yyerror("flag not declared");
2789 2812
 							$$=mk_action(SETFLAG_T, 1, NUMBER_ST,
2790 2813
 										(void*)(long)i_tmp);
2814
+							set_cfg_pos($$);
2791 2815
 									}
2792 2816
 	| SETFLAG error			{ $$=0; yyerror("missing '(' or ')'?"); }
2793 2817
 	| RESETFLAG LPAREN NUMBER RPAREN {
2794 2818
 							if (check_flag($3)==-1)
2795 2819
 								yyerror("bad flag value");
2796 2820
 							$$=mk_action(RESETFLAG_T, 1, NUMBER_ST, (void*)$3);
2821
+							set_cfg_pos($$);
2797 2822
 									}
2798 2823
 	| RESETFLAG LPAREN flag_name RPAREN	{
2799 2824
 							i_tmp=get_flag_no($3, strlen($3));
2800 2825
 							if (i_tmp<0) yyerror("flag not declared");
2801 2826
 							$$=mk_action(RESETFLAG_T, 1, NUMBER_ST,
2802 2827
 										(void*)(long)i_tmp);
2828
+							set_cfg_pos($$);
2803 2829
 									}
2804 2830
 	| RESETFLAG error		{ $$=0; yyerror("missing '(' or ')'?"); }
2805 2831
 	| ISFLAGSET LPAREN NUMBER RPAREN {
2806 2832
 							if (check_flag($3)==-1)
2807 2833
 								yyerror("bad flag value");
2808 2834
 							$$=mk_action(ISFLAGSET_T, 1, NUMBER_ST, (void*)$3);
2835
+							set_cfg_pos($$);
2809 2836
 									}
2810 2837
 	| ISFLAGSET LPAREN flag_name RPAREN	{
2811 2838
 							i_tmp=get_flag_no($3, strlen($3));
2812 2839
 							if (i_tmp<0) yyerror("flag not declared");
2813 2840
 							$$=mk_action(ISFLAGSET_T, 1, NUMBER_ST,
2814 2841
 										(void*)(long)i_tmp);
2842
+							set_cfg_pos($$);
2815 2843
 									}
2816 2844
 	| ISFLAGSET error { $$=0; yyerror("missing '(' or ')'?"); }
2817 2845
 	| avpflag_oper LPAREN attr_id_any_str COMMA flag_name RPAREN {
2818 2846
 		i_tmp=get_avpflag_no($5);
2819 2847
 		if (i_tmp==0) yyerror("avpflag not declared");
2820 2848
 		$$=mk_action(AVPFLAG_OPER_T, 3, AVP_ST, $3, NUMBER_ST, (void*)(long)i_tmp, NUMBER_ST, (void*)$1);
2849
+		set_cfg_pos($$);
2821 2850
 	}
2822 2851
 	| avpflag_oper LPAREN attr_id_any_str COMMA error RPAREN {
2823 2852
 		$$=0; yyerror("error parsing flag name");
... ...
@@ -2827,7 +2856,9 @@ cmd:
2827 2856
 	}
2828 2857
 	| avpflag_oper LPAREN error RPAREN { $$=0; yyerror("bad parameters"); }
2829 2858
 	| avpflag_oper error { $$=0; yyerror("missing '(' or ')'?"); }
2830
-	| ERROR LPAREN STRING COMMA STRING RPAREN {$$=mk_action(ERROR_T, 2, STRING_ST, $3, STRING_ST, $5); }
2859
+	| ERROR LPAREN STRING COMMA STRING RPAREN {$$=mk_action(ERROR_T, 2, STRING_ST, $3, STRING_ST, $5);
2860
+			set_cfg_pos($$);
2861
+	}
2831 2862
 	| ERROR error { $$=0; yyerror("missing '(' or ')' ?"); }
2832 2863
 	| ERROR LPAREN error RPAREN { $$=0; yyerror("bad error argument"); }
2833 2864
 	| ROUTE LPAREN route_name RPAREN	{
... ...
@@ -2837,23 +2868,24 @@ cmd:
2837 2868
 							YYABORT;
2838 2869
 						}
2839 2870
 						$$=mk_action(ROUTE_T, 1, NUMBER_ST,(void*)(long)i_tmp);
2871
+						set_cfg_pos($$);
2840 2872
 										}
2841 2873
 	| ROUTE error { $$=0; yyerror("missing '(' or ')' ?"); }
2842 2874
 	| ROUTE LPAREN error RPAREN { $$=0; yyerror("bad route argument"); }
2843
-	| EXEC LPAREN STRING RPAREN	{ $$=mk_action(EXEC_T, 1, STRING_ST, $3); }
2844
-	| SET_HOST LPAREN STRING RPAREN { $$=mk_action(SET_HOST_T, 1, STRING_ST, $3); }
2875
+	| EXEC LPAREN STRING RPAREN	{ $$=mk_action(EXEC_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2876
+	| SET_HOST LPAREN STRING RPAREN { $$=mk_action(SET_HOST_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2845 2877
 	| SET_HOST error { $$=0; yyerror("missing '(' or ')' ?"); }
2846 2878
 	| SET_HOST LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2847
-	| PREFIX LPAREN STRING RPAREN { $$=mk_action(PREFIX_T, 1, STRING_ST,  $3); }
2879
+	| PREFIX LPAREN STRING RPAREN { $$=mk_action(PREFIX_T, 1, STRING_ST,  $3); set_cfg_pos($$); }
2848 2880
 	| PREFIX error { $$=0; yyerror("missing '(' or ')' ?"); }
2849 2881
 	| PREFIX LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2850
-	| STRIP_TAIL LPAREN NUMBER RPAREN { $$=mk_action(STRIP_TAIL_T, 1, NUMBER_ST, (void*)$3); }
2882
+	| STRIP_TAIL LPAREN NUMBER RPAREN { $$=mk_action(STRIP_TAIL_T, 1, NUMBER_ST, (void*)$3); set_cfg_pos($$); }
2851 2883
 	| STRIP_TAIL error { $$=0; yyerror("missing '(' or ')' ?"); }
2852 2884
 	| STRIP_TAIL LPAREN error RPAREN { $$=0; yyerror("bad argument, number expected"); }
2853
-	| STRIP LPAREN NUMBER RPAREN { $$=mk_action(STRIP_T, 1, NUMBER_ST, (void*) $3); }
2885
+	| STRIP LPAREN NUMBER RPAREN { $$=mk_action(STRIP_T, 1, NUMBER_ST, (void*) $3); set_cfg_pos($$); }
2854 2886
 	| STRIP error { $$=0; yyerror("missing '(' or ')' ?"); }
2855 2887
 	| STRIP LPAREN error RPAREN { $$=0; yyerror("bad argument, number expected"); }
2856
-	| SET_USERPHONE LPAREN RPAREN { $$=mk_action(SET_USERPHONE_T, 0); }
2888
+	| SET_USERPHONE LPAREN RPAREN { $$=mk_action(SET_USERPHONE_T, 0); set_cfg_pos($$); }
2857 2889
 	| SET_USERPHONE error { $$=0; yyerror("missing '(' or ')' ?"); }
2858 2890
 	| APPEND_BRANCH LPAREN STRING COMMA STRING RPAREN {
2859 2891
 		qvalue_t q;
... ...
@@ -2861,37 +2893,39 @@ cmd:
2861 2893
 			yyerror("bad argument, q value expected");
2862 2894
 		}
2863 2895
 		$$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, $3, NUMBER_ST, (void *)(long)q);
2896
+		set_cfg_pos($$);
2864 2897
 	}
2865
-	| APPEND_BRANCH LPAREN STRING RPAREN { $$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, $3, NUMBER_ST, (void *)Q_UNSPECIFIED); }
2866
-	| APPEND_BRANCH LPAREN RPAREN { $$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, 0, NUMBER_ST, (void *)Q_UNSPECIFIED); }
2867
-	| APPEND_BRANCH {  $$=mk_action( APPEND_BRANCH_T, 1, STRING_ST, 0); }
2868
-	| SET_HOSTPORT LPAREN STRING RPAREN { $$=mk_action(SET_HOSTPORT_T, 1, STRING_ST, $3); }
2898
+	| APPEND_BRANCH LPAREN STRING RPAREN { $$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, $3, NUMBER_ST, (void *)Q_UNSPECIFIED); set_cfg_pos($$); }
2899
+	| APPEND_BRANCH LPAREN RPAREN { $$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, 0, NUMBER_ST, (void *)Q_UNSPECIFIED); set_cfg_pos($$); }
2900
+	| APPEND_BRANCH {  $$=mk_action( APPEND_BRANCH_T, 1, STRING_ST, 0); set_cfg_pos($$); }
2901
+	| SET_HOSTPORT LPAREN STRING RPAREN { $$=mk_action(SET_HOSTPORT_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2869 2902
 	| SET_HOSTPORT error { $$=0; yyerror("missing '(' or ')' ?"); }
2870 2903
 	| SET_HOSTPORT LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2871
-	| SET_HOSTPORTTRANS LPAREN STRING RPAREN { $$=mk_action(SET_HOSTPORTTRANS_T, 1, STRING_ST, $3); }
2904
+	| SET_HOSTPORTTRANS LPAREN STRING RPAREN { $$=mk_action(SET_HOSTPORTTRANS_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2872 2905
 	| SET_HOSTPORTTRANS error { $$=0; yyerror("missing '(' or ')' ?"); }
2873 2906
 	| SET_HOSTPORTTRANS LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2874
-	| SET_PORT LPAREN STRING RPAREN { $$=mk_action(SET_PORT_T, 1, STRING_ST, $3); }
2907
+	| SET_PORT LPAREN STRING RPAREN { $$=mk_action(SET_PORT_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2875 2908
 	| SET_PORT error { $$=0; yyerror("missing '(' or ')' ?"); }
2876 2909
 	| SET_PORT LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2877
-	| SET_USER LPAREN STRING RPAREN { $$=mk_action(SET_USER_T, 1, STRING_ST, $3); }
2910
+	| SET_USER LPAREN STRING RPAREN { $$=mk_action(SET_USER_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2878 2911
 	| SET_USER error { $$=0; yyerror("missing '(' or ')' ?"); }
2879 2912
 	| SET_USER LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2880
-	| SET_USERPASS LPAREN STRING RPAREN { $$=mk_action(SET_USERPASS_T, 1, STRING_ST, $3); }
2913
+	| SET_USERPASS LPAREN STRING RPAREN { $$=mk_action(SET_USERPASS_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2881 2914
 	| SET_USERPASS error { $$=0; yyerror("missing '(' or ')' ?"); }
2882 2915
 	| SET_USERPASS LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2883
-	| SET_URI LPAREN STRING RPAREN { $$=mk_action(SET_URI_T, 1, STRING_ST,$3); }
2916
+	| SET_URI LPAREN STRING RPAREN { $$=mk_action(SET_URI_T, 1, STRING_ST,$3); set_cfg_pos($$); }
2884 2917
 	| SET_URI error { $$=0; yyerror("missing '(' or ')' ?"); }
2885 2918
 	| SET_URI LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2886
-	| REVERT_URI LPAREN RPAREN { $$=mk_action(REVERT_URI_T, 0); }
2887
-	| REVERT_URI { $$=mk_action(REVERT_URI_T, 0); }
2888
-	| FORCE_RPORT LPAREN RPAREN	{ $$=mk_action(FORCE_RPORT_T, 0); }
2889
-	| FORCE_RPORT	{$$=mk_action(FORCE_RPORT_T, 0); }
2890
-	| ADD_LOCAL_RPORT LPAREN RPAREN	{ $$=mk_action(ADD_LOCAL_RPORT_T, 0); }
2891
-	| ADD_LOCAL_RPORT	{$$=mk_action(ADD_LOCAL_RPORT_T, 0); }
2919
+	| REVERT_URI LPAREN RPAREN { $$=mk_action(REVERT_URI_T, 0); set_cfg_pos($$); }
2920
+	| REVERT_URI { $$=mk_action(REVERT_URI_T, 0); set_cfg_pos($$); }
2921
+	| FORCE_RPORT LPAREN RPAREN	{ $$=mk_action(FORCE_RPORT_T, 0); set_cfg_pos($$); }
2922
+	| FORCE_RPORT	{$$=mk_action(FORCE_RPORT_T, 0); set_cfg_pos($$); }
2923
+	| ADD_LOCAL_RPORT LPAREN RPAREN	{ $$=mk_action(ADD_LOCAL_RPORT_T, 0); set_cfg_pos($$); }
2924
+	| ADD_LOCAL_RPORT	{$$=mk_action(ADD_LOCAL_RPORT_T, 0); set_cfg_pos($$); }
2892 2925
 	| FORCE_TCP_ALIAS LPAREN NUMBER RPAREN	{
2893 2926
 		#ifdef USE_TCP
2894 2927
 			$$=mk_action(FORCE_TCP_ALIAS_T, 1, NUMBER_ST, (void*)$3);
2928
+			set_cfg_pos($$);
2895 2929
 		#else
2896 2930
 			yyerror("tcp support not compiled in");
2897 2931
 		#endif
... ...
@@ -2899,6 +2933,7 @@ cmd:
2899 2933
 	| FORCE_TCP_ALIAS LPAREN RPAREN	{
2900 2934
 		#ifdef USE_TCP
2901 2935
 			$$=mk_action(FORCE_TCP_ALIAS_T, 0);
2936
+			set_cfg_pos($$);
2902 2937
 		#else
2903 2938
 			yyerror("tcp support not compiled in");
2904 2939
 		#endif
... ...
@@ -2906,13 +2941,14 @@ cmd:
2906 2941
 	| FORCE_TCP_ALIAS				{
2907 2942
 		#ifdef USE_TCP
2908 2943
 			$$=mk_action(FORCE_TCP_ALIAS_T, 0);
2944
+			set_cfg_pos($$);
2909 2945
 		#else
2910 2946
 			yyerror("tcp support not compiled in");
2911 2947
 		#endif
2912 2948
 	}
2913 2949
 	| FORCE_TCP_ALIAS LPAREN error RPAREN	{$$=0; yyerror("bad argument, number expected"); }
2914 2950
 	| UDP_MTU_TRY_PROTO LPAREN proto RPAREN
2915
-		{ $$=mk_action(UDP_MTU_TRY_PROTO_T, 1, NUMBER_ST, $3); }
2951
+		{ $$=mk_action(UDP_MTU_TRY_PROTO_T, 1, NUMBER_ST, $3); set_cfg_pos($$); }
2916 2952
 	| UDP_MTU_TRY_PROTO LPAREN error RPAREN
2917 2953
 		{ $$=0; yyerror("bad argument, UDP, TCP, TLS or SCTP expected"); }
2918 2954
 	| SET_ADV_ADDRESS LPAREN listen_id RPAREN {
... ...
@@ -2923,6 +2959,7 @@ cmd:
2923 2959
 			str_tmp->s=$3;
2924 2960
 			str_tmp->len=$3?strlen($3):0;
2925 2961
 			$$=mk_action(SET_ADV_ADDR_T, 1, STR_ST, str_tmp);
2962
+			set_cfg_pos($$);
2926 2963
 		}
2927 2964
 	}
2928 2965
 	| SET_ADV_ADDRESS LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
... ...
@@ -2939,6 +2976,7 @@ cmd:
2939 2976
 				memcpy(str_tmp->s, tmp, i_tmp);
2940 2977
 				str_tmp->len=i_tmp;
2941 2978
 				$$=mk_action(SET_ADV_PORT_T, 1, STR_ST, str_tmp);
2979
+				set_cfg_pos($$);
2942 2980
 			}
2943 2981
 		}
2944 2982
 	}
... ...
@@ -2946,6 +2984,7 @@ cmd:
2946 2984
 	| SET_ADV_PORT  error {$$=0; yyerror("missing '(' or ')' ?"); }
2947 2985
 	| FORCE_SEND_SOCKET LPAREN phostport RPAREN { 
2948 2986
 		$$=mk_action(FORCE_SEND_SOCKET_T, 1, SOCKID_ST, $3);
2987
+		set_cfg_pos($$);
2949 2988
 	}
2950 2989
 	| FORCE_SEND_SOCKET LPAREN error RPAREN {
2951 2990
 		$$=0; yyerror("bad argument, [proto:]host[:port] expected");
... ...
@@ -2994,6 +3033,7 @@ cmd:
2994 3033
 			}
2995 3034
 		}
2996 3035
 		$$ = mod_func_action;
3036
+		set_cfg_pos($$);
2997 3037
 	}
2998 3038
 	| ID error					{ yyerror("'('')' expected (function call)");}
2999 3039
 	;
... ...
@@ -3029,49 +3069,48 @@ func_param:
3029 3069
 ret_cmd:
3030 3070
 	DROP LPAREN RPAREN		{
3031 3071
 		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST,
3032
-						(void*)(DROP_R_F|EXIT_R_F)); 
3072
+						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
3033 3073
 	}
3034 3074
 	| DROP rval_expr	{
3035 3075
 		$$=mk_action(DROP_T, 2, RVE_ST, $2, NUMBER_ST,
3036
-						(void*)(DROP_R_F|EXIT_R_F)); 
3076
+						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
3037 3077
 	}
3038 3078
 	| DROP				{
3039 3079
 		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, 
3040
-						(void*)(DROP_R_F|EXIT_R_F)); 
3080
+						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
3041 3081
 	}
3042 3082
 	| EXIT LPAREN RPAREN		{
3043
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F); 
3083
+		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F);
3084
+		set_cfg_pos($$);
3044 3085
 	}
3045 3086
 	| EXIT rval_expr	{
3046 3087
 		$$=mk_action(DROP_T, 2, RVE_ST, $2, NUMBER_ST, (void*)EXIT_R_F);
3088
+		set_cfg_pos($$);
3047 3089
 	}
3048 3090
 	| EXIT				{
3049
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F); 
3091
+		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F);
3092
+		set_cfg_pos($$);
3050 3093
 	}
3051 3094
 	| RETURN			{
3052 3095
 		$$=mk_action(DROP_T, 2, NUMBER_ST, (void*)1, NUMBER_ST,
3053
-						(void*)RETURN_R_F);
3096
+						(void*)RETURN_R_F); set_cfg_pos($$);
3054 3097
 	}
3055 3098
 	| RETURN  LPAREN RPAREN		{
3056 3099
 		$$=mk_action(DROP_T, 2, NUMBER_ST, (void*)1, NUMBER_ST,
3057
-						(void*)RETURN_R_F);
3100
+						(void*)RETURN_R_F); set_cfg_pos($$);
3058 3101
 	}
3059 3102
 	| RETURN rval_expr	{
3060 3103
 		$$=mk_action(DROP_T, 2, RVE_ST, $2, NUMBER_ST, (void*)RETURN_R_F);
3104
+		set_cfg_pos($$);
3061 3105
 	}
3062 3106
 	| BREAK				{
3063
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)BREAK_R_F); 
3107
+		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)BREAK_R_F);
3108
+		set_cfg_pos($$);
3064 3109
 	}
3065 3110
 	;
3066 3111
 
3067 3112
 %%
3068 3113
 
3069
-extern int line;
3070
-extern int column;
3071
-extern int startcolumn;
3072
-extern int startline;
3073
-extern char *finame;
3074
-
3075 3114
 static void get_cpos(struct cfg_pos* pos)
3076 3115
 {
3077 3116
 	pos->s_line=startline;
... ...
@@ -181,6 +181,8 @@ typedef struct {
181 181
 #define MAX_ACTIONS (2+6)
182 182
 
183 183
 struct action{
184
+	int cline;
185
+	char *cfile;
184 186
 	enum action_type type;  /* forward, drop, log, send ...*/
185 187
 	int count;
186 188
 	struct action* next;