mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-03 21:43:32 +00:00
[gprs] Add new 'NS' and 'BSSGP' logging categories
This commit is contained in:
@@ -30,6 +30,8 @@ enum {
|
|||||||
DDB,
|
DDB,
|
||||||
DREF,
|
DREF,
|
||||||
DGPRS,
|
DGPRS,
|
||||||
|
DNS,
|
||||||
|
DBSSGP,
|
||||||
Debug_LastEntry,
|
Debug_LastEntry,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,16 @@ static const struct log_info_cat default_categories[] = {
|
|||||||
.description = "GPRS Packet Service",
|
.description = "GPRS Packet Service",
|
||||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||||
},
|
},
|
||||||
|
[DNS] = {
|
||||||
|
.name = "DNS",
|
||||||
|
.description = "GPRS Network Service",
|
||||||
|
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||||
|
},
|
||||||
|
[DBSSGP] = {
|
||||||
|
.name = "DBSSGP",
|
||||||
|
.description = "GPRS BSSGP Protocol",
|
||||||
|
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum log_ctxt {
|
enum log_ctxt {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg)
|
|||||||
struct bssgp_normal_hdr *bgph =
|
struct bssgp_normal_hdr *bgph =
|
||||||
(struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph));
|
(struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph));
|
||||||
|
|
||||||
DEBUGPC(DGPRS, "BSSGP: TX STATUS, cause=%s\n", bssgp_cause_str(cause));
|
DEBUGPC(DBSSGP, "BSSGP: TX STATUS, cause=%s\n", bssgp_cause_str(cause));
|
||||||
msgb_nsei(msg) = msgb_nsei(orig_msg);
|
msgb_nsei(msg) = msgb_nsei(orig_msg);
|
||||||
msgb_bvci(msg) = 0;
|
msgb_bvci(msg) = 0;
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ static int bssgp_rx_bvc_reset(struct msgb *msg, struct tlv_parsed *tp,
|
|||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI));
|
bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI));
|
||||||
DEBUGPC(DGPRS, "BVCI=%u, cause=%s\n", bvci,
|
DEBUGPC(DBSSGP, "BVCI=%u, cause=%s\n", bvci,
|
||||||
bssgp_cause_str(*TLVP_VAL(tp, BSSGP_IE_CAUSE)));
|
bssgp_cause_str(*TLVP_VAL(tp, BSSGP_IE_CAUSE)));
|
||||||
|
|
||||||
/* look-up or create the BTS context for this BVC */
|
/* look-up or create the BTS context for this BVC */
|
||||||
@@ -235,14 +235,14 @@ static int bssgp_rx_bvc_reset(struct msgb *msg, struct tlv_parsed *tp,
|
|||||||
* informs us about its RAC + Cell ID, so we can create a mapping */
|
* informs us about its RAC + Cell ID, so we can create a mapping */
|
||||||
if (bvci != 0 && bvci != 1) {
|
if (bvci != 0 && bvci != 1) {
|
||||||
if (!TLVP_PRESENT(tp, BSSGP_IE_CELL_ID)) {
|
if (!TLVP_PRESENT(tp, BSSGP_IE_CELL_ID)) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "BSSGP RESET BVCI=%u "
|
LOGP(DBSSGP, LOGL_ERROR, "BSSGP RESET BVCI=%u "
|
||||||
"missing mandatory IE\n", bvci);
|
"missing mandatory IE\n", bvci);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
/* actually extract RAC / CID */
|
/* actually extract RAC / CID */
|
||||||
bctx->cell_id = bssgp_parse_cell_id(&bctx->ra_id,
|
bctx->cell_id = bssgp_parse_cell_id(&bctx->ra_id,
|
||||||
TLVP_VAL(tp, BSSGP_IE_CELL_ID));
|
TLVP_VAL(tp, BSSGP_IE_CELL_ID));
|
||||||
LOGP(DGPRS, LOGL_NOTICE, "Cell %u-%u-%u-%u CI %u on BVCI %u\n",
|
LOGP(DBSSGP, LOGL_NOTICE, "Cell %u-%u-%u-%u CI %u on BVCI %u\n",
|
||||||
bctx->ra_id.mcc, bctx->ra_id.mnc, bctx->ra_id.lac,
|
bctx->ra_id.mcc, bctx->ra_id.mnc, bctx->ra_id.lac,
|
||||||
bctx->ra_id.rac, bctx->cell_id, bvci);
|
bctx->ra_id.rac, bctx->cell_id, bvci);
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ static int bssgp_rx_ul_ud(struct msgb *msg)
|
|||||||
struct tlv_parsed tp;
|
struct tlv_parsed tp;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DEBUGP(DGPRS, "BSSGP UL-UD\n");
|
DEBUGP(DBSSGP, "BSSGP UL-UD\n");
|
||||||
|
|
||||||
/* extract TLLI and parse TLV IEs */
|
/* extract TLLI and parse TLV IEs */
|
||||||
msgb_tlli(msg) = ntohl(budh->tlli);
|
msgb_tlli(msg) = ntohl(budh->tlli);
|
||||||
@@ -289,7 +289,7 @@ static int bssgp_rx_suspend(struct msgb *msg)
|
|||||||
struct tlv_parsed tp;
|
struct tlv_parsed tp;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DEBUGP(DGPRS, "BSSGP SUSPEND\n");
|
DEBUGP(DBSSGP, "BSSGP SUSPEND\n");
|
||||||
|
|
||||||
rc = bssgp_tlv_parse(&tp, bgph->data, data_len);
|
rc = bssgp_tlv_parse(&tp, bgph->data, data_len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
@@ -311,7 +311,7 @@ static int bssgp_rx_resume(struct msgb *msg)
|
|||||||
struct tlv_parsed tp;
|
struct tlv_parsed tp;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DEBUGP(DGPRS, "BSSGP RESUME\n");
|
DEBUGP(DBSSGP, "BSSGP RESUME\n");
|
||||||
|
|
||||||
rc = bssgp_tlv_parse(&tp, bgph->data, data_len);
|
rc = bssgp_tlv_parse(&tp, bgph->data, data_len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
@@ -329,7 +329,7 @@ static int bssgp_rx_resume(struct msgb *msg)
|
|||||||
static int bssgp_rx_fc_bvc(struct msgb *msg, struct tlv_parsed *tp)
|
static int bssgp_rx_fc_bvc(struct msgb *msg, struct tlv_parsed *tp)
|
||||||
{
|
{
|
||||||
|
|
||||||
DEBUGP(DGPRS, "BSSGP FC BVC\n");
|
DEBUGP(DBSSGP, "BSSGP FC BVC\n");
|
||||||
|
|
||||||
if (!TLVP_PRESENT(tp, BSSGP_IE_TAG) ||
|
if (!TLVP_PRESENT(tp, BSSGP_IE_TAG) ||
|
||||||
!TLVP_PRESENT(tp, BSSGP_IE_BVC_BUCKET_SIZE) ||
|
!TLVP_PRESENT(tp, BSSGP_IE_BVC_BUCKET_SIZE) ||
|
||||||
@@ -371,11 +371,11 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
|
|||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_RA_CAPABILITY:
|
case BSSGP_PDUT_RA_CAPABILITY:
|
||||||
/* BSS requests RA capability or IMSI */
|
/* BSS requests RA capability or IMSI */
|
||||||
DEBUGP(DGPRS, "BSSGP RA CAPABILITY UPDATE\n");
|
DEBUGP(DBSSGP, "BSSGP RA CAPABILITY UPDATE\n");
|
||||||
/* FIXME: send RA_CAPA_UPDATE_ACK */
|
/* FIXME: send RA_CAPA_UPDATE_ACK */
|
||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_RADIO_STATUS:
|
case BSSGP_PDUT_RADIO_STATUS:
|
||||||
DEBUGP(DGPRS, "BSSGP RADIO STATUS\n");
|
DEBUGP(DBSSGP, "BSSGP RADIO STATUS\n");
|
||||||
/* BSS informs us of some exception */
|
/* BSS informs us of some exception */
|
||||||
/* FIXME: notify GMM */
|
/* FIXME: notify GMM */
|
||||||
break;
|
break;
|
||||||
@@ -389,13 +389,13 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
|
|||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_FLUSH_LL:
|
case BSSGP_PDUT_FLUSH_LL:
|
||||||
/* BSS informs MS has moved to one cell to other cell */
|
/* BSS informs MS has moved to one cell to other cell */
|
||||||
DEBUGP(DGPRS, "BSSGP FLUSH LL\n");
|
DEBUGP(DBSSGP, "BSSGP FLUSH LL\n");
|
||||||
/* FIXME: notify GMM */
|
/* FIXME: notify GMM */
|
||||||
/* Send FLUSH_LL_ACK */
|
/* Send FLUSH_LL_ACK */
|
||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_LLC_DISCARD:
|
case BSSGP_PDUT_LLC_DISCARD:
|
||||||
/* BSS informs that some LLC PDU's have been discarded */
|
/* BSS informs that some LLC PDU's have been discarded */
|
||||||
DEBUGP(DGPRS, "BSSGP LLC DISCARDED\n");
|
DEBUGP(DBSSGP, "BSSGP LLC DISCARDED\n");
|
||||||
/* FIXME: notify GMM */
|
/* FIXME: notify GMM */
|
||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_FLOW_CONTROL_BVC:
|
case BSSGP_PDUT_FLOW_CONTROL_BVC:
|
||||||
@@ -404,18 +404,18 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
|
|||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_FLOW_CONTROL_MS:
|
case BSSGP_PDUT_FLOW_CONTROL_MS:
|
||||||
/* BSS informs us of available bandwidth to one MS */
|
/* BSS informs us of available bandwidth to one MS */
|
||||||
DEBUGP(DGPRS, "BSSGP FC MS\n");
|
DEBUGP(DBSSGP, "BSSGP FC MS\n");
|
||||||
/* FIXME: actually implement flow control */
|
/* FIXME: actually implement flow control */
|
||||||
/* FIXME: Send FLOW_CONTROL_MS_ACK */
|
/* FIXME: Send FLOW_CONTROL_MS_ACK */
|
||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_BVC_BLOCK:
|
case BSSGP_PDUT_BVC_BLOCK:
|
||||||
/* BSS tells us that BVC shall be blocked */
|
/* BSS tells us that BVC shall be blocked */
|
||||||
DEBUGP(DGPRS, "BSSGP BVC BLOCK ");
|
DEBUGP(DBSSGP, "BSSGP BVC BLOCK ");
|
||||||
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI) ||
|
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI) ||
|
||||||
!TLVP_PRESENT(&tp, BSSGP_IE_CAUSE))
|
!TLVP_PRESENT(&tp, BSSGP_IE_CAUSE))
|
||||||
goto err_mand_ie;
|
goto err_mand_ie;
|
||||||
bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
||||||
DEBUGPC(DGPRS, "BVCI=%u, cause=%s\n", bvci,
|
DEBUGPC(DBSSGP, "BVCI=%u, cause=%s\n", bvci,
|
||||||
bssgp_cause_str(*TLVP_VAL(&tp, BSSGP_IE_CAUSE)));
|
bssgp_cause_str(*TLVP_VAL(&tp, BSSGP_IE_CAUSE)));
|
||||||
/* We always acknowledge the BLOCKing */
|
/* We always acknowledge the BLOCKing */
|
||||||
rc = bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK_ACK,
|
rc = bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK_ACK,
|
||||||
@@ -423,18 +423,18 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
|
|||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_BVC_UNBLOCK:
|
case BSSGP_PDUT_BVC_UNBLOCK:
|
||||||
/* BSS tells us that BVC shall be unblocked */
|
/* BSS tells us that BVC shall be unblocked */
|
||||||
DEBUGP(DGPRS, "BSSGP BVC UNBLOCK ");
|
DEBUGP(DBSSGP, "BSSGP BVC UNBLOCK ");
|
||||||
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
|
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
|
||||||
goto err_mand_ie;
|
goto err_mand_ie;
|
||||||
bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
||||||
DEBUGPC(DGPRS, "BVCI=%u\n", bvci);
|
DEBUGPC(DBSSGP, "BVCI=%u\n", bvci);
|
||||||
/* We always acknowledge the unBLOCKing */
|
/* We always acknowledge the unBLOCKing */
|
||||||
rc = bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_UNBLOCK_ACK,
|
rc = bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_UNBLOCK_ACK,
|
||||||
msgb_nsei(msg), bvci, ns_bvci);
|
msgb_nsei(msg), bvci, ns_bvci);
|
||||||
break;
|
break;
|
||||||
case BSSGP_PDUT_BVC_RESET:
|
case BSSGP_PDUT_BVC_RESET:
|
||||||
/* BSS tells us that BVC init is required */
|
/* BSS tells us that BVC init is required */
|
||||||
DEBUGP(DGPRS, "BSSGP BVC RESET ");
|
DEBUGP(DBSSGP, "BSSGP BVC RESET ");
|
||||||
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI) ||
|
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI) ||
|
||||||
!TLVP_PRESENT(&tp, BSSGP_IE_CAUSE))
|
!TLVP_PRESENT(&tp, BSSGP_IE_CAUSE))
|
||||||
goto err_mand_ie;
|
goto err_mand_ie;
|
||||||
@@ -448,7 +448,7 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
|
|||||||
case BSSGP_PDUT_CREATE_BSS_PFC_NACK:
|
case BSSGP_PDUT_CREATE_BSS_PFC_NACK:
|
||||||
case BSSGP_PDUT_MODIFY_BSS_PFC:
|
case BSSGP_PDUT_MODIFY_BSS_PFC:
|
||||||
case BSSGP_PDUT_DELETE_BSS_PFC_ACK:
|
case BSSGP_PDUT_DELETE_BSS_PFC_ACK:
|
||||||
DEBUGP(DGPRS, "BSSGP PDU type 0x%02x not [yet] implemented\n",
|
DEBUGP(DBSSGP, "BSSGP PDU type 0x%02x not [yet] implemented\n",
|
||||||
pdu_type);
|
pdu_type);
|
||||||
break;
|
break;
|
||||||
/* those only exist in the SGSN -> BSS direction */
|
/* those only exist in the SGSN -> BSS direction */
|
||||||
@@ -466,12 +466,12 @@ int gprs_bssgp_rcvmsg(struct msgb *msg)
|
|||||||
case BSSGP_PDUT_BVC_BLOCK_ACK:
|
case BSSGP_PDUT_BVC_BLOCK_ACK:
|
||||||
case BSSGP_PDUT_BVC_UNBLOCK_ACK:
|
case BSSGP_PDUT_BVC_UNBLOCK_ACK:
|
||||||
case BSSGP_PDUT_SGSN_INVOKE_TRACE:
|
case BSSGP_PDUT_SGSN_INVOKE_TRACE:
|
||||||
DEBUGP(DGPRS, "BSSGP PDU type 0x%02x only exists in DL\n",
|
DEBUGP(DBSSGP, "BSSGP PDU type 0x%02x only exists in DL\n",
|
||||||
pdu_type);
|
pdu_type);
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUGP(DGPRS, "BSSGP PDU type 0x%02x unknown\n", pdu_type);
|
DEBUGP(DBSSGP, "BSSGP PDU type 0x%02x unknown\n", pdu_type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ int gprs_bssgp_tx_dl_ud(struct msgb *msg)
|
|||||||
|
|
||||||
/* Identifiers from UP: TLLI, BVCI, NSEI (all in msgb->cb) */
|
/* Identifiers from UP: TLLI, BVCI, NSEI (all in msgb->cb) */
|
||||||
if (bvci < 2) {
|
if (bvci < 2) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "Cannot send DL-UD to BVCI %u\n",
|
LOGP(DBSSGP, LOGL_ERROR, "Cannot send DL-UD to BVCI %u\n",
|
||||||
bvci);
|
bvci);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ static int gprs_ns_tx(struct gprs_nsvc *nsvc, struct msgb *msg)
|
|||||||
ret = nsip_sendmsg(nsvc, msg);
|
ret = nsip_sendmsg(nsvc, msg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGP(DGPRS, LOGL_ERROR, "unsupported NS linklayer %u\n", nsvc->nsi->ll);
|
LOGP(DNS, LOGL_ERROR, "unsupported NS linklayer %u\n", nsvc->nsi->ll);
|
||||||
msgb_free(msg);
|
msgb_free(msg);
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
break;
|
break;
|
||||||
@@ -234,7 +234,7 @@ static void gprs_ns_timer_cb(void *data)
|
|||||||
if (nsvc->alive_retries > NS_ALIVE_RETRIES) {
|
if (nsvc->alive_retries > NS_ALIVE_RETRIES) {
|
||||||
/* mark as dead and blocked */
|
/* mark as dead and blocked */
|
||||||
nsvc->state = NSE_S_BLOCKED;
|
nsvc->state = NSE_S_BLOCKED;
|
||||||
DEBUGP(DGPRS, "NSEI=%u Tns-alive expired more then "
|
DEBUGP(DNS, "NSEI=%u Tns-alive expired more then "
|
||||||
"%u times, blocking NS-VC\n", nsvc->nsei,
|
"%u times, blocking NS-VC\n", nsvc->nsei,
|
||||||
NS_ALIVE_RETRIES);
|
NS_ALIVE_RETRIES);
|
||||||
/* FIXME: inform higher layers */
|
/* FIXME: inform higher layers */
|
||||||
@@ -273,7 +273,7 @@ static int gprs_ns_tx_reset_ack(struct gprs_nsvc *nsvc)
|
|||||||
|
|
||||||
nsh->pdu_type = NS_PDUT_RESET_ACK;
|
nsh->pdu_type = NS_PDUT_RESET_ACK;
|
||||||
|
|
||||||
DEBUGP(DGPRS, "NSEI=%u Tx NS RESET ACK (NSVCI=%u)\n",
|
DEBUGP(DNS, "NSEI=%u Tx NS RESET ACK (NSVCI=%u)\n",
|
||||||
nsvc->nsei, nsvc->nsvci);
|
nsvc->nsei, nsvc->nsvci);
|
||||||
|
|
||||||
msgb_tvlv_put(msg, NS_IE_VCI, 2, (uint8_t *)&nsvci);
|
msgb_tvlv_put(msg, NS_IE_VCI, 2, (uint8_t *)&nsvci);
|
||||||
@@ -291,25 +291,25 @@ int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
|
|||||||
|
|
||||||
nsvc = nsvc_by_nsei(nsi, msgb_nsei(msg));
|
nsvc = nsvc_by_nsei(nsi, msgb_nsei(msg));
|
||||||
if (!nsvc) {
|
if (!nsvc) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "Unable to resolve NSEI %u "
|
LOGP(DNS, LOGL_ERROR, "Unable to resolve NSEI %u "
|
||||||
"to NS-VC!\n", msgb_nsei(msg));
|
"to NS-VC!\n", msgb_nsei(msg));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(nsvc->state & NSE_S_ALIVE)) {
|
if (!(nsvc->state & NSE_S_ALIVE)) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "NSEI=%u is not alive, cannot send\n",
|
LOGP(DNS, LOGL_ERROR, "NSEI=%u is not alive, cannot send\n",
|
||||||
nsvc->nsei);
|
nsvc->nsei);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
if (nsvc->state & NSE_S_BLOCKED) {
|
if (nsvc->state & NSE_S_BLOCKED) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "NSEI=%u is blocked, cannot send\n",
|
LOGP(DNS, LOGL_ERROR, "NSEI=%u is blocked, cannot send\n",
|
||||||
nsvc->nsei);
|
nsvc->nsei);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsh = (struct gprs_ns_hdr *) msgb_push(msg, sizeof(*nsh) + 3);
|
nsh = (struct gprs_ns_hdr *) msgb_push(msg, sizeof(*nsh) + 3);
|
||||||
if (!nsh) {
|
if (!nsh) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "Not enough headroom for NS header\n");
|
LOGP(DNS, LOGL_ERROR, "Not enough headroom for NS header\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,17 +344,17 @@ static int gprs_ns_rx_status(struct gprs_nsvc *nsvc, struct msgb *msg)
|
|||||||
uint8_t cause;
|
uint8_t cause;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DEBUGP(DGPRS, "NSEI=%u NS STATUS ", nsvc->nsei);
|
DEBUGP(DNS, "NSEI=%u NS STATUS ", nsvc->nsei);
|
||||||
|
|
||||||
rc = tlv_parse(&tp, &ns_att_tlvdef, nsh->data, msgb_l2len(msg), 0, 0);
|
rc = tlv_parse(&tp, &ns_att_tlvdef, nsh->data, msgb_l2len(msg), 0, 0);
|
||||||
|
|
||||||
if (!TLVP_PRESENT(&tp, NS_IE_CAUSE)) {
|
if (!TLVP_PRESENT(&tp, NS_IE_CAUSE)) {
|
||||||
DEBUGPC(DGPRS, "missing cause IE\n");
|
DEBUGPC(DNS, "missing cause IE\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cause = *TLVP_VAL(&tp, NS_IE_CAUSE);
|
cause = *TLVP_VAL(&tp, NS_IE_CAUSE);
|
||||||
DEBUGPC(DGPRS, "cause=%s\n", gprs_ns_cause_str(cause));
|
DEBUGPC(DNS, "cause=%s\n", gprs_ns_cause_str(cause));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -374,7 +374,7 @@ static int gprs_ns_rx_reset(struct gprs_nsvc *nsvc, struct msgb *msg)
|
|||||||
!TLVP_PRESENT(&tp, NS_IE_VCI) ||
|
!TLVP_PRESENT(&tp, NS_IE_VCI) ||
|
||||||
!TLVP_PRESENT(&tp, NS_IE_NSEI)) {
|
!TLVP_PRESENT(&tp, NS_IE_NSEI)) {
|
||||||
/* FIXME: respond with NS_CAUSE_MISSING_ESSENT_IE */
|
/* FIXME: respond with NS_CAUSE_MISSING_ESSENT_IE */
|
||||||
LOGP(DGPRS, LOGL_ERROR, "NS RESET Missing mandatory IE\n");
|
LOGP(DNS, LOGL_ERROR, "NS RESET Missing mandatory IE\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ static int gprs_ns_rx_reset(struct gprs_nsvc *nsvc, struct msgb *msg)
|
|||||||
nsvci = (uint16_t *) TLVP_VAL(&tp, NS_IE_VCI);
|
nsvci = (uint16_t *) TLVP_VAL(&tp, NS_IE_VCI);
|
||||||
nsei = (uint16_t *) TLVP_VAL(&tp, NS_IE_NSEI);
|
nsei = (uint16_t *) TLVP_VAL(&tp, NS_IE_NSEI);
|
||||||
|
|
||||||
DEBUGP(DGPRS, "NSEI=%u NS RESET (NSVCI=%u, cause=%s)\n",
|
DEBUGP(DNS, "NSEI=%u NS RESET (NSVCI=%u, cause=%s)\n",
|
||||||
nsvc->nsvci, nsvc->nsei, gprs_ns_cause_str(*cause));
|
nsvc->nsvci, nsvc->nsei, gprs_ns_cause_str(*cause));
|
||||||
|
|
||||||
nsvc->state = NSE_S_BLOCKED | NSE_S_ALIVE;
|
nsvc->state = NSE_S_BLOCKED | NSE_S_ALIVE;
|
||||||
@@ -409,13 +409,13 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
|
|||||||
if (!nsvc) {
|
if (!nsvc) {
|
||||||
/* Only the RESET procedure creates a new NSVC */
|
/* Only the RESET procedure creates a new NSVC */
|
||||||
if (nsh->pdu_type != NS_PDUT_RESET) {
|
if (nsh->pdu_type != NS_PDUT_RESET) {
|
||||||
LOGP(DGPRS, LOGL_INFO, "Ignoring NS PDU type 0x%0x "
|
LOGP(DNS, LOGL_INFO, "Ignoring NS PDU type 0x%0x "
|
||||||
"from %s for non-existing NS-VC\n",
|
"from %s for non-existing NS-VC\n",
|
||||||
nsh->pdu_type, inet_ntoa(saddr->sin_addr));
|
nsh->pdu_type, inet_ntoa(saddr->sin_addr));
|
||||||
//gprs_ns_tx_reset(nsvc, NS_CAUSE_NSVC_UNKNOWN);
|
//gprs_ns_tx_reset(nsvc, NS_CAUSE_NSVC_UNKNOWN);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
LOGP(DGPRS, LOGL_INFO, "Creating NS-VC for BSS at %s:%u\n",
|
LOGP(DNS, LOGL_INFO, "Creating NS-VC for BSS at %s:%u\n",
|
||||||
inet_ntoa(saddr->sin_addr), ntohs(saddr->sin_port));
|
inet_ntoa(saddr->sin_addr), ntohs(saddr->sin_port));
|
||||||
nsvc = nsvc_create(nsi, 0xffff);
|
nsvc = nsvc_create(nsi, 0xffff);
|
||||||
nsvc->ip.bts_addr = *saddr;
|
nsvc->ip.bts_addr = *saddr;
|
||||||
@@ -450,7 +450,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
|
|||||||
rc = gprs_ns_rx_reset(nsvc, msg);
|
rc = gprs_ns_rx_reset(nsvc, msg);
|
||||||
break;
|
break;
|
||||||
case NS_PDUT_RESET_ACK:
|
case NS_PDUT_RESET_ACK:
|
||||||
DEBUGP(DGPRS, "NSEI=%u Rx NS RESET ACK\n", nsvc->nsei);
|
DEBUGP(DNS, "NSEI=%u Rx NS RESET ACK\n", nsvc->nsei);
|
||||||
/* mark remote NS-VC as blocked + active */
|
/* mark remote NS-VC as blocked + active */
|
||||||
nsvc->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE;
|
nsvc->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE;
|
||||||
if (nsvc->remote_end_is_sgsn) {
|
if (nsvc->remote_end_is_sgsn) {
|
||||||
@@ -465,29 +465,29 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
|
|||||||
break;
|
break;
|
||||||
case NS_PDUT_UNBLOCK:
|
case NS_PDUT_UNBLOCK:
|
||||||
/* Section 7.2: unblocking procedure */
|
/* Section 7.2: unblocking procedure */
|
||||||
DEBUGP(DGPRS, "NSEI=%u Rx NS UNBLOCK\n", nsvc->nsei);
|
DEBUGP(DNS, "NSEI=%u Rx NS UNBLOCK\n", nsvc->nsei);
|
||||||
nsvc->state &= ~NSE_S_BLOCKED;
|
nsvc->state &= ~NSE_S_BLOCKED;
|
||||||
rc = gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK_ACK);
|
rc = gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK_ACK);
|
||||||
break;
|
break;
|
||||||
case NS_PDUT_UNBLOCK_ACK:
|
case NS_PDUT_UNBLOCK_ACK:
|
||||||
DEBUGP(DGPRS, "NSEI=%u Rx NS UNBLOCK ACK\n", nsvc->nsei);
|
DEBUGP(DNS, "NSEI=%u Rx NS UNBLOCK ACK\n", nsvc->nsei);
|
||||||
/* mark remote NS-VC as unblocked + active */
|
/* mark remote NS-VC as unblocked + active */
|
||||||
nsvc->remote_state = NSE_S_ALIVE;
|
nsvc->remote_state = NSE_S_ALIVE;
|
||||||
if (nsvc->remote_end_is_sgsn)
|
if (nsvc->remote_end_is_sgsn)
|
||||||
nsvc->state = NSE_S_ALIVE;
|
nsvc->state = NSE_S_ALIVE;
|
||||||
break;
|
break;
|
||||||
case NS_PDUT_BLOCK:
|
case NS_PDUT_BLOCK:
|
||||||
DEBUGP(DGPRS, "NSEI=%u Rx NS BLOCK\n", nsvc->nsei);
|
DEBUGP(DNS, "NSEI=%u Rx NS BLOCK\n", nsvc->nsei);
|
||||||
nsvc->state |= NSE_S_BLOCKED;
|
nsvc->state |= NSE_S_BLOCKED;
|
||||||
rc = gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK_ACK);
|
rc = gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK_ACK);
|
||||||
break;
|
break;
|
||||||
case NS_PDUT_BLOCK_ACK:
|
case NS_PDUT_BLOCK_ACK:
|
||||||
DEBUGP(DGPRS, "NSEI=%u Rx NS BLOCK ACK\n", nsvc->nsei);
|
DEBUGP(DNS, "NSEI=%u Rx NS BLOCK ACK\n", nsvc->nsei);
|
||||||
/* mark remote NS-VC as blocked + active */
|
/* mark remote NS-VC as blocked + active */
|
||||||
nsvc->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE;
|
nsvc->remote_state = NSE_S_BLOCKED | NSE_S_ALIVE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUGP(DGPRS, "NSEI=%u Rx Unknown NS PDU type 0x%02x\n",
|
DEBUGP(DNS, "NSEI=%u Rx Unknown NS PDU type 0x%02x\n",
|
||||||
nsvc->nsei, nsh->pdu_type);
|
nsvc->nsei, nsh->pdu_type);
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
break;
|
break;
|
||||||
@@ -533,7 +533,7 @@ static struct msgb *read_nsip_msg(struct bsc_fd *bfd, int *error,
|
|||||||
ret = recvfrom(bfd->fd, msg->data, NS_ALLOC_SIZE, 0,
|
ret = recvfrom(bfd->fd, msg->data, NS_ALLOC_SIZE, 0,
|
||||||
(struct sockaddr *)saddr, &saddr_len);
|
(struct sockaddr *)saddr, &saddr_len);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "recv error %s during NSIP recv\n",
|
LOGP(DNS, LOGL_ERROR, "recv error %s during NSIP recv\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
msgb_free(msg);
|
msgb_free(msg);
|
||||||
*error = ret;
|
*error = ret;
|
||||||
@@ -634,7 +634,7 @@ struct gprs_nsvc *nsip_connect(struct gprs_ns_inst *nsi,
|
|||||||
|
|
||||||
/* Initiate a RESET procedure */
|
/* Initiate a RESET procedure */
|
||||||
if (gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION) < 0) {
|
if (gprs_ns_tx_reset(nsvc, NS_CAUSE_OM_INTERVENTION) < 0) {
|
||||||
LOGP(DGPRS, LOGL_ERROR, "NSEI=%u, error resetting NS-VC\n",
|
LOGP(DNS, LOGL_ERROR, "NSEI=%u, error resetting NS-VC\n",
|
||||||
nsei);
|
nsei);
|
||||||
}
|
}
|
||||||
/* run a timer and re-transmit the reset request? */
|
/* run a timer and re-transmit the reset request? */
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ DEFUN(logging_prnt_timestamp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: those have to be kept in sync with the log levels and categories */
|
/* FIXME: those have to be kept in sync with the log levels and categories */
|
||||||
#define VTY_DEBUG_CATEGORIES "(rll|cc|mm|rr|rsl|nm|sms|pag|mncc|inp|mi|mib|mux|meas|sccp|msc|mgcp|ho|db|ref|gprs)"
|
#define VTY_DEBUG_CATEGORIES "(rll|cc|mm|rr|rsl|nm|sms|pag|mncc|inp|mi|mib|mux|meas|sccp|msc|mgcp|ho|db|ref|gprs|ns|bssgp)"
|
||||||
#define VTY_DEBUG_LEVELS "(everything|debug|info|notice|error|fatal)"
|
#define VTY_DEBUG_LEVELS "(everything|debug|info|notice|error|fatal)"
|
||||||
DEFUN(logging_level,
|
DEFUN(logging_level,
|
||||||
logging_level_cmd,
|
logging_level_cmd,
|
||||||
|
|||||||
Reference in New Issue
Block a user