source: trunk/package/wireless-tools/patches/003-we_essential_def.patch @ 26218

Last change on this file since 26218 was 26218, checked in by nbd, 5 years ago

wireless-tools: remove some more unnecessary stuff from iwconfig

File size: 10.9 KB
  • iwlist.c

    a b typedef struct iw_auth_descr 
    5858 * Maybe this should go in iwlib.c ? 
    5959 */ 
    6060 
    61 #ifndef WE_ESSENTIAL 
    6261#define IW_ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0])) 
    6362 
    6463//static const struct iwmask_name iw_enc_mode_name[] = { 
    static const char * iw_ie_key_mgmt_name[ 
    161160}; 
    162161#define IW_IE_KEY_MGMT_NUM      IW_ARRAY_LEN(iw_ie_key_mgmt_name) 
    163162 
    164 #endif  /* WE_ESSENTIAL */ 
    165  
    166163/************************* WPA SUBROUTINES *************************/ 
    167164 
    168 #ifndef WE_ESSENTIAL 
    169165/*------------------------------------------------------------------*/ 
    170166/* 
    171167 * Print all names corresponding to a mask. 
    iw_print_gen_ie(unsigned char * buffer, 
    431427      offset += buffer[offset+1] + 2; 
    432428    } 
    433429} 
    434 #endif  /* WE_ESSENTIAL */ 
    435430 
    436431/***************************** SCANNING *****************************/ 
    437432/* 
    print_scanning_token(struct stream_descr 
    585580                     &event->u.qual, iw_range, has_range); 
    586581      printf("                    %s\n", buffer); 
    587582      break; 
    588 #ifndef WE_ESSENTIAL 
    589583    case IWEVGENIE: 
    590584      /* Informations Elements are complex, let's do only some of them */ 
    591585      iw_print_gen_ie(event->u.data.pointer, event->u.data.length); 
    592586      break; 
    593 #endif  /* WE_ESSENTIAL */ 
    594587    case IWEVCUSTOM: 
    595588      { 
    596589        char custom[IW_CUSTOM_MAX+1]; 
    print_pm_info(int skfd, 
    13021295  return(0); 
    13031296} 
    13041297 
    1305 #ifndef WE_ESSENTIAL 
    13061298/************************** TRANSMIT POWER **************************/ 
    13071299 
    13081300/*------------------------------------------------------------------*/ 
    print_txpower_info(int skfd, 
    14051397  return(0); 
    14061398} 
    14071399 
     1400#ifndef WE_ESSENTIAL 
    14081401/*********************** RETRY LIMIT/LIFETIME ***********************/ 
    14091402 
    14101403/*------------------------------------------------------------------*/ 
    static const struct iwlist_entry iwlist_ 
    20602053  { "encryption",       print_keys_info,        0, NULL }, 
    20612054  { "keys",             print_keys_info,        0, NULL }, 
    20622055  { "power",            print_pm_info,          0, NULL }, 
    2063 #ifndef WE_ESSENTIAL 
    20642056  { "txpower",          print_txpower_info,     0, NULL }, 
     2057#ifndef WE_ESSENTIAL 
    20652058  { "retry",            print_retry_info,       0, NULL }, 
    20662059  { "ap",               print_ap_info,          0, NULL }, 
    20672060  { "accesspoints",     print_ap_info,          0, NULL }, 
  • iwconfig.c

    a b get_info(int skfd, 
    106106    if(wrq.u.data.length > 1) 
    107107      info->has_nickname = 1; 
    108108 
    109   if((info->has_range) && (info->range.we_version_compiled > 9)) 
    110     { 
    111       /* Get Transmit Power */ 
    112       if(iw_get_ext(skfd, ifname, SIOCGIWTXPOW, &wrq) >= 0) 
    113         { 
    114           info->has_txpower = 1; 
    115           memcpy(&(info->txpower), &(wrq.u.txpower), sizeof(iwparam)); 
    116         } 
    117     } 
    118  
    119109  /* Get sensitivity */ 
    120110  if(iw_get_ext(skfd, ifname, SIOCGIWSENS, &wrq) >= 0) 
    121111    { 
    get_info(int skfd, 
    132122          memcpy(&(info->retry), &(wrq.u.retry), sizeof(iwparam)); 
    133123        } 
    134124    } 
     125#endif  /* WE_ESSENTIAL */ 
     126 
     127  if((info->has_range) && (info->range.we_version_compiled > 9)) 
     128    { 
     129      /* Get Transmit Power */ 
     130      if(iw_get_ext(skfd, ifname, SIOCGIWTXPOW, &wrq) >= 0) 
     131        { 
     132          info->has_txpower = 1; 
     133          memcpy(&(info->txpower), &(wrq.u.txpower), sizeof(iwparam)); 
     134        } 
     135    } 
    135136 
    136137  /* Get RTS threshold */ 
    137138  if(iw_get_ext(skfd, ifname, SIOCGIWRTS, &wrq) >= 0) 
    get_info(int skfd, 
    146147      info->has_frag = 1; 
    147148      memcpy(&(info->frag), &(wrq.u.frag), sizeof(iwparam)); 
    148149    } 
    149 #endif  /* WE_ESSENTIAL */ 
    150150 
    151151  return(0); 
    152152} 
    display_info(struct wireless_info * info 
    269269      printf("Bit Rate%c%s   ", (info->bitrate.fixed ? '=' : ':'), buffer); 
    270270    } 
    271271 
    272 #ifndef WE_ESSENTIAL 
    273272  /* Display the Transmit Power */ 
    274273  if(info->has_txpower) 
    275274    { 
    display_info(struct wireless_info * info 
    286285      printf("Tx-Power%c%s   ", (info->txpower.fixed ? '=' : ':'), buffer); 
    287286    } 
    288287 
     288#ifndef WE_ESSENTIAL 
    289289  /* Display sensitivity */ 
    290290  if(info->has_sens) 
    291291    { 
    display_info(struct wireless_info * info 
    340340      printf("   "); 
    341341      tokens += 5;      /* Between 3 and 5, depend on flags */ 
    342342    } 
     343#endif  /* WE_ESSENTIAL */ 
    343344 
    344345  /* Display the RTS threshold */ 
    345346  if(info->has_rts) 
    display_info(struct wireless_info * info 
    383384  /* Formating */ 
    384385  if(tokens > 0) 
    385386    printf("\n          "); 
    386 #endif  /* WE_ESSENTIAL */ 
    387387 
    388388  /* Display encryption information */ 
    389389  /* Note : we display only the "current" key, use iwlist to list all keys */ 
    set_nwid_info(int skfd, 
    11961196  /* 1 arg */ 
    11971197  return(1); 
    11981198} 
     1199#endif  /* WE_ESSENTIAL */ 
    11991200 
    12001201/*------------------------------------------------------------------*/ 
    12011202/* 
    set_txpower_info(int skfd, 
    13621363  return(i); 
    13631364} 
    13641365 
     1366#ifndef WE_ESSENTIAL 
    13651367/*------------------------------------------------------------------*/ 
    13661368/* 
    13671369 * Set Sensitivity 
    set_retry_info(int skfd, 
    14591461  /* Var args */ 
    14601462  return(i); 
    14611463} 
     1464#endif  /* WE_ESSENTIAL */ 
    14621465 
    14631466/*------------------------------------------------------------------*/ 
    14641467/* 
    set_frag_info(int skfd, 
    15651568  return(1); 
    15661569} 
    15671570 
     1571#ifndef WE_ESSENTIAL 
    15681572/*------------------------------------------------------------------*/ 
    15691573/* 
    15701574 * Set Modulation 
    static const struct iwconfig_entry iwcon 
    17191723        "Set Nickname",                 "NNN" }, 
    17201724  { "nwid",             set_nwid_info,          1,      SIOCSIWNWID, 
    17211725        "Set NWID",                     "{NN|on|off}" }, 
    1722   { "ap",               set_apaddr_info,        1,      SIOCSIWAP, 
    1723         "Set AP Address",               "{N|off|auto}" }, 
    1724   { "txpower",          set_txpower_info,       1,      SIOCSIWTXPOW, 
    1725         "Set Tx Power",                 "{NmW|NdBm|off|auto}" }, 
    17261726  { "sens",             set_sens_info,          1,      SIOCSIWSENS, 
    17271727        "Set Sensitivity",              "N" }, 
     1728  { "modulation",       set_modulation_info,    1,      SIOCGIWMODUL, 
     1729        "Set Modulation",               "{11g|11a|CCK|OFDMg|...}" }, 
    17281730  { "retry",            set_retry_info,         1,      SIOCSIWRETRY, 
    17291731        "Set Retry Limit",              "{limit N|lifetime N}" }, 
     1732#endif  /* WE_ESSENTIAL */ 
     1733  { "ap",               set_apaddr_info,        1,      SIOCSIWAP, 
     1734        "Set AP Address",               "{N|off|auto}" }, 
     1735  { "txpower",          set_txpower_info,       1,      SIOCSIWTXPOW, 
     1736        "Set Tx Power",                 "{NmW|NdBm|off|auto}" }, 
    17301737  { "rts",              set_rts_info,           1,      SIOCSIWRTS, 
    17311738        "Set RTS Threshold",            "{N|auto|fixed|off}" }, 
    17321739  { "frag",             set_frag_info,          1,      SIOCSIWFRAG, 
    17331740        "Set Fragmentation Threshold",  "{N|auto|fixed|off}" }, 
    1734   { "modulation",       set_modulation_info,    1,      SIOCGIWMODUL, 
    1735         "Set Modulation",               "{11g|11a|CCK|OFDMg|...}" }, 
    1736 #endif  /* WE_ESSENTIAL */ 
    17371741  { "commit",           set_commit_info,        0,      SIOCSIWCOMMIT, 
    17381742        "Commit changes",               "" }, 
    17391743  { NULL, NULL, 0, 0, NULL, NULL }, 
  • iwmulticall.c

    a b extern int 
    8181#define main(args...) main_iwspy(args) 
    8282#include "iwspy.c" 
    8383#undef main 
    84 #endif  /* WE_ESSENTIAL */ 
     84#endif 
    8585 
    8686/* Get iwpriv in there. Mandatory for HostAP and some other drivers. */ 
    8787#define main(args...) main_iwpriv(args) 
    extern int 
    9090#undef iw_usage 
    9191#undef main 
    9292 
     93#ifndef WE_ESSENTIAL 
    9394/* Do we really need iwgetid ? Well, it's not like it's a big one */ 
    9495#define main(args...) main_iwgetid(args) 
    9596#define iw_usage(args...) iwgetid_usage(args) 
    9697#include "iwgetid.c" 
    9798#undef iw_usage 
    9899#undef main 
     100#endif 
    99101 
    100102/* iwevent is useless for most people, don't grab it ? */ 
    101103 
    main(int argc, 
    131133#ifndef WE_ESSENTIAL 
    132134  if(!strcmp(call_name, "iwspy")) 
    133135    return(main_iwspy(argc, argv)); 
    134 #endif  /* WE_ESSENTIAL */ 
     136#endif 
    135137  if(!strcmp(call_name, "iwpriv")) 
    136138    return(main_iwpriv(argc, argv)); 
     139#ifndef WE_ESSENTIAL 
    137140  if(!strcmp(call_name, "iwgetid")) 
    138141    return(main_iwgetid(argc, argv)); 
     142#endif 
    139143 
    140144  /* Uh oh... Not supposed to come here. */ 
    141145  printf("iwmulticall : you are not supposed to call me this way...\n"); 
  • iwlib.c

    a b const struct iw_modul_descr iw_modul_lis 
    113113  { IW_MODUL_11A, "11a", "IEEE 802.11a (5 GHz, up to 54 Mb/s)" }, 
    114114  { IW_MODUL_11B, "11b", "IEEE 802.11b (2.4 GHz, up to 11 Mb/s)" }, 
    115115 
     116#ifndef WE_ESSENTIAL 
    116117  /* Proprietary aggregates */ 
    117118  { IW_MODUL_TURBO | IW_MODUL_11A, "turboa", 
    118119    "Atheros turbo mode at 5 GHz (up to 108 Mb/s)" }, 
    const struct iw_modul_descr iw_modul_lis 
    120121    "Atheros turbo mode at 2.4 GHz (up to 108 Mb/s)" }, 
    121122  { IW_MODUL_PBCC | IW_MODUL_11B, "11+", 
    122123    "TI 802.11+ (2.4 GHz, up to 22 Mb/s)" }, 
     124#endif 
    123125 
    124126  /* Individual modulations */ 
    125127  { IW_MODUL_OFDM_G, "OFDMg", 
    const struct iw_modul_descr iw_modul_lis 
    129131  { IW_MODUL_DS, "DS", "802.11 Direct Sequence (2.4 GHz, up to 2 Mb/s)" }, 
    130132  { IW_MODUL_FH, "FH", "802.11 Frequency Hopping (2,4 GHz, up to 2 Mb/s)" }, 
    131133 
     134#ifndef WE_ESSENTIAL 
    132135  /* Proprietary modulations */ 
    133136  { IW_MODUL_TURBO, "turbo", 
    134137    "Atheros turbo mode, channel bonding (up to 108 Mb/s)" }, 
    const struct iw_modul_descr iw_modul_lis 
    136139    "TI 802.11+ higher rates (2.4 GHz, up to 22 Mb/s)" }, 
    137140  { IW_MODUL_CUSTOM, "custom", 
    138141    "Driver specific modulation (check driver documentation)" }, 
     142#endif 
    139143}; 
    140144 
    141145/* Disable runtime version warning in iw_get_range_info() */ 
    iw_print_version_info(const char * tooln 
    440444      return -1; 
    441445    } 
    442446 
     447#ifndef WE_ESSENTIAL 
    443448  /* Information about the tools themselves */ 
    444449  if(toolname != NULL) 
    445450    printf("%-8.16s  Wireless-Tools version %d\n", toolname, WT_VERSION); 
    iw_print_version_info(const char * tooln 
    452457  if(we_kernel_version > 15) 
    453458    printf("Kernel    Currently compiled with Wireless Extension v%d.\n\n", 
    454459           we_kernel_version); 
     460#endif 
    455461 
    456462  /* Version for each device */ 
    457463  iw_enum_devices(skfd, &print_iface_version_info, NULL, 0); 
    iw_get_range_info(int skfd, 
    501507      /* Copy stuff at the right place, ignore extra */ 
    502508      memcpy((char *) range, buffer, sizeof(iwrange)); 
    503509    } 
     510#ifndef WE_ESSENTIAL 
    504511  else 
    505512    { 
    506513      /* Zero unknown fields */ 
    iw_get_range_info(int skfd, 
    574581       * If the driver source has not been updated to the latest, it doesn't 
    575582       * matter because the new fields are set to zero */ 
    576583    } 
     584#endif 
    577585 
    578586  /* Don't complain twice. 
    579587   * In theory, the test apply to each individual driver, but usually 
    iw_print_key(char * buffer, 
    15421550    } 
    15431551} 
    15441552 
     1553#ifndef WE_ESSENTIAL 
    15451554/*------------------------------------------------------------------*/ 
    15461555/* 
    15471556 * Convert a passphrase into a key 
    iw_pass_key(const char * input, 
    15561565  fprintf(stderr, "Error: Passphrase not implemented\n"); 
    15571566  return(-1); 
    15581567} 
     1568#endif 
    15591569 
    15601570/*------------------------------------------------------------------*/ 
    15611571/* 
    iw_in_key(const char * input, 
    15781588        keylen = IW_ENCODING_TOKEN_MAX; 
    15791589      memcpy(key, input + 2, keylen); 
    15801590    } 
     1591#ifndef WE_ESSENTIAL 
    15811592  else 
    15821593    if(!strncmp(input, "p:", 2)) 
    15831594      { 
    15841595        /* Second case : as a passphrase (PrismII cards) */ 
    15851596        return(iw_pass_key(input + 2, key));            /* skip "p:" */ 
    15861597      } 
     1598#endif 
    15871599    else 
    15881600      { 
    15891601        const char *    p; 
  • Makefile

    a b install-iwmulticall:: iwmulticall 
    195195        install -m 755 $< $(INSTALL_DIR)/iwconfig 
    196196        ( cd $(INSTALL_DIR) ; \ 
    197197          ln -f -s iwconfig iwlist ; \ 
    198           ln -f -s iwconfig iwspy ; \ 
     198          $(if $(BUILD_WE_ESSENTIAL),,ln -f -s iwconfig iwspy ;) \ 
    199199          ln -f -s iwconfig iwpriv ; \ 
    200           ln -f -s iwconfig iwgetid ) 
     200          $(if $(BUILD_WE_ESSENTIAL),,ln -f -s iwconfig iwgetid ) ) 
    201201 
    202202clean:: 
    203203        $(RM_CMD)  
Note: See TracBrowser for help on using the repository browser.