Changeset 18045
- Timestamp:
- 12/24/11 22:36:00 (17 months ago)
- Location:
- src/router
- Files:
-
- 1 added
- 24 edited
-
httpd/Makefile (modified) (3 diffs)
-
httpd/modules/broadcom.c (modified) (1 diff)
-
httpd/validate/webs.c (modified) (1 diff)
-
httpd/visuals/dd-wrt.c (modified) (24 diffs)
-
httpd/visuals/wireless_madwifiath9k.c (modified) (2 diffs)
-
libutils/Makefile (modified) (5 diffs)
-
libutils/country.c (modified) (2 diffs)
-
libutils/mac80211info.c (modified) (9 diffs)
-
libutils/utils.c (modified) (1 diff)
-
libutils/wl.c (modified) (2 diffs)
-
nvram/Makefile (modified) (2 diffs)
-
rc/Makefile (modified) (4 diffs)
-
rules/generic.mk (added)
-
services/Makefile (modified) (5 diffs)
-
services/networking/firewall.c (modified) (1 diff)
-
services/networking/interface.c (modified) (1 diff)
-
services/networking/madwifi.c (modified) (1 diff)
-
services/networking/madwifi_ath9k.c (modified) (6 diffs)
-
services/networking/network.c (modified) (1 diff)
-
services/services/chillispot.c (modified) (1 diff)
-
services/services/routing.c (modified) (5 diffs)
-
services/sysinit/defaults.c (modified) (1 diff)
-
services/sysinit/sysinit-ja76pf.c (modified) (1 diff)
-
services/sysinit/sysinit.c (modified) (1 diff)
-
shared/Makefile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/httpd/Makefile
r17917 r18045 164 164 endif 165 165 166 include $(TOP)/rules/generic.mk 167 CFLAGS += $(DD_CFLAGS) 168 166 169 ifeq ($(CONFIG_BUFFALO),y) 167 170 CFLAGS += -DHAVE_BUFFALO -DDEFAULT_COUNTRY_CODE=\"$(CONFIG_DEFAULT_COUNTRYCODE)\" … … 366 369 ifeq ($(CONFIG_DIR400),y) 367 370 CFLAGS += -DHAVE_DIR400 371 endif 372 ifeq ($(CONFIG_DIR825),y) 373 CFLAGS += -DHAVE_DIR825 368 374 endif 369 375 ifeq ($(CONFIG_XR4SPECIAL),y) … … 810 816 CFLAGS += -DHAVE_ADM5120 811 817 endif 818 ifeq ($(CONFIG_JJAP93),y) 819 CFLAGS += -DHAVE_JJAP93 820 endif 821 ifeq ($(CONFIG_TIEXTRA1),y) 822 CFLAGS += -DHAVE_TIEXTRA1 823 VISOBJS += $(TOP)/private/telkom/mchillispotejs.o 824 VISOBJS += $(TOP)/jansson/src/.libs/libjansson.a 825 WEBSOBJS += $(TOP)/private/telkom/mchillispotvalidate.o 826 WEBSOBJS += $(TOP)/jansson/src/.libs/libjansson.a 827 endif 812 828 813 829 ifeq ($(SAMBA_SUPPORT),1) -
src/router/httpd/modules/broadcom.c
r17887 r18045 1212 1212 {"USB", "usbdrivers", 0, SERVICE_RESTART, NULL}, 1213 1213 {"NAS", "nassrv", 0, SERVICE_RESTART, NULL}, 1214 {"Hotspot", "hotspot", 0, SERVICE_RESTART, "hotspot_save"}, 1214 1215 {"Hotspot", "hotspot", 0, SERVICE_RESTART, NULL}, 1215 1216 {"AnchorFree", "anchorfree", 0, SERVICE_RESTART, NULL}, -
src/router/httpd/validate/webs.c
r17794 r18045 2877 2877 // nvram_commit (); 2878 2878 applytake(value); 2879 } 2880 2881 void hotspot_save(webs_t wp) { 2882 #ifdef HAVE_TIEXTRA1 2883 chillispot_save(wp); 2884 #endif 2885 validate_cgi(wp); 2879 2886 } 2880 2887 -
src/router/httpd/visuals/dd-wrt.c
r17904 r18045 2022 2022 websWrite(wp, " MTU "); 2023 2023 // Bridges are bridges, Ports are ports, show it again HERE 2024 sprintf(bridge_name, "bridgemtu%d", count);2025 websWrite(wp,2026 "<input class=\"num\" name=\"%s\"size=\"5\" value=\"1500\" />\n",2027 bridge_name);2024 sprintf(bridge_name, "bridgemtu%d", count); 2025 websWrite(wp, 2026 "<input class=\"num\" name=\"%s\"size=\"5\" value=\"1500\" />\n", 2027 bridge_name); 2028 2028 websWrite(wp, "</div>\n"); 2029 2029 // don't show that here, since that is under Basic Setup 2030 // show_ipnetmask(wp, bridge);2030 // show_ipnetmask(wp, bridge); 2031 2031 count++; 2032 2032 } … … 2055 2055 break; 2056 2056 2057 2057 2058 websWrite(wp, "<div class=\"setting\">\n"); 2058 2059 websWrite(wp, "<div class=\"label\">Bridge %d</div>\n", count); … … 2071 2072 websWrite(wp, " MTU "); 2072 2073 // Bridges are bridges, Ports are ports, show it again HERE 2073 sprintf(bridge_name, "bridgemtu%d", count);2074 websWrite(wp,2075 "<input class=\"num\" name=\"%s\"size=\"5\" value=\"%s\" />\n",2076 bridge_name, mtu != NULL ? mtu : "1500");2074 sprintf(bridge_name, "bridgemtu%d", count); 2075 websWrite(wp, 2076 "<input class=\"num\" name=\"%s\"size=\"5\" value=\"%s\" />\n", 2077 bridge_name, mtu != NULL ? mtu : "1500"); 2077 2078 websWrite(wp, 2078 2079 "<script type=\"text/javascript\">\n//<![CDATA[\n document.write(\"<input class=\\\"button\\\" type=\\\"button\\\" value=\\\"\" + sbutton.del + \"\\\" onclick=\\\"bridge_del_submit(this.form,%d)\\\" />\");\n//]]>\n</script>\n", … … 2080 2081 websWrite(wp, "</div>\n"); 2081 2082 // don't show that here, since that is under Basic Setup 2082 if (strcmp(bridge, "br0")) {2083 if (strcmp(bridge,"br0")) { 2083 2084 show_ipnetmask(wp, bridge); 2084 2085 } … … 2104 2105 bridge_name, "32768"); 2105 2106 websWrite(wp, " MTU "); 2106 sprintf(bridge_name, "bridgemtu%d", count);2107 websWrite(wp,2108 "<input class=\"num\" name=\"%s\"size=\"5\" value=\"%s\" />\n",2109 bridge_name, "1500");2107 sprintf(bridge_name, "bridgemtu%d", count); 2108 websWrite(wp, 2109 "<input class=\"num\" name=\"%s\"size=\"5\" value=\"%s\" />\n", 2110 bridge_name, "1500"); 2110 2111 websWrite(wp, 2111 2112 "<script type=\"text/javascript\">\n//<![CDATA[\n document.write(\"<input class=\\\"button\\\" type=\\\"button\\\" value=\\\"\" + sbutton.del + \"\\\" onclick=\\\"bridge_del_submit(this.form,%d)\\\" />\");\n//]]>\n</script>\n", … … 3827 3828 3828 3829 sprintf(wl_regdomain, "%s_regdomain", prefix); 3829 if ( nvram_nmatch("1", "%s_regulatory", prefix) || !issuperchannel()) {3830 if (1 || nvram_nmatch("1", "%s_regulatory", prefix) || !issuperchannel()) { 3830 3831 websWrite(wp, 3831 3832 "<div class=\"setting\"><div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.regdom)</script></div>\n"); … … 3872 3873 3873 3874 } 3874 int txpower = atoi(nvram_safe_get(power)); 3875 int txpower = atoi(nvram_safe_get(power)); 3875 3876 #ifdef HAVE_ESPOD 3876 3877 #ifdef HAVE_SUB3 3877 if (txpower > 28) {3878 if(txpower > 28 ) { 3878 3879 txpower = 28; 3879 3880 nvram_set(power, "28"); 3880 3881 } 3881 3882 #else 3882 if (txpower > 30) {3883 if(txpower > 30 ) { 3883 3884 txpower = 28; 3884 3885 nvram_set(power, "30"); … … 3889 3890 websWrite(wp, 3890 3891 "<div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.TXpower)</script></div><input class=\"num\" name=\"%s\" size=\"6\" maxlength=\"3\" value=\"%d\" /> dBm\n", 3891 power, txpower + wifi_gettxpoweroffset(prefix)); 3892 power, 3893 txpower + wifi_gettxpoweroffset(prefix)); 3892 3894 websWrite(wp, "</div>\n"); 3893 3895 sprintf(power, "%s_antgain", prefix); … … 4179 4181 #endif 4180 4182 #ifdef HAVE_ATH9K 4181 if (!is_ath9k(prefix)) 4182 #endif 4183 { 4184 websWrite(wp, 4185 "document.write(\"<option value=\\\"10\\\" %s >\" + share.half + \"</option>\");\n", 4186 nvram_match(wl_width, 4187 "10") ? "selected=\\\"selected\\\"" : ""); 4188 websWrite(wp, 4189 "document.write(\"<option value=\\\"5\\\" %s >\" + share.quarter + \"</option>\");\n", 4190 nvram_match(wl_width, 4191 "5") ? "selected=\\\"selected\\\"" : ""); 4183 if (is_ath9k(prefix)) 4184 #endif 4185 { 4186 websWrite(wp, 4187 "document.write(\"<option value=\\\"10\\\" %s >\" + share.half + \"</option>\");\n", 4188 nvram_match(wl_width, "10") ? "selected=\\\"selected\\\"" : ""); 4189 websWrite(wp, 4190 "document.write(\"<option value=\\\"5\\\" %s >\" + share.quarter + \"</option>\");\n", 4191 nvram_match(wl_width, "5") ? "selected=\\\"selected\\\"" : ""); 4192 4192 #ifdef HAVE_SUBQUARTER 4193 4193 if (registered_has_subquarter()) { 4194 /* will be enabled once it is tested and the spectrum analyse is done */ 4195 websWrite(wp, 4196 "document.write(\"<option value=\\\"2\\\" %s >\" + share.subquarter + \"</option>\");\n", 4197 nvram_match(wl_width, 4198 "2") ? "selected=\\\"selected\\\"" : ""); 4194 /* will be enabled once it is tested and the spectrum analyse is done */ 4195 websWrite(wp, 4196 "document.write(\"<option value=\\\"2\\\" %s >\" + share.subquarter + \"</option>\");\n", 4197 nvram_match(wl_width, "2") ? "selected=\\\"selected\\\"" : ""); 4199 4198 } 4200 4199 #endif … … 4826 4825 "20") ? "selected=\\\"selected\\\"" : ""); 4827 4826 #ifdef HAVE_ATH9K 4828 if (!is_ath9k(prefix))4829 #endif 4830 {4831 websWrite(wp,4832 "document.write(\"<option value=\\\"10\\\" %s >\" + share.half + \"</option>\");\n",4833 nvram_match(wl_width,4834 "10") ? "selected=\\\"selected\\\"" : "");4835 websWrite(wp,4836 "document.write(\"<option value=\\\"5\\\" %s >\" + share.quarter + \"</option>\");\n",4837 nvram_match(wl_width,4838 "5") ? "selected=\\\"selected\\\"" : "");4839 }4827 if (is_ath9k(prefix)) 4828 #endif 4829 { 4830 websWrite(wp, 4831 "document.write(\"<option value=\\\"10\\\" %s >\" + share.half + \"</option>\");\n", 4832 nvram_match(wl_width, 4833 "10") ? "selected=\\\"selected\\\"" : ""); 4834 websWrite(wp, 4835 "document.write(\"<option value=\\\"5\\\" %s >\" + share.quarter + \"</option>\");\n", 4836 nvram_match(wl_width, 4837 "5") ? "selected=\\\"selected\\\"" : ""); 4838 } 4840 4839 #ifdef HAVE_SUBQUARTER 4841 if (registered_has_subquarter()) {4842 /* will be enabled once it is tested and the spectrum analyse is done */4843 websWrite(wp,4844 "document.write(\"<option value=\\\"2\\\" %s >\" + share.subquarter + \"</option>\");\n",4845 nvram_match(wl_width,4846 "2") ? "selected=\\\"selected\\\"" : "");4840 if(registered_has_subquarter()) { 4841 /* will be enabled once it is tested and the spectrum analyse is done */ 4842 websWrite(wp, 4843 "document.write(\"<option value=\\\"2\\\" %s >\" + share.subquarter + \"</option>\");\n", 4844 nvram_match(wl_width, 4845 "2") ? "selected=\\\"selected\\\"" : ""); 4847 4846 } 4848 4847 #endif … … 5114 5113 5115 5114 sprintf(wl_regdomain, "%s_regdomain", prefix); 5116 if ( nvram_nmatch("1", "%s_regulatory", prefix) || !issuperchannel()) {5115 if (1 || nvram_nmatch("1", "%s_regulatory", prefix) || !issuperchannel()) { 5117 5116 websWrite(wp, 5118 5117 "<div class=\"setting\"><div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.regdom)</script></div>\n"); … … 5154 5153 #ifdef HAVE_ESPOD 5155 5154 #ifdef HAVE_SUB3 5156 if (txpower > 28 ) {5155 if (txpower > 28 ) { 5157 5156 txpower = 28; 5158 5157 nvram_set(power, "28"); 5159 5158 } 5160 5159 #else 5161 if (txpower > 30 ) {5160 if (txpower > 30 ) { 5162 5161 txpower = 30; 5163 5162 nvram_set(power, "30"); … … 5168 5167 websWrite(wp, 5169 5168 "<div class=\"label\"><script type=\"text/javascript\">Capture(wl_basic.TXpower)</script></div><input class=\"num\" name=\"%s\" size=\"6\" maxlength=\"3\" value=\"%d\" /> dBm\n", 5170 power, txpower + wifi_gettxpoweroffset(prefix)); 5169 power, 5170 txpower + wifi_gettxpoweroffset(prefix)); 5171 5171 websWrite(wp, "</div>\n"); 5172 5172 sprintf(power, "%s_antgain", prefix); … … 6567 6567 #ifdef HAVE_ESPOD 6568 6568 char *p; 6569 p = strtok( line, ",");6570 if (p != NULL) {6569 p = strtok( line, "," ); 6570 if( p != NULL ) { 6571 6571 websWrite(wp, "%s<br>\n", p); 6572 p = strtok( NULL, "\0");6572 p = strtok( NULL, "\0"); 6573 6573 websWrite(wp, "%s", p); 6574 6574 } … … 7703 7703 getIfList(bufferif, "br"); 7704 7704 foreach(var, eths, next) { 7705 int skipip = 0;7706 7705 if (!strcmp("etherip0", var)) 7707 7706 continue; 7708 if (strchr(var, '.') == NULL){7707 if (strchr(var,'.') == NULL) { 7709 7708 if (!strcmp(get_wan_face(), var)) 7710 7709 continue; 7711 if (!strcmp(nvram_safe_get("lan_ifname"), var) 7712 && !has_gateway()) 7710 if (!strcmp(nvram_safe_get("lan_ifname"), var)) 7713 7711 continue; 7714 7712 foreach(bword, bufferif, bnext) { 7715 if (!strcmp(bword, var)) {7716 skipip = 1;7713 if(!strcmp( bword, var) ) { 7714 goto skip; 7717 7715 } 7718 7716 } 7719 7717 } 7718 7720 7719 char layer[64]; 7721 7720 strcpy(layer, var); 7722 7721 rep(layer, '.', 'X'); 7723 7724 7722 sprintf(ssid, "%s_bridged", var); 7725 7723 // nvram_nset("0", "%s_bridged", var); … … 7741 7739 websWrite(wp, "<div id=\"%s_idnet\">\n", layer); 7742 7740 7743 if (!skipip) { 7744 char mtu[32]; 7745 sprintf(mtu, "%s_mtu", var); 7746 websWrite(wp, "<div class=\"setting\">\n"); 7747 websWrite(wp, "<div class=\"label\">%s</div>\n", 7748 live_translate("idx.mtu")); 7749 websWrite(wp, 7750 "<input class=\"num\" maxlength=\"4\" onblur=\"valid_mtu(this)\" size=\"5\" name=\"%s_mtu\" value=\"%s\" />\n", 7751 var, nvram_default_get(mtu, "1500")); 7752 websWrite(wp, "</div>\n"); 7753 } 7741 websWrite(wp, "<div class=\"setting\">\n"); 7742 websWrite(wp, "<div class=\"label\">%s</div>\n", 7743 live_translate("idx.mtu")); 7744 char mtu[32]; 7745 sprintf(mtu, "%s_mtu", var); 7746 websWrite(wp, 7747 "<input class=\"num\" maxlength=\"4\" onblur=\"valid_mtu(this)\" size=\"5\" name=\"%s_mtu\" value=\"%s\" />\n", 7748 var, nvram_default_get(mtu, "1500")); 7749 websWrite(wp, "</div>\n"); 7750 7754 7751 char mcast[32]; 7755 7752 … … 7763 7760 showRadio(wp, "wl_basic.masquerade", mcast); 7764 7761 } 7765 if (!skipip) 7766 show_ipnetmask(wp, var);7762 7763 show_ipnetmask(wp, var); 7767 7764 #if defined(HAVE_BKM) || defined(HAVE_TMK) 7768 7765 #ifdef HAVE_REGISTER 7769 7766 if (registered_has_cap(21)) 7770 7767 #endif 7771 {7768 { 7772 7769 char nld_enable[32], nld_bridge[32], bufferif[256]; 7773 7770 static char word[256]; … … 7776 7773 sprintf(nld_enable, "nld_%s_enable", var); 7777 7774 websWrite(wp, 7778 "<div class=\"setting\">\n<div class=\"label\">ZCM enable</div>\n");7775 "<div class=\"setting\">\n<div class=\"label\">ZCM enable</div>\n"); 7779 7776 websWrite(wp, 7780 "<input class=\"spaceradio\" type=\"checkbox\" name=\"nld_%s_enable\" value=\"1\" %s /></div>\n", 7781 var, nvram_match(nld_enable, 7782 "1") ? "checked=\"checked\"" 7783 : ""); 7777 "<input class=\"spaceradio\" type=\"checkbox\" name=\"nld_%s_enable\" value=\"1\" %s /></div>\n", var, 7778 nvram_match(nld_enable, "1") ? "checked=\"checked\"" : ""); 7784 7779 7785 7780 sprintf(nld_bridge, "nld_%s_bridge", var); 7786 nvram_default_get(nld_bridge, "br0");7781 nvram_default_get(nld_bridge,"br0"); 7787 7782 websWrite(wp, 7788 7783 "<div class=\"setting\">\n<div class=\"label\"><script type=\"text/javascript\">/*Capture(idx.wanport)*/</script>ZCM Bridge</div>\n"); … … 7793 7788 foreach(word, bufferif, next) { 7794 7789 // if( strcmp( word, "br0" ) ) { 7795 websWrite(wp, 7796 "<option value=\"%s\" %s >%s</option>\n", 7797 word, nvram_match(nld_bridge, 7798 word) ? 7799 "selected=\"selected\"" : "", word); 7790 websWrite(wp, "<option value=\"%s\" %s >%s</option>\n", 7791 word, nvram_match( nld_bridge, word ) ? "selected=\"selected\"" : 7792 "", word); 7800 7793 // } 7801 7794 } … … 7805 7798 #if defined(HAVE_BATMANADV) 7806 7799 #ifdef HAVE_REGISTER 7807 if (registered_has_cap(19)) 7800 if (registered_has_cap(19)) 7808 7801 #endif 7809 7802 { … … 7814 7807 sprintf(bat_enable, "bat_%s_enable", var); 7815 7808 websWrite(wp, 7816 "<div class=\"setting\">\n<div class=\"label\">L2Mesh enable</div>\n");7809 "<div class=\"setting\">\n<div class=\"label\">L2Mesh enable</div>\n"); 7817 7810 websWrite(wp, 7818 "<input class=\"spaceradio\" type=\"checkbox\" name=\"bat_%s_enable\" value=\"1\" %s /></div>\n", 7819 var, nvram_match(bat_enable, 7820 "1") ? "checked=\"checked\"" 7821 : ""); 7811 "<input class=\"spaceradio\" type=\"checkbox\" name=\"bat_%s_enable\" value=\"1\" %s /></div>\n", var, 7812 nvram_match(bat_enable, "1") ? "checked=\"checked\"" : ""); 7822 7813 7823 7814 sprintf(bat_bridge, "bat_%s_bridge", var); 7824 nvram_default_get(bat_bridge, "br0");7815 nvram_default_get(bat_bridge,"br0"); 7825 7816 websWrite(wp, 7826 7817 "<div class=\"setting\">\n<div class=\"label\"><script type=\"text/javascript\">/*Capture(idx.wanport)*/</script>L2Mesh Bridge</div>\n"); … … 7831 7822 foreach(word, bufferif, next) { 7832 7823 // if( strcmp( word, "br0" ) ) { 7833 websWrite(wp, 7834 "<option value=\"%s\" %s >%s</option>\n", 7835 word, nvram_match(bat_bridge, 7836 word) ? 7837 "selected=\"selected\"" : "", word); 7824 websWrite(wp, "<option value=\"%s\" %s >%s</option>\n", 7825 word, nvram_match( bat_bridge, word ) ? "selected=\"selected\"" : 7826 "", word); 7838 7827 // } 7839 7828 } … … 7841 7830 } 7842 7831 #endif 7843 websWrite(wp, "<br />\n"); 7844 websWrite(wp, "</div>\n"); 7832 websWrite(wp, "<br />\n</div>\n"); 7845 7833 websWrite(wp, 7846 7834 "<script type=\"text/javascript\">\n//<![CDATA[\n "); … … 7850 7838 "0") ? "true" : "false"); 7851 7839 websWrite(wp, "//]]>\n</script>\n"); 7840 skip:; 7852 7841 } 7853 7842 websWrite(wp, "</fieldset><br />\n"); -
src/router/httpd/visuals/wireless_madwifiath9k.c
r16587 r18045 45 45 struct wifi_client_info *wc; 46 46 char nb[32]; 47 int bias,qual ;47 int bias,qual,it; 48 48 49 49 sprintf(nb, "%s_bias", ifname); 50 50 bias = atoi(nvram_default_get(nb, "0")); 51 // sprintf(it, "inactivity_time", ifname); 52 it = atoi(nvram_default_get("inacttime", "300000")); 51 53 52 54 mac80211_info = mac80211_assoclist(ifname); … … 68 70 qual = wc->signal * 124 + 11600; 69 71 qual /= 10; 70 72 if (wc->inactive_time < it) 71 73 websWrite(wp, 72 74 "'%s','%s','%s','%dM','%dM','%d','%d','%d','%d'", -
src/router/libutils/Makefile
r18022 r18045 52 52 ifeq ($(CONFIG_SUPERCHANNEL),y) 53 53 CFLAGS += -DHAVE_SUPERCHANNEL 54 ATH9KCFLAGS += -DHAVE_SUPERCHANNEL 54 55 OBJS += $(TOP)/register/register_check.o 55 56 endif 56 57 ifeq ($(CONFIG_REGISTER),y) 57 58 CFLAGS += -DHAVE_REGISTER 59 ATH9KCFLAGS += -DHAVE_REGISTER 58 60 OBJS += $(TOP)/register/register_check.o 59 61 endif … … 139 141 CFLAGS += -DHAVE_SAMBA3 140 142 CFLAGS += -DHAVE_SAMBA_SERVER 143 OBJS += $(TOP)/jansson/src/.libs/libjansson.a 144 endif 145 ifeq ($(CONFIG_TIEXTRA1),y) 146 OBJS += $(TOP)/private/telkom/mchillispot.o 147 CFLAGS += -I$(TOP)/jansson/src -I$(TOP)/private/telkom 148 CFLAGS += -DHAVE_TIEXTRA1 141 149 OBJS += $(TOP)/jansson/src/.libs/libjansson.a 142 150 endif … … 783 791 CFLAGS += -DHAVE_WR740v1 784 792 endif 793 ifeq ($(CONFIG_JJAP93),y) 794 CFLAGS += -DHAVE_JJAP93 795 endif 785 796 786 797 ifeq ($(CONFIG_MACBIND),y) … … 901 912 CFLAGS += -DHAVE_SUBQUARTER 902 913 endif 914 915 include $(TOP)/rules/generic.mk 916 CFLAGS += $(DD_CFLAGS) 903 917 904 918 ifeq ($(CONFIG_MATRIXSSL),y) … … 928 942 rm -f *.h~ 929 943 rm -f *.c~ 944 rm -f $(TOP)/private/telkom/*.o 945 946 930 947 931 948 libutils.so: $(OBJS) 932 949 $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ $^ -lcrypt -L../nvram -lnvram 950 951 mchillispot.o: $(TOP)/private/telkom/mchillispot.c 952 $(CC) -DNEED_PRINTF -I$(TOP)/jansson/src $(ATH9KCFLAGS) -c -o $@ $^ 953 933 954 934 955 libwireless.so: $(WOBJS) -
src/router/libutils/country.c
r17601 r18045 279 279 CTRY_ICELAND = 352, /* Iceland */ 280 280 CTRY_INDIA = 356, /* India */ 281 CTRY_INDIA_BFWA = 357, /* India BFWA*/ 281 282 CTRY_INDONESIA = 360, /* Indonesia */ 282 283 CTRY_IRAN = 364, /* Iran */ … … 525 526 //#else 526 527 {CTRY_INDIA, APL11_WORLD, "IN", "INDIA", YES, YES, YES, 5825}, 528 {CTRY_INDIA_BFWA, APL11_WORLD, "97", "INDIA_BFWA", YES, YES, YES, 5875}, 527 529 //#endif 528 530 {CTRY_INDONESIA, APL1_WORLD, "ID", "INDONESIA", YES, NO, YES, 7000}, -
src/router/libutils/mac80211info.c
r17696 r18045 95 95 } 96 96 97 98 97 static struct nla_policy survey_policy[NL80211_SURVEY_INFO_MAX + 1] = { 99 98 [NL80211_SURVEY_INFO_FREQUENCY] = { .type = NLA_U32 }, … … 147 146 } 148 147 149 if (sinfo[NL80211_SURVEY_INFO_NOISE]) { 148 if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]) 149 mac80211_info->channel_receive_time = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]); 150 151 if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]) 152 mac80211_info->channel_transmit_time = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]); 153 154 if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY]) 155 mac80211_info->extension_channel_busy_time = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY]); 156 157 if (sinfo[NL80211_SURVEY_INFO_NOISE]) 150 158 mac80211_info->noise = nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]); 151 }152 159 } 153 160 … … 433 440 }; 434 441 435 436 442 int mac80211_check_band(char *interface,int checkband) { 437 443 struct nlattr *tb[NL80211_BAND_ATTR_MAX + 1]; … … 439 445 struct nlattr *bands, *band,*freqlist,*freq; 440 446 int rem, rem2, freq_mhz; 441 int phy =0;447 int phy; 442 448 int bandfound=0; 443 449 phy = mac80211_get_phyidx_by_vifname(interface); … … 496 502 int chancount=0; 497 503 int count=0; 504 char sc[32]; 505 int skip=1; 506 int rrdcount=0; 498 507 499 508 phy = mac80211_get_phyidx_by_vifname(interface); 500 509 if (phy == -1) return NULL; 510 /* 511 #ifdef HAVE_SUPERCHANNEL 512 sprintf(sc, "%s_regulatory", interface); 513 if (issuperchannel() && atoi(nvram_default_get(sc, "1")) == 0) skip=0; 514 #endif 515 */ 516 skip =0; 501 517 502 518 rd=mac80211_get_regdomain(country); 519 // for now just leave 520 if (rd == NULL) return list; 503 521 504 522 msg = unl_genl_msg(&unl, NL80211_CMD_GET_WIPHY, false); … … 526 544 continue; 527 545 528 if ( tb[NL80211_FREQUENCY_ATTR_DISABLED])546 if (skip && tb[NL80211_FREQUENCY_ATTR_DISABLED]) 529 547 continue; 530 548 regfound=0; … … 535 553 range=max_bandwidth_khz/2; 536 554 freq_mhz = (int) nla_get_u32(tb[NL80211_FREQUENCY_ATTR_FREQ]); 537 for (rrc = 0; rrc < rd->n_reg_rules; rrc++) { 555 if (skip == 0) 556 rrdcount=1; 557 else 558 rrdcount=rd->n_reg_rules; 559 for (rrc = 0; rrc < rrdcount; rrc++) { 538 560 regfreq = rd->reg_rules[rrc].freq_range; 539 561 startfreq=(int)((float)(regfreq.start_freq_khz)/1000.0); 540 562 stopfreq=(int)((float)(regfreq.end_freq_khz)/1000.0); 541 563 regmaxbw=(int)((float)(regfreq.max_bandwidth_khz)/1000.0); 542 if ( (freq_mhz - range) >= startfreq && (freq_mhz + range) <= stopfreq) {564 if ( !skip || ( (freq_mhz - range) >= startfreq && (freq_mhz + range) <= stopfreq )) { 543 565 if (run == 1) { 544 566 regpower = rd->reg_rules[rrc].power_rule; … … 566 588 if (rd->reg_rules[rrc].flags & RRF_NO_IBSS) 567 589 list[count].no_ibss = 1; 568 if (max_bandwidth_khz == 40) { 569 if ((freq_mhz - htrange) >= startfreq ) { 570 list[count].ht40minus = 1; 571 } 572 if ((freq_mhz + htrange) <= stopfreq) { 573 list[count].ht40plus = 1; 590 if (!skip) { 591 list[count].ht40minus = 1; 592 list[count].ht40plus = 1; 593 } 594 else { 595 if (max_bandwidth_khz == 40) { 596 if ((freq_mhz - htrange) >= startfreq ) { 597 list[count].ht40minus = 1; 598 } 599 if ((freq_mhz + htrange) <= stopfreq) { 600 list[count].ht40plus = 1; 601 } 574 602 } 575 603 } … … 591 619 nlmsg_free(msg); 592 620 return NULL; 621 } 622 623 int mac80211_check_valid_frequency(char *interface, char *country, int freq) { 624 struct wifi_channels *chan; 625 int found=0; 626 int i=0; 627 chan = mac80211_get_channels(interface, country, 40, 0xff); 628 if (chan != NULL) 629 while (chan[i].freq != -1) { 630 if (freq == chan[i].freq) { 631 found=1; 632 break; 633 } 634 i++; 635 } 636 if (chan != NULL) 637 free(chan); 638 if ( found ) 639 return(freq); 640 else 641 return(0); 593 642 } 594 643 -
src/router/libutils/utils.c
r18041 r18045 963 963 nvram_default_get("ath0_txantenna", "1"); 964 964 return ROUTER_BOARD_WHRHPGN; 965 #elif HAVE_JJAP93 966 setRouter("JJPLUS AP93"); 967 nvram_default_get("ath0_rxantenna", "1"); 968 nvram_default_get("ath0_txantenna", "1"); 969 return ROUTER_BOARD_PB42; 970 #elif HAVE_JJAP005 971 setRouter("JJPLUS AP005"); 972 nvram_default_get("ath0_rxantenna", "1"); 973 nvram_default_get("ath0_txantenna", "1"); 974 return ROUTER_BOARD_PB42; 975 #elif HAVE_JJAP501 976 setRouter("JJPLUS AP501"); 977 nvram_default_get("ath0_rxantenna", "3"); 978 nvram_default_get("ath0_txantenna", "3"); 979 return ROUTER_BOARD_PB42; 980 #elif HAVE_AC722 981 setRouter("ACCTON AC722"); 982 nvram_default_get("ath0_rxantenna", "3"); 983 nvram_default_get("ath0_txantenna", "3"); 984 return ROUTER_BOARD_PB42; 985 #elif HAVE_AC622 986 setRouter("ACCTON AC622"); 987 nvram_default_get("ath0_rxantenna", "3"); 988 nvram_default_get("ath0_txantenna", "3"); 989 return ROUTER_BOARD_PB42; 965 990 #elif HAVE_UBNTM 966 991 typedef struct UBNTDEV { -
src/router/libutils/wl.c
r17559 r18045 116 116 if (freq == 2484) 117 117 return 14; 118 if (freq < 2484 ) {119 int chan = (freq - (2407)) / 5;120 if (chan < 0)121 chan +=256;122 return chan;123 }118 if (freq < 2484 && freq > 2407 ) 119 return (freq - 2407) / 5; 120 if (freq < 2412 ){ 121 int d = ((((int)freq) - 2412) / 5) + 256; 122 return d; 123 } 124 124 if (freq < 2502) 125 125 return 14; … … 128 128 if (freq < 4990 && freq > 4940) 129 129 return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; 130 else if (freq >= 4800 && freq < 5005) 131 return (freq - 4000) / 5; 130 132 if (freq < 5000) 131 133 return 15 + ((freq - (2512)) / 20); -
src/router/nvram/Makefile
r17157 r18045 102 102 CFLAGS += -DHAVE_WR1043 103 103 endif 104 ifeq ($(CONFIG_JJAP93),y) 105 CFLAGS += -DHAVE_JJAP93 106 endif 104 107 ifeq ($(CONFIG_NVRAM_60K),y) 105 108 CFLAGS += -DHAVE_NVRAM_60K … … 108 111 CFLAGS += -DHAVE_NVRAM_64K 109 112 endif 113 114 include $(TOP)/rules/generic.mk 115 CFLAGS += $(DD_CFLAGS) 110 116 111 117 vpath %.c $(SRCBASE)/shared/nvram -
src/router/rc/Makefile
r17944 r18045 284 284 ifeq ($(CONFIG_JA76PF),y) 285 285 CFLAGS += -DHAVE_JA76PF 286 endif 287 ifeq ($(CONFIG_JA76PF2),y) 288 CFLAGS += -DHAVE_JA76PF2 286 289 endif 287 290 ifeq ($(CONFIG_ALFAAP94),y) … … 462 465 CFLAGS += -DHAVE_USR5453 463 466 endif 467 ifeq ($(CONFIG_JJAP93),y) 468 CFLAGS += -DHAVE_JJAP93 469 endif 464 470 ifeq ($(CONFIG_WIVIZ),y) 465 471 OBJS += run_wiviz.o … … 714 720 CFLAGS += -DHAVE_ATH9K 715 721 endif 722 723 include $(TOP)/rules/generic.mk 724 CFLAGS += $(DD_CFLAGS) 716 725 717 726 vpath %.c $(TOP)/shared $(SRCBASE)/rts/src … … 783 792 cd $(INSTALLDIR)/sbin && ln -sf rc mtd 784 793 cd $(INSTALLDIR)/sbin && ln -sf rc beep 794 cd $(INSTALLDIR)/sbin && ln -sf rc ledtracking 785 795 ifeq ($(CONFIG_REGISTER),y) 786 796 cd $(INSTALLDIR)/sbin && ln -sf rc regshell -
src/router/services/Makefile
r18023 r18045 362 362 CFLAGS_EXTRA += -DHAVE_WRT400 363 363 endif 364 ifeq ($(CONFIG_JJAP93),y) 365 CFLAGS_EXTRA += -DHAVE_JJAP93 -DDDMACOFFSET=$(CONFIG_MACOFFSET) 366 endif 364 367 ifeq ($(CONFIG_VLANTAGGING),y) 365 368 CFLAGS_EXTRA += -DHAVE_VLANTAGGING … … 568 571 OBJS += upnp.o 569 572 endif 570 ifeq ($(CONFIG_CHILLILOCAL),y)571 CFLAGS_EXTRA += -DHAVE_CHILLILOCAL572 OBJS += chillispot.o573 endif574 573 575 574 ifeq ($(CONFIG_TFTP),y) … … 885 884 endif 886 885 886 ifeq ($(CONFIG_TIEXTRA1),y) 887 CFLAGS += -DHAVE_TIEXTRA1 888 endif 889 887 890 ifeq ($(CONFIG_GGEW),y) 888 891 CFLAGS_EXTRA += -DHAVE_GGEW … … 998 1001 999 1002 ifeq ($(CONFIG_CHILLISPOT),y) 1003 ifeq ($(CONFIG_CHILLILOCAL),y) 1004 CFLAGS_EXTRA += -DHAVE_CHILLILOCAL 1005 endif 1000 1006 CFLAGS_EXTRA += -DHAVE_CHILLI 1007 OBJS += chillispot.o 1001 1008 endif 1002 1009 ifeq ($(CONFIG_HOTSPOT),y) … … 1144 1151 CFLAGS_EXTRA += -DHAVE_ADMTEKNESTEDVLAN 1145 1152 endif 1153 1154 include $(TOP)/rules/generic.mk 1155 CFLAGS_EXTRA += $(DD_CFLAGS) 1146 1156 1147 1157 CFLAGS += $(CFLAGS_EXTRA) -
src/router/services/networking/firewall.c
r17922 r18045 2577 2577 if (has_gateway()) { 2578 2578 save2file 2579 ("-I INPUT -m state --state NEW -i tun 0-j %s\n",2579 ("-I INPUT -m state --state NEW -i tun+ -j %s\n", 2580 2580 log_accept); 2581 2581 save2file 2582 ("-I FORWARD -m state --state NEW -i tun 0-j %s\n",2582 ("-I FORWARD -m state --state NEW -i tun+ -j %s\n", 2583 2583 log_accept); 2584 2584 } else { 2585 save2file("-I INPUT -i tun 0-j %s\n", log_accept);2586 save2file("-I FORWARD -i tun 0-j %s\n", log_accept);2585 save2file("-I INPUT -i tun+ -j %s\n", log_accept); 2586 save2file("-I FORWARD -i tun+ -j %s\n", log_accept); 2587 2587 } 2588 2588 } -
src/router/services/networking/interface.c
r17944 r18045 594 594 snprintf(all_ifnames, 255, "%s %s %s", "eth0", 595 595 nvram_safe_get("lan_ifnames"), nvram_safe_get("wan_ifnames")); 596 #elif CONFIG_JJAP93 597 snprintf(all_ifnames, 255, "%s %s %s", "eth0", 598 nvram_safe_get("lan_ifnames"), nvram_safe_get("wan_ifnames")); 599 #elif HAVE_JJAP005 600 snprintf(all_ifnames, 255, "%s %s %s", "eth0 eth1", 601 nvram_safe_get("lan_ifnames"), nvram_safe_get("wan_ifnames")); 602 #elif HAVE_JJAP501 603 snprintf(all_ifnames, 255, "%s %s %s", "eth0 eth1", 604 nvram_safe_get("lan_ifnames"), nvram_safe_get("wan_ifnames")); 605 #elif HAVE_AC722 606 snprintf(all_ifnames, 255, "%s %s %s", "eth0 eth1", 607 nvram_safe_get("lan_ifnames"), nvram_safe_get("wan_ifnames")); 608 #elif HAVE_AC622 609 snprintf(all_ifnames, 255, "%s %s %s", "eth0 eth1", 610 nvram_safe_get("lan_ifnames"), nvram_safe_get("wan_ifnames")); 596 611 #elif HAVE_RS 597 612 snprintf(all_ifnames, 255, "%s %s %s", "eth0 eth1", -
src/router/services/networking/madwifi.c
r17798 r18045 2365 2365 int changed = 0; 2366 2366 2367 #ifdef HAVE_ATH9K 2368 char regdomain[16]; 2369 char *country; 2370 sprintf(regdomain, "ath0_regdomain"); 2371 country = nvram_default_get(regdomain, "UNITED_STATES"); 2372 sysprintf("iw reg set 00"); 2373 sysprintf("iw reg set %s", getIsoName(country)); 2374 sleep (4); 2375 #endif 2367 2376 for (i = 0; i < c; i++) 2368 2377 adjust_regulatory(i); -
src/router/services/networking/madwifi_ath9k.c
r18021 r18045 112 112 char *country; 113 113 sprintf(dev, "ath%d", count); 114 sprintf(regdomain, "%s_regdomain", dev);115 country = nvram_default_get(regdomain, "US");116 sysprintf("iw reg set %s", getIsoName(country));117 sleep(3);114 // sprintf(regdomain, "%s_regdomain", dev); 115 // country = nvram_default_get(regdomain, "US"); 116 // sysprintf("iw reg set %s", getIsoName(country)); 117 // // sleep(3); 118 118 if (count == 0) 119 119 vapcount = 0; … … 132 132 sprintf(net, "%s_net_mode", dev); 133 133 char *netmode = nvram_default_get(net, "mixed"); 134 if (!strcmp(netmode, "disabled")) {134 if (!strcmp(netmode, "disabled")) 135 135 return; 136 } 136 char bw[32]; 137 138 // set channelbw ht40 is also 20! 139 140 sprintf(bw, "%s_channelbw", dev); 141 if (nvram_match(bw, "5")) 142 sysprintf("echo 5 > /sys/kernel/debug/ieee80211/%s/ath9k/chanbw", wif); 143 else if (nvram_match(bw, "10")) 144 sysprintf("echo 10 > /sys/kernel/debug/ieee80211/%s/ath9k/chanbw", wif); 145 else 146 sysprintf("echo 20 > /sys/kernel/debug/ieee80211/%s/ath9k/chanbw", wif); 147 137 148 #ifdef HAVE_REGISTER 138 149 int cpeonly = iscpe(); … … 227 238 struct wifi_channels *chan; 228 239 int channel = 0; 240 int freq = 0; 229 241 static char nfreq[16]; 230 242 int i = 0; … … 305 317 } 306 318 } 307 319 else 320 sprintf(ht, "20"); 308 321 } else { 309 322 sprintf(ht, "20"); … … 332 345 // also we still should take care on the selected mode 333 346 sprintf(nfreq, "%s_channel", prefix); 334 intfreq = atoi(nvram_default_get(nfreq, "0"));347 freq = atoi(nvram_default_get(nfreq, "0")); 335 348 if (freq == 0) { 336 349 struct mac80211_ac *acs; … … 377 390 if (chan) 378 391 free(chan); 379 if (channel < 36) { 380 if (!strcmp(netmode, "b-only")) { 381 fprintf(fp, "hw_mode=b\n"); 382 fprintf(fp, "supported_rates=10 20 55 110\n"); 383 } else { 384 fprintf(fp, "hw_mode=g\n"); 385 } 386 387 } else 392 if (freq < 4000) 393 fprintf(fp, "hw_mode=g\n"); 394 else 388 395 fprintf(fp, "hw_mode=a\n"); 389 396 fprintf(fp, "channel=%d\n", channel); 397 fprintf(fp, "\n"); 398 fprintf(fp, "frequency=%d\n", freq); 390 399 fprintf(fp, "\n"); 391 400 } -
src/router/services/networking/network.c
r17944 r18045 1086 1086 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1087 1087 PORTSETUPWAN("eth0"); 1088 } 1089 strncpy(ifr.ifr_name, "eth1", IFNAMSIZ); 1090 ioctl(s, SIOCGIFHWADDR, &ifr); 1091 if (nvram_match("et0macaddr", "")) 1092 nvram_set("et0macaddr", 1093 ether_etoa(ifr.ifr_hwaddr.sa_data, eabuf)); 1094 strcpy(mac, nvram_safe_get("et0macaddr")); 1095 #elif CONFIG_JJAP93 1096 if (getSTA() || getWET() || CANBRIDGE()) { 1097 nvram_setz(lan_ifnames, "eth0 ath0"); 1098 PORTSETUPWAN(""); 1099 } else { 1100 nvram_setz(lan_ifnames, "eth0 ath0"); 1101 PORTSETUPWAN("eth0"); 1102 } 1103 strncpy(ifr.ifr_name, "eth0", IFNAMSIZ); 1104 ioctl(s, SIOCGIFHWADDR, &ifr); 1105 if (nvram_match("et0macaddr", "")) 1106 nvram_set("et0macaddr", 1107 ether_etoa(ifr.ifr_hwaddr.sa_data, eabuf)); 1108 strcpy(mac, nvram_safe_get("et0macaddr")); 1109 #elif HAVE_JJAP005 1110 if (getSTA() || getWET() || CANBRIDGE()) { 1111 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1112 PORTSETUPWAN(""); 1113 } else { 1114 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1115 PORTSETUPWAN("eth1"); 1116 } 1117 strncpy(ifr.ifr_name, "eth1", IFNAMSIZ); 1118 ioctl(s, SIOCGIFHWADDR, &ifr); 1119 if (nvram_match("et0macaddr", "")) 1120 nvram_set("et0macaddr", 1121 ether_etoa(ifr.ifr_hwaddr.sa_data, eabuf)); 1122 strcpy(mac, nvram_safe_get("et0macaddr")); 1123 #elif HAVE_JJAP501 1124 if (getSTA() || getWET() || CANBRIDGE()) { 1125 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1126 PORTSETUPWAN(""); 1127 } else { 1128 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1129 PORTSETUPWAN("eth1"); 1130 } 1131 strncpy(ifr.ifr_name, "eth1", IFNAMSIZ); 1132 ioctl(s, SIOCGIFHWADDR, &ifr); 1133 if (nvram_match("et0macaddr", "")) 1134 nvram_set("et0macaddr", 1135 ether_etoa(ifr.ifr_hwaddr.sa_data, eabuf)); 1136 strcpy(mac, nvram_safe_get("et0macaddr")); 1137 #elif HAVE_AC722 1138 if (getSTA() || getWET() || CANBRIDGE()) { 1139 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1140 PORTSETUPWAN(""); 1141 } else { 1142 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1143 PORTSETUPWAN("eth1"); 1144 } 1145 strncpy(ifr.ifr_name, "eth1", IFNAMSIZ); 1146 ioctl(s, SIOCGIFHWADDR, &ifr); 1147 if (nvram_match("et0macaddr", "")) 1148 nvram_set("et0macaddr", 1149 ether_etoa(ifr.ifr_hwaddr.sa_data, eabuf)); 1150 strcpy(mac, nvram_safe_get("et0macaddr")); 1151 #elif HAVE_AC622 1152 if (getSTA() || getWET() || CANBRIDGE()) { 1153 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1154 PORTSETUPWAN(""); 1155 } else { 1156 nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 1157 PORTSETUPWAN("eth1"); 1088 1158 } 1089 1159 strncpy(ifr.ifr_name, "eth1", IFNAMSIZ); -
src/router/services/services/chillispot.c
r17266 r18045 113 113 "chilli : chilli daemon successfully started\n"); 114 114 } 115 #ifdef HAVE_TIEXTRA1 116 start_mchilli(); 117 #endif 115 118 116 119 cprintf("done\n"); -
src/router/services/services/routing.c
r15610 r18045 34 34 35 35 int zebra_ospf_init(void); 36 int zebra_ospf6_init(void); 36 37 int zebra_bgp_init(void); 37 38 int zebra_ripd_init(void); … … 51 52 dd_syslog(LOG_INFO, 52 53 "zebra : zebra (ospf) successfully initiated\n"); 54 } else if (!strcmp(var, "ospf6")) { 55 zebra_ospf6_init(); 56 dd_syslog(LOG_INFO, 57 "zebra : zebra (ospf6) successfully initiated\n"); 53 58 } else if (!strcmp(var, "bgp")) { 54 59 zebra_bgp_init(); … … 103 108 nvram_set("ospfd_copt", "0"); 104 109 nvram_unset("ospfd_conf"); 110 } 111 112 in = fopen("/tmp/ospf6d.conf", "rb"); 113 114 if (in != NULL) { 115 fseek(in, 0, SEEK_END); 116 int len = ftell(in); 117 118 rewind(in); 119 char *buf = malloc(len + 1); 120 121 fread(buf, len, 1, in); 122 buf[len] = 0; 123 fclose(in); 124 nvram_set("ospf6d_copt", "1"); 125 nvram_set("ospf6d_conf", buf); 126 free(buf); 127 } else { 128 nvram_set("ospf6d_copt", "0"); 129 nvram_unset("ospf6d_conf"); 105 130 } 106 131 … … 267 292 ret1 = eval("zebra", "-d", "-r", "-f", "/tmp/zebra.conf"); 268 293 ret2 = eval("ospfd", "-d", "-f", "/tmp/ospfd.conf"); 294 295 return ret1 + ret2; 296 } 297 298 int zebra_ospf6_init(void) 299 { 300 char *lf = nvram_safe_get("lan_ifname"); 301 char *wf = get_wan_face(); 302 303 FILE *fp; 304 int ret1, ret2, s = 0, i = 0; 305 306 /* 307 * Write configuration file based on current information 308 */ 309 if (!(fp = fopen("/tmp/zebra.conf", "w"))) { 310 perror("/tmp/zebra.conf"); 311 return errno; 312 } 313 314 if (nvram_match("zebra_copt", "1")) { 315 if (nvram_match("zebra_log", "1")) { 316 fprintf(fp, "log file /var/log/zebra.log\n"); 317 } 318 } 319 320 if (strlen(nvram_safe_get("zebra_conf")) > 0) { 321 fwritenvram("zebra_conf", fp); 322 } 323 324 fclose(fp); 325 326 if (!(fp = fopen("/tmp/ospf6d.conf", "w"))) { 327 perror("/tmp/ospf6d.conf"); 328 return errno; 329 } 330 331 if (nvram_match("ospf6d_copt", "1") 332 && strlen(nvram_safe_get("ospf6d_conf"))) { 333 fwritenvram("ospf6d_conf", fp); 334 } else { 335 fprintf(fp, "!\n"); 336 // fprintf (fp, "password %s\n", nvram_safe_get ("http_passwd")); 337 // fprintf (fp, "enable password %s\n", nvram_safe_get 338 // ("http_passwd")); 339 fprintf(fp, "!\n!\n!\n"); 340 341 fprintf(fp, "interface %s\n!\n", lf); 342 if (wf && strlen(wf) > 0) 343 fprintf(fp, "interface %s\n", wf); 344 345 int cnt = get_wl_instances(); 346 int c; 347 348 for (c = 0; c < cnt; c++) { 349 if (nvram_nmatch("1", "wl%d_br1_enable", c)) { 350 fprintf(fp, "!\n! 'Subnet' WDS bridge\n"); 351 fprintf(fp, "interface br1\n"); 352 } 353 if (nvram_nmatch("ap", "wl%d_mode", c)) 354 for (s = 1; s <= MAX_WDS_DEVS; s++) { 355 char wdsdevospf[32] = { 0 }; 356 char *dev; 357 358 sprintf(wdsdevospf, "wl%d_wds%d_ospf", 359 c, s); 360 dev = nvram_nget("wl%d_wds%d_if", c, s); 361 362 if (nvram_nmatch 363 ("1", "wl%d_wds%d_enable", c, s)) { 364 fprintf(fp, "!\n! WDS: %s\n", 365 nvram_nget 366 ("wl%d_wds%d_desc", c, 367 s)); 368 fprintf(fp, "interface %s\n", 369 dev); 370 371 if (atoi 372 (nvram_safe_get(wdsdevospf)) 373 > 0) 374 fprintf(fp, 375 " ip ospf cost %s\n", 376 nvram_safe_get 377 (wdsdevospf)); 378 } 379 } 380 fprintf(fp, "!\n"); 381 } 382 fprintf(fp, "router osp6f\n"); 383 // fprintf(fp, " passive-interface lo\n"); 384 // fprintf(fp, " ospf router-id %s\n", 385 // nvram_safe_get("lan_ipaddr")); 386 fprintf(fp, " redistribute kernel\n"); 387 fprintf(fp, " redistribute connected\n"); 388 fprintf(fp, " redistribute static\n"); 389 // fprintf(fp, " network 0.0.0.0/0 area 0\n"); // handle all routing 390 // fprintf(fp, " default-information originate\n"); 391 392 for (s = 1; s <= MAX_WDS_DEVS; s++) { 393 char wdsdevospf[32] = { 0 }; 394 sprintf(wdsdevospf, "wl_wds%d_ospf", s); 395 396 if (atoi(nvram_safe_get(wdsdevospf)) < 0) 397 fprintf(fp, " passive-interface %s\n", 398 nvram_nget("wl_wds%d_if", s)); 399 } 400 401 if (nvram_match("zebra_log", "1")) { 402 fprintf(fp, "!\n"); 403 fprintf(fp, "log file /var/log/ospf6.log\n"); 404 } 405 406 fprintf(fp, "!\nline vty\n!\n"); 407 } 408 409 fflush(fp); 410 fclose(fp); 411 412 // if (nvram_match("dyn_default", "1")) 413 // while (!eval("ip", "route", "del", "default")) ; 414 415 ret1 = eval("zebra", "-d", "-r", "-f", "/tmp/zebra.conf"); 416 ret2 = eval("ospf6d", "-d", "-f", "/tmp/ospf6d.conf"); 269 417 270 418 return ret1 + ret2; … … 597 745 stop_process("ripd", "rip daemon"); 598 746 stop_process("ospfd", "ospf daemon"); 747 stop_process("ospf6d", "ospf6 daemon"); 599 748 stop_process("bgpd", "bgp daemon"); 600 749 return; -
src/router/services/sysinit/defaults.c
r17958 r18045 366 366 {"wan_proto", "dhcp", 0}, /* [static|dhcp|pppoe|disabled] */ 367 367 #endif 368 #elif CONFIG_JJAP93 369 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ 370 #elif CONFIG_JJAP005 371 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ 372 #elif CONFIG_JJAP501 373 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ 374 #elif CONFIG_AC722 375 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ 376 #elif CONFIG_AC622 377 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ 368 378 #elif HAVE_JWAP003 369 379 #ifdef HAVE_MAKSAT -
src/router/services/sysinit/sysinit-ja76pf.c
r17372 r18045 107 107 108 108 //#endif 109 eval("ifconfig", "eth0", "up");110 eval("ifconfig", "eth1", "up");109 // eval("ifconfig", "eth0", "up"); 110 // eval("ifconfig", "eth1", "up"); 111 111 struct ifreq ifr; 112 112 int s; -
src/router/services/sysinit/sysinit.c
r17829 r18045 951 951 {0, 0, 0} 952 952 }; 953 #elif CONFIG_JJAP93 954 struct nvram_tuple generic[] = { 955 {"lan_ifname", "br0", 0}, 956 {"lan_ifnames", "eth0 ath0", 0}, 957 {"wan_ifname", "", 0}, 958 {"wan_ifname2", "", 0}, 959 {"wan_ifnames", "", 0}, 960 {"wan_default", "", 0}, 961 {0, 0, 0} 962 }; 963 #elif CONFIG_JJAP005 964 struct nvram_tuple generic[] = { 965 {"lan_ifname", "br0", 0}, 966 {"lan_ifnames", "eth0 eth1 ath0", 0}, 967 {"wan_ifname", "eth1", 0}, 968 {"wan_ifname2", "eth1", 0}, 969 {"wan_ifnames", "eth1", 0}, 970 {"wan_default", "eth1", 0}, 971 {0, 0, 0} 972 }; 973 #elif CONFIG_JJAP501 974 struct nvram_tuple generic[] = { 975 {"lan_ifname", "br0", 0}, 976 {"lan_ifnames", "eth0 eth1 ath0", 0}, 977 {"wan_ifname", "eth1", 0}, 978 {"wan_ifname2", "eth1", 0}, 979 {"wan_ifnames", "eth1", 0}, 980 {"wan_default", "eth1", 0}, 981 {0, 0, 0} 982 }; 983 #elif CONFIG_AC722 984 struct nvram_tuple generic[] = { 985 {"lan_ifname", "br0", 0}, 986 {"lan_ifnames", "eth0 eth1 ath0", 0}, 987 {"wan_ifname", "eth1", 0}, 988 {"wan_ifname2", "eth1", 0}, 989 {"wan_ifnames", "eth1", 0}, 990 {"wan_default", "eth1", 0}, 991 {0, 0, 0} 992 }; 993 #elif CONFIG_AC622 994 struct nvram_tuple generic[] = { 995 {"lan_ifname", "br0", 0}, 996 {"lan_ifnames", "eth0 eth1 ath0", 0}, 997 {"wan_ifname", "eth1", 0}, 998 {"wan_ifname2", "eth1", 0}, 999 {"wan_ifnames", "eth1", 0}, 1000 {"wan_default", "eth1", 0}, 1001 {0, 0, 0} 1002 }; 953 1003 #elif HAVE_LSX 954 1004 struct nvram_tuple generic[] = { -
src/router/shared/Makefile
r17358 r18045 107 107 CFLAGS += -DHAVE_ESR6650 108 108 endif 109 ifeq ($(CONFIG_JJAP93),y) 110 CFLAGS += -DHAVE_JJAP93 111 endif 109 112 ifeq ($(CONFIG_GEMTEK),y) 110 113 CFLAGS += -DHAVE_GEMTEK … … 449 452 endif 450 453 454 include $(TOP)/rules/generic.mk 455 CFLAGS_EXTRA += $(DD_CFLAGS) 456 451 457 ifeq ($(CONFIG_MATRIXSSL),y) 452 458 #CFLAGS += -I$(TOP)/matrixssl
Note: See TracChangeset
for help on using the changeset viewer.
