Changeset 10805
- Timestamp:
- 11/07/08 10:16:21 (5 years ago)
- File:
-
- 1 edited
-
src/router/services/tools/site_survey_ralink.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/services/tools/site_survey_ralink.c
r10803 r10805 112 112 #define DOT11_CAP_ESS 0x0001 113 113 #define DOT11_CAP_IBSS 0x0002 114 115 unsigned char b1[32],b2[32],b3[32],b4[32],b5[32],b6[32],b7[32],b8[32]; 114 #define DOT11_CAP_PRIVACY 0x0010 /* d11 cap. privacy */ 115 116 unsigned char b1[32],b2[64],b3[32],b4[32],b5[32],b6[32],b7[32],b8[32]; 116 117 int i = 0; 117 118 … … 121 122 122 123 memset( site_survey_lists, sizeof( site_survey_lists ), 0 ); 123 124 if (nvram_match("wl0_mode","ap") || nvram_match("wl0_mode","apsta")) 125 { 124 126 eval( "iwpriv", "ra0","set","SiteSurvey=1" ); // only in ap mode 125 127 sleep(4); //wait 4 seconds per spec 128 } 126 129 127 130 FILE *scan = popen("iwpriv ra0 get_site_survey","rb"); … … 133 136 if (feof(scan)) 134 137 break; 135 int ret = fscanf(scan,"%s %s %s %s %s %s %s %s",b1,b2,b3,b4,b5,b6,b7,b8); //skip second line 136 if (ret<8) 138 fread(b1,4,1,scan); 139 b1[4]=0; 140 b1[strlen(b1)]=0; 141 fread(b2,33,1,scan); 142 b2[32]=0; 143 b2[strlen(b2)]=0; 144 int ret = fscanf(scan,"%s %s %s %s %s %s",b3,b4,b5,b6,b7,b8); //skip second line 145 if (ret<6) 137 146 break; 138 147 site_survey_lists[i].channel = atoi(b1); // channel … … 157 166 if (!strcmp(b8,"Ad")) 158 167 site_survey_lists[i].capability=DOT11_CAP_IBSS; 168 169 if (strcmp(b5,"OPEN")) 170 site_survey_lists[i].capability|=DOT11_CAP_PRIVACY; 171 159 172 i++; 160 173 }
Note: See TracChangeset
for help on using the changeset viewer.
