[sr-dev] git:master: core: readded conditions for core sctp forwarding functions

Daniel-Constantin Mierla miconda at gmail.com
Sat May 25 17:29:06 CEST 2013


Module: sip-router
Branch: master
Commit: e549d96b571ae509a67984be789b281ed2230bc3
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e549d96b571ae509a67984be789b281ed2230bc3

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sat May 25 11:24:22 2013 +0200

core: readded conditions for core sctp forwarding functions

- typo fixed in log message

---

 cfg.y |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/cfg.y b/cfg.y
index dd95a74..968888a 100644
--- a/cfg.y
+++ b/cfg.y
@@ -2930,39 +2930,84 @@ cmd:
 	| FORWARD_TLS LPAREN error RPAREN { $$=0; 
 									yyerror("bad forward_tls argument"); }
 	| FORWARD_SCTP LPAREN host RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN STRING RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN ip RPAREN	{
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN host COMMA NUMBER RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
 							(void*)$5); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN STRING COMMA NUMBER RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
 							(void*)$5); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN ip COMMA NUMBER RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 
 							(void*)$5); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 					}
 	| FORWARD_SCTP LPAREN URIHOST COMMA URIPORT RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN URIHOST COMMA NUMBER RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST,
 							(void*)$5); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("sctp support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP LPAREN URIHOST RPAREN {
+		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$);
+		#else
+			$$=0;
+			yyerror("tls support not compiled in");
+		#endif
 	}
 	| FORWARD_SCTP error { $$=0; yyerror("missing '(' or ')' ?"); }
 	| FORWARD_SCTP LPAREN error RPAREN { $$=0; 
-									yyerror("bad forward_tls argument"); }
+									yyerror("bad forward_sctp argument"); }
 	| LOG_TOK LPAREN STRING RPAREN	{$$=mk_action(LOG_T, 2, NUMBER_ST,
 										(void*)(L_DBG+1), STRING_ST, $3);
 									set_cfg_pos($$); }




More information about the sr-dev mailing list