pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30856 )
Change subject: Standarize lle and llme state enum & value_string ......................................................................
Standarize lle and llme state enum & value_string
Change-Id: Iaf102ce5ca60854fe7eb1af17c73a80e7c76181b --- M include/osmocom/sgsn/gprs_llc.h M src/sgsn/gprs_llc.c M src/sgsn/gprs_llc_vty.c 3 files changed, 13 insertions(+), 12 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h index 7ba5510..32b16b0 100644 --- a/include/osmocom/sgsn/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -90,6 +90,7 @@ GPRS_LLES_LOCAL_REL = 6, /* Local Release */ GPRS_LLES_TIMER_REC = 7, /* Timer Recovery */ }; +extern const struct value_string gprs_llc_lle_state_names[];
enum gprs_llc_llme_state { GPRS_LLMS_UNASSIGNED = 1, /* No TLLI yet */ diff --git a/src/sgsn/gprs_llc.c b/src/sgsn/gprs_llc.c index fda0319..612dbca 100644 --- a/src/sgsn/gprs_llc.c +++ b/src/sgsn/gprs_llc.c @@ -50,6 +50,17 @@ { 0, NULL } };
+const struct value_string gprs_llc_lle_state_names[] = { + { GPRS_LLES_UNASSIGNED, "TLLI Unassigned" }, + { GPRS_LLES_ASSIGNED_ADM, "TLLI Assigned" }, + { GPRS_LLES_LOCAL_EST, "Local Establishment" }, + { GPRS_LLES_REMOTE_EST, "Remote Establishment" }, + { GPRS_LLES_ABM, "Asynchronous Balanced Mode" }, + { GPRS_LLES_LOCAL_REL, "Local Release" }, + { GPRS_LLES_TIMER_REC, "Timer Recovery" }, + { 0, NULL } +}; + static struct gprs_llc_llme *llme_alloc(uint32_t tlli); static int gprs_llc_tx_xid(const struct gprs_llc_lle *lle, struct msgb *msg, int command); diff --git a/src/sgsn/gprs_llc_vty.c b/src/sgsn/gprs_llc_vty.c index 124daa3..4572f95 100644 --- a/src/sgsn/gprs_llc_vty.c +++ b/src/sgsn/gprs_llc_vty.c @@ -39,22 +39,11 @@ #include <osmocom/vty/vty.h> #include <osmocom/vty/command.h>
-struct value_string gprs_llc_state_strs[] = { - { GPRS_LLES_UNASSIGNED, "TLLI Unassigned" }, - { GPRS_LLES_ASSIGNED_ADM, "TLLI Assigned" }, - { GPRS_LLES_LOCAL_EST, "Local Establishment" }, - { GPRS_LLES_REMOTE_EST, "Remote Establishment" }, - { GPRS_LLES_ABM, "Asynchronous Balanced Mode" }, - { GPRS_LLES_LOCAL_REL, "Local Release" }, - { GPRS_LLES_TIMER_REC, "Timer Recovery" }, - { 0, NULL } -}; - static void vty_dump_lle(struct vty *vty, struct gprs_llc_lle *lle) { struct gprs_llc_params *par = &lle->params; vty_out(vty, " SAPI %2u State %s VUsend=%u, VUrecv=%u", lle->sapi, - get_value_string(gprs_llc_state_strs, lle->state), + get_value_string(gprs_llc_lle_state_names, lle->state), lle->vu_send, lle->vu_recv); vty_out(vty, " Vsent=%u Vack=%u Vrecv=%u, RetransCtr=%u%s", lle->v_sent, lle->v_ack, lle->v_recv,