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 2077
 		if ($2 && rval_expr_int_check($2)>=0){
2078 2078
 			warn_ct_rve($2, "if");
2079 2079
 			$$=mk_action( IF_T, 3, RVE_ST, $2, ACTIONS_ST, $3, NOSUBTYPE, 0);
2080
+			set_cfg_pos($$);
2080 2081
 		}else
2081 2082
 			YYERROR;
2082 2083
 	}
... ...
@@ -2084,6 +2100,7 @@ if_cmd:
2084 2084
 		if ($2 && rval_expr_int_check($2)>=0){
2085 2085
 			warn_ct_rve($2, "if");
2086 2086
 			$$=mk_action( IF_T, 3, RVE_ST, $2, ACTIONS_ST, $3, ACTIONS_ST, $5);
2087
+			set_cfg_pos($$);
2087 2088
 		}else
2088 2089
 			YYERROR;
2089 2090
 	}
... ...
@@ -2184,6 +2201,7 @@ switch_cmd:
2184 2184
 				yyerror("internal error");
2185 2185
 				YYABORT;
2186 2186
 			}
2187
+			set_cfg_pos($$);
2187 2188
 		}
2188 2189
 	}
2189 2190
 	| SWITCH rval_expr LBRACE RBRACE {
... ...
@@ -2199,6 +2217,7 @@ switch_cmd:
2199 2199
 				yyerror("internal error");
2200 2200
 				YYABORT;
2201 2201
 			}
2202
+			set_cfg_pos($$);
2202 2203
 		}
2203 2204
 	}
2204 2205
 	| SWITCH error { $$=0; yyerror ("bad expression in switch(...)"); }
... ...
@@ -2211,6 +2230,7 @@ while_cmd:
2211 2211
 		if ($2 && rval_expr_int_check($2)>=0){
2212 2212
 			warn_ct_rve($2, "while");
2213 2213
 			$$=mk_action( WHILE_T, 2, RVE_ST, $2, ACTIONS_ST, $3);
2214
+			set_cfg_pos($$);
2214 2215
 		}else{
2215 2216
 			yyerror_at(&$2->fpos, "bad while(...) expression");
2216 2217
 			YYERROR;
... ...
@@ -2549,6 +2569,7 @@ rval_expr: rval						{ $$=$1;
2549 2549
 
2550 2550
 assign_action: lval assign_op  rval_expr	{ $$=mk_action($2, 2, LVAL_ST, $1, 
2551 2551
 														 	  RVE_ST, $3);
2552
+											set_cfg_pos($$);
2552 2553
 										}
2553 2554
 	;
2554 2555
 
... ...
@@ -2569,42 +2590,42 @@ avpflag_oper:
2569 2569
 	| ISAVPFLAGSET { $$ = -1; }
2570 2570
 	;
2571 2571
 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); }
2572
+	FORWARD LPAREN host RPAREN	{ $$=mk_action(	FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2573
+	| FORWARD LPAREN STRING RPAREN	{ $$=mk_action(	FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2574
+	| FORWARD LPAREN ip RPAREN	{ $$=mk_action(	FORWARD_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2575
+	| FORWARD LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2576
+	| FORWARD LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2577
+	| FORWARD LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2578
+	| FORWARD LPAREN URIHOST COMMA URIPORT RPAREN { $$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$); }
2579
+	| FORWARD LPAREN URIHOST COMMA NUMBER RPAREN {$$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2580
+	| FORWARD LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$); }
2581 2581
 	| FORWARD error { $$=0; yyerror("missing '(' or ')' ?"); }
2582 2582
 	| 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); }
2583
+	| FORWARD_UDP LPAREN host RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2584
+	| FORWARD_UDP LPAREN STRING RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2585
+	| FORWARD_UDP LPAREN ip RPAREN	{ $$=mk_action(FORWARD_UDP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2586
+	| FORWARD_UDP LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2587
+	| FORWARD_UDP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_UDP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2588
+	| FORWARD_UDP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2589
+	| FORWARD_UDP LPAREN URIHOST COMMA URIPORT RPAREN {$$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$); }
2590
+	| FORWARD_UDP LPAREN URIHOST COMMA NUMBER RPAREN { $$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2591
+	| FORWARD_UDP LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_UDP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$); }
2592 2592
 	| FORWARD_UDP error { $$=0; yyerror("missing '(' or ')' ?"); }
2593 2593
 	| 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); }
