Changeset 9830
- Timestamp:
- 07/02/08 01:04:39 (5 years ago)
- Location:
- src/router/shared
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/router/shared/utils.c
r9828 r9830 1056 1056 return ROUTER_USR_5461; 1057 1057 } 1058 1058 1059 1059 if (boardnum == 10500 && nvram_match ("boardtype", "0x456")) 1060 1060 { … … 1063 1063 return ROUTER_USR_5461; //should work in the same way 1064 1064 } 1065 1065 1066 1066 if (boardnum == 10506 && nvram_match ("boardtype", "0x456")) 1067 1067 { … … 1918 1918 1919 1919 1920 int isListed(char *listname, char *value) 1921 { 1922 char *next, word[32]; 1923 char *list = nvram_get(listname); 1924 if (!list) 1920 int 1921 isListed (char *listname, char *value) 1922 { 1923 char *next, word[32]; 1924 char *list = nvram_get (listname); 1925 if (!list) 1925 1926 return 0; 1926 1927 foreach (word, list, next) 1927 1928 { 1928 if (!strcmp(word,value))1929 return 1;1929 if (!strcmp (word, value)) 1930 return 1; 1930 1931 } 1931 return 0; 1932 } 1933 1934 void addList(char *listname, char *value) 1935 { 1936 int listlen=0; 1937 if (isListed(listname,value)) 1932 return 0; 1933 } 1934 1935 void 1936 addList (char *listname, char *value) 1937 { 1938 int listlen = 0; 1939 if (isListed (listname, value)) 1938 1940 return; 1939 char *list = nvram_get(listname);1940 char *newlist;1941 if (list)1942 listlen =strlen(list);1943 newlist = malloc(strlen(value+2)+listlen);1944 if (list)1945 sprintf(newlist,"%s %s",list,value); 1946 else1947 sprintf(newlist,"%s",value); 1948 nvram_set(listname,newlist);1949 free(newlist);1941 char *list = nvram_get (listname); 1942 char *newlist; 1943 if (list) 1944 listlen = strlen (list); 1945 newlist = malloc (strlen (value + 2) + listlen); 1946 if (list) 1947 sprintf (newlist, "%s %s", list, value); 1948 else 1949 sprintf (newlist, "%s", value); 1950 nvram_set (listname, newlist); 1951 free (newlist); 1950 1952 } 1951 1953 -
src/router/shared/utils.h
r9828 r9830 602 602 int endswith (char *str, char *cmp); 603 603 604 int isListed (char *listname, char *value);605 void addList (char *listname, char *value);604 int isListed (char *listname, char *value); 605 void addList (char *listname, char *value); 606 606 607 607 #endif -
src/router/shared/wl.c
r9828 r9830 63 63 64 64 int 65 wl_getbssid (char *wl, char *mac)66 { 67 int ret;68 struct ether_addr ea;69 wl_ioctl(wl,WLC_GET_BSSID,&ea,ETHER_ADDR_LEN);70 ether_etoa(&ea,mac);65 wl_getbssid (char *wl, char *mac) 66 { 67 int ret; 68 struct ether_addr ea; 69 wl_ioctl (wl, WLC_GET_BSSID, &ea, ETHER_ADDR_LEN); 70 ether_etoa (&ea, mac); 71 71 } 72 72 … … 1092 1092 if (!ifexists (name)) 1093 1093 return -1; 1094 if (wl_probe (name))1094 if (wl_probe (name)) 1095 1095 return -1; 1096 1096 ret = wl_ioctl (name, WLC_GET_INSTANCE, &unit, sizeof (unit)); … … 1127 1127 { 1128 1128 int ret, val; 1129 if (isListed ("probe_blacklist",name))1129 if (isListed ("probe_blacklist", name)) 1130 1130 return -1; 1131 1131 … … 1134 1134 if ((ret = wl_get_dev_type (name, buf, DEV_TYPE_LEN)) < 0) 1135 1135 { 1136 addList("probe_blacklist",name);1137 return ret;1136 addList ("probe_blacklist", name); 1137 return ret; 1138 1138 } 1139 1139 /* Check interface */ 1140 1140 if (strncmp (buf, "wl", 2)) 1141 1141 { 1142 addList("probe_blacklist",name);1143 return -1;1142 addList ("probe_blacklist", name); 1143 return -1; 1144 1144 } 1145 1145 #else … … 1147 1147 if ((ret = wl_ioctl (name, WLC_GET_MAGIC, &val, sizeof (val)))) 1148 1148 { 1149 addList("probe_blacklist",name);1150 return ret;1149 addList ("probe_blacklist", name); 1150 return ret; 1151 1151 } 1152 1152 #endif 1153 1153 if ((ret = wl_ioctl (name, WLC_GET_VERSION, &val, sizeof (val)))) 1154 1154 { 1155 addList("probe_blacklist",name);1156 return ret;1155 addList ("probe_blacklist", name); 1156 return ret; 1157 1157 } 1158 1158 if (val > WLC_IOCTL_VERSION) 1159 1159 { 1160 addList("probe_blacklist",name);1161 return -1;1160 addList ("probe_blacklist", name); 1161 return -1; 1162 1162 } 1163 1163 return ret; -
src/router/shared/wlutils.h
r9819 r9830 144 144 int val); 145 145 146 int wl_getbssid (char *wl, char *mac);146 int wl_getbssid (char *wl, char *mac); 147 147 148 148 #endif /* _wlutils_h_ */
Note: See TracChangeset
for help on using the changeset viewer.
