aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-18 12:31:50 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-18 12:31:50 +0200
commitb61f403dd3aba5310f8eba5e4bdd2cfea3b7925f (patch)
treeac03f03de60cc1c24f563105cec1950da1afbe02
parent2e918a87ebace1886ff29dc8ccbfe5aede695184 (diff)
[GPRS] LLC: print human-readable LLC command type
-rw-r--r--openbsc/src/gprs/gprs_llc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 3eea82d48..484a16878 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -80,6 +80,22 @@ enum gprs_llc_cmd {
GPRS_LLC_UI,
};
+static const struct value_string llc_cmd_strs[] = {
+ { GPRS_LLC_NULL, "NULL" },
+ { GPRS_LLC_RR, "RR" },
+ { GPRS_LLC_ACK, "ACK" },
+ { GPRS_LLC_RNR, "RNR" },
+ { GPRS_LLC_SACK, "SACK" },
+ { GPRS_LLC_DM, "DM" },
+ { GPRS_LLC_DISC, "DISC" },
+ { GPRS_LLC_UA, "UA" },
+ { GPRS_LLC_SABM, "SABM" },
+ { GPRS_LLC_FRMR, "FRMR" },
+ { GPRS_LLC_XID, "XID" },
+ { GPRS_LLC_UI, "UI" },
+ { 0, NULL }
+};
+
struct gprs_llc_hdr_parsed {
uint8_t sapi;
uint8_t is_cmd:1,
@@ -251,7 +267,7 @@ static int gprs_llc_hdr_dump(struct gprs_llc_hdr_parsed *gph)
gph->fcs, gph->fcs_calc == gph->fcs ? "correct" : "WRONG");
if (gph->cmd)
- DEBUGPC(DLLC, "CMD=%u ", gph->cmd);
+ DEBUGPC(DLLC, "CMD=%s ", get_value_string(llc_cmd_strs, gph->cmd));
if (gph->data)
DEBUGPC(DLLC, "DATA ");