2594
+	| FORWARD_TCP LPAREN host RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2595
+	| FORWARD_TCP LPAREN STRING RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2596
+	| FORWARD_TCP LPAREN ip RPAREN	{ $$=mk_action(FORWARD_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2597
+	| FORWARD_TCP LPAREN host COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2598
+	| FORWARD_TCP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(FORWARD_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2599
+	| FORWARD_TCP LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2600
+	| FORWARD_TCP LPAREN URIHOST COMMA URIPORT RPAREN {$$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$); }
2601
+	| FORWARD_TCP LPAREN URIHOST COMMA NUMBER RPAREN { $$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2602
+	| FORWARD_TCP LPAREN URIHOST RPAREN { $$=mk_action(FORWARD_TCP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$); }
2603 2603
 	| FORWARD_TCP error { $$=0; yyerror("missing '(' or ')' ?"); }
2604 2604
 	| FORWARD_TCP LPAREN error RPAREN { $$=0; yyerror("bad forward_tcp argument"); }
2605 2605
 	| FORWARD_TLS LPAREN host RPAREN {
2606 2606
 		#ifdef USE_TLS
2607
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2607
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2608 2608
 		#else
2609 2609
 			$$=0;
2610 2610
 			yyerror("tls support not compiled in");
... ...
@@ -2612,7 +2633,7 @@ cmd:
2612 2612
 	}
2613 2613
 	| FORWARD_TLS LPAREN STRING RPAREN {
2614 2614
 		#ifdef USE_TLS
2615
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2615
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2616 2616
 		#else
2617 2617
 			$$=0;
2618 2618
 			yyerror("tls support not compiled in");
... ...
@@ -2620,7 +2641,7 @@ cmd:
2620 2620
 	}
2621 2621
 	| FORWARD_TLS LPAREN ip RPAREN	{
2622 2622
 		#ifdef USE_TLS
2623
-			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0);
2623
+			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$);
2624 2624
 		#else
2625 2625
 			$$=0;
2626 2626
 			yyerror("tls support not compiled in");
... ...
@@ -2628,7 +2649,7 @@ cmd:
2628 2628
 	}
2629 2629
 	| FORWARD_TLS LPAREN host COMMA NUMBER RPAREN {
2630 2630
 		#ifdef USE_TLS
2631
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5);
2631
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2632 2632
 		#else
2633 2633
 			$$=0;
2634 2634
 			yyerror("tls support not compiled in");
... ...
@@ -2636,7 +2657,7 @@ cmd:
2636 2636
 	}
2637 2637
 	| FORWARD_TLS LPAREN STRING COMMA NUMBER RPAREN {
2638 2638
 		#ifdef USE_TLS
2639
-			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5);
2639
+			$$=mk_action(FORWARD_TLS_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2640 2640
 		#else
2641 2641
 			$$=0;
2642 2642
 			yyerror("tls support not compiled in");
... ...
@@ -2644,7 +2665,7 @@ cmd:
2644 2644
 	}
2645 2645
 	| FORWARD_TLS LPAREN ip COMMA NUMBER RPAREN {
2646 2646
 		#ifdef USE_TLS
2647
-			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5);
2647
+			$$=mk_action(FORWARD_TLS_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2648 2648
 		#else
2649 2649
 			$$=0;
2650 2650
 			yyerror("tls support not compiled in");
... ...
@@ -2652,7 +2673,7 @@ cmd:
2652 2652
 					}
2653 2653
 	| FORWARD_TLS LPAREN URIHOST COMMA URIPORT RPAREN {
2654 2654
 		#ifdef USE_TLS
2655
-			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, URIPORT_ST, 0);
2655
+			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$);
2656 2656
 		#else
2657 2657
 			$$=0;
2658 2658
 			yyerror("tls support not compiled in");
... ...
@@ -2660,7 +2681,7 @@ cmd:
2660 2660
 	}
