diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-06-24 21:49:37 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-06-24 21:50:40 +0200 |
commit | 7ed61ae2a2660b69ebafbbcfcb5054fef1188c6d (patch) | |
tree | f4670b9a1aec050a3c4c8f46529b3831e99a59d1 /openbsc/src/osmo-ganc/ganc_server.c | |
parent | 9979e8e7b4cd575acd27f5fb03803234dd6ea52b (diff) |
ganc: handle classmark change
Diffstat (limited to 'openbsc/src/osmo-ganc/ganc_server.c')
-rw-r--r-- | openbsc/src/osmo-ganc/ganc_server.c | 26 |
1 files changed, 24 insertions, 2 deletions
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; |