aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-02 21:07:14 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-04 07:20:44 +0200
commit0c3eae0011af64f3fdf8619bfaf97bc459bc5c11 (patch)
tree4fda88d0a4019ce84c081da20279f109fd184b9f /openbsc
parentd60570991fd5a5454306752af8eb4b37c2ce5b6e (diff)
[gprs] GMM: print more details about PDP context activation request
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_04_08_gprs.h1
-rw-r--r--openbsc/src/gsm_04_08_gprs.c47
2 files changed, 44 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/gsm_04_08_gprs.h b/openbsc/include/openbsc/gsm_04_08_gprs.h
index 7f9aa76e1..86adea156 100644
--- a/openbsc/include/openbsc/gsm_04_08_gprs.h
+++ b/openbsc/include/openbsc/gsm_04_08_gprs.h
@@ -105,7 +105,6 @@ struct gsm48_attach_ack {
struct gsm48_act_pdp_ctx_req {
uint8_t req_nsapi;
uint8_t req_llc_sapi;
- uint8_t req_qos_lv[4];
uint8_t data[0];
} __attribute__((packed));
diff --git a/openbsc/src/gsm_04_08_gprs.c b/openbsc/src/gsm_04_08_gprs.c
index 8dc96a22a..c0fe45de2 100644
--- a/openbsc/src/gsm_04_08_gprs.c
+++ b/openbsc/src/gsm_04_08_gprs.c
@@ -555,7 +555,7 @@ static int gsm48_tx_gsm_act_pdp_acc(struct msgb *old_msg, struct gsm48_act_pdp_c
act_ack = (struct gsm48_act_pdp_ctx_ack *)
msgb_put(msg, sizeof(*act_ack));
act_ack->llc_sapi = req->req_llc_sapi;
- memcpy(act_ack->qos_lv, req->req_qos_lv, sizeof(act_ack->qos_lv));
+ memcpy(act_ack->qos_lv, req->data, sizeof(act_ack->qos_lv));
//act_ack->radio_prio = 4;
return gsm48_gmm_sendmsg(msg, 0);
@@ -586,10 +586,51 @@ static int gsm48_rx_gsm_act_pdp_req(struct msgb *msg)
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg);
struct gsm48_act_pdp_ctx_req *act_req = (struct gsm48_act_pdp_ctx_req *) gh->data;
uint8_t *pdp_addr_lv = act_req->data;
+ uint8_t req_qos_len, req_pdpa_len;
+ uint8_t *req_qos, *req_pdpa;
+ struct tlv_parsed tp;
+
+ DEBUGP(DMM, "ACTIVATE PDP CONTEXT REQ: ");
+ req_qos_len = act_req->data[0];
+ req_qos = act_req->data + 1; /* 10.5.6.5 */
+ req_pdpa_len = act_req->data[1 + req_qos_len];
+ req_pdpa = act_req->data + 1 + req_qos_len + 1; /* 10.5.6.4 */
+
+ switch (req_pdpa[0] & 0xf) {
+ case 0x0:
+ DEBUGPC(DMM, "ETSI ");
+ break;
+ case 0x1:
+ DEBUGPC(DMM, "IETF ");
+ break;
+ case 0xf:
+ DEBUGPC(DMM, "Empty ");
+ break;
+ }
- DEBUGP(DMM, "ACTIVATE PDP CONTEXT REQ\n");
+ switch (req_pdpa[1]) {
+ case 0x21:
+ DEBUGPC(DMM, "IPv4 ");
+ if (req_pdpa_len >= 6) {
+ struct in_addr ia;
+ ia.s_addr = ntohl(*((uint32_t *) (req_pdpa+2)));
+ DEBUGPC(DMM, "%s ", inet_ntoa(ia));
+ }
+ break;
+ case 0x57:
+ DEBUGPC(DMM, "IPv6 ");
+ if (req_pdpa_len >= 18) {
+ /* FIXME: print IPv6 address */
+ }
+ break;
+ default:
+ DEBUGPC(DMM, "0x%02x ", req_pdpa[1]);
+ break;
+ }
- /* FIXME: parse access point name + IPCP config options */
+ /* FIXME: parse TLV for AP name and protocol config options */
+ if (TLVP_PRESENT(&tp, GSM48_IE_GSM_APN)) {}
+ if (TLVP_PRESENT(&tp, GSM48_IE_GSM_PROTO_CONF_OPT)) {}
return gsm48_tx_gsm_act_pdp_acc(msg, act_req);
}