2661 2661
 	| FORWARD_TLS LPAREN URIHOST COMMA NUMBER RPAREN {
2662 2662
 		#ifdef USE_TLS
2663
-			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5);
2663
+			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, (void*)$5); set_cfg_pos($$);
2664 2664
 		#else
2665 2665
 			$$=0;
2666 2666
 			yyerror("tls support not compiled in");
... ...
@@ -2668,7 +2689,7 @@ cmd:
2668 2668
 	}
2669 2669
 	| FORWARD_TLS LPAREN URIHOST RPAREN {
2670 2670
 		#ifdef USE_TLS
2671
-			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, 0);
2671
+			$$=mk_action(FORWARD_TLS_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$);
2672 2672
 		#else
2673 2673
 			$$=0;
2674 2674
 			yyerror("tls support not compiled in");
... ...
@@ -2679,7 +2700,7 @@ cmd:
2679 2679
 									yyerror("bad forward_tls argument"); }
2680 2680
 	| FORWARD_SCTP LPAREN host RPAREN {
2681 2681
 		#ifdef USE_SCTP
2682
-			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2682
+			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2683 2683
 		#else
2684 2684
 			$$=0;
2685 2685
 			yyerror("sctp support not compiled in");
... ...
@@ -2687,7 +2708,7 @@ cmd:
2687 2687
 	}
2688 2688
 	| FORWARD_SCTP LPAREN STRING RPAREN {
2689 2689
 		#ifdef USE_SCTP
2690
-			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0);
2690
+			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
2691 2691
 		#else
2692 2692
 			$$=0;
2693 2693
 			yyerror("sctp support not compiled in");
... ...
@@ -2695,7 +2716,7 @@ cmd:
2695 2695
 	}
2696 2696
 	| FORWARD_SCTP LPAREN ip RPAREN	{
2697 2697
 		#ifdef USE_SCTP
2698
-			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0);
2698
+			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$);
2699 2699
 		#else
2700 2700
 			$$=0;
2701 2701
 			yyerror("sctp support not compiled in");
... ...
@@ -2704,7 +2725,7 @@ cmd:
2704 2704
 	| FORWARD_SCTP LPAREN host COMMA NUMBER RPAREN {
2705 2705
 		#ifdef USE_SCTP
2706 2706
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
2707
-							(void*)$5);
2707
+							(void*)$5); set_cfg_pos($$);
2708 2708
 		#else
2709 2709
 			$$=0;
2710 2710
 			yyerror("sctp support not compiled in");
... ...
@@ -2713,7 +2734,7 @@ cmd:
2713 2713
 	| FORWARD_SCTP LPAREN STRING COMMA NUMBER RPAREN {
2714 2714
 		#ifdef USE_SCTP
2715 2715
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
2716
-							(void*)$5);
2716
+							(void*)$5); set_cfg_pos($$);
2717 2717
 		#else
2718 2718
 			$$=0;
2719 2719
 			yyerror("sctp support not compiled in");
... ...
@@ -2722,7 +2743,7 @@ cmd:
2722 2722
 	| FORWARD_SCTP LPAREN ip COMMA NUMBER RPAREN {
2723 2723
 		#ifdef USE_SCTP
2724 2724
 			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 
2725
-							(void*)$5);
2725
+							(void*)$5); set_cfg_pos($$);
2726 2726
 		#else
2727 2727
 			$$=0;
2728 2728
 			yyerror("sctp support not compiled in");
... ...
@@ -2730,7 +2751,7 @@ cmd:
2730 2730
 					}
2731 2731
 	| FORWARD_SCTP LPAREN URIHOST COMMA URIPORT RPAREN {
2732 2732
 		#ifdef USE_SCTP
2733
-			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0);
2733
+			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$);
2734 2734
 		#else
2735 2735
 			$$=0;
2736 2736
 			yyerror("sctp support not compiled in");
... ...
@@ -2739,7 +2760,7 @@ cmd:
2739 2739
 	| FORWARD_SCTP LPAREN URIHOST COMMA NUMBER RPAREN {
2740 2740
 		#ifdef USE_SCTP
2741 2741
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST,
2742
-							(void*)$5);
2742
+							(void*)$5); set_cfg_pos($$);
2743 2743
 		#else
