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