<div dir="ltr"><div><div><div><div>Yes, we needn't this macro now. The only place it can be used is vty_interface_layer3.c:<br><br>static struct gsm_subscriber *get_subscr_by_argv(struct gsm_network *gsmnet,<br>                         const char *type,<br>                         const char *id)<br>{<br>    if (!strcmp(type, "extension"))<br>        return subscr_get_by_extension(gsmnet->subscr_group, id);<br>    else if (!strcmp(type, "imsi"))<br>        return subscr_get_by_imsi(gsmnet->subscr_group, id);<br>    else if (!strcmp(type, "tmsi"))<br>        return subscr_get_by_tmsi(gsmnet->subscr_group, id);<br>    else if (!strcmp(type, "id"))<br>        return subscr_get_by_id(gsmnet->subscr_group, atoi(id));<br><br>    return NULL;<br>}<br><br></div>In this place we have to convert a string (written from VTY) to uint32_t<br></div>and then call the subscr_get_by_tmsi() with converted value.<br></div>User input can be unexpected, so we should check/limit the length<br></div>and check if there is '0x' sequence or not.<br><div><div><div><div><br></div></div></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>С наилучшими пожеланиями,<br></div>Яницкий Вадим.<br></div></div></div>
<br><div class="gmail_quote">2016-03-29 22:39 GMT+06:00 Holger Freyther <span dir="ltr"><<a href="mailto:holger@freyther.de" target="_blank">holger@freyther.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 29 Mar 2016, at 18:10, Вадим Яницкий <<a href="mailto:axilirator@gmail.com">axilirator@gmail.com</a>> wrote:<br>
><br>
> Hello!<br>
><br>
> > thanks a lot, I am afraid we need one more round.<br>
><br>
> No problem :)<br>
><br>
> > -#define tmsi_from_string(str) strtoul(str, NULL, 10)<br>
> > +#define tmsi_from_string(str) strtoul(str + 2, NULL, 16)<br>
> ><br>
> > this macro is used for parsing strings from the network. We should not modify it.<br>
><br>
> I cannot find where...<br>
<br>
<br>
</span>ah I see. You change the invocations in gsm_04_08.c. I would prefer if the name of this method is changed but once we work with uint32_t it will mostly go away anyway?<br>
<span class="HOEnZb"><font color="#888888"><br>
holger</font></span></blockquote></div><br></div>