<div dir="ltr"><div class="gmail_quote">Hi Harald,<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id=":12r" class="">I would prefer if we could use long-name and short-name instead of 'long<br>
name' and 'short name' in the VTY syntax.<br>
<br>
The VTY commands with spaces in them are a sign of my lack of<br>
understanding of the VTY system at that time.  Multiple words should<br>
only be used if there actually is a 'fork' in the tree, i.e. if several<br>
commands are possible.<br>
<br>
So two commands 'name short' and 'name long' would make sense, as they<br>
are about name, and there are two options, one for short, and one for<br>
long name.  Basically the same as 'name (short|long)'<br>
<br>
But 'short name' and 'long name' will install command nodes for 'short'<br>
and long', which doesn't make sense.  We keep the old syntax for<br>
compatibility on the 'network' node, but for new code added, we should<br>
try to avoid this.<br>
<br>
So let's either use 'name (short|long)' (maybe the best solutioin) or<br>
'short-name' and 'long-name'.<br></div></blockquote><div><br>Thank you for explanation.<br>We will have different commands for configuring the same parameters for main network and virtual networks ("short name OpenBSC" and "name short OpenBSC"), but I think it's ok, I will change it to 'name (short|long)'. <br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id=":12r" class="">
> +#define IMSI_PREFIX_LENGTH 16<br>
<br>
we should probably not pull the magic number 16 out of our sleeve here,<br>
but try to use an existing #define for the length of an IMSI.  I'm quite<br>
sure we have one somewhere in libosmocore or the openbsc code base.<br></div></blockquote><div><br></div><div>Ok, I see that GSM_IMSI_LENGTH is defined in gsm_subscriber.h, so I can just move it to gsm_data.h and use it.<br>Btw, as I know maximum imsi length is 15, why 17 is used for GSM_IMSI_LENGTH instead of 16?<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id=":12r" class="">
<span class=""><br>
> +struct gsm_virt_network *gsm_virt_net_alloc_register(struct gsm_network *net)<br>
> +{<br>
> +     struct gsm_virt_network *virt_net;<br>
> +<br>
> +     virt_net = gsm_virt_net_alloc(net);<br>
> +     if (!virt_net)<br>
> +             return NULL;<br>
> +<br>
> +     virt_net->nr = net->num_virt_net++;<br>
> +     virt_net->network = net;<br>
> +     strcpy(virt_net->imsi_prefix, "00101");<br>
> +     virt_net->name_short = talloc_strdup(net, "OpenBSC");<br>
> +     virt_net->name_long = talloc_strdup(net, "OpenBSC");<br>
<br>
</span>why do we have hard-coded defaults for a prefix 00101 inside the code?<br>
I think we should advoid such automatism, as creating a new virtual<br>
network will then instantaneously match 00101 prefixed IMSIs without the<br>
user ever specifying this. Or am I misunderstanding this?<br>
</div></blockquote></div><div class="gmail_extra"><br>Yes, you are right, by default imsi-prefix should be undefined, I will fix it.<br><br></div></div>