[PATCH 1/3] mncc: Implement helper functions to convert MNCC cause to a string.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Harald Welte laforge at gnumonks.org
Sun Dec 13 11:09:23 UTC 2015


Hi Alexander,

I may just have broken your patch-set accidentially by converting
mncc_names to value_string, sorry for that :/

Regarding your patch, I have to disagree about several topics:

On Wed, Nov 25, 2015 at 03:31:04PM -0500, Alexander Chemeris wrote:
> -static struct mncc_names {
> +struct name_value {
>  	char *name;
>  	int value;
> -} mncc_names[] = {
> +};

Is there a specific reason to introduce a new structure rather than use
struct value_string from libosmocore, which is used all over the Osmo*
code for this kind of name-value mapping?  All code should use that
infrastructure, and the occasional separate implementation should bec
converted to value_string.

> +static struct name_value mncc_locations[] = {
> +	{"GSM48_CAUSE_LOC_USER",		0x00},

1) The cause values and cause locations are GSM 04.08, not MNCC
   specific.  As such, they belong into libosmogsm, not OsmoNITB.  Also,
   they shouldn't be called 'mncc_locations' if in fact they are GSM
   04.08 locations.

2) Also, rather than introducing magic numbers, the defnitions from
   <osmocmo/gsm/protocol/gsm_04_08.h> should be used, making the above an

struct value_string gsm48_cause_loc_names[] = {
	{ GSM48_CAUSE_LOC_USER, "GSM48_CAUSE_LOC_USER" },

3) And finally, the string should be more user-readable than the cryptic
   #define/enum value, i.e.

struct value_string gsm48_cause_loc_names[] = {
	{ GSM48_CAUSE_LOC_USER, "User" },

Regards,
	Harald
-- 
- Harald Welte <laforge at gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)



More information about the OpenBSC mailing list