:: Re: [DNG] netman GIT project
Top Page
Delete this message
Reply to this message
Author: karl
Date:  
To: dng
Subject: Re: [DNG] netman GIT project
Irrwahn:
> On Tue, 25 Aug 2015 19:24:17 +0200 (CEST), Karl wrote:
> > Tilt!:
> >> i wonder if we ever get to see such SSIDs from iwlist anyway -
> >> how is it supposed to print SSIDs that contain the zerobyte ...
> >
> > iwlib.c line 989..995:
> >       /* Is it a non-ASCII character ??? */
> >       if(isescape || !isascii(*s) || iscntrl(*s))
> >         {
> >           /* Escape */
> >           sprintf(d, "\\x%02X", *s);
> >           d += 4;
> >         }

>
> Thank you. One problem, though:
> Not a single version of the Wireless Tools for Linux sources I
> happened to stumble upon doing a quick internet search contains
> this snippet, or anything remotely like it. Care to share with us,
> where this originates?


$ apt-get source wireless-tools
$ cd wireless-tools-30~pre9
$ ls iw*.[ch]
iwconfig.c iwevent.c iwgetid.c iwlib.c iwlib.h iwlib-private.h iwlist.c iwmulticall.c iwpriv.c iwspy.c
$ grep download debian/copyright
It was downloaded from: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
$


http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
under "Wireless Tools latest versions":
///
The main features of the latest beta is support for non-ASCII ESSIDs (such as localised ESSID), support for displaying Scanning Capabilities, slightly bigger scan buffer, fixing minor bug iwconfig parser and minor enhancement to ifrename :

    Wireless Tools version 30-pre9 (beta) 
///


> Or give a little more context, particularly
> how isescape is set?


iwlib.c line 971..981:
      /* Escape the escape to avoid ambiguity.
       * We do a fast path test for performance reason. Compiler will
       * optimise all that ;-) */
      if(*s == '\\')
        {
          /* Check if we would confuse it with an escape sequence */
          if((e-s) > 4 && (s[1] == 'x')
             && (isxdigit(s[2])) && (isxdigit(s[3])))
            {
              isescape = 1;
            }


Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57