Revert jcdutton's changes which are not subject to be disclaimed

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@87 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Mark Spencer
2004-04-11 01:55:54 +00:00
parent 8da0a1e5a7
commit f2eb8afb7f
3 changed files with 7 additions and 23 deletions

View File

@@ -148,7 +148,7 @@ typedef enum q921_state {
} q921_state;
/* Dumps a *known good* Q.921 packet */
extern void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx);
extern void q921_dump(q921_h *h, int len, int showraw, int txrx);
/* Bring up the D-channel */
extern void q921_start(struct pri *pri, int now);

23
q921.c
View File

@@ -78,7 +78,7 @@ static int q921_transmit(struct pri *pri, q921_h *h, int len)
#endif
/* Just send it raw */
if (pri->debug & PRI_DEBUG_Q921_DUMP)
q921_dump(pri, h, len, pri->debug & PRI_DEBUG_Q921_RAW, 1);
q921_dump(h, len, pri->debug & PRI_DEBUG_Q921_RAW, 1);
/* Write an extra two bytes for the FCS */
res = write(pri->fd, h, len + 2);
if (res != (len + 2)) {
@@ -486,27 +486,13 @@ static pri_event *q921_handle_iframe(struct pri *pri, q921_i *i, int len)
return NULL;
}
void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx)
void q921_dump(q921_h *h, int len, int showraw, int txrx)
{
int x;
char *type;
char direction_tag;
char *cmd_rsp;
direction_tag = txrx ? '>' : '<';
/* If we are PRI_CPE: Use "Command" if we are transmitting and C/R bit is 0.
* Use "Response" if we are transmitting and C/R bit is 1.
* Use "Command" if we are receiving and C/R bit is 1.
* Use "Response" if we are receiving and C/R bit is 0.
*
* If we are PRI_NETWORK: Use "Command" if we are transmitting and C/R bit is 1.
* Use "Response" if we are transmitting and C/R bit is 0.
* Use "Command" if we are receiving and C/R bit is 0.
* Use "Response" if we are receiving and C/R bit is 1.
*/
cmd_rsp = (((pri->localtype == PRI_CPE)?0:1) ^ txrx ^ h->h.c_r) ? "Command" : "Response";
if (showraw) {
char *buf = malloc(len * 3 + 1);
int buflen = 0;
@@ -532,13 +518,12 @@ void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx)
}
pri_message(
"%c SAPI: %02d C/R: %d EA: %d [%s]\n"
"%c SAPI: %02d C/R: %d EA: %d\n"
"%c TEI: %03d EA: %d\n",
direction_tag,
h->h.sapi,
h->h.c_r,
h->h.ea1,
cmd_rsp,
direction_tag,
h->h.tei,
h->h.ea2);
@@ -701,7 +686,7 @@ static pri_event *__q921_receive(struct pri *pri, q921_h *h, int len)
len -= 2;
if (pri->debug & PRI_DEBUG_Q921_DUMP)
q921_dump(pri, h, len, pri->debug & PRI_DEBUG_Q921_RAW, 0);
q921_dump(h, len, pri->debug & PRI_DEBUG_Q921_RAW, 0);
/* Check some reject conditions -- Start by rejecting improper ea's */
if (h->h.ea1 || !(h->h.ea2))

5
q931.c
View File

@@ -1149,7 +1149,7 @@ static int transmit_cause(struct pri *pri, q931_call *call, int msgtype, q931_ie
static void dump_sending_complete(q931_ie *ie, int len, char prefix)
{
pri_message("%c Sending Complete.\n", prefix);
pri_message("%c Sending Complete (len=%2d)\n", prefix, ie->len);
}
static int receive_sending_complete(struct pri *pri, q931_call *call, int msgtype, q931_ie *ie, int len)
@@ -1410,8 +1410,7 @@ void q931_dump(q931_h *h, int len, int txrx)
int x=0, r;
c = txrx ? '>' : '<';
pri_message("%c Protocol Discriminator: %s (%d) len=%d\n", c, disc2str(h->pd), h->pd, len);
pri_message("%c Call Ref: len=%2d (reference %d/0x%X) (%s)\n",
c, h->crlen, q931_cr(h) & 0x7fff, q931_cr(h) & 0x7fff, (q931_cr(h) & 0x8000) ? "Terminator" : "Originator");
pri_message("%c Call Ref: len=%2d (reference %d/0x%X) (%s)\n", c, h->crlen, q931_cr(h), q931_cr(h), (h->crv[0] & 0x80) ? "Terminator" : "Originator");
/* Message header begins at the end of the call reference number */
mh = (q931_mh *)(h->contents + h->crlen);
pri_message("%c Message type: %s (%d)\n", c, msg2str(mh->msg), mh->msg);