aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-01-09 14:58:41 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-09 14:58:41 +0100
commit00749515efe6a9eb4906d2ffd0703b4e940a7007 (patch)
tree7434b6f0bf562c6b6ba8dafefcbcb7c18075e1eb
parentda5dd03d4e433262ac9628d26aeef1d1cc17adf0 (diff)
add LLC XID information decode
-rw-r--r--src/diag_log_gprs.c21
-rw-r--r--src/protocol/diag_log_gsm.h30
2 files changed, 51 insertions, 0 deletions
diff --git a/src/diag_log_gprs.c b/src/diag_log_gprs.c
index 00c2e13..6b6b8a1 100644
--- a/src/diag_log_gprs.c
+++ b/src/diag_log_gprs.c
@@ -61,6 +61,26 @@ static void handle_llc_me_info(struct log_hdr *lh, struct msgb *msg)
osmo_hexdump_nospc(gli->enc_key, sizeof(gli->enc_key)));
}
+static void handle_llc_xid_info(struct log_hdr *lh, struct msgb *msg)
+{
+ struct diag_gprs_llc_xid_info *glxi;
+
+ glxi = (struct diag_gprs_llc_xid_info *) msgb_data(msg);
+ printf("LLC-XID-INFO { sapi=%u, pending_xid_bitmap=0x%04x, iov_i=%u, cur/pref "
+ "t200=%u/%u, n200=%u/%u, n201_u=%u/%u, n201_i=%u/%u, md=%u/%u, mu=%u/%u, kd=%u/%u, ku=%u/%u }\n",
+ glxi->gllc_sapi, glxi->pending_xid_bitmap, glxi->cur_iov_i,
+ glxi->t200.current, glxi->t200.preferred,
+ glxi->n200.current, glxi->n200.preferred,
+ glxi->n201_u.current, glxi->n201_u.preferred,
+ glxi->n201_i.current, glxi->n201_i.preferred,
+ glxi->md.current, glxi->md.preferred,
+ glxi->mu.current, glxi->mu.preferred,
+ glxi->kd.current, glxi->kd.preferred,
+ glxi->ku.current, glxi->ku.preferred
+ );
+}
+
+
static void handle_llc_pdu_stats(struct log_hdr *lh, struct msgb *msg)
{
struct diag_gprs_llc_stats *gls;
@@ -177,6 +197,7 @@ static void handle_gmm_ota_msg(struct log_hdr *lh, struct msgb *msg)
static const struct diag_log_dispatch_tbl log_tbl[] = {
{ GSM(LOG_GPRS_LLC_ME_INFO_C), handle_llc_me_info },
{ GSM(LOG_GPRS_LLC_PDU_STATS_C), handle_llc_pdu_stats },
+ { GSM(LOG_GPRS_LLC_XID_INFO_C), handle_llc_xid_info },
{ GSM(LOG_GPRS_GRR_STATE_C), handle_grr_state_msg },
{ GSM(LOG_GPRS_RLC_UL_ABNRML_RLS_COUNTS_C), handle_rlc_ul_abnrml_rls },
{ GSM(LOG_GPRS_RLC_UL_EVENT_COUNTS_C), handle_rlc_ul_evt_cnt },
diff --git a/src/protocol/diag_log_gsm.h b/src/protocol/diag_log_gsm.h
index c3b54b9..946a213 100644
--- a/src/protocol/diag_log_gsm.h
+++ b/src/protocol/diag_log_gsm.h
@@ -221,4 +221,34 @@ struct diag_gprs_llc_stats {
uint32_t llpdu_short_err;
} __attribute__((packed));
+struct diag_xid_tuple32 {
+ uint32_t current;
+ uint32_t preferred;
+} __attribute__ ((packed));
+
+struct diag_xid_tuple16 {
+ uint16_t current;
+ uint16_t preferred;
+} __attribute__ ((packed));
+
+struct diag_xid_tuple8 {
+ uint8_t current;
+ uint8_t preferred;
+} __attribute__ ((packed));
+
+/* LOG_GPRS_LLC_XID_INFO_C */
+struct diag_gprs_llc_xid_info {
+ uint8_t gllc_sapi;
+ uint16_t pending_xid_bitmap;
+ uint32_t cur_iov_i;
+ struct diag_xid_tuple32 t200;
+ struct diag_xid_tuple8 n200;
+ struct diag_xid_tuple16 n201_u;
+ struct diag_xid_tuple16 n201_i;
+ struct diag_xid_tuple16 md;
+ struct diag_xid_tuple16 mu;
+ struct diag_xid_tuple8 kd;
+ struct diag_xid_tuple8 ku;
+} __attribute__ ((packed));
+
struct msgb *diag_gsm_make_log_pack_req(uint16_t log_code, uint8_t zero_stats, uint8_t addl_info);