diff --git a/Makefile b/Makefile index 0e849f0..2096654 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,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 AWK=awk @@ -93,7 +90,7 @@ DYNAMIC_OBJS= \ 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 diff --git a/pri.c b/pri.c index 1288f58..854001b 100644 --- a/pri.c +++ b/pri.c @@ -476,12 +476,11 @@ static struct pri *pri_ctrl_new(int fd, int node, int switchtype, pri_io_cb rd, 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 *pri_dump_info_str(struct pri *ctrl) 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 @@ char *pri_dump_info_str(struct pri *ctrl) 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 @@ char *pri_dump_info_str(struct pri *ctrl) 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); diff --git a/pri_internal.h b/pri_internal.h index 6504c61..e496b98 100644 --- a/pri_internal.h +++ b/pri_internal.h @@ -135,13 +135,11 @@ struct pri { 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) */ diff --git a/q921.c b/q921.c index 28a2e14..095e91d 100644 --- a/q921.c +++ b/q921.c @@ -183,9 +183,7 @@ static int q921_transmit(struct pri *ctrl, q921_h *h, int len) 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 *q921_receive(struct pri *ctrl, q921_h *h, int len) { pri_event *e; e = __q921_receive(ctrl, h, len); -#ifdef LIBPRI_COUNTERS ctrl->q921_rxcount++; -#endif return e; } diff --git a/q931.c b/q931.c index 9e3c4ab..35eb01a 100644 --- a/q931.c +++ b/q931.c @@ -4536,9 +4536,7 @@ static void q931_xmit(struct q921_link *link, q931_h *h, int len, int cr, int ui 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 @@ int q931_receive(struct q921_link *link, q931_h *h, int len) 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;