Attachment 'UBNT_SDK3.2.3-rc_with_olsrd-01.patch'
Download 1 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/index.cgi ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/index.cgi
2 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/index.cgi 2008-09-03 15:01:28.000000000 +0200
3 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/index.cgi 2008-11-06 06:46:44.000000000 +0100
4 @@ -73,6 +73,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 @@ -322,6 +330,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 ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/link.inc ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/link.inc
33 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/link.inc 2008-09-02 14:02:39.000000000 +0200
34 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/link.inc 2008-11-05 23:19:37.000000000 +0100
35 @@ -915,10 +915,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 ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/netrouterap.tmpl ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/netrouterap.tmpl
57 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/netrouterap.tmpl 2008-09-04 14:37:10.000000000 +0200
58 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/netrouterap.tmpl 2008-11-04 15:22:28.000000000 +0100
59 @@ -126,7 +126,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 ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/netroutersta.tmpl ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/netroutersta.tmpl
69 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/netroutersta.tmpl 2008-09-04 14:37:10.000000000 +0200
70 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/netroutersta.tmpl 2008-11-04 15:22:28.000000000 +0100
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 ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/services.tmpl ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/services.tmpl
81 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/lib/services.tmpl 2008-09-03 15:01:28.000000000 +0200
82 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/lib/services.tmpl 2008-11-06 03:22:20.000000000 +0100
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 ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/services.cgi ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/services.cgi
151 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/services.cgi 2008-07-22 11:23:08.000000000 +0200
152 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/services.cgi 2008-11-04 15:22:28.000000000 +0100
153 @@ -136,6 +136,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 @@ -178,6 +185,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 @@ -186,6 +219,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 ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/system.js ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/system.js
209 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/web/common/system.js 2008-07-29 12:31:25.000000000 +0200
210 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/web/common/system.js 2008-11-04 15:22:28.000000000 +0100
211 @@ -99,3 +99,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 ubnt-lsX-SDK-v3.2.3743.orig/conf/xs2/busybox.config ubnt-lsX-SDK-v3.2.3743.diff/conf/xs2/busybox.config
220 --- ubnt-lsX-SDK-v3.2.3743.orig/conf/xs2/busybox.config 2008-09-02 06:39:27.000000000 +0200
221 +++ ubnt-lsX-SDK-v3.2.3743.diff/conf/xs2/busybox.config 2008-11-06 06:43:35.000000000 +0100
222 @@ -323,7 +323,7 @@
223 # CONFIG_IPROUTE is not set
224 # CONFIG_IPTUNNEL is not set
225 # CONFIG_NAMEIF is not set
226 -# CONFIG_NC is not set
227 +CONFIG_NC=y
228 # CONFIG_NETSTAT is not set
229 # CONFIG_NSLOOKUP is not set
230 CONFIG_PING=y
231 @@ -360,8 +360,9 @@
232 CONFIG_PIDOF=y
233 CONFIG_PS=y
234 # CONFIG_RENICE is not set
235 -# CONFIG_TOP is not set
236 -# CONFIG_UPTIME is not set
237 +CONFIG_TOP=y
238 +FEATURE_CPU_USAGE_PERCENTAGE=y
239 +CONFIG_UPTIME=y
240 # CONFIG_SYSCTL is not set
241
242 #
243 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/conf/xs2/product.mk ubnt-lsX-SDK-v3.2.3743.diff/conf/xs2/product.mk
244 --- ubnt-lsX-SDK-v3.2.3743.orig/conf/xs2/product.mk 2008-09-04 17:17:22.000000000 +0200
245 +++ ubnt-lsX-SDK-v3.2.3743.diff/conf/xs2/product.mk 2008-11-04 15:26:23.000000000 +0100
246 @@ -38,6 +38,7 @@
247 iproute2 trigger_url ntpclient igmpproxy dropbear
248 # bird batmand wifidog
249 #APPS_GPL += libpcap tcpdump iperf
250 +APPS_GPL += libpcap tcpdump olsrd
251
252 export DRIVERS APPS_OPEN APPS_GPL
253
254 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/conf/xs5/busybox.config ubnt-lsX-SDK-v3.2.3743.diff/conf/xs5/busybox.config
255 --- ubnt-lsX-SDK-v3.2.3743.orig/conf/xs5/busybox.config 2008-09-02 06:39:27.000000000 +0200
256 +++ ubnt-lsX-SDK-v3.2.3743.diff/conf/xs5/busybox.config 2008-11-06 06:43:41.000000000 +0100
257 @@ -323,7 +323,7 @@
258 # CONFIG_IPROUTE is not set
259 # CONFIG_IPTUNNEL is not set
260 # CONFIG_NAMEIF is not set
261 -# CONFIG_NC is not set
262 +CONFIG_NC=y
263 # CONFIG_NETSTAT is not set
264 # CONFIG_NSLOOKUP is not set
265 CONFIG_PING=y
266 @@ -360,8 +360,9 @@
267 CONFIG_PIDOF=y
268 CONFIG_PS=y
269 # CONFIG_RENICE is not set
270 -# CONFIG_TOP is not set
271 -# CONFIG_UPTIME is not set
272 +CONFIG_TOP=y
273 +FEATURE_CPU_USAGE_PERCENTAGE=y
274 +CONFIG_UPTIME=y
275 # CONFIG_SYSCTL is not set
276
277 #
278 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/conf/xs5/product.mk ubnt-lsX-SDK-v3.2.3743.diff/conf/xs5/product.mk
279 --- ubnt-lsX-SDK-v3.2.3743.orig/conf/xs5/product.mk 2008-09-04 17:17:22.000000000 +0200
280 +++ ubnt-lsX-SDK-v3.2.3743.diff/conf/xs5/product.mk 2008-11-04 15:26:23.000000000 +0100
281 @@ -38,6 +38,7 @@
282 iproute2 trigger_url ntpclient igmpproxy dropbear
283 # bird batmand wifidog
284 #APPS_GPL += libpcap tcpdump iperf
285 +APPS_GPL += libpcap tcpdump olsrd
286
287 export DRIVERS APPS_OPEN APPS_GPL
288
289 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/rootfs/ls2/linuxrc ubnt-lsX-SDK-v3.2.3743.diff/rootfs/ls2/linuxrc
290 --- ubnt-lsX-SDK-v3.2.3743.orig/rootfs/ls2/linuxrc 2008-08-29 04:19:27.000000000 +0200
291 +++ ubnt-lsX-SDK-v3.2.3743.diff/rootfs/ls2/linuxrc 2008-11-04 15:24:39.000000000 +0100
292 @@ -128,6 +128,15 @@
293 /sbin/ubntconf
294 fi
295
296 +# add olsrd to init
297 +grep -q "olsrd.status=enabled" /tmp/system.cfg
298 +if [ $? -eq 0 ] && [ -x /bin/olsrd ]; then
299 + cp -f /usr/etc/init.d/olsrd /etc/sysinit/olsrd.conf
300 + echo "null::respawn:/bin/olsrd -nofork" >> /etc/inittab
301 + echo "olsrd" >> /etc/startup.list
302 +fi
303 +
304 +
305 echo "Executing init..."
306 exec /sbin/init -f
307
308 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/rootfs/ls2/usr/etc/rc.d/rc.softrestart ubnt-lsX-SDK-v3.2.3743.diff/rootfs/ls2/usr/etc/rc.d/rc.softrestart
309 --- ubnt-lsX-SDK-v3.2.3743.orig/rootfs/ls2/usr/etc/rc.d/rc.softrestart 2008-07-29 13:03:56.000000000 +0200
310 +++ ubnt-lsX-SDK-v3.2.3743.diff/rootfs/ls2/usr/etc/rc.d/rc.softrestart 2008-11-04 15:25:00.000000000 +0100
311 @@ -20,6 +20,14 @@
312 /sbin/ubntconf
313 fi
314
315 +# add olsrd to init
316 +grep -q "olsrd.status=enabled" /tmp/system.cfg
317 +if [ $? -eq 0 ] && [ -x /bin/olsrd ]; then
318 + cp -f /usr/etc/init.d/olsrd /etc/sysinit/olsrd.conf
319 + echo "null::respawn:/bin/olsrd -nofork" >> /etc/inittab
320 + echo "olsrd" >> /etc/startup.list
321 +fi
322 +
323 RC_CMD=start
324 . /etc/rc.d/rc
325
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.