2744 2744
 			$$=0;
2745 2745
 			yyerror("sctp support not compiled in");
... ...
@@ -2747,7 +2768,7 @@ cmd:
2747 2747
 	}
2748 2748
 	| FORWARD_SCTP LPAREN URIHOST RPAREN {
2749 2749
 		#ifdef USE_SCTP
2750
-			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0);
2750
+			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$);
2751 2751
 		#else
2752 2752
 			$$=0;
2753 2753
 			yyerror("tls support not compiled in");
... ...
@@ -2756,25 +2777,26 @@ cmd:
2756 2756
 	| FORWARD_SCTP error { $$=0; yyerror("missing '(' or ')' ?"); }
2757 2757
 	| FORWARD_SCTP LPAREN error RPAREN { $$=0; 
2758 2758
 									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); }
2759
+	| SEND LPAREN host RPAREN	{ $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2760
+	| SEND LPAREN STRING RPAREN { $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2761
+	| SEND LPAREN ip RPAREN		{ $$=mk_action(SEND_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2762
+	| SEND LPAREN host COMMA NUMBER RPAREN	{ $$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2763
+	| SEND LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(SEND_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2764
+	| SEND LPAREN ip COMMA NUMBER RPAREN { $$=mk_action(SEND_T, 2, IP_ST, (void*)$3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2765 2765
 	| SEND error { $$=0; yyerror("missing '(' or ')' ?"); }
2766 2766
 	| 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); }
2767
+	| SEND_TCP LPAREN host RPAREN	{ $$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2768
+	| SEND_TCP LPAREN STRING RPAREN { $$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$); }
2769
+	| SEND_TCP LPAREN ip RPAREN	{ $$=mk_action(SEND_TCP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$); }
2770
+	| SEND_TCP LPAREN host COMMA NUMBER RPAREN	{ $$=mk_action(	SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$);}
2771
+	| SEND_TCP LPAREN STRING COMMA NUMBER RPAREN {$$=mk_action(SEND_TCP_T, 2, STRING_ST, $3, NUMBER_ST, (void*)$5); set_cfg_pos($$); }
2772
+	| 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 2773
 	| SEND_TCP error { $$=0; yyerror("missing '(' or ')' ?"); }
2774 2774
 	| SEND_TCP LPAREN error RPAREN { $$=0; yyerror("bad send_tcp argument"); }
2775 2775
 	| 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); }
2776
+										(void*)(L_DBG+1), STRING_ST, $3);
2777
+									set_cfg_pos($$); }
2778
+	| LOG_TOK LPAREN NUMBER COMMA STRING RPAREN	{$$=mk_action(LOG_T, 2, NUMBER_ST, (void*)$3, STRING_ST, $5); set_cfg_pos($$); }
2778 2779
 	| LOG_TOK error 		{ $$=0; yyerror("missing '(' or ')' ?"); }
2779 2780
 	| LOG_TOK LPAREN error RPAREN	{ $$=0; yyerror("bad log argument"); }
2780 2781
 	| SETFLAG LPAREN NUMBER RPAREN	{
... ...
@@ -2782,42 +2804,49 @@ cmd:
2782 2782
 								yyerror("bad flag value");
2783 2783
 							$$=mk_action(SETFLAG_T, 1, NUMBER_ST,
2784 2784
 													(void*)$3);
2785
+							set_cfg_pos($$);
2785 2786
 									}
2786 2787
 	| SETFLAG LPAREN flag_name RPAREN	{
2787 2788
 							i_tmp=get_flag_no($3, strlen($3));
2788 2789
 							if (i_tmp<0) yyerror("flag not declared");
2789 2790
 							$$=mk_action(SETFLAG_T, 1, NUMBER_ST,
2790 2791
 										(void*)(long)i_tmp);
2792
+							set_cfg_pos($$);
2791 2793
 									}
2792 2794
 	| SETFLAG error			{ $$=0; yyerror("missing '(' or ')'?"); }
2793 2795
 	| RESETFLAG LPAREN NUMBER RPAREN {
2794 2796
 							if (check_flag($3)==-1)
2795 2797
 								yyerror("bad flag value");
2796 2798
 							$$=mk_action(RESETFLAG_T, 1, NUMBER_ST, (void*)$3);
2799
+							set_cfg_pos($$);
2797 2800
 									}
2798 2801
 	| RESETFLAG LPAREN flag_name RPAREN	{
2799 2802
 							i_tmp=get_flag_no($3, strlen($3));
2800 2803
 							if (i_tmp<0) yyerror("flag not declared");
2801 2804
 							$$=mk_action(RESETFLAG_T, 1, NUMBER_ST,
2802 2805
 										(void*)(long)i_tmp);
2806
+							set_cfg_pos($$);
2803 2807
 									}
2804 2808
 	| RESETFLAG error		{ $$=0; yyerror("missing '(' or ')'?"); }
2805 2809
 	| ISFLAGSET LPAREN NUMBER RPAREN {
2806 2810
 							if (check_flag($3)==-1)
2807 2811
 								yyerror("bad flag value");
2808 2812
 							$$=mk_action(ISFLAGSET_T, 1, NUMBER_ST, (void*)$3);
2813
+							set_cfg_pos($$);
2809 2814
 									}
2810 2815
 	| ISFLAGSET LPAREN flag_name RPAREN	{
2811 2816
 							i_tmp=get_flag_no($3, strlen($3));
2812 2817
 							if (i_tmp<0) yyerror("flag not declared");
2813 2818
 							$$=mk_action(ISFLAGSET_T, 1, NUMBER_ST,
2814 2819
 										(void*)(long)i_tmp);
2820
+							set_cfg_pos($$);
2815 2821
 									}
2816 2822
 	| ISFLAGSET error { $$=0; yyerror("missing '(' or ')'?"); }
2817 2823
 	| avpflag_oper LPAREN attr_id_any_str COMMA flag_name RPAREN {
2818 2824
 		i_tmp=get_avpflag_no($5);
2819 2825
 		if (i_tmp==0) yyerror("avpflag not declared");
2820 2826
 		$$=mk_action(AVPFLAG_OPER_T, 3, AVP_ST, $3, NUMBER_ST, (void*)(long)i_tmp, NUMBER_ST, (void*)$1);
2827
+		set_cfg_pos($$);
2821 2828
 	}
2822 2829
 	| avpflag_oper LPAREN attr_id_any_str COMMA error RPAREN {
2823 2830
 		$$=0; yyerror("error parsing flag name");
... ...
@@ -2827,7 +2856,9 @@ cmd:
2827 2827
 	}
2828 2828
 	| avpflag_oper LPAREN error RPAREN { $$=0; yyerror("bad parameters"); }
2829 2829
 	| 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); }
