[svn-commits] mmichelson: branch mmichelson/rls-config r416798 - in /team/mmichelson/rls-co...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 19 15:40:42 CDT 2014


Author: mmichelson
Date: Thu Jun 19 15:40:38 2014
New Revision: 416798

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=416798
Log:
Set the automerge property again.


Modified:
    team/mmichelson/rls-config/   (props changed)
    team/mmichelson/rls-config/channels/sip/reqresp_parser.c
    team/mmichelson/rls-config/include/asterisk/acl.h
    team/mmichelson/rls-config/include/asterisk/netsock2.h
    team/mmichelson/rls-config/main/acl.c
    team/mmichelson/rls-config/main/bridge.c
    team/mmichelson/rls-config/main/logger.c
    team/mmichelson/rls-config/main/netsock2.c
    team/mmichelson/rls-config/main/test.c
    team/mmichelson/rls-config/res/parking/parking_tests.c
    team/mmichelson/rls-config/res/res_pjsip_endpoint_identifier_ip.c

Propchange: team/mmichelson/rls-config/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/mmichelson/rls-config/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Propchange: team/mmichelson/rls-config/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun 19 15:40:38 2014
@@ -1,1 +1,1 @@
-/trunk:1-416727
+/trunk:1-416795

Modified: team/mmichelson/rls-config/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/channels/sip/reqresp_parser.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/channels/sip/reqresp_parser.c (original)
+++ team/mmichelson/rls-config/channels/sip/reqresp_parser.c Thu Jun 19 15:40:38 2014
@@ -2586,8 +2586,8 @@
 
 		if (testdataptr->expected_port && testdataptr->expected_port != via->port) {
 			ast_test_status_update(test, "TEST#%d FAILED: VIA = \"%s\"\n"
-				"parsed port = \"%d\"\n"
-				"expected = \"%d\"\n"
+				"parsed port = \"%u\"\n"
+				"expected = \"%u\"\n"
 				"failed to parse port\n",
 			i, testdataptr->in, via->port, testdataptr->expected_port);
 			res = AST_TEST_FAIL;

Modified: team/mmichelson/rls-config/include/asterisk/acl.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/include/asterisk/acl.h?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/include/asterisk/acl.h (original)
+++ team/mmichelson/rls-config/include/asterisk/acl.h Thu Jun 19 15:40:38 2014
@@ -140,6 +140,13 @@
  * \param buf string buffer to convert data to
  */
 void ast_ha_join(const struct ast_ha *ha, struct ast_str **buf);
+
+/*!
+ * \brief Convert HAs to a comma separated string value using CIDR notation
+ * \param ha the starting ha head
+ * \param buf string buffer to convert data to
+ */
+void ast_ha_join_cidr(const struct ast_ha *ha, struct ast_str **buf);
 
 /*!
  * \brief Add a rule to an ACL struct

Modified: team/mmichelson/rls-config/include/asterisk/netsock2.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/include/asterisk/netsock2.h?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/include/asterisk/netsock2.h (original)
+++ team/mmichelson/rls-config/include/asterisk/netsock2.h Thu Jun 19 15:40:38 2014
@@ -263,6 +263,16 @@
 }
 
 /*!
+ * \since 12.4
+ *
+ * \brief
+ * Count the 1 bits in a netmask
+ *
+ * \return number of 1 bits
+ */
+int ast_sockaddr_cidr_bits(const struct ast_sockaddr *sa);
+
+/*!
  * \since 1.8
  *
  * \brief

Modified: team/mmichelson/rls-config/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/main/acl.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/main/acl.c (original)
+++ team/mmichelson/rls-config/main/acl.c Thu Jun 19 15:40:38 2014
@@ -671,6 +671,19 @@
 		ast_str_append(buf, 0, "%s%s/%s",
 			       ha->sense == AST_SENSE_ALLOW ? "!" : "",
 			       addr, ast_sockaddr_stringify_addr(&ha->netmask));
+		if (ha->next) {
+			ast_str_append(buf, 0, ",");
+		}
+	}
+}
+
+void ast_ha_join_cidr(const struct ast_ha *ha, struct ast_str **buf)
+{
+	for (; ha; ha = ha->next) {
+		const char *addr = ast_sockaddr_stringify_addr(&ha->addr);
+		ast_str_append(buf, 0, "%s%s/%d",
+			       ha->sense == AST_SENSE_ALLOW ? "!" : "",
+			       addr, ast_sockaddr_cidr_bits(&ha->netmask));
 		if (ha->next) {
 			ast_str_append(buf, 0, ",");
 		}

Modified: team/mmichelson/rls-config/main/bridge.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/main/bridge.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/main/bridge.c (original)
+++ team/mmichelson/rls-config/main/bridge.c Thu Jun 19 15:40:38 2014
@@ -3446,7 +3446,7 @@
 	cleanup_video_mode(bridge);
 	bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;
 	bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);
-	ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to single source\r\nVideo Mode: %d\r\nVideo Channel: %s",
+	ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to single source\r\nVideo Mode: %u\r\nVideo Channel: %s",
 		bridge->softmix.video_mode.mode, ast_channel_name(video_src_chan));
 	ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);
 	ast_bridge_unlock(bridge);
@@ -3457,7 +3457,7 @@
 	ast_bridge_lock(bridge);
 	cleanup_video_mode(bridge);
 	bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_TALKER_SRC;
-	ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to talker source\r\nVideo Mode: %d",
+	ast_test_suite_event_notify("BRIDGE_VIDEO_MODE", "Message: video mode set to talker source\r\nVideo Mode: %u",
 		bridge->softmix.video_mode.mode);
 	ast_bridge_unlock(bridge);
 }

Modified: team/mmichelson/rls-config/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/main/logger.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/main/logger.c (original)
+++ team/mmichelson/rls-config/main/logger.c Thu Jun 19 15:40:38 2014
@@ -1479,7 +1479,7 @@
 
 	call->call_identifier = ast_atomic_fetchadd_int(&next_unique_callid, +1);
 #ifdef TEST_FRAMEWORK
-	ast_debug(3, "CALL_ID [C-%08x] created by thread.\n", call->call_identifier);
+	ast_debug(3, "CALL_ID [C-%08x] created by thread.\n", (unsigned)call->call_identifier);
 #endif
 	return call;
 }
@@ -1509,7 +1509,7 @@
 
 	if (*id && (*id != callid)) {
 #ifdef TEST_FRAMEWORK
-		ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (*id)->call_identifier);
+		ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (unsigned)(*id)->call_identifier);
 #endif
 		*id = ast_callid_unref(*id);
 		*id = NULL;
@@ -1520,7 +1520,7 @@
 		ast_callid_ref(callid);
 		*id = callid;
 #ifdef TEST_FRAMEWORK
-		ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", callid->call_identifier);
+		ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", (unsigned)callid->call_identifier);
 #endif
 	}
 
@@ -1542,7 +1542,7 @@
 		ast_callid_ref(callid);
 		*pointing = callid;
 #ifdef TEST_FRAMEWORK
-		ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", callid->call_identifier);
+		ast_debug(3, "CALL_ID [C-%08x] bound to thread.\n", (unsigned)callid->call_identifier);
 #endif
 	} else {
 		ast_log(LOG_WARNING, "Attempted to ast_callid_threadassoc_add on thread already associated with a callid.\n");
@@ -1567,7 +1567,7 @@
 		return -1;
 	} else {
 #ifdef TEST_FRAMEWORK
-		ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (*pointing)->call_identifier);
+		ast_debug(3, "CALL_ID [C-%08x] being removed from thread.\n", (unsigned)(*pointing)->call_identifier);
 #endif
 		*pointing = ast_callid_unref(*pointing);
 		return 0;

Modified: team/mmichelson/rls-config/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/main/netsock2.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/main/netsock2.c (original)
+++ team/mmichelson/rls-config/main/netsock2.c Thu Jun 19 15:40:38 2014
@@ -129,6 +129,40 @@
 	return ast_str_buffer(str);
 }
 
+int ast_sockaddr_cidr_bits(const struct ast_sockaddr *sa)
+{
+	struct ast_sockaddr sa_ipv4;
+	const struct ast_sockaddr *sa_tmp;
+	int bits = 0;
+	int bytes;
+	int i;
+	int j;
+	char *addr;
+
+	if (ast_sockaddr_isnull(sa)) {
+		return 0;
+	}
+
+	if (ast_sockaddr_ipv4_mapped(sa, &sa_ipv4)) {
+		sa_tmp = &sa_ipv4;
+	} else {
+		sa_tmp = sa;
+	}
+
+	bytes = sa_tmp->len;
+	addr = ((struct sockaddr *)&sa_tmp->ss)->sa_data;
+
+	for (i = 0; i < bytes ; ++i) {
+		for (j = 0; j < 8; ++j) {
+			if ((addr[i] >> j) & 1) {
+				bits++;
+			}
+		}
+	}
+
+	return bits;
+}
+
 int ast_sockaddr_split_hostport(char *str, char **host, char **port, int flags)
 {
 	char *s = str;

Modified: team/mmichelson/rls-config/main/test.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/main/test.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/main/test.c (original)
+++ team/mmichelson/rls-config/main/test.c Thu Jun 19 15:40:38 2014
@@ -276,7 +276,7 @@
 		return;
 	}
 
-	fprintf(f, "\t<testcase time=\"%d.%d\" name=\"%s%s\"%s>\n",
+	fprintf(f, "\t<testcase time=\"%u.%u\" name=\"%s%s\"%s>\n",
 			test->time / 1000, test->time % 1000,
 			test->info.category, test->info.name,
 			test->state == AST_TEST_PASS ? "/" : "");
@@ -301,7 +301,7 @@
 	fprintf(f,   "Description:       %s\n", test->info.description);
 	fprintf(f,   "Result:            %s\n", test_result2str[test->state]);
 	if (test->state != AST_TEST_NOT_RUN) {
-		fprintf(f,   "Time:              %d\n", test->time);
+		fprintf(f,   "Time:              %u\n", test->time);
 	}
 	if (test->state == AST_TEST_FAIL) {
 		fprintf(f,   "Error Description: %s\n\n", S_OR(ast_str_buffer(test->status_str), "NA"));
@@ -387,7 +387,7 @@
 					(test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
 					0,
 					sizeof(result_buf));
-				ast_cli(cli->fd, "END    %s - %s Time: %s%dms Result: %s\n",
+				ast_cli(cli->fd, "END    %s - %s Time: %s%ums Result: %s\n",
 					test->info.category,
 					test->info.name,
 					test->time ? "" : "<",
@@ -476,7 +476,7 @@
 		 * http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo
 		 */
 		fprintf(f_xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-		fprintf(f_xml, "<testsuite errors=\"0\" time=\"%d.%d\" tests=\"%d\" "
+		fprintf(f_xml, "<testsuite errors=\"0\" time=\"%u.%u\" tests=\"%u\" "
 				"name=\"AsteriskUnitTests\">\n",
 				last_results.total_time / 1000, last_results.total_time % 1000,
 				last_results.total_tests);
@@ -489,11 +489,11 @@
 	if (f_txt) {
 		fprintf(f_txt, "Asterisk Version:         %s\n", ast_get_version());
 		fprintf(f_txt, "Asterisk Version Number:  %s\n", ast_get_version_num());
-		fprintf(f_txt, "Number of Tests:          %d\n", last_results.total_tests);
-		fprintf(f_txt, "Number of Tests Executed: %d\n", (last_results.total_passed + last_results.total_failed));
-		fprintf(f_txt, "Passed Tests:             %d\n", last_results.total_passed);
-		fprintf(f_txt, "Failed Tests:             %d\n", last_results.total_failed);
-		fprintf(f_txt, "Total Execution Time:     %d\n", last_results.total_time);
+		fprintf(f_txt, "Number of Tests:          %u\n", last_results.total_tests);
+		fprintf(f_txt, "Number of Tests Executed: %u\n", (last_results.total_passed + last_results.total_failed));
+		fprintf(f_txt, "Passed Tests:             %u\n", last_results.total_passed);
+		fprintf(f_txt, "Failed Tests:             %u\n", last_results.total_failed);
+		fprintf(f_txt, "Total Execution Time:     %u\n", last_results.total_time);
 	}
 
 	/* export each individual test */
@@ -819,7 +819,7 @@
 		if (!(last_results.last_passed + last_results.last_failed)) {
 			ast_cli(a->fd, "--- No Tests Found! ---\n");
 		}
-		ast_cli(a->fd, "\n%d Test(s) Executed  %d Passed  %d Failed\n",
+		ast_cli(a->fd, "\n%u Test(s) Executed  %u Passed  %u Failed\n",
 			(last_results.last_passed + last_results.last_failed),
 			last_results.last_passed,
 			last_results.last_failed);

Modified: team/mmichelson/rls-config/res/parking/parking_tests.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/res/parking/parking_tests.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/res/parking/parking_tests.c (original)
+++ team/mmichelson/rls-config/res/parking/parking_tests.c Thu Jun 19 15:40:38 2014
@@ -275,12 +275,12 @@
 	}
 
 	if (expected->time_limit != actual->time_limit) {
-		ast_test_status_update(test, "time_limit expected: %d - got: %d\n", expected->time_limit, actual->time_limit);
+		ast_test_status_update(test, "time_limit expected: %u - got: %u\n", expected->time_limit, actual->time_limit);
 		return 0;
 	}
 
 	if (expected->resolution != actual->resolution) {
-		ast_test_status_update(test, "resolution expected: %d - got: %d\n", expected->resolution, actual->resolution);
+		ast_test_status_update(test, "resolution expected: %u - got: %u\n", expected->resolution, actual->resolution);
 		return 0;
 	}
 
@@ -300,22 +300,22 @@
 	}
 
 	if (expected->parkingtime != actual->parkingtime) {
-		ast_test_status_update(test, "parkingtime expected: %d - got: %d\n", expected->parkingtime, actual->parkingtime);
+		ast_test_status_update(test, "parkingtime expected: %u - got: %u\n", expected->parkingtime, actual->parkingtime);
 		return 0;
 	}
 
 	if (expected->comebackdialtime != actual->comebackdialtime) {
-		ast_test_status_update(test, "comebackdialtime expected: %d - got: %d\n", expected->comebackdialtime, actual->comebackdialtime);
+		ast_test_status_update(test, "comebackdialtime expected: %u - got: %u\n", expected->comebackdialtime, actual->comebackdialtime);
 		return 0;
 	}
 
 	if (expected->parkfindnext != actual->parkfindnext) {
-		ast_test_status_update(test, "parkfindnext expected: %d - got: %d\n", expected->parkfindnext, actual->parkfindnext);
+		ast_test_status_update(test, "parkfindnext expected: %u - got: %u\n", expected->parkfindnext, actual->parkfindnext);
 		return 0;
 	}
 
 	if (expected->parkext_exclusive != actual->parkext_exclusive) {
-		ast_test_status_update(test, "parkext_exclusive expected: %d - got: %d\n", expected->parkext_exclusive, actual->parkext_exclusive);
+		ast_test_status_update(test, "parkext_exclusive expected: %u - got: %u\n", expected->parkext_exclusive, actual->parkext_exclusive);
 		return 0;
 	}
 

Modified: team/mmichelson/rls-config/res/res_pjsip_endpoint_identifier_ip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/rls-config/res/res_pjsip_endpoint_identifier_ip.c?view=diff&rev=416798&r1=416797&r2=416798
==============================================================================
--- team/mmichelson/rls-config/res/res_pjsip_endpoint_identifier_ip.c (original)
+++ team/mmichelson/rls-config/res/res_pjsip_endpoint_identifier_ip.c Thu Jun 19 15:40:38 2014
@@ -372,7 +372,7 @@
 
 	ast_str_append(&context->output_buffer, 0, "%*s:  ",
 		CLI_INDENT_TO_SPACES(context->indent_level), "Identify");
-	ast_ha_join(ident->matches, &str);
+	ast_ha_join_cidr(ident->matches, &str);
 	ast_str_append(&context->output_buffer, 0, "%s\n", ast_str_buffer(str));
 
 	return 0;




More information about the svn-commits mailing list