[libpri-commits] rmudgett: branch 1.4 r2183 - /branches/1.4/

SVN commits to the libpri project libpri-commits at lists.digium.com
Mon Jan 31 18:37:53 CST 2011


Author: rmudgett
Date: Mon Jan 31 18:37:49 2011
New Revision: 2183

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2183
Log:
Enable LIBPRI_COUNTERS code by default.

Removed the conditional LIBPRI_COUNTERS to include the code
unconditionally.

Patches:
      enable_LIBPRI_COUNTERS_LIBPRI-61.diff uploaded by jbigelow

JIRA LIBPRI-61

Modified:
    branches/1.4/Makefile
    branches/1.4/pri.c
    branches/1.4/pri_internal.h
    branches/1.4/q921.c
    branches/1.4/q931.c

Modified: branches/1.4/Makefile
URL: http://svnview.digium.com/svn/libpri/branches/1.4/Makefile?view=diff&rev=2183&r1=2182&r2=2183
==============================================================================
--- branches/1.4/Makefile (original)
+++ branches/1.4/Makefile Mon Jan 31 18:37:49 2011
@@ -23,9 +23,6 @@
 #
 # Uncomment if you want libpri not send PROGRESS_INDICATOR w/ALERTING
 #ALERTING=-DALERTING_NO_PROGRESS
-
-# Uncomment if you want libpri to count number of Q921/Q931 sent/received
-#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
 
 CC=gcc
 GREP=grep
@@ -93,7 +90,7 @@
 	rose_qsig_mwi.lo \
 	rose_qsig_name.lo \
 	version.lo
-CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS) $(LIBPRI_OPT) $(COVERAGE_CFLAGS)
+CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_OPT) $(COVERAGE_CFLAGS)
 INSTALL_PREFIX=$(DESTDIR)
 INSTALL_BASE=/usr
 libdir?=$(INSTALL_BASE)/lib

Modified: branches/1.4/pri.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri.c?view=diff&rev=2183&r1=2182&r2=2183
==============================================================================
--- branches/1.4/pri.c (original)
+++ branches/1.4/pri.c Mon Jan 31 18:37:49 2011
@@ -476,12 +476,11 @@
 	ctrl->nsf = PRI_NSF_NONE;
 	ctrl->callpool = &ctrl->localpool;
 	pri_default_timers(ctrl, switchtype);
-#ifdef LIBPRI_COUNTERS
 	ctrl->q921_rxcount = 0;
 	ctrl->q921_txcount = 0;
 	ctrl->q931_rxcount = 0;
 	ctrl->q931_txcount = 0;
-#endif
+
 	switch (switchtype) {
 	case PRI_SWITCH_GR303_EOC:
 		ctrl->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
@@ -1653,11 +1652,9 @@
 	char *buf;
 	size_t buf_size;
 	size_t used;
-#ifdef LIBPRI_COUNTERS
 	struct q921_frame *f;
 	struct q921_link *link;
 	unsigned q921outstanding;
-#endif
 	unsigned idx;
 	unsigned long switch_bit;
 
@@ -1676,7 +1673,6 @@
 	used = pri_snprintf(buf, used, buf_size, "Switchtype: %s\n",
 		pri_switch2str(ctrl->switchtype));
 	used = pri_snprintf(buf, used, buf_size, "Type: %s\n", pri_node2str(ctrl->localtype));
-#ifdef LIBPRI_COUNTERS
 	/* Remember that Q921 Counters include Q931 packets (and any retransmissions) */
 	used = pri_snprintf(buf, used, buf_size, "Q931 RX: %d\n", ctrl->q931_rxcount);
 	used = pri_snprintf(buf, used, buf_size, "Q931 TX: %d\n", ctrl->q931_txcount);
@@ -1690,7 +1686,6 @@
 		used = pri_snprintf(buf, used, buf_size, "Q921 Outstanding: %u (TEI=%d)\n",
 			q921outstanding, link->tei);
 	}
-#endif
 #if 0
 	used = pri_snprintf(buf, used, buf_size, "Window Length: %d/%d\n",
 		ctrl->timers[PRI_TIMER_K], ctrl->window);

Modified: branches/1.4/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri_internal.h?view=diff&rev=2183&r1=2182&r2=2183
==============================================================================
--- branches/1.4/pri_internal.h (original)
+++ branches/1.4/pri_internal.h Mon Jan 31 18:37:49 2011
@@ -135,13 +135,11 @@
 	struct q931_call **callpool;
 	struct q931_call *localpool;
 
-#ifdef LIBPRI_COUNTERS
 	/* q921/q931 packet counters */
 	unsigned int q921_txcount;
 	unsigned int q921_rxcount;
 	unsigned int q931_txcount;
 	unsigned int q931_rxcount;
-#endif
 
 	short last_invoke;	/* Last ROSE invoke ID (Valid in master record only) */
 

Modified: branches/1.4/q921.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q921.c?view=diff&rev=2183&r1=2182&r2=2183
==============================================================================
--- branches/1.4/q921.c (original)
+++ branches/1.4/q921.c Mon Jan 31 18:37:49 2011
@@ -183,9 +183,7 @@
 		return 0;
 	}
 #endif
-#ifdef LIBPRI_COUNTERS
 	ctrl->q921_txcount++;
-#endif
 	/* Just send it raw */
 	if (ctrl->debug & (PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_RAW))
 		q921_dump(ctrl, h, len, ctrl->debug & PRI_DEBUG_Q921_RAW, 1);
@@ -2959,9 +2957,7 @@
 {
 	pri_event *e;
 	e = __q921_receive(ctrl, h, len);
-#ifdef LIBPRI_COUNTERS
 	ctrl->q921_rxcount++;
-#endif
 	return e;
 }
 

Modified: branches/1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q931.c?view=diff&rev=2183&r1=2182&r2=2183
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Mon Jan 31 18:37:49 2011
@@ -4536,9 +4536,7 @@
 	struct pri *ctrl;
 
 	ctrl = link->ctrl;
-#ifdef LIBPRI_COUNTERS
 	ctrl->q931_txcount++;
-#endif
 	if (uiframe) {
 		if (link->tei != Q921_TEI_GROUP) {
 			pri_error(ctrl, "Huh?! Attempting to send UI-frame on TEI %d\n", link->tei);
@@ -6692,9 +6690,7 @@
 
 	ctrl = link->ctrl;
 	memset(last_ie, 0, sizeof(last_ie));
-#ifdef LIBPRI_COUNTERS
 	ctrl->q931_rxcount++;
-#endif
 	if (len < 3 || len < 3 + h->crlen) {
 		/* Message too short for supported protocols. */
 		return -1;




More information about the libpri-commits mailing list