2830
+	| ERROR LPAREN STRING COMMA STRING RPAREN {$$=mk_action(ERROR_T, 2, STRING_ST, $3, STRING_ST, $5);
2831
+			set_cfg_pos($$);
2832
+	}
2831 2833
 	| ERROR error { $$=0; yyerror("missing '(' or ')' ?"); }
2832 2834
 	| ERROR LPAREN error RPAREN { $$=0; yyerror("bad error argument"); }
2833 2835
 	| ROUTE LPAREN route_name RPAREN	{
... ...
@@ -2837,23 +2868,24 @@ cmd:
2837 2837
 							YYABORT;
2838 2838
 						}
2839 2839
 						$$=mk_action(ROUTE_T, 1, NUMBER_ST,(void*)(long)i_tmp);
2840
+						set_cfg_pos($$);
2840 2841
 										}
2841 2842
 	| ROUTE error { $$=0; yyerror("missing '(' or ')' ?"); }
2842 2843
 	| 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); }
2844
+	| EXEC LPAREN STRING RPAREN	{ $$=mk_action(EXEC_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2845
+	| SET_HOST LPAREN STRING RPAREN { $$=mk_action(SET_HOST_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2845 2846
 	| SET_HOST error { $$=0; yyerror("missing '(' or ')' ?"); }
2846 2847
 	| SET_HOST LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
2847
-	| PREFIX LPAREN STRING RPAREN { $$=mk_action(PREFIX_T, 1, STRING_ST,  $3); }
2848
+	| PREFIX LPAREN STRING RPAREN { $$=mk_action(PREFIX_T, 1, STRING_ST,  $3); set_cfg_pos($$); }
2848 2849
 	| PREFIX error { $$=0; yyerror("missing '(' or ')' ?"); }
2849 2850
 	| 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); }
2851
+	| STRIP_TAIL LPAREN NUMBER RPAREN { $$=mk_action(STRIP_TAIL_T, 1, NUMBER_ST, (void*)$3); set_cfg_pos($$); }
2851 2852
 	| STRIP_TAIL error { $$=0; yyerror("missing '(' or ')' ?"); }
2852 2853
 	| 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); }
