9
0
Fork 0

log: Improve some logging messages across several files.

This commit is contained in:
Holger Hans Peter Freyther 2011-02-17 18:18:22 +01:00
parent 7c6feca7cf
commit 5e5758c783
2 changed files with 21 additions and 16 deletions

View File

@ -266,7 +266,7 @@ static int linkset_up(struct mtp_link *link)
set->linkset_up = 1; set->linkset_up = 1;
LOGP(DINP, LOGL_NOTICE, LOGP(DINP, LOGL_NOTICE,
"The linkset %s is considered running.\n", set->name); "The linkset %d/%s is considered running.\n", set->nr, set->name);
return 0; return 0;
} }
@ -289,9 +289,9 @@ static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *
case MTP_TRF_RESTR_MSG_GRP: case MTP_TRF_RESTR_MSG_GRP:
switch (cmn->h1) { switch (cmn->h1) {
case MTP_RESTR_MSG_ALLWED: case MTP_RESTR_MSG_ALLWED:
LOGP(DINP, LOGL_INFO, "Received Restart Allowed. SST could be next: %s.\n", link->name); LOGP(DINP, LOGL_INFO, "Received Restart Allowed. SST could be next on %d/%s.\n", link->nr, link->name);
link->sccp_up = 1; link->sccp_up = 1;
LOGP(DINP, LOGL_INFO, "SCCP traffic allowed on %s.\n", link->name); LOGP(DINP, LOGL_INFO, "SCCP traffic allowed on %d/%s.\n", link->nr, link->name);
return 0; return 0;
break; break;
} }
@ -300,20 +300,23 @@ static int mtp_link_sign_msg(struct mtp_link_set *link, struct mtp_level_3_hdr *
switch (cmn->h1) { switch (cmn->h1) {
case MTP_PROHIBIT_MSG_SIG: case MTP_PROHIBIT_MSG_SIG:
if (l3_len < 3) { if (l3_len < 3) {
LOGP(DINP, LOGL_ERROR, "TFP is too short.\n"); LOGP(DINP, LOGL_ERROR, "TFP is too short on %d/%s.\n", link->nr, link->name);
return -1; return -1;
} }
apc = (uint16_t *) &hdr->data[1]; apc = (uint16_t *) &hdr->data[1];
LOGP(DINP, LOGL_INFO, LOGP(DINP, LOGL_INFO,
"TFP for the affected point code: %d\n", *apc); "TFP for the affected point code %d on %d/%s\n",
*apc, link->nr, link->name);
return 0; return 0;
break; break;
} }
break; break;
} }
LOGP(DINP, LOGL_ERROR, "Unknown message:%d/%d %s\n", cmn->h0, cmn->h1, hexdump(&hdr->data[0], l3_len)); LOGP(DINP, LOGL_ERROR, "Unknown message:%d/%d %s on %d/%s.\n",
cmn->h0, cmn->h1, hexdump(&hdr->data[0], l3_len),
link->nr, link->name);
return -1; return -1;
} }
@ -329,8 +332,8 @@ static int mtp_link_regular_msg(struct mtp_link *link, struct mtp_level_3_hdr *h
} }
if (MTP_ADDR_DPC(hdr->addr) != link->set->opc) { if (MTP_ADDR_DPC(hdr->addr) != link->set->opc) {
LOGP(DINP, LOGL_ERROR, "MSG for 0x%x not handled by 0x%x\n", LOGP(DINP, LOGL_ERROR, "MSG for OPC %d not handled on %d/%s\n",
MTP_ADDR_DPC(hdr->addr), link->set->opc); MTP_ADDR_DPC(hdr->addr), link->set->nr, link->set->name);
return -1; return -1;
} }
@ -377,7 +380,8 @@ static int mtp_link_sccp_data(struct mtp_link_set *link, struct mtp_level_3_hdr
} }
if (!link->sccp_up) { if (!link->sccp_up) {
LOGP(DINP, LOGL_ERROR, "SCCP traffic is not allowed.\n"); LOGP(DINP, LOGL_ERROR, "SCCP traffic is not allowed on %d/%s\n",
link->nr, link->name);
return -1; return -1;
} }
@ -399,12 +403,12 @@ static int mtp_link_sccp_data(struct mtp_link_set *link, struct mtp_level_3_hdr
prt = (struct sccp_con_ctrl_prt_mgt *) &msg->l3h[0]; prt = (struct sccp_con_ctrl_prt_mgt *) &msg->l3h[0];
if (prt->apoc != MTP_MAKE_APOC(link->sccp_opc)) { if (prt->apoc != MTP_MAKE_APOC(link->sccp_opc)) {
LOGP(DINP, LOGL_ERROR, "Unknown APOC: %u/%u\n", LOGP(DINP, LOGL_ERROR, "Unknown APOC: %u/%u on %d/%s\n",
ntohs(prt->apoc), prt->apoc); ntohs(prt->apoc), prt->apoc, link->nr, link->name);
type = SCCP_SSP; type = SCCP_SSP;
} else if (!link->supported_ssn[prt->assn]) { } else if (!link->supported_ssn[prt->assn]) {
LOGP(DINP, LOGL_ERROR, "Unknown affected SSN assn: %u\n", LOGP(DINP, LOGL_ERROR, "Unknown affected SSN assn: %u on %d/%s\n",
prt->assn); prt->assn, link->nr, link->name);
type = SCCP_SSP; type = SCCP_SSP;
} else { } else {
type = SCCP_SSA; type = SCCP_SSA;
@ -435,7 +439,7 @@ int mtp_link_set_data(struct mtp_link *link, struct msgb *msg)
if (!link->set->running) { if (!link->set->running) {
LOGP(DINP, LOGL_ERROR, LOGP(DINP, LOGL_ERROR,
"Link %d/%s of Linkse %d/%s is not running. Call mtp_link_reset first.\n", "Link %d/%s of %d/%s is not running. Call mtp_link_reset first.\n",
link->nr, link->name, link->set->nr, link->set->name); link->nr, link->name, link->set->nr, link->set->name);
return -1; return -1;
} }
@ -473,7 +477,8 @@ int mtp_link_set_submit_sccp_data(struct mtp_link_set *link, int sls, const uint
{ {
if (!link->sccp_up) { if (!link->sccp_up) {
LOGP(DINP, LOGL_ERROR, "SCCP msg after TRA and before SSA. Dropping it.\n"); LOGP(DINP, LOGL_ERROR, "SCCP msg after TRA and before SSA. Dropping it on %d/%s\n",
link->nr, link->name);
return -1; return -1;
} }

View File

@ -541,7 +541,7 @@ static int m2ua_conn_read(struct bsc_fd *fd)
} }
msgb_put(msg, rc); msgb_put(msg, rc);
LOGP(DINP, LOGL_NOTICE, "Read %d on stream: %d ssn: %d assoc: %d\n", LOGP(DINP, LOGL_DEBUG, "Read %d on stream: %d ssn: %d assoc: %d\n",
rc, info.sinfo_stream, info.sinfo_ssn, info.sinfo_assoc_id); rc, info.sinfo_stream, info.sinfo_ssn, info.sinfo_assoc_id);
m2ua_conn_handle(fd->data, msg, &info); m2ua_conn_handle(fd->data, msg, &info);
msgb_free(msg); msgb_free(msg);