[svn-commits] rmudgett: branch 1.4 r901 - /branches/1.4/libpri.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 25 12:35:27 CDT 2009


Author: rmudgett
Date: Thu Jun 25 12:35:23 2009
New Revision: 901

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=901
Log:
Convert PRI_TIMER_xxx to an enum so PRI_MAX_TIMERS can be automatically adjusted.

Modified:
    branches/1.4/libpri.h

Modified: branches/1.4/libpri.h
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/libpri.h?view=diff&rev=901&r1=900&r2=901
==============================================================================
--- branches/1.4/libpri.h (original)
+++ branches/1.4/libpri.h Thu Jun 25 12:35:23 2009
@@ -722,41 +722,46 @@
 int pri_get_timer(struct pri *pri, int timer);
 int pri_timer2idx(const char *timer_name);
 
-#define PRI_MAX_TIMERS 32
-
-#define PRI_TIMER_N200	0	/* Maximum numer of q921 retransmissions */
-#define PRI_TIMER_N201	1	/* Maximum numer of octets in an information field */
-#define PRI_TIMER_N202	2	/* Maximum numer of transmissions of the TEI identity request message */
-#define PRI_TIMER_K		3	/* Maximum number of outstanding I-frames */
-
-#define PRI_TIMER_T200	4	/* time between SABME's */
-#define PRI_TIMER_T201	5	/* minimum time between retransmissions of the TEI Identity check messages */
-#define PRI_TIMER_T202	6	/* minimum time between transmission of TEI Identity request messages */
-#define PRI_TIMER_T203	7	/* maximum time without exchanging packets */
-
-#define PRI_TIMER_T300	8	
-#define PRI_TIMER_T301	9	/* maximum time to respond to an ALERT */
-#define PRI_TIMER_T302	10
-#define PRI_TIMER_T303	11	/* maximum time to wait after sending a SETUP without a response */
-#define PRI_TIMER_T304	12
-#define PRI_TIMER_T305	13
-#define PRI_TIMER_T306	14
-#define PRI_TIMER_T307	15
-#define PRI_TIMER_T308	16
-#define PRI_TIMER_T309	17
-#define PRI_TIMER_T310	18	/* maximum time between receiving a CALLPROCEEDING and receiving a ALERT/CONNECT/DISCONNECT/PROGRESS */
-#define PRI_TIMER_T313	19
-#define PRI_TIMER_T314	20
-#define PRI_TIMER_T316	21	/* maximum time between transmitting a RESTART and receiving a RESTART ACK */
-#define PRI_TIMER_T317	22
-#define PRI_TIMER_T318	23
-#define PRI_TIMER_T319	24
-#define PRI_TIMER_T320	25
-#define PRI_TIMER_T321	26
-#define PRI_TIMER_T322	27
-
-#define PRI_TIMER_TM20	28	/* maximum time awaiting XID response */
-#define PRI_TIMER_NM20	29	/* number of XID retransmits */
+/* New configurable timers and counters must be added to the end of the list */
+enum PRI_TIMERS_AND_COUNTERS {
+	PRI_TIMER_N200,	/* Maximum numer of Q.921 retransmissions */
+	PRI_TIMER_N201,	/* Maximum numer of octets in an information field */
+	PRI_TIMER_N202,	/* Maximum numer of transmissions of the TEI identity request message */
+	PRI_TIMER_K,	/* Maximum number of outstanding I-frames */
+
+	PRI_TIMER_T200,	/* Time between SABME's */
+	PRI_TIMER_T201,	/* Minimum time between retransmissions of the TEI Identity check messages */
+	PRI_TIMER_T202,	/* Minimum time between transmission of TEI Identity request messages */
+	PRI_TIMER_T203,	/* Maximum time without exchanging packets */
+
+	PRI_TIMER_T300,
+	PRI_TIMER_T301,	/* Maximum time to respond to an ALERT */
+	PRI_TIMER_T302,
+	PRI_TIMER_T303,	/* Maximum time to wait after sending a SETUP without a response */
+	PRI_TIMER_T304,
+	PRI_TIMER_T305,	/* Wait for DISCONNECT acknowledge */
+	PRI_TIMER_T306,
+	PRI_TIMER_T307,
+	PRI_TIMER_T308,	/* Wait for RELEASE acknowledge */
+	PRI_TIMER_T309,	/* Time active calls can tollerate data link layer being down before clearing. */
+	PRI_TIMER_T310,	/* Maximum time between receiving a CALL_PROCEEDING and receiving a ALERT/CONNECT/DISCONNECT/PROGRESS */
+	PRI_TIMER_T313,	/* Wait for CONNECT acknowledge, CPE side only */
+	PRI_TIMER_T314,
+	PRI_TIMER_T316,	/* Maximum time between transmitting a RESTART and receiving a RESTART ACK */
+	PRI_TIMER_T317,
+	PRI_TIMER_T318,
+	PRI_TIMER_T319,
+	PRI_TIMER_T320,
+	PRI_TIMER_T321,
+	PRI_TIMER_T322,
+
+	PRI_TIMER_TM20,	/* Maximum time awaiting XID response */
+	PRI_TIMER_NM20,	/* Number of XID retransmits */
+
+	/* Must be last in the enum list */
+	_PRI_MAX_TIMERS,
+	PRI_MAX_TIMERS = (_PRI_MAX_TIMERS < 32) ? 32 : _PRI_MAX_TIMERS
+};
 
 /* Get PRI version */
 const char *pri_get_version(void);




More information about the svn-commits mailing list