2854
+	| STRIP LPAREN NUMBER RPAREN { $$=mk_action(STRIP_T, 1, NUMBER_ST, (void*) $3); set_cfg_pos($$); }
2854 2855
 	| STRIP error { $$=0; yyerror("missing '(' or ')' ?"); }
2855 2856
 	| STRIP LPAREN error RPAREN { $$=0; yyerror("bad argument, number expected"); }
2856
-	| SET_USERPHONE LPAREN RPAREN { $$=mk_action(SET_USERPHONE_T, 0); }
2857
+	| SET_USERPHONE LPAREN RPAREN { $$=mk_action(SET_USERPHONE_T, 0); set_cfg_pos($$); }
2857 2858
 	| SET_USERPHONE error { $$=0; yyerror("missing '(' or ')' ?"); }
2858 2859
 	| APPEND_BRANCH LPAREN STRING COMMA STRING RPAREN {
2859 2860
 		qvalue_t q;
... ...
@@ -2861,37 +2893,39 @@ cmd:
2861 2861
 			yyerror("bad argument, q value expected");
2862 2862
 		}
2863 2863
 		$$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, $3, NUMBER_ST, (void *)(long)q);
2864
+		set_cfg_pos($$);
2864 2865
 	}
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); }
2866
+	| APPEND_BRANCH LPAREN STRING RPAREN { $$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, $3, NUMBER_ST, (void *)Q_UNSPECIFIED); set_cfg_pos($$); }
2867
+	| APPEND_BRANCH LPAREN RPAREN { $$=mk_action(APPEND_BRANCH_T, 2, STRING_ST, 0, NUMBER_ST, (void *)Q_UNSPECIFIED); set_cfg_pos($$); }
2868
+	| APPEND_BRANCH {  $$=mk_action( APPEND_BRANCH_T, 1, STRING_ST, 0); set_cfg_pos($$); }
2869
+	| SET_HOSTPORT LPAREN STRING RPAREN { $$=mk_action(SET_HOSTPORT_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2869 2870
 	| SET_HOSTPORT error { $$=0; yyerror("missing '(' or ')' ?"); }
2870 2871
 	| 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); }
2872
+	| SET_HOSTPORTTRANS LPAREN STRING RPAREN { $$=mk_action(SET_HOSTPORTTRANS_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2872 2873
 	| SET_HOSTPORTTRANS error { $$=0; yyerror("missing '(' or ')' ?"); }
2873 2874
 	| 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); }
2875
+	| SET_PORT LPAREN STRING RPAREN { $$=mk_action(SET_PORT_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2875 2876
 	| SET_PORT error { $$=0; yyerror("missing '(' or ')' ?"); }
2876 2877
 	| 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); }
2878
+	| SET_USER LPAREN STRING RPAREN { $$=mk_action(SET_USER_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2878 2879
 	| SET_USER error { $$=0; yyerror("missing '(' or ')' ?"); }
2879 2880
 	| 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); }
2881
+	| SET_USERPASS LPAREN STRING RPAREN { $$=mk_action(SET_USERPASS_T, 1, STRING_ST, $3); set_cfg_pos($$); }
2881 2882
 	| SET_USERPASS error { $$=0; yyerror("missing '(' or ')' ?"); }
2882 2883
 	| 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); }
