
NB3711 User Manual 4.0
Here is an example how one might adopt those functions:
/* check current city and enable the second WAN link */
location = nb_status (
" location "
);
if
( location ) {
city = struct_get ( location ,
" LOCATION_CITY "
);
if
( city ==
" Wonderland "
) {
for
( led = 0; led < 5; led ++) {
nb_led_set (led , LED_BLINK_FAST | LED_COLOR_RED );
}
}
e l s e
{
printf (
" You 'll never walk alone in %s ...\ n"
, city );
nb_config_set (
" wanlink .1. mode =1"
);
}
}
Running SDK
In the SDK, we are speaking of
scripts
and
triggers
which form
jobs
.
Any
arena
script can be uploaded to the router or imported by using dedicated user
configuration packages. You may also edit the script directly at the Web Manager or
select one of our examples. You will further have a testing section on the router which
can be used to check your syntax or doing test runs.
Once uploaded, you will have to specify a trigger, that is, telling the router when the
script is to be executed. This can be either time-based (e.g. each Monday) or triggered by
one of the pre-defined system events (e.g. wan-up) as described in Events chapter
5.7.7
.
With both, a script and a trigger, you can finally set up an SDK job now. The
test
event usually serves as a good facility to check whether your job is doing well. The
admin section also offers facilities to troubleshoot any issues and control running jobs.
The SDK host (sdkhost) corresponds to the daemon managing the scripts and their
operations and thus avoiding any harm to the system. In terms of resources, it will
limit CPU and memory for running scripts and also provide a pre-defined portion of
the available flash storage. You may, however, extend it by external USB storage or
(depending on your model) SD cards.
Files written to
/tmp
will be hold in memory and will be cleared upon a restart of the
script. As your scripts operate in the sandbox, you will have no access to tools on the
system (such as
ifconfig
).
113
Summary of Contents for NB3711
Page 90: ...NB3711 User Manual 4 0 Figure 5 27 Inbound NAPT 90...
Page 92: ...NB3711 User Manual 4 0 Figure 5 29 OpenVPN Configuration 92...
Page 96: ...NB3711 User Manual 4 0 Figure 5 30 OpenVPN Client Management 96...
Page 98: ...NB3711 User Manual 4 0 Figure 5 31 IPsec Administration 98...
Page 104: ...NB3711 User Manual 4 0 Figure 5 34 PPTP Tunnel Configuration 104...
Page 114: ...NB3711 User Manual 4 0 Figure 5 37 SDK Administration 114...
Page 117: ...NB3711 User Manual 4 0 Figure 5 38 SDK Jobs 117...
Page 121: ...NB3711 User Manual 4 0 Figure 5 39 DHCP Server 121...
Page 131: ...NB3711 User Manual 4 0 Figure 5 44 SMS Configuration 131...
Page 158: ...NB3711 User Manual 4 0 Figure 5 55 Remote Authentication 158...
Page 162: ...NB3711 User Manual 4 0 Figure 5 57 Automatic File Configuration 162...
Page 166: ...NB3711 User Manual 4 0 Figure 5 59 Log Viewer 166...
Page 167: ...NB3711 User Manual 4 0 Figure 5 60 Tech Support File 167...
Page 175: ...NB3711 User Manual 4 0 5 9 LOGOUT Please use this menu to log out from the Web Manager 175...
Page 213: ...NB3711 User Manual 4 0 Event Description Table A 3 SDK Examples 213...
Page 214: ......