diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-02-28 13:08:01 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-02-28 13:08:01 +0000 |
commit | 3cc4bf517f4eb7f5ab0dd9e02cf7a7bc3106e1ff (patch) | |
tree | 6743514de65bc3ba99cd1f94634940c6117d04ab /src/input/misdn.c | |
parent | 51f38457e54a9d8c50d7d77e9b7e92465475cf84 (diff) |
make hexdump return a 'char *' rather than printing by itself
Diffstat (limited to 'src/input/misdn.c')
-rw-r--r-- | src/input/misdn.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/input/misdn.c b/src/input/misdn.c index 8acf4c901..245df50d8 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -148,10 +148,7 @@ static int handle_ts1_read(struct bsc_fd *bfd) break; case DL_DATA_IND: msg->l2h = msg->data + MISDN_HEADER_LEN; - if (debug_mask & DMI) { - fprintf(stdout, "RX: "); - hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN); - } + DEBUGP(DMI, "RX: %s\n", hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN)); ret = e1inp_rx_ts(e1i_ts, msg, l2addr.tei, l2addr.sapi); break; default: @@ -185,10 +182,8 @@ static int handle_ts1_write(struct bsc_fd *bfd) hh = (struct mISDNhead *) msgb_push(msg, sizeof(*hh)); hh->prim = DL_DATA_REQ; - if (debug_mask & DMI) { - fprintf(stdout, "TX TEI(%d): ", sign_link->tei); - hexdump(l2_data, msg->len - MISDN_HEADER_LEN); - } + DEBUGP(DMI, "TX TEI(%d): %s\n", sign_link->tei, + hexdump(l2_data, msg->len - MISDN_HEADER_LEN)); /* construct the sockaddr */ sa.family = AF_ISDN; @@ -223,10 +218,8 @@ static int handle_tsX_write(struct bsc_fd *bfd) subchan_mux_out(mx, tx_buf+sizeof(*hh), BCHAN_TX_GRAN); - if (debug_mask & DMIB) { - fprintf(stdout, "BCHAN TX: "); - hexdump(tx_buf+sizeof(*hh), BCHAN_TX_GRAN); - } + DEBUGP(DMIB, "BCHAN TX: %s\n", + hexdump(tx_buf+sizeof(*hh), BCHAN_TX_GRAN)); ret = send(bfd->fd, tx_buf, sizeof(*hh) + BCHAN_TX_GRAN, 0); if (ret < sizeof(*hh) + BCHAN_TX_GRAN) @@ -266,10 +259,8 @@ static int handle_tsX_read(struct bsc_fd *bfd) switch (hh->prim) { case PH_DATA_IND: msg->l2h = msg->data + MISDN_HEADER_LEN; - if (debug_mask & DMIB) { - fprintf(stdout, "BCHAN RX: "); - hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN); - } + DEBUGP(DMIB, "BCHAN RX: %s\n", + hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN)); ret = e1inp_rx_ts(e1i_ts, msg, 0, 0); break; case PH_ACTIVATE_IND: |