2884
+	| SET_URI LPAREN STRING RPAREN { $$=mk_action(SET_URI_T, 1, STRING_ST,$3); set_cfg_pos($$); }
2884 2885
 	| SET_URI error { $$=0; yyerror("missing '(' or ')' ?"); }
2885 2886
 	| 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); }
2887
+	| REVERT_URI LPAREN RPAREN { $$=mk_action(REVERT_URI_T, 0); set_cfg_pos($$); }
2888
+	| REVERT_URI { $$=mk_action(REVERT_URI_T, 0); set_cfg_pos($$); }
2889
+	| FORCE_RPORT LPAREN RPAREN	{ $$=mk_action(FORCE_RPORT_T, 0); set_cfg_pos($$); }
2890
+	| FORCE_RPORT	{$$=mk_action(FORCE_RPORT_T, 0); set_cfg_pos($$); }
2891
+	| ADD_LOCAL_RPORT LPAREN RPAREN	{ $$=mk_action(ADD_LOCAL_RPORT_T, 0); set_cfg_pos($$); }
2892
+	| ADD_LOCAL_RPORT	{$$=mk_action(ADD_LOCAL_RPORT_T, 0); set_cfg_pos($$); }
2892 2893
 	| FORCE_TCP_ALIAS LPAREN NUMBER RPAREN	{
2893 2894
 		#ifdef USE_TCP
2894 2895
 			$$=mk_action(FORCE_TCP_ALIAS_T, 1, NUMBER_ST, (void*)$3);
2896
+			set_cfg_pos($$);
2895 2897
 		#else
2896 2898
 			yyerror("tcp support not compiled in");
2897 2899
 		#endif
... ...
@@ -2899,6 +2933,7 @@ cmd:
2899 2899
 	| FORCE_TCP_ALIAS LPAREN RPAREN	{
2900 2900
 		#ifdef USE_TCP
2901 2901
 			$$=mk_action(FORCE_TCP_ALIAS_T, 0);
2902
+			set_cfg_pos($$);
2902 2903
 		#else
2903 2904
 			yyerror("tcp support not compiled in");
2904 2905
 		#endif
... ...
@@ -2906,13 +2941,14 @@ cmd:
2906 2906
 	| FORCE_TCP_ALIAS				{
2907 2907
 		#ifdef USE_TCP
2908 2908
 			$$=mk_action(FORCE_TCP_ALIAS_T, 0);
2909
+			set_cfg_pos($$);
2909 2910
 		#else
2910 2911
 			yyerror("tcp support not compiled in");
2911 2912
 		#endif
2912 2913
 	}
2913 2914
 	| FORCE_TCP_ALIAS LPAREN error RPAREN	{$$=0; yyerror("bad argument, number expected"); }
2914 2915
 	| UDP_MTU_TRY_PROTO LPAREN proto RPAREN
2915
-		{ $$=mk_action(UDP_MTU_TRY_PROTO_T, 1, NUMBER_ST, $3); }
2916
+		{ $$=mk_action(UDP_MTU_TRY_PROTO_T, 1, NUMBER_ST, $3); set_cfg_pos($$); }
2916 2917
 	| UDP_MTU_TRY_PROTO LPAREN error RPAREN
2917 2918
 		{ $$=0; yyerror("bad argument, UDP, TCP, TLS or SCTP expected"); }
2918 2919
 	| SET_ADV_ADDRESS LPAREN listen_id RPAREN {
... ...
@@ -2923,6 +2959,7 @@ cmd:
2923 2923
 			str_tmp->s=$3;
2924 2924
 			str_tmp->len=$3?strlen($3):0;
2925 2925
 			$$=mk_action(SET_ADV_ADDR_T, 1, STR_ST, str_tmp);
2926
+			set_cfg_pos($$);
2926 2927
 		}
2927 2928
 	}
2928 2929
 	| SET_ADV_ADDRESS LPAREN error RPAREN { $$=0; yyerror("bad argument, string expected"); }
... ...
@@ -2939,6 +2976,7 @@ cmd:
2939 2939
 				memcpy(str_tmp->s, tmp, i_tmp);
2940 2940
 				str_tmp->len=i_tmp;
2941 2941
 				$$=mk_action(SET_ADV_PORT_T, 1, STR_ST, str_tmp);
2942
+				set_cfg_pos($$);
2942 2943
 			}
