Attachment 'UBNT_SDK3.4_with_olsrd-01.patch'
Download 1 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/index.cgi SDK.UBNT.v3.4.4416/apps/web/common/index.cgi
2 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/index.cgi 2009-03-31 09:35:16.000000000 +0200
3 +++ SDK.UBNT.v3.4.4416/apps/web/common/index.cgi 2009-09-28 23:52:48.000000000 +0200
4 @@ -77,6 +77,14 @@
5 addOption(o, '<? echo dict_translate("Show Port Forward..."); >', 'pfw.cgi');
6 addOption(o, '<? echo dict_translate("Show DHCP Leases..."); >', 'leases.cgi');
7 }
8 + if('<? echo cfg_get_def($cfg, "olsrd.status", "disabled"); >'=='enabled') {
9 + addOption(o, '<? echo dict_translate("Show OLSR Neighbors..."); >', 'solsr.cgi?olsrview=neigh');
10 + addOption(o, '<? echo dict_translate("Show OLSR Links..."); >', 'solsr.cgi?olsrview=link');
11 + addOption(o, '<? echo dict_translate("Show OLSR Topology..."); >', 'solsr.cgi?olsrview=topo');
12 + addOption(o, '<? echo dict_translate("Show OLSR MID..."); >', 'solsr.cgi?olsrview=mid');
13 + addOption(o, '<? echo dict_translate("Show OLSR HNA..."); >', 'solsr.cgi?olsrview=hna');
14 + addOption(o, '<? echo dict_translate("Show OLSR Routes..."); >', 'solsr.cgi?olsrview=route');
15 + }
16 selectOption(o,'');
17 }
18 var o = document.getElementById('tools');
19 @@ -324,6 +332,12 @@
20 <option value="fw.cgi?netmode=<? echo $netmode;>"><? echo dict_translate("Show Firewall..."); ></option>
21 <option value="fw.cgi"><? echo dict_translate("Show Port Forward..."); ></option>
22 <option value="leases.cgi"><? echo dict_translate("Show DHCP Leases..."); ></option>
23 + <option value="solsr.cgi?olsrview=neigh"><? echo dict_translate("Show OLSR Neighbors..."); ></option>
24 + <option value="solsr.cgi?olsrview=link"><? echo dict_translate("Show OLSR Links..."); ></option>
25 + <option value="solsr.cgi?olsrview=topo"><? echo dict_translate("Show OLSR Topology..."); ></option>
26 + <option value="solsr.cgi?olsrview=mid"><? echo dict_translate("Show OLSR MID..."); ></option>
27 + <option value="solsr.cgi?olsrview=hna"><? echo dict_translate("Show OLSR HNA..."); ></option>
28 + <option value="solsr.cgi?olsrview=route"><? echo dict_translate("Show OLSR Routes..."); ></option>
29 </select></td>
30 <td> </td>
31 <td class="h"><? echo dict_translate("Tools:"); ></td>
32 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/link.inc SDK.UBNT.v3.4.4416/apps/web/common/lib/link.inc
33 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/link.inc 2009-05-19 15:30:13.000000000 +0200
34 +++ SDK.UBNT.v3.4.4416/apps/web/common/lib/link.inc 2009-09-28 23:52:48.000000000 +0200
35 @@ -952,10 +952,16 @@
36 );
37
38 Function cfg_get_ipv4gw $cfg, $iface, $gw (
39 - if (!strlen($gw)) {
40 - $gw = "0.0.0.0";
41 - }
42 - return cfg_get_def($cfg, "route.1.gateway", $gw);
43 + $status = "disabled";
44 + $status = cfg_get_def($cfg, "route.1.status", $status);
45 + if($status == "enabled")
46 + {
47 + if (!strlen($gw)) {
48 + $gw = "0.0.0.0";
49 + }
50 + return cfg_get_def($cfg, "route.1.gateway", $gw);
51 + }
52 + return "";
53 );
54
55 Function cfg_get_dns $cfg, $dns (
56 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/netrouterap.tmpl SDK.UBNT.v3.4.4416/apps/web/common/lib/netrouterap.tmpl
57 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/netrouterap.tmpl 2008-11-17 16:42:54.000000000 +0100
58 +++ SDK.UBNT.v3.4.4416/apps/web/common/lib/netrouterap.tmpl 2009-09-28 23:52:48.000000000 +0200
59 @@ -129,7 +129,7 @@
60 onClick="return openPage('ipalias.cgi?iface=<? echo $wan_iface;>',720,330);" /></td>
61 </tr>
62 <tr><td class="f"><strong><? echo dict_translate("Gateway IP:"); ></strong></td>
63 - <td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWanIP" realname="<? echo dict_translate("LAN Gateway IP"); >"/></td>
64 + <td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWlanOptIP" realname="<? echo dict_translate("LAN Gateway IP"); >"/></td>
65 </tr>
66 <tr><td class="f"><strong><? echo dict_translate("Primary DNS IP:"); ></strong></td>
67 <td colspan="3"><input class="f" type="text" name="dns1" id="dns1" value="<?echo $dns1>" required="1" callback="validateWanIP" realname="<? echo dict_translate("Primary DNS IP"); >"/></td>
68 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/netroutersta.tmpl SDK.UBNT.v3.4.4416/apps/web/common/lib/netroutersta.tmpl
69 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/netroutersta.tmpl 2008-11-17 16:42:54.000000000 +0100
70 +++ SDK.UBNT.v3.4.4416/apps/web/common/lib/netroutersta.tmpl 2009-09-28 23:52:48.000000000 +0200
71 @@ -83,7 +83,7 @@
72 onClick="return openPage('ipalias.cgi?iface=<? echo $wan_iface;>',720,330);" /></td>
73 </tr>
74 <tr><td class="f"><strong><? echo dict_translate("Gateway IP:"); ></strong></td>
75 - <td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWanIP" realname="<? echo dict_translate("WLAN Gateway IP"); >"/></td>
76 + <td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWlanOptIP" realname="<? echo dict_translate("WLAN Gateway IP"); >"/></td>
77 </tr>
78 <tr><td class="f"><strong><? echo dict_translate("Primary DNS IP:"); ></strong></td>
79 <td colspan="3"><input class="f" type="text" name="dns1" id="dns1" value="<?echo $dns1>" required="1" callback="validateWanIP" realname="<? echo dict_translate("Primary DNS IP"); >"/></td>
80 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/services.tmpl SDK.UBNT.v3.4.4416/apps/web/common/lib/services.tmpl
81 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/lib/services.tmpl 2008-11-17 16:42:54.000000000 +0100
82 +++ SDK.UBNT.v3.4.4416/apps/web/common/lib/services.tmpl 2009-09-28 23:52:48.000000000 +0200
83 @@ -19,6 +19,7 @@
84 telnetStatusClicked();
85 sshStatusClicked();
86 syslogStatusClicked();
87 + olsrStatusClicked();
88 }
89 window.onload=init;
90 </script>
91 @@ -242,6 +243,23 @@
92 </tr>
93 </table>
94 </form>
95 +
96 + <form enctype="multipart/form-data" action="services.cgi" method="POST" onSubmit="return validateStandard(this, 'error');">
97 + <table class="linktable" cellspacing="0">
98 + <tr><th colspan="3"><? echo dict_translate("OLSRd"); ></th></tr>
99 + <tr>
100 + <td class="f"><strong><? echo dict_translate("Enable OLSRd:"); ></strong></td>
101 + <td><input type="checkbox" name="olsr_status" value="enabled" id="olsr_status" <? if ($olsr_status=="enabled") { echo "checked"; }> onClick="olsrStatusClicked();"></td>
102 + <td class="f"> </td>
103 + </tr>
104 + <tr>
105 + <td class="f"> <input type="hidden" name="action" value="cholsr"></td>
106 + <td><input type="submit" value="<? echo dict_translate("Change"); >"> </td>
107 + <td class="f"> </td>
108 + </tr>
109 + </table>
110 + </form>
111 +
112 <!-- we use default certificates
113 <form enctype="multipart/form-data" action="services.cgi" method="POST" onSubmit="return validateStandard(this, 'error');">
114 <table class="linktable" cellspacing="0">
115 @@ -274,6 +292,34 @@
116 </form>
117 -->
118
119 + <form enctype="multipart/form-data" action="services.cgi" method="POST" onSubmit="return validateStandard(this, 'error');">
120 + <table class="linktable" cellspacing="0">
121 + <tr><th colspan="3"><? echo dict_translate("OLSRd Configuration"); ></th></tr>
122 + <tr>
123 + <td class="f"><strong><? echo dict_translate("Upload Configuration File:"); ></strong></td>
124 + <td><input type="file" name="olsr_conf_file" id="olsr_conf_file" realname="<? echo dict_translate("Configuration File"); >"></td>
125 + </td>
126 + <td class="f"> </td>
127 + </tr>
128 + <tr>
129 + <td class="f"> <input type="hidden" name="action" value="olsrconfupload"></td>
130 + <td><input type="submit" value="<? echo dict_translate("Upload"); >"> </td>
131 + <td class="f"> </td>
132 + </tr>
133 + <tr>
134 + <td class="f" rowspan="2"><strong><? echo dict_translate("Current Configuration File:"); ></strong></td>
135 + <td>
136 + <input type="button" onClick="return openPage('olsrconf.cgi');" value="<? echo dict_translate("Download..."); >">
137 + <input type="submit" id="olsrconfdelete" name="olsrconfdelete" value="<? echo dict_translate("Remove"); >"
138 + onClick="return confirm('<? echo dict_translate("qst_remove_olsr_conf|Do you really want to remove uploaded OLSRd Configuration file?"); >');">
139 + </td>
140 + <td class="f"> </td>
141 + </tr>
142 + <td></td>
143 + </table>
144 + </form>
145 +
146 +
147 </td>
148 </tr>
149 <tr>
150 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/services.cgi SDK.UBNT.v3.4.4416/apps/web/common/services.cgi
151 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/services.cgi 2008-09-30 17:09:13.000000000 +0200
152 +++ SDK.UBNT.v3.4.4416/apps/web/common/services.cgi 2009-09-28 23:52:48.000000000 +0200
153 @@ -132,6 +132,13 @@
154 }
155 cfg_save($cfg, $cfg_file);
156 cfg_set_modified($cfg_file);
157 + } elseif ($action == "cholsr") {
158 + if ($olsr_status != "enabled") {
159 + $olsr_status = "disabled";
160 + }
161 + cfg_set($cfg, "olsrd.status", $olsr_status);
162 + cfg_save($cfg, $cfg_file);
163 + cfg_set_modified($cfg_file);
164 } elseif ($action == "httpscertupload" && strlen($httpscertdelete) > 0) {
165 @unlink("/etc/persistent/https/server.crt");
166 @unlink("/etc/persistent/https/server.key");
167 @@ -174,6 +181,32 @@
168 }
169 cfg_save($cfg, $cfg_file);
170 cfg_set_modified($cfg_file);
171 + } elseif ($action == "olsrconfupload" && strlen($olsrconfdelete) > 0) {
172 + @unlink("/etc/persistent/olsrd.conf");
173 + cfg_save($cfg, $cfg_file);
174 + cfg_set_modified($cfg_file);
175 + } elseif ($action == "olsrconfupload") {
176 + if (strlen($olsr_conf_file) == 0)
177 + {
178 + $error_msg = dict_translate("msg_no_olsr_conf_file_specified|No OLSRd configuration file specified.");
179 + include("lib/services.tmpl");
180 + exit;
181 + }
182 + $conf_error = check_uploaded_file($olsr_conf_file,
183 + $olsr_conf_file_size, dict_translate("OLSRd configuration"), 5120);
184 + if (strlen($conf_error) > 0)
185 + {
186 + $error_msg = $conf_error;
187 + @unlink($olsr_conf_file);
188 + include("lib/services.tmpl");
189 + exit;
190 + }
191 + if (strlen($olsr_conf_file))
192 + {
193 + exec("mv "+$olsr_conf_file+" /etc/persistent/olsrd.conf");
194 + }
195 + cfg_save($cfg, $cfg_file);
196 + cfg_set_modified($cfg_file);
197 }
198 }
199
200 @@ -182,6 +215,7 @@
201 $ssh_status = cfg_get_def($cfg, "sshd.status", $ssh_status);
202 $syslog_status = cfg_get_def($cfg, "syslog.status", $syslog_status);
203 $rsyslog_status = cfg_get_def($cfg, "syslog.remote.status", $rsyslog_status);
204 +$olsr_status = cfg_get_def($cfg, "olsrd.status", $olsr_status);
205 $httpport = cfg_get_def($cfg, "httpd.port", "80");
206 if (strlen($httpport) == 0) {
207 $httpport = "80";
208 diff -Nur SDK.UBNT.v3.4.4416.orig/apps/web/common/system.js SDK.UBNT.v3.4.4416/apps/web/common/system.js
209 --- SDK.UBNT.v3.4.4416.orig/apps/web/common/system.js 2008-10-08 16:44:17.000000000 +0200
210 +++ SDK.UBNT.v3.4.4416/apps/web/common/system.js 2009-09-28 23:52:48.000000000 +0200
211 @@ -104,3 +104,7 @@
212 var c=document.getElementById('roStatus');
213 statusClicked(c,new Array('rousername', 'roPassword'));
214 }
215 +function olsrStatusClicked() {
216 +var c=document.getElementById('olsr_status');
217 +statusClicked(c,new Array());
218 +}
219 diff -Nur SDK.UBNT.v3.4.4416.orig/conf/xs2/busybox.config SDK.UBNT.v3.4.4416/conf/xs2/busybox.config
220 --- SDK.UBNT.v3.4.4416.orig/conf/xs2/busybox.config 2008-10-20 23:34:04.000000000 +0200
221 +++ SDK.UBNT.v3.4.4416/conf/xs2/busybox.config 2009-09-28 23:52:48.000000000 +0200
222 @@ -360,8 +360,9 @@
223 CONFIG_PIDOF=y
224 CONFIG_PS=y
225 # CONFIG_RENICE is not set
226 -# CONFIG_TOP is not set
227 -# CONFIG_UPTIME is not set
228 +CONFIG_TOP=y
229 +FEATURE_CPU_USAGE_PERCENTAGE=y
230 +CONFIG_UPTIME=y
231 # CONFIG_SYSCTL is not set
232
233 #
234 diff -Nur SDK.UBNT.v3.4.4416.orig/conf/xs2/product.mk SDK.UBNT.v3.4.4416/conf/xs2/product.mk
235 --- SDK.UBNT.v3.4.4416.orig/conf/xs2/product.mk 2009-05-21 14:03:36.000000000 +0200
236 +++ SDK.UBNT.v3.4.4416/conf/xs2/product.mk 2009-09-28 23:52:48.000000000 +0200
237 @@ -38,6 +38,7 @@
238 iproute2 trigger_url ntpclient igmpproxy dropbear
239 # bird batmand wifidog
240 #APPS_GPL += libpcap tcpdump iperf
241 +APPS_GPL += olsrd
242
243 export DRIVERS APPS_OPEN APPS_GPL
244
245 diff -Nur SDK.UBNT.v3.4.4416.orig/conf/xs5/busybox.config SDK.UBNT.v3.4.4416/conf/xs5/busybox.config
246 --- SDK.UBNT.v3.4.4416.orig/conf/xs5/busybox.config 2008-10-17 23:03:39.000000000 +0200
247 +++ SDK.UBNT.v3.4.4416/conf/xs5/busybox.config 2009-09-28 23:52:48.000000000 +0200
248 @@ -360,8 +360,9 @@
249 CONFIG_PIDOF=y
250 CONFIG_PS=y
251 # CONFIG_RENICE is not set
252 -# CONFIG_TOP is not set
253 -# CONFIG_UPTIME is not set
254 +CONFIG_TOP=y
255 +FEATURE_CPU_USAGE_PERCENTAGE=y
256 +CONFIG_UPTIME=y
257 # CONFIG_SYSCTL is not set
258
259 #
260 diff -Nur SDK.UBNT.v3.4.4416.orig/conf/xs5/product.mk SDK.UBNT.v3.4.4416/conf/xs5/product.mk
261 --- SDK.UBNT.v3.4.4416.orig/conf/xs5/product.mk 2009-05-21 14:03:36.000000000 +0200
262 +++ SDK.UBNT.v3.4.4416/conf/xs5/product.mk 2009-09-28 23:52:48.000000000 +0200
263 @@ -38,6 +38,7 @@
264 iproute2 trigger_url ntpclient igmpproxy dropbear
265 # bird batmand wifidog
266 #APPS_GPL += libpcap tcpdump iperf
267 +APPS_GPL += olsrd
268
269 export DRIVERS APPS_OPEN APPS_GPL
270
271 diff -Nur SDK.UBNT.v3.4.4416.orig/rootfs/ls2/linuxrc SDK.UBNT.v3.4.4416/rootfs/ls2/linuxrc
272 --- SDK.UBNT.v3.4.4416.orig/rootfs/ls2/linuxrc 2009-04-17 12:55:29.000000000 +0200
273 +++ SDK.UBNT.v3.4.4416/rootfs/ls2/linuxrc 2009-09-28 23:52:48.000000000 +0200
274 @@ -129,6 +129,15 @@
275 /sbin/ubntconf
276 fi
277
278 +# add olsrd to init
279 +grep -q "olsrd.status=enabled" /tmp/system.cfg
280 +if [ $? -eq 0 ] && [ -x /bin/olsrd ]; then
281 + cp -f /usr/etc/init.d/olsrd /etc/sysinit/olsrd.conf
282 + echo "null::respawn:/bin/olsrd -nofork" >> /etc/inittab
283 + echo "olsrd" >> /etc/startup.list
284 +fi
285 +
286 +
287 echo "Executing init..."
288 exec /sbin/init -f
289
290 diff -Nur SDK.UBNT.v3.4.4416.orig/rootfs/ls2/usr/etc/rc.d/rc.softrestart SDK.UBNT.v3.4.4416/rootfs/ls2/usr/etc/rc.d/rc.softrestart
291 --- SDK.UBNT.v3.4.4416.orig/rootfs/ls2/usr/etc/rc.d/rc.softrestart 2008-07-29 13:03:56.000000000 +0200
292 +++ SDK.UBNT.v3.4.4416/rootfs/ls2/usr/etc/rc.d/rc.softrestart 2009-09-28 23:52:48.000000000 +0200
293 @@ -20,6 +20,14 @@
294 /sbin/ubntconf
295 fi
296
297 +# add olsrd to init
298 +grep -q "olsrd.status=enabled" /tmp/system.cfg
299 +if [ $? -eq 0 ] && [ -x /bin/olsrd ]; then
300 + cp -f /usr/etc/init.d/olsrd /etc/sysinit/olsrd.conf
301 + echo "null::respawn:/bin/olsrd -nofork" >> /etc/inittab
302 + echo "olsrd" >> /etc/startup.list
303 +fi
304 +
305 RC_CMD=start
306 . /etc/rc.d/rc
307
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.