diff options
author | Max <msuraev@sysmocom.de> | 2016-03-09 12:29:23 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-03-11 22:29:39 +0700 |
commit | c0d9a6c083aa7e35174093c7a7265319bf993a9d (patch) | |
tree | c313a21221f228ac5b7a3a4398087b60729abf20 /src/gb/gprs_bssgp_util.c | |
parent | e859aec95264f0cda85073b03def63d8596b07a3 (diff) |
Add helper function to convert numerical BSSGP PDU type to string
Diffstat (limited to 'src/gb/gprs_bssgp_util.c')
-rw-r--r-- | src/gb/gprs_bssgp_util.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c index 19ae23a0..6fff3621 100644 --- a/src/gb/gprs_bssgp_util.c +++ b/src/gb/gprs_bssgp_util.c @@ -62,11 +62,57 @@ static const struct value_string bssgp_cause_strings[] = { { 0, NULL }, }; +static const struct value_string bssgp_pdu_strings[] = { + { BSSGP_PDUT_DL_UNITDATA, "DL-UNITDATA" }, + { BSSGP_PDUT_UL_UNITDATA, "UL-UNITDATA" }, + { BSSGP_PDUT_RA_CAPABILITY, "RA-CAPABILITY" }, + { BSSGP_PDUT_PTM_UNITDATA, "PTM-UNITDATA" }, + { BSSGP_PDUT_PAGING_PS, "PAGING-PS" }, + { BSSGP_PDUT_PAGING_CS, "PAGING-CS" }, + { BSSGP_PDUT_RA_CAPA_UDPATE, "RA-CAPABILITY-UPDATE" }, + { BSSGP_PDUT_RA_CAPA_UPDATE_ACK, "RA-CAPABILITY-UPDATE-ACK" }, + { BSSGP_PDUT_RADIO_STATUS, "RADIO-STATUS" }, + { BSSGP_PDUT_SUSPEND, "SUSPEND" }, + { BSSGP_PDUT_SUSPEND_ACK, "SUSPEND-ACK" }, + { BSSGP_PDUT_SUSPEND_NACK, "SUSPEND-NACK" }, + { BSSGP_PDUT_RESUME, "RESUME" }, + { BSSGP_PDUT_RESUME_ACK, "RESUME-ACK" }, + { BSSGP_PDUT_RESUME_NACK, "RESUME-NACK" }, + { BSSGP_PDUT_BVC_BLOCK, "BVC-BLOCK" }, + { BSSGP_PDUT_BVC_BLOCK_ACK, "BVC-BLOCK-ACK" }, + { BSSGP_PDUT_BVC_RESET, "BVC-RESET" }, + { BSSGP_PDUT_BVC_RESET_ACK, "BVC-RESET-ACK" }, + { BSSGP_PDUT_BVC_UNBLOCK, "BVC-UNBLOCK" }, + { BSSGP_PDUT_BVC_UNBLOCK_ACK, "BVC-UNBLOCK-ACK" }, + { BSSGP_PDUT_FLOW_CONTROL_BVC, "FLOW-CONTROL-BVC" }, + { BSSGP_PDUT_FLOW_CONTROL_BVC_ACK, "FLOW-CONTROL-BVC-ACK" }, + { BSSGP_PDUT_FLOW_CONTROL_MS, "FLOW-CONTROL-MS" }, + { BSSGP_PDUT_FLOW_CONTROL_MS_ACK, "FLOW-CONTROL-MS-ACK" }, + { BSSGP_PDUT_FLUSH_LL, "FLUSH-LL" }, + { BSSGP_PDUT_FLUSH_LL_ACK, "FLUSH-LL-ACK" }, + { BSSGP_PDUT_LLC_DISCARD, "LLC DISCARDED" }, + { BSSGP_PDUT_SGSN_INVOKE_TRACE, "SGSN-INVOKE-TRACE" }, + { BSSGP_PDUT_STATUS, "STATUS" }, + { BSSGP_PDUT_DOWNLOAD_BSS_PFC, "DOWNLOAD-BSS-PFC" }, + { BSSGP_PDUT_CREATE_BSS_PFC, "CREATE-BSS-PFC" }, + { BSSGP_PDUT_CREATE_BSS_PFC_ACK, "CREATE-BSS-PFC-ACK" }, + { BSSGP_PDUT_CREATE_BSS_PFC_NACK, "CREATE-BSS-PFC-NACK" }, + { BSSGP_PDUT_MODIFY_BSS_PFC, "MODIFY-BSS-PFC" }, + { BSSGP_PDUT_MODIFY_BSS_PFC_ACK, "MODIFY-BSS-PFC-ACK" }, + { BSSGP_PDUT_DELETE_BSS_PFC, "DELETE-BSS-PFC" }, + { BSSGP_PDUT_DELETE_BSS_PFC_ACK, "DELETE-BSS-PFC-ACK" }, + { 0, NULL }, +}; + const char *bssgp_cause_str(enum gprs_bssgp_cause cause) { return get_value_string(bssgp_cause_strings, cause); } +const char *bssgp_pdu_str(enum bssgp_pdu_type pdu) +{ + return get_value_string(bssgp_pdu_strings, pdu); +} struct msgb *bssgp_msgb_alloc(void) { |