2943 2944
 		}
2944 2945
 	}
... ...
@@ -2946,6 +2984,7 @@ cmd:
2946 2946
 	| SET_ADV_PORT  error {$$=0; yyerror("missing '(' or ')' ?"); }
2947 2947
 	| FORCE_SEND_SOCKET LPAREN phostport RPAREN { 
2948 2948
 		$$=mk_action(FORCE_SEND_SOCKET_T, 1, SOCKID_ST, $3);
2949
+		set_cfg_pos($$);
2949 2950
 	}
2950 2951
 	| FORCE_SEND_SOCKET LPAREN error RPAREN {
2951 2952
 		$$=0; yyerror("bad argument, [proto:]host[:port] expected");
... ...
@@ -2994,6 +3033,7 @@ cmd:
2994 2994
 			}
2995 2995
 		}
2996 2996
 		$$ = mod_func_action;
2997
+		set_cfg_pos($$);
2997 2998
 	}
2998 2999
 	| ID error					{ yyerror("'('')' expected (function call)");}
2999 3000
 	;
... ...
@@ -3029,49 +3069,48 @@ func_param:
3029 3029
 ret_cmd:
3030 3030
 	DROP LPAREN RPAREN		{
3031 3031
 		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST,
3032
-						(void*)(DROP_R_F|EXIT_R_F)); 
3032
+						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
3033 3033
 	}
3034 3034
 	| DROP rval_expr	{
3035 3035
 		$$=mk_action(DROP_T, 2, RVE_ST, $2, NUMBER_ST,
3036
-						(void*)(DROP_R_F|EXIT_R_F)); 
3036
+						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
3037 3037
 	}
3038 3038
 	| DROP				{
3039 3039
 		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, 
3040
-						(void*)(DROP_R_F|EXIT_R_F)); 
3040
+						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
3041 3041
 	}
3042 3042
 	| EXIT LPAREN RPAREN		{
3043
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F); 
3043
+		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F);
3044
+		set_cfg_pos($$);
3044 3045
 	}
3045 3046
 	| EXIT rval_expr	{
3046 3047
 		$$=mk_action(DROP_T, 2, RVE_ST, $2, NUMBER_ST, (void*)EXIT_R_F);
3048
+		set_cfg_pos($$);
3047 3049
 	}
3048 3050
 	| EXIT				{
3049
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F); 
3051
+		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F);
3052
+		set_cfg_pos($$);
3050 3053
 	}
3051 3054
 	| RETURN			{
3052 3055
 		$$=mk_action(DROP_T, 2, NUMBER_ST, (void*)1, NUMBER_ST,
3053
-						(void*)RETURN_R_F);
3056
+						(void*)RETURN_R_F); set_cfg_pos($$);
3054 3057
 	}
3055 3058
 	| RETURN  LPAREN RPAREN		{
3056 3059
 		$$=mk_action(DROP_T, 2, NUMBER_ST, (void*)1, NUMBER_ST,
3057
-						(void*)RETURN_R_F);
3060
+						(void*)RETURN_R_F); set_cfg_pos($$);
3058 3061
 	}
3059 3062
 	| RETURN rval_expr	{
3060 3063
 		$$=mk_action(DROP_T, 2, RVE_ST, $2, NUMBER_ST, (void*)RETURN_R_F);
3064
+		set_cfg_pos($$);
3061 3065
 	}
3062 3066
 	| BREAK				{
3063
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)BREAK_R_F); 
3067
+		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)BREAK_R_F);
3068
+		set_cfg_pos($$);
3064 3069
 	}
3065 3070
 	;
3066 3071
 
3067 3072
 %%
3068 3073
 
3069
-extern int line;
3070
-extern int column;
3071
-extern int startcolumn;
3072
-extern int startline;
3073
-extern char *finame;
3074
-
3075 3074
 static void get_cpos(struct cfg_pos* pos)
3076 3075
 {
3077 3076
 	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;