Browse code

Revert "core: Initial revision of branch_failure_route"

Remove new branch_failure_route in favour of an event_route

This reverts commit a5946574cb9917f0a9a90ea547c9357f3f6477bd.

Hugh Waite authored on 26/03/2013 11:22:31
Showing 6 changed files
... ...
@@ -200,7 +200,6 @@ ERROR	error
200 200
 ROUTE	route
201 201
 ROUTE_REQUEST request_route
202 202
 ROUTE_FAILURE failure_route
203
-ROUTE_BRANCH_FAILURE branch_failure_route
204 203
 ROUTE_REPLY reply_route
205 204
 ROUTE_ONREPLY onreply_route
206 205
 ROUTE_BRANCH branch_route
... ...
@@ -624,8 +623,6 @@ IMPORTFILE      "import_file"
624 624
 <INITIAL>{ROUTE_REPLY}	{ count(); yylval.strval=yytext; return ROUTE_REPLY; }
625 625
 <INITIAL>{ROUTE_FAILURE}	{ count(); yylval.strval=yytext;
626 626
 								return ROUTE_FAILURE; }
627
-<INITIAL>{ROUTE_BRANCH_FAILURE}	{ count(); yylval.strval=yytext;
628
-								return ROUTE_BRANCH_FAILURE; }
629 627
 <INITIAL>{ROUTE_BRANCH} { count(); yylval.strval=yytext; return ROUTE_BRANCH; }
630 628
 <INITIAL>{ROUTE_SEND} { count(); yylval.strval=yytext; return ROUTE_SEND; }
631 629
 <INITIAL>{ROUTE_EVENT} { count(); yylval.strval=yytext; return ROUTE_EVENT; }
... ...
@@ -314,7 +314,6 @@ extern char *finame;
314 314
 %token ROUTE
315 315
 %token ROUTE_REQUEST
316 316
 %token ROUTE_FAILURE
317
-%token ROUTE_BRANCH_FAILURE
318 317
 %token ROUTE_ONREPLY
319 318
 %token ROUTE_REPLY
320 319
 %token ROUTE_BRANCH
... ...
@@ -706,7 +705,6 @@ statement:
706 706
 	| module_stm
707 707
 	| {rt=REQUEST_ROUTE;} route_stm
708 708
 	| {rt=FAILURE_ROUTE;} failure_route_stm
709
-	| {rt=BRANCH_FAILURE_ROUTE;} branch_failure_route_stm
710 709
 	| onreply_route_stm
711 710
 	| {rt=BRANCH_ROUTE;} branch_route_stm
712 711
 	| {rt=ONSEND_ROUTE;}   send_route_stm
... ...
@@ -1972,28 +1970,6 @@ failure_route_stm:
1972 1972
 	| ROUTE_FAILURE error { yyerror("invalid failure_route statement"); }
1973 1973
 	;
1974 1974
 
1975
-branch_failure_route_stm:
1976
-	ROUTE_BRANCH_FAILURE LBRACK route_name RBRACK LBRACE actions RBRACE {
1977
-	#ifdef SHM_MEM
1978
-		if (!shm_initialized() && init_shm()<0) {
1979
-			yyerror("Can't initialize shared memory");
1980
-			YYABORT;
1981
-		}
1982
-	#endif /* SHM_MEM */
1983
-		i_tmp=route_get(&branch_failure_rt, $3);
1984
-		if (i_tmp==-1){
1985
-			yyerror("internal error");
1986
-			YYABORT;
1987
-		}
1988
-		if (branch_failure_rt.rlist[i_tmp]){
1989
-			yyerror("duplicate route");
1990
-			YYABORT;
1991
-		}
1992
-		push($6, &branch_failure_rt.rlist[i_tmp]);
1993
-	}
1994
-	| ROUTE_BRANCH_FAILURE error { yyerror("invalid branch_failure_route statement"); }
1995
-	;
1996
-
1997 1975
 
1998 1976
 route_reply_main:	ROUTE_ONREPLY { ; }
1999 1977
 		  | ROUTE_REPLY { ; }
... ...
@@ -102,7 +102,6 @@
102 102
 struct route_list main_rt;
103 103
 struct route_list onreply_rt;
104 104
 struct route_list failure_rt;
105
-struct route_list branch_failure_rt;
106 105
 struct route_list branch_rt;
107 106
 struct route_list onsend_rt;
108 107
 struct route_list event_rt;
... ...
@@ -143,7 +142,6 @@ void destroy_routes()
143 143
 	destroy_rlist(&main_rt);
144 144
 	destroy_rlist(&onreply_rt);
145 145
 	destroy_rlist(&failure_rt);
146
-	destroy_rlist(&branch_failure_rt);
147 146
 	destroy_rlist(&branch_rt);
148 147
 	destroy_rlist(&event_rt);
149 148
 }
... ...
@@ -212,8 +210,6 @@ int init_routes()
212 212
 		goto error;
213 213
 	if (init_rlist("failure", &failure_rt, FAILURE_RT_NO, RT_HASH_SIZE)<0)
214 214
 		goto error;
215
-	if (init_rlist("branch_failure", &branch_failure_rt, FAILURE_RT_NO, RT_HASH_SIZE)<0)
216
-		goto error;
217 215
 	if (init_rlist("branch", &branch_rt, BRANCH_RT_NO, RT_HASH_SIZE)<0)
218 216
 		goto error;
219 217
 	if (init_rlist("on_send", &onsend_rt, ONSEND_RT_NO, RT_HASH_SIZE)<0)
... ...
@@ -53,7 +53,6 @@
53 53
 #define ERROR_ROUTE   (1 << 5)
54 54
 #define LOCAL_ROUTE   (1 << 6)
55 55
 #define CORE_ONREPLY_ROUTE (1 << 7)
56
-#define BRANCH_FAILURE_ROUTE (1 << 8)
57 56
 #define ONREPLY_ROUTE (TM_ONREPLY_ROUTE|CORE_ONREPLY_ROUTE)
58 57
 #define EVENT_ROUTE   REQUEST_ROUTE
59 58
 #define ANY_ROUTE     (0xFFFFFFFF)
... ...
@@ -86,7 +85,6 @@ extern struct route_list main_rt;
86 86
 /* main reply route table */
87 87
 extern struct route_list onreply_rt;
88 88
 extern struct route_list failure_rt;
89
-extern struct route_list branch_failure_rt;
90 89
 extern struct route_list branch_rt;
91 90
 extern struct route_list onsend_rt;
92 91
 extern struct route_list event_rt;
... ...
@@ -53,7 +53,7 @@
53 53
 #include "mem/mem.h"
54 54
 
55 55
 /* Number of cb types = last cb type */
56
-#define SCRIPT_CB_NUM	(CB_TYPE_MAX-1)
56
+#define SCRIPT_CB_NUM	EVENT_CB_TYPE
57 57
 
58 58
 static struct script_cb *pre_script_cb[SCRIPT_CB_NUM];
59 59
 static struct script_cb *post_script_cb[SCRIPT_CB_NUM];
... ...
@@ -49,15 +49,14 @@ typedef int (cb_function)(struct sip_msg *msg, unsigned int flags, void *param);
49 49
  */
50 50
 enum script_cb_flag { REQUEST_CB=1, FAILURE_CB=2, ONREPLY_CB=4,
51 51
 			BRANCH_CB=8, ONSEND_CB=16, ERROR_CB=32,
52
-			LOCAL_CB=64, EVENT_CB=128, BRANCH_FAILURE_CB=256 };
52
+			LOCAL_CB=64, EVENT_CB=128 };
53 53
 
54 54
 /* Callback types used for executing the callbacks.
55 55
  * Keep in sync with script_cb_flag!!!
56 56
  */
57 57
 enum script_cb_type { REQUEST_CB_TYPE=1, FAILURE_CB_TYPE, ONREPLY_CB_TYPE,
58 58
 			BRANCH_CB_TYPE, ONSEND_CB_TYPE, ERROR_CB_TYPE,
59
-			LOCAL_CB_TYPE, EVENT_CB_TYPE, BRANCH_FAILURE_CB_TYPE,
60
-			CB_TYPE_MAX};
59
+			LOCAL_CB_TYPE, EVENT_CB_TYPE };
61 60
 
62 61
 struct script_cb{
63 62
 	cb_function *cbf;