[nat] Use and print the connection type of a SCCP connection.
This commit is contained in:
parent
19c0a84fb8
commit
234d31218f
|
@ -124,6 +124,9 @@ struct sccp_connections {
|
||||||
struct sccp_source_reference remote_ref;
|
struct sccp_source_reference remote_ref;
|
||||||
int has_remote_ref;
|
int has_remote_ref;
|
||||||
|
|
||||||
|
/* status */
|
||||||
|
int con_type;
|
||||||
|
|
||||||
/* GSM audio handling. That is 32 * multiplex + ts */
|
/* GSM audio handling. That is 32 * multiplex + ts */
|
||||||
int crcx;
|
int crcx;
|
||||||
int msc_timeslot;
|
int msc_timeslot;
|
||||||
|
@ -254,6 +257,8 @@ void bsc_nat_set_msc_ip(struct bsc_nat *bsc, const char *ip);
|
||||||
void sccp_connection_destroy(struct sccp_connections *);
|
void sccp_connection_destroy(struct sccp_connections *);
|
||||||
void bsc_close_connection(struct bsc_connection *);
|
void bsc_close_connection(struct bsc_connection *);
|
||||||
|
|
||||||
|
const char *bsc_con_type_to_string(int type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parse the given message into the above structure
|
* parse the given message into the above structure
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -611,6 +611,7 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
|
||||||
if (create_sccp_src_ref(bsc, msg, parsed) != 0)
|
if (create_sccp_src_ref(bsc, msg, parsed) != 0)
|
||||||
goto exit2;
|
goto exit2;
|
||||||
con = patch_sccp_src_ref_to_msc(msg, parsed, bsc);
|
con = patch_sccp_src_ref_to_msc(msg, parsed, bsc);
|
||||||
|
con->con_type = con_type;
|
||||||
break;
|
break;
|
||||||
case SCCP_MSG_TYPE_RLSD:
|
case SCCP_MSG_TYPE_RLSD:
|
||||||
case SCCP_MSG_TYPE_CREF:
|
case SCCP_MSG_TYPE_CREF:
|
||||||
|
|
|
@ -389,3 +389,16 @@ void bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **
|
||||||
regcomp(reg, argv[0], 0);
|
regcomp(reg, argv[0], 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *con_types [] = {
|
||||||
|
[NAT_CON_TYPE_NONE] = "n/a",
|
||||||
|
[NAT_CON_TYPE_LU] = "Location Update",
|
||||||
|
[NAT_CON_TYPE_CM_SERV_REQ] = "CM Serv Req",
|
||||||
|
[NAT_CON_TYPE_PAG_RESP] = "Paging Response",
|
||||||
|
[NAT_CON_TYPE_OTHER] = "Other",
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *bsc_con_type_to_string(int type)
|
||||||
|
{
|
||||||
|
return con_types[type];
|
||||||
|
}
|
|
@ -95,7 +95,7 @@ DEFUN(show_sccp, show_sccp_cmd, "show sccp connections",
|
||||||
vty_out(vty, "Listing all opening SCCP connections%s", VTY_NEWLINE);
|
vty_out(vty, "Listing all opening SCCP connections%s", VTY_NEWLINE);
|
||||||
|
|
||||||
llist_for_each_entry(con, &_nat->sccp_connections, list_entry) {
|
llist_for_each_entry(con, &_nat->sccp_connections, list_entry) {
|
||||||
vty_out(vty, "For BSC Nr: %d lac: %d; BSC ref: 0x%x; MUX ref: 0x%x; Network has ref: %d ref: 0x%x MSC/BSC mux: 0x%x/0x%x%s",
|
vty_out(vty, "For BSC Nr: %d lac: %d; BSC ref: 0x%x; MUX ref: 0x%x; Network has ref: %d ref: 0x%x MSC/BSC mux: 0x%x/0x%x type: %s%s",
|
||||||
con->bsc->cfg ? con->bsc->cfg->nr : -1,
|
con->bsc->cfg ? con->bsc->cfg->nr : -1,
|
||||||
con->bsc->cfg ? con->bsc->cfg->lac : -1,
|
con->bsc->cfg ? con->bsc->cfg->lac : -1,
|
||||||
sccp_src_ref_to_int(&con->real_ref),
|
sccp_src_ref_to_int(&con->real_ref),
|
||||||
|
@ -103,6 +103,7 @@ DEFUN(show_sccp, show_sccp_cmd, "show sccp connections",
|
||||||
con->has_remote_ref,
|
con->has_remote_ref,
|
||||||
sccp_src_ref_to_int(&con->remote_ref),
|
sccp_src_ref_to_int(&con->remote_ref),
|
||||||
con->msc_timeslot, con->bsc_timeslot,
|
con->msc_timeslot, con->bsc_timeslot,
|
||||||
|
bsc_con_type_to_string(con->con_type),
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue