aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-06-24 21:49:37 +0200
committerHarald Welte <laforge@gnumonks.org>2015-11-15 14:04:06 +0100
commit487d3ea8b4b82e10aab7d5db13ec55bbd20eb12a (patch)
treee5f1dfc1ccd48166a5e5ced3c29e584c424eb1a7
parent8b9fa6829b930dff4f0ddec7b0e34c01340dc54b (diff)
ganc: handle classmark change
-rw-r--r--openbsc/src/osmo-ganc/ganc_data.h5
-rw-r--r--openbsc/src/osmo-ganc/ganc_server.c26
2 files changed, 29 insertions, 2 deletions
diff --git a/openbsc/src/osmo-ganc/ganc_data.h b/openbsc/src/osmo-ganc/ganc_data.h
index 5092e784a..3faf785f0 100644
--- a/openbsc/src/osmo-ganc/ganc_data.h
+++ b/openbsc/src/osmo-ganc/ganc_data.h
@@ -39,6 +39,11 @@ struct gan_peer {
enum ganc_state csr_state;
char imsi[16+1];
uint8_t gan_classmark[2];
+ uint8_t cm2[3];
+ struct {
+ unsigned int len;
+ uint8_t *val;
+ } cm3;
};
struct ganc_net {
diff --git a/openbsc/src/osmo-ganc/ganc_server.c b/openbsc/src/osmo-ganc/ganc_server.c
index 8c48ddd04..7a54ff566 100644
--- a/openbsc/src/osmo-ganc/ganc_server.c
+++ b/openbsc/src/osmo-ganc/ganc_server.c
@@ -260,8 +260,26 @@ static int rx_csr_ul_direct_xfer(struct gan_peer *peer, struct msgb *msg,
sapi = *TLVP_VAL(tp, GA_IE_SAPI_ID) & 0x7;
if (TLVP_PRESENT(tp, GA_IE_L3_MSG))
- printf("\tL3: %s\n", osmo_hexdump(TLVP_VAL(tp, GA_IE_L3_MSG),
- TLVP_LEN(tp, GA_IE_L3_MSG)));
+ printf("\tL3(%u): %s\n", sapi,
+ osmo_hexdump(TLVP_VAL(tp, GA_IE_L3_MSG),
+ TLVP_LEN(tp, GA_IE_L3_MSG)));
+ return 0;
+}
+
+/* 10.1.27 GA-CSR CLASSMARK CHANGE */
+static int rx_csr_cm_chg(struct gan_peer *peer, struct msgb *msg,
+ struct tlv_parsed *tp)
+{
+ if (TLVP_PRESENT(tp, GA_IE_MS_CLASSMARK2) &&
+ TLVP_LEN(tp, GA_IE_MS_CLASSMARK2) == 3)
+ memcpy(peer->cm2, TLVP_VAL(tp, GA_IE_MS_CLASSMARK2), 3);
+
+ if (TLVP_PRESENT(tp, GA_IE_MS_CLASSMARK3)) {
+ peer->cm3.len = TLVP_LEN(tp, GA_IE_MS_CLASSMARK3);
+ peer->cm3.val = talloc_memdup(peer,
+ TLVP_VAL(tp, GA_IE_MS_CLASSMARK3),
+ peer->cm3.len);
+ }
return 0;
}
@@ -283,6 +301,10 @@ static int rx_unc_rc_csr(struct gan_peer *peer, struct msgb *msg,
return rx_rc_deregister(peer, msg, tp);
case GA_MT_CSR_UL_DIRECT_XFER:
return rx_csr_ul_direct_xfer(peer, msg, tp);
+ case GA_MT_CSR_CM_CHANGE:
+ return rx_csr_cm_chg(peer, msg, tp);
+ case GA_MT_RC_KEEPALIVE:
+ break;
default:
printf("\tunhandled!\n");
break;