/* Extract the Wireless Protocol from a live interface  */
static int mapping_getiwproto(int skfd, const char *ifname, struct if_mapping *target, int flag)
/* Extract the Wireless Protocol from a live interface  */
static int mapping_getiwproto(int skfd, const char *ifname, struct if_mapping *target, int flag)
{
  struct iwreq		wrq;
  flag = flag;
  if(iw_get_ext(skfd, ifname, SIOCGIWNAME, &wrq) < 0)
    return(-1);
  strncpy(target->iwproto, wrq.u.name, IFNAMSIZ);
  target->iwproto[IFNAMSIZ] = '\0';
  target->active[SELECT_IWPROTO] = 1;
  if(verbose)
    fprintf(stderr,
	    "Querying %s : Got Wireless Protocol `%s'.\n",
	    ifname, target->iwproto);
  return(0);
}