Compare commits

...

309 Commits
3.16 ... 4.1.0

Author SHA1 Message Date
Robin Stjerndorff
9ad0074feb ice-client: update to 5.1.9 2018-08-22 09:46:56 +02:00
Reidar Cederqvist
686d0136d7 inteno-netmodes: fix so that wet interface is brought down refs #15267 2018-06-11 14:03:39 +02:00
Reidar Cederqvist
2a1bd9f5fe inteno-netmodes: trigger a reload of icwmp hotplug iface script 2018-06-05 12:43:15 +02:00
Reidar Cederqvist
bf43c42979 icwmp & inteno-netmodes: dont reload icwmp if netmode-conf is running 2018-06-04 16:31:03 +02:00
Reidar Cederqvist
202bc9e3a0 icwmp: fix hotplug iface script (check device and restart) 2018-06-04 09:38:17 +02:00
Reidar Cederqvist
44c2a71e5d icwmp: install hotplug.d iface script 2018-05-29 15:43:05 +02:00
Reidar Cederqvist
658c4fb2c4 inteno-netmodes: libexec script can't run scripts in background fixed by extra-script
by starting a script that starts netmode-conf in the background refs #14901
2018-05-09 11:37:09 +02:00
Reidar Cederqvist
f5ffbc4b1f Update feed [ feed_inteno_packages ] package [ inteno-netmodes ]
-------------------------------------------------------------------------------
* fbd7dcf netmode: config: config_compare_wet: fix band comparison refs #14918 refs #14919 refs #14920
* 81f444e netmode: config: config_compare_wet: log the change for the wet interface
* acf96c5 fix some text in comments
* e43701f zero-out the buffer before initializing it
* b898924 ubus call netmode sync: make the call reentrant by adding a mutex
* bd47286 add ubus sync method: push credentials to all registered repeaters
* dfc2c63 netmoded: do not compare network for local ifaces refs #14339
-------------------------------------------------------------------------------
commit fbd7dcfab03df19b3c32675940e0aee708c7cf75
Author: Ionuț-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-05-07 14:17:55 +0200

    netmode: config: config_compare_wet: fix band comparison refs #14918 refs
    #14919 refs #14920

Base directory -> /
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 81f444ef9c914d49c2896229e205302d449ecc24
Author: Ionuț-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-05-07 14:16:12 +0200

    netmode: config: config_compare_wet: log the change for the wet interface

Base directory -> /
 config.c | 3 +++
 1 file changed, 3 insertions(+)
-------------------------------------------------------------------------------
commit acf96c5272c763c355cda5f168de091f536b8ac7
Author: Ionuț-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-05-07 14:14:02 +0200

    fix some text in comments

Base directory -> /
 config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit e43701f76ba2a8699df797d88fffc3895a3bfeb8
Author: Ionuț-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-04-19 12:29:33 +0200

    zero-out the buffer before initializing it

Base directory -> /
 netmoded.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
commit b898924491c378ca09ab124991b27f54a336e4e9
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-03-02 15:34:22 +0100

    ubus call netmode sync: make the call reentrant by adding a mutex

    	if this ubus call is issued twice at the same time,
    only one will do the actual work and the other one will return with
    an error.

    	Can be tested with:
    	while true ; do ubus call netmode sync & done
    Most of the calls will fail
    (Done with return code 9 == UBUS_STATUS_UNKNOWN_ERROR),
    but still the maximum (continuosly) possible will run.

Base directory -> /
 netmoded.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit bd472860ff1fe71ebd066813dcebe8fd99553747
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-03-02 14:26:59 +0100

    add ubus sync method: push credentials to all registered repeaters

Base directory -> /
 netmoded.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit dfc2c634122f2b2eb9aad12125aa8d08fdf9e20a
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-03-01 11:19:07 +0100

    netmoded: do not compare network for local ifaces refs #14339

Base directory -> /
 config.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
2018-05-09 11:31:29 +02:00
Sukru Senli
f51d16c2eb questd updated 2018-04-19 17:01:08 +02:00
Sukru Senli
f7727f045c inteno-netmodes: testnet: log connection status when changed 2018-04-16 16:58:10 +02:00
Kenneth Johansson
c17344d56f uboot: Fix hang. variable is of array type not char.
Boot was hanging.
2018-04-12 13:25:08 +02:00
Erik Horemans
216ced880c new ice-client 5.0.3-RC5 2018-04-12 10:25:53 +02:00
Erik Horemans
39a004eb4b new ice-client 5.0.3-RC2 2018-04-12 10:25:48 +02:00
Sukru Senli
d41f784794 inteno-netmodes: testnet: fix typo 2018-03-27 09:42:50 +02:00
Sukru Senli
c7728860b4 inteno-netmodes: testnet: direct operstate check error to devnull 2018-03-27 09:42:46 +02:00
Sukru Senli
f109c662e0 inteno-netmodes: testnet: disable access to wireless only if uplink is wifi wan refs #14531 2018-03-23 21:41:38 +01:00
Sukru Senli
af708cad74 questd: allow getting assoclist for a specific vif 2018-03-19 19:15:08 +01:00
Erik Horemans
2135dead70 new ice-client 5.0.2-RC15 2018-03-05 18:19:09 +01:00
Sukru Senli
e4392950b0 questd: updated 2018-03-05 15:00:58 +01:00
Sukru Senli
cac8b6a97a inteno-netmodes: fix netmode-discover checking for wifi script running 2018-03-05 13:51:50 +01:00
Ionut-Alex Oprea
d0207ff6da inteno-netmodes: netmode-discover: prevent busy waiting 2018-03-05 11:49:43 +01:00
Sukru Senli
e45395560a inteno-netmodes: netmode-discover: fping network only if mask is equals or higher than 24 2018-02-27 14:06:35 +01:00
Sukru Senli
1bce24b26d questd: updated 2018-02-27 10:36:36 +01:00
Sukru Senli
6ef0eccab2 inteno-netmodes: fix netmode.sh 2018-02-21 14:40:54 +01:00
Sukru Senli
02bd873096 inteno-netmodes: try to send credentials to client only if it is ia valid wificontrol.txt file 2018-02-20 21:10:29 +01:00
Sukru Senli
0031a8a4e4 inteno-netmodes: activate netmode-client-detect in router mode 2018-02-20 20:58:47 +01:00
Sukru Senli
229f240c8a inteno-netmodes: testnet: give repeater more time to reconnect to master before retrying 2018-02-20 20:30:59 +01:00
Sukru Senli
d589e7034e icwmp-4.0-2018-02-12 2018-02-20 20:15:37 +01:00
Sukru Senli
344c9c4813 icwmp-4.0-2018-02-07 2018-02-20 20:15:25 +01:00
Sukru Senli
a9529bc199 inteno-netmodes: netmode-discover: fping wan network only if mask is 24 or less 2018-02-20 20:14:49 +01:00
Erik Horemans
2047bd7fbb new ice-client 5.0.2-RC5 2018-02-20 20:14:23 +01:00
Sukru Senli
a92fe417f0 inteno-netmodes: testnet: do not for enable internet led 2018-02-01 16:34:43 +01:00
Sukru Senli
1cbef1d6a5 iop: deselect ppp-mod-pppoe 2018-01-31 19:31:41 +01:00
Sukru Senli
384e1cd2cd Revert "config: Disable ppp as it is not compiling nor used."
This reverts commit 5b6c96ccec.
2018-01-31 19:26:08 +01:00
Kent Ekholm
ba59bd78ae Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* e14f741 Added code for enabling conference for a connection.
-------------------------------------------------------------------------------
commit e14f741c9c7ecdc6584ce109bed22d3f85a29a16
Author: Kent Ekholm <Kent.Ekholm@evidente.se>
Date: 2018-01-31 17:06:34 +0100

    Added code for enabling conference for a connection.

    Ref: 13867

Base directory -> /
 src/endpt.c | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2018-01-31 17:30:50 +01:00
Reidar Cederqvist
99a3589c77 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 44852fc router.wps: fix typo in status parsing
-------------------------------------------------------------------------------
commit 44852fcce18b5ceefa6b09bd5eb775d783ee6362
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-31 10:44:01 +0100

    router.wps: fix typo in status parsing

Base directory -> /
 wps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-31 10:48:31 +01:00
Reidar Cederqvist
9096e0a8c2 Update feed [ feed_inteno_packages ] package [ inteno-netmodes ]
-------------------------------------------------------------------------------
* f6ad4be netmoded: move comment to correct row
* fb103ef netmoded: add support for filtering by network
-------------------------------------------------------------------------------
commit f6ad4becd96f9856f900cb9cdbdad730198b24e9
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-31 10:41:55 +0100

    netmoded: move comment to correct row

Base directory -> /
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit fb103ef303c21a6de3cca8edbc3d4295784f96a7
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-31 10:41:01 +0100

    netmoded: add support for filtering by network

Base directory -> /
 config.c   | 22 +++++++++++++---------
 config.h   |  2 +-
 netmoded.c |  8 +++++---
 3 files changed, 19 insertions(+), 13 deletions(-)
-------------------------------------------------------------------------------
2018-01-31 10:45:07 +01:00
Kenneth Johansson
bd9637b8f5 u-boot: support for sdx-500ap 2018-01-29 15:16:08 +01:00
Erik Horemans
2d36c5935d new ice-client 5.0.2-RC4 2018-01-28 13:39:42 +01:00
Sukru Senli
2ac79b3ae8 inteno-netmodes: update network config for mtk routed 2018-01-28 12:45:55 +01:00
Sukru Senli
b03bcefc7d Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* c2a046d show usb spec correctly
-------------------------------------------------------------------------------
commit c2a046da81bf716cd9a5e3203715fc9c5f7d1cc5
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-26 23:55:11 +0100

    show usb spec correctly

Base directory -> /
 dumper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
2018-01-26 23:56:24 +01:00
Sukru Senli
0971e2a150 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 4998ea8 system: add usb to specs
-------------------------------------------------------------------------------
commit 4998ea8902c61be2b4c21c3cc5575e71e7ede1cb
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-26 21:30:44 +0100

    system: add usb to specs

Base directory -> /
 dumper.c | 8 ++++++--
 system.c | 2 ++
 system.h | 1 +
 3 files changed, 9 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2018-01-26 21:31:16 +01:00
Sukru Senli
17e555938f layer2interface: fix dsl capability option type 2018-01-26 16:17:00 +01:00
Sukru Senli
e8896b88d0 inteno-netmodes: testnet: do not run apcliconnect during wifi import 2018-01-26 14:49:05 +01:00
Sukru Senli
5f85d28d3f inteno-netmodes: remove ex400 hardcoding 2018-01-26 13:39:18 +01:00
Sukru Senli
73d75255a9 wlng: mark iopsys_ramips target as mediatek 2018-01-26 13:38:28 +01:00
Sukru Senli
916fc33f07 inteno-netmodes :exclude SDX* boards from some profiles 2018-01-26 12:00:03 +01:00
Sukru Senli
694a37df39 icwmp: definiton by target instead of iboardid 2018-01-26 11:58:49 +01:00
Sukru Senli
49fa404295 questd: select swconfig if target is iopsys_ramips 2018-01-26 11:53:59 +01:00
Sukru Senli
250253ae92 layer2interface: support setting wan port from ports config uplink option 2018-01-26 11:22:17 +01:00
Sukru Senli
776a5bb53a inteno-netmodes: make sure firewall is disabled in repeater mode 2018-01-25 21:41:33 +01:00
Kenneth Johansson
23fdec1d3e uboot: add sdx-500ap board. 2018-01-25 19:59:06 +01:00
Kenneth Johansson
1b1dfc2f9c genconfig: add new mediatek board sdx-500ap 2018-01-25 19:58:06 +01:00
Kenneth Johansson
dbd1279239 questd: make it test for ramips instead of ex400. 2018-01-25 14:31:09 +01:00
Sukru Senli
4cd231b7e2 inteno-netmodes: flush br-lan only if repeaterready is set and wan ip is private 2018-01-24 18:53:33 +01:00
Kent Ekholm
d39c16248f voice-client: patch from Pantera.
Ref: 13031
2018-01-24 18:07:17 +01:00
Sukru Senli
8f36765f5b iop: update extract_core with packages to export 2018-01-24 18:07:05 +01:00
Sukru Senli
4040bbc39d iop: update extract_top with packages to ignore 2018-01-24 18:07:03 +01:00
Sukru Senli
634219efc8 inteno-netmodes: netmode.sh change/remove variables 2018-01-23 22:47:29 +01:00
Sukru Senli
e7be0ba557 inteno-netmodes: testnet: move accesspolicy variable declaration to correct place 2018-01-23 22:30:01 +01:00
Ionut-Alex Oprea
9b82fd92d2 inteno-netmodes: fix comment 2018-01-22 15:23:00 +01:00
Ionut-Alex Oprea
7cbfc3ccae inteno-netmodes: set juci homepage to overview on netmode reload 2018-01-22 15:22:00 +01:00
Ionut-Alex Oprea
a0b58dfde6 inteno-netmodes: hotplug.d: fix typo 2018-01-22 14:37:31 +01:00
Sukru Senli
e34472afd3 inteno-netmodes: use correct function 2018-01-22 11:12:37 +01:00
Sukru Senli
1ac87df83f inteno-netmodes: change conflicting function name 2018-01-22 10:38:25 +01:00
Sukru Senli
b16e181651 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* d0df492 network: correct the comparison of repeateds with clients
-------------------------------------------------------------------------------
commit d0df492d49dc1e4fb14c976b8eb297c006f602db
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-21 18:50:35 +0100

    network: correct the comparison of repeateds with clients

Base directory -> /
 network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-21 18:55:35 +01:00
Sukru Senli
5f57a90aee inteno-netmodes: netmode-conf: sync after restoring config 2018-01-20 12:59:43 +01:00
Sukru Senli
d0c84e2ab3 inteno-netmodes: remove the unneeded script 2018-01-20 12:57:03 +01:00
Sukru Senli
960b7a262a inteno-netmodes: make sure uplink macaddr is corrected after reboot 2018-01-20 12:25:59 +01:00
Sukru Senli
761841b937 inteno-netmodes: trigger of correcting uplink macaddr every time netmode changes 2018-01-19 23:46:24 +01:00
Sukru Senli
68dcd628ef inteno-netmodes: do not set to repeater mode by default 2018-01-19 22:27:01 +01:00
Sukru Senli
d36120f54a inteno-netmodes: set macaddress of uplink bridge to wetif macaddr 2018-01-19 10:25:30 +01:00
Reidar Cederqvist
aba88af339 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 6bd30b1 graphd: in *_traffic calls return bytes instead of bits
-------------------------------------------------------------------------------
commit 6bd30b1d54ac508589444c44180bf88e2c6c0679
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-19 09:54:13 +0100

    graphd: in *_traffic calls return bytes instead of bits

Base directory -> /
 graphd.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
-------------------------------------------------------------------------------
2018-01-19 09:54:24 +01:00
Reidar Cederqvist
0d477445df Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* d14ff10 graphd: correct the fix for overflow values
-------------------------------------------------------------------------------
commit d14ff10740767ce60e17469632ab0fd13b0e7118
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-18 18:29:44 +0100

    graphd: correct the fix for overflow values

Base directory -> /
 graphd.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
2018-01-18 18:30:03 +01:00
Reidar Cederqvist
8262dbb7ff Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* d0bb682 graphd: add safeguard for when values overflow on the system
* 4f02bf8 graphd: fix typo
-------------------------------------------------------------------------------
commit d0bb682e44797784d4b60c0c406d88b4e773410e
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-18 18:13:13 +0100

    graphd: add safeguard for when values overflow on the system

Base directory -> /
 graphd.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
-------------------------------------------------------------------------------
commit 4f02bf8b51390eb092b2c76beb7bb1bd68d3e1e2
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-18 18:12:12 +0100

    graphd: fix typo

Base directory -> /
 graphd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-18 18:14:35 +01:00
Sukru Senli
1c71f37716 inteno-netmodes: move netmode.sh under /lib/functions and adapt scripts accordingly 2018-01-18 17:27:07 +01:00
Reidar Cederqvist
1279e795f2 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* aef738b graphd: fix missing blob_buf_free and added casts for malloc
* cb5929c graphd: update ubus keys to follow ubus standard ref #13710
-------------------------------------------------------------------------------
commit aef738bab48065057002c1b0ea018ee3f2cbbfb3
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-18 16:49:40 +0100

    graphd: fix missing blob_buf_free and added casts for malloc

Base directory -> /
 graphd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit cb5929c0184ea26cace2ee71204316d4179282a4
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-18 09:04:11 +0100

    graphd: update ubus keys to follow ubus standard ref #13710

Base directory -> /
 graphd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
-------------------------------------------------------------------------------
2018-01-18 16:49:51 +01:00
Jonas Höglund
339b7338bc Update feed [ feed_inteno_packages ] package [ dectmngr2 ]
-------------------------------------------------------------------------------
* ace6a3d Send on/offhook event to asterisk
* 41484bb Call main asterisk ubus object
-------------------------------------------------------------------------------
commit ace6a3dcb6aa463cf5a34ad39ac37a5bc7d4ce5e
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-18 10:49:27 +0100

    Send on/offhook event to asterisk

Base directory -> /
 src/external_call.c |  4 ++++
 src/ubus.c          | 25 +++++++++++++++++++++++++
 src/ubus.h          |  1 +
 3 files changed, 30 insertions(+)
-------------------------------------------------------------------------------
commit 41484bb47ebc4fddc06583275209b1abb084bc2b
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-16 17:19:28 +0100

    Call main asterisk ubus object

Base directory -> /
 src/ubus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-18 10:52:45 +01:00
Jonas Höglund
d76c4802c5 Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 9338fea Remove astproxy binary from tracking
-------------------------------------------------------------------------------
commit 9338fea66c3bdd3329ebdca66347b0ede0282e5e
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-16 17:11:04 +0100

    Remove astproxy binary from tracking

Base directory -> /
 src/.gitignore |   1 +
 src/astproxy   | Bin 91516 -> 0 bytes
 2 files changed, 1 insertion(+)
-------------------------------------------------------------------------------
2018-01-18 10:52:38 +01:00
Sukru Senli
2e1eb9e479 inteno-netmodes: netmode.sh get_device->get_device_of to prevent conflict with netmode-conf 2018-01-17 19:43:30 +01:00
Sukru Senli
9fec422d26 layer2interface: update dsl config to support multiple dsl lines 2018-01-17 19:22:13 +01:00
Jonas Höglund
71062ef692 libpicoevent: Create install dir in staging_dir 2018-01-17 16:59:30 +01:00
Reidar Cederqvist
9f14fa0abd Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 8a07e7a graphd: some cleanup + move blob_buf to local variables
* 5834e24 graphd: fixed broken client_traffic call
* 065369f graphd: refactoring background thread to use dynamic lists
-------------------------------------------------------------------------------
commit 8a07e7aa03410880e0efebe5efe9b70f30dd8141
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-17 15:18:02 +0100

    graphd: some cleanup + move blob_buf to local variables

Base directory -> /
 graphd.c | 127 ++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 65 insertions(+), 62 deletions(-)
-------------------------------------------------------------------------------
commit 5834e24c02025ac8891156abbc9a17369ae2ce74
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-17 15:15:51 +0100

    graphd: fixed broken client_traffic call

Base directory -> /
 graphd.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
commit 065369fbc985b5d983ca5ad0ddf28b73c47d57f3
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-17 13:26:42 +0100

    graphd: refactoring background thread to use dynamic lists

Base directory -> /
 graphd.c | 383 ++++++++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 242 insertions(+), 141 deletions(-)
-------------------------------------------------------------------------------
2018-01-17 16:21:22 +01:00
Sukru Senli
daaaaf7d14 inteno-netmodes: include network.sh lib in netmode handler 2018-01-17 09:27:28 +01:00
Sukru Senli
c90ab17d11 inteno-netmodes: remove unneeded library from netmode library 2018-01-16 16:43:59 +01:00
Jonas Höglund
3c7fd028dd Update feed [ feed_inteno_packages ] package [ dectmngr2 ]
-------------------------------------------------------------------------------
* f3236c0 Compile with ubus for lede
-------------------------------------------------------------------------------
commit f3236c0456cc19154150b105ac516962438022b1
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-16 13:17:07 +0100

    Compile with ubus for lede

Base directory -> /
 src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-16 13:17:35 +01:00
Reidar Cederqvist
d3a2490192 Update feed [ feed_inteno_packages ] package [ inteno-netmodes ]
-------------------------------------------------------------------------------
* 6275685 netmoded: reload wifi servcies after successful config_apply
-------------------------------------------------------------------------------
commit 62756854163fe43bebe19a2d4218113e4e1e587c
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-16 10:55:51 +0100

    netmoded: reload wifi servcies after successful config_apply

Base directory -> /
 netmoded.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
-------------------------------------------------------------------------------
2018-01-16 11:02:59 +01:00
Jonas Höglund
05ea98d3e7 Update feed [ feed_inteno_packages ] package [ dectmngr2 ]
-------------------------------------------------------------------------------
* 49d9ba5 dectshimdrv.h has been removed
* 661e1f2 musl compatibility
* 51b81d5 musl compatibility
* 635602b Minor build issue fix for factory production.
-------------------------------------------------------------------------------
commit 49d9ba5e7d98016cd83a4c16e44d63f31043fff3
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-16 10:38:30 +0100

    dectshimdrv.h has been removed

Base directory -> /
 src/connection_init.c | 63 +++++++++++++++++++++++++--------------------------
 1 file changed, 31 insertions(+), 32 deletions(-)
-------------------------------------------------------------------------------
commit 661e1f2d590f49627982f9f0a26fcf85783c3598
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2017-09-13 13:39:25 +0200

    musl compatibility

Base directory -> /
 src/rawmail.c | 1 +
 src/util.c    | 1 +
 2 files changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit 51b81d5d1868e57fb3a41c5ef8eb9eb72d0d8e43
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2017-09-13 13:27:50 +0200

    musl compatibility

Base directory -> /
 src/stream.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 635602bf60cd7c7a65080c8a2d8716512b1c77d4
Author: Ronny Nilsson <ronny.nilsson@inteno.se>
Date: 2017-08-21 14:45:58 +0200

    Minor build issue fix for factory production.

Base directory -> /
 src/ubus-dummy.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
2018-01-16 10:50:22 +01:00
Jonas Höglund
37ae7ef4aa Remove unused endptcfg 2018-01-16 10:42:55 +01:00
Jonas Höglund
96ea4ba32d Remove asterisk-1.8.x 2018-01-16 10:02:32 +01:00
Sukru Senli
7a76c4bf69 inteno-netmodes: turn off internet led when wps client mode is active and blink when trying to connect 2018-01-15 19:21:53 +01:00
Sukru Senli
f0b8f9d819 inteno-netmodes: move more function to netmode library 2018-01-15 18:36:55 +01:00
Sukru Senli
4ecedd7a08 inteno-netmodes: move functions to /lib/network/netmode.sh 2018-01-15 15:30:26 +01:00
Ionut-Alex Oprea
916e6496ba Update feed [ feed_inteno_packages ] package [ inteno-netmodes ]
-------------------------------------------------------------------------------
* 1500caa reduce debug print
-------------------------------------------------------------------------------
commit 1500caa19a7162ee36f81a9c8771127f2842d72e
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-15 14:22:15 +0100

    reduce debug print

Base directory -> /
 netmoded.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2018-01-15 14:28:25 +01:00
Ionut-Alex Oprea
83a9779cf8 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 274dec8 uproxyd: reschedule the initial add clients timer if it fails
* 0a2617e dumper: hardware_version: remove error message when there is actually no error; add missing fclose if fscanf fails; fix checkpatch errors;
-------------------------------------------------------------------------------
commit 274dec8339aa826828f41f74fd70db3ab5bcfe17
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-15 14:14:04 +0100

    uproxyd: reschedule the initial add clients timer if it fails

Base directory -> /
 uproxyd.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
commit 0a2617e252bd98ec1364609ff6e4d19f1790709a
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-15 11:42:25 +0100

    dumper: hardware_version: remove error message when there is actually no
    error; add missing fclose if fscanf fails; fix checkpatch errors;

Base directory -> /
 dumper.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
-------------------------------------------------------------------------------
2018-01-15 14:26:45 +01:00
Sukru Senli
d91c6aeafb inteno-netmodes: correct uplink after applying wifi settings 2018-01-12 17:44:05 +01:00
Sukru Senli
16fe48bee8 inteno-netmodes: decrease wireless link recovery try interval 2018-01-12 17:43:40 +01:00
Jonas Höglund
642124b863 Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 9b5b12a Add reload trigger for voice_client config change.
-------------------------------------------------------------------------------
commit 9b5b12a3b84eea84dd0d412fb7668bca22945d80
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-12 14:18:53 +0100

    Add reload trigger for voice_client config change.

Base directory -> /
 files/etc/init.d/endptmngr | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
-------------------------------------------------------------------------------
2018-01-12 17:21:43 +01:00
Ionut-Alex Oprea
ecd82c9b55 peripheral_manager: update 2018-01-12 17:03:56 +01:00
Sukru Senli
3d5f9a5485 inteno-netmodes: blink internet led to state trying to connect 2018-01-12 16:39:39 +01:00
Reidar Cederqvist
db55cfc74a owsd/questd: move uproxyd startup from questd to owsd init.d script 2018-01-12 16:18:10 +01:00
Sukru Senli
53a484ddc5 inteno-netmodes: remove owsd from netmodes 2018-01-12 15:33:42 +01:00
Sukru Senli
f64186bb36 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* a4666dd ubusproxy: free memory allocated by blobmsg_format_json
* 15700b1 wificontrol: remove network monitoring functionality
* 4842bf5 uproxyd: fix memory leaks
* c807280 uproxyd.c: remove unusefull comments
* 550dbb0 questd: remove obselete code
-------------------------------------------------------------------------------
commit a4666dd4aa2120b980c11b574079bb2f35023b6c
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-12 14:11:40 +0100

    ubusproxy: free memory allocated by blobmsg_format_json

Base directory -> /
 uproxyd.c | 54 +++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 35 insertions(+), 19 deletions(-)
-------------------------------------------------------------------------------
commit 15700b181920c5a1d54ec65d909a0b1074b756ac
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-12 13:59:01 +0100

    wificontrol: remove network monitoring functionality

Base directory -> /
 wificontrol.c | 159 ----------------------------------------------------------
 1 file changed, 159 deletions(-)
-------------------------------------------------------------------------------
commit 4842bf59c5443adb7342e13691e4d8298b2ee573
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-12 12:03:00 +0100

    uproxyd: fix memory leaks

Base directory -> /
 uproxyd.c | 4 ++++
 1 file changed, 4 insertions(+)
-------------------------------------------------------------------------------
commit c8072803cd661f4cf6ed867c60b95f35f766870e
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2018-01-12 12:02:13 +0100

    uproxyd.c: remove unusefull comments

Base directory -> /
 uproxyd.c | 12 ------------
 1 file changed, 12 deletions(-)
-------------------------------------------------------------------------------
commit 550dbb007489ce4e87460ed1e1bb678a1b5adcec
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-11 01:03:17 +0100

    questd: remove obselete code

Base directory -> /
 Makefile  |   2 +-
 eventd.c  | 167 ------------------------------------------------
 eventd.h  |   7 --
 router.sh | 112 --------------------------------
 scriptd.c | 215 --------------------------------------------------------------
 wps.sh    |  24 -------
 6 files changed, 1 insertion(+), 526 deletions(-)
-------------------------------------------------------------------------------
2018-01-12 15:07:25 +01:00
Sukru Senli
fbea8f365d inteno-netmodes: do not start netmode-client-detect but start wificontrol 2018-01-12 15:06:45 +01:00
Sukru Senli
5ceb1037a2 inteno-netmodes: testnet script which handles network monitoring for extender/repeater as well 2018-01-12 15:02:23 +01:00
Sukru Senli
1fb2725c84 inteno-netmodes: make sure correct uplink device is used when switched to extender/repeater mode 2018-01-12 14:11:40 +01:00
Sukru Senli
880bed3b68 inteno-netmodes: when switching between extender and repeater modes, defer the unused uplink device 2018-01-12 14:03:48 +01:00
Jonas Höglund
b34e652054 Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* ec9bb4f Handle dtmf events
-------------------------------------------------------------------------------
commit ec9bb4f772ab544c8beacaf6a4c075bb031a4788
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-12 11:43:21 +0100

    Handle dtmf events

Base directory -> /
 src/endpt.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
-------------------------------------------------------------------------------
2018-01-12 13:37:30 +01:00
Reidar Cederqvist
d1fbaaf35b questd: updet to newest version 2018-01-12 12:07:13 +01:00
Jonas Höglund
97bf327405 Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* f9e1dcf Add ringback signal
* 37307d1 Set country from config
* c6f6f07 Updated .gitignore
* 294a5f1 Remove binary from tracking
* 847f74f Cleanup
* 01aa472 Read country code  from voice_client config
-------------------------------------------------------------------------------
commit f9e1dcfce3a5745a91b70dcc04c0209177f99683
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-11 16:31:06 +0100

    Add ringback signal

Base directory -> /
 src/endpt.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
commit 37307d1b25600ffc3ea4e29506cfcd5aec3916fa
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-11 13:34:58 +0100

    Set country from config

Base directory -> /
 src/endpt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit c6f6f0706dfc45e725475c92416afae7076906cb
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-11 13:29:41 +0100

    Updated .gitignore

Base directory -> /
 src/.gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 294a5f1f8f12875b418148df3267643139a74e3e
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-11 13:29:14 +0100

    Remove binary from tracking

Base directory -> /
 src/endptmngr | Bin 7258316 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
-------------------------------------------------------------------------------
commit 847f74fe878a85e850e3482c978e77740709d536
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-11 13:24:17 +0100

    Cleanup

Base directory -> /
 src/endpt.c | 84 +++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 48 insertions(+), 36 deletions(-)
-------------------------------------------------------------------------------
commit 01aa4729b7a1ae9dbe129a1710b3e8ed1eef9f82
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-11 11:46:39 +0100

    Read country code  from voice_client config

Base directory -> /
 src/endpt.c   | 159 ++++++++++++++++++++++++++++++++++++++++++++--------------
 src/endptmngr | Bin 7250960 -> 7258316 bytes
 2 files changed, 122 insertions(+), 37 deletions(-)
-------------------------------------------------------------------------------
2018-01-11 16:33:30 +01:00
Ionut-Alex Oprea
5b39bed1eb Update feed [ feed_inteno_packages ] package [ inteno-netmodes ]
-------------------------------------------------------------------------------
* 155aa7d check if wet iface has changed or needs update
* c55b4bf extract code for getting the wet section
* bf513a2 apply credentials on the wet iface
* b6a8626 debug the debug level numerical value
* 01078c9 initialize section to NULL
-------------------------------------------------------------------------------
commit 155aa7dad052b37f081683ad9cf366d39a03f4d7
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-11 16:21:20 +0100

    check if wet iface has changed or needs update

Base directory -> /
 config.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 config.h |   5 +-
 2 files changed, 151 insertions(+), 26 deletions(-)
-------------------------------------------------------------------------------
commit c55b4bf0cc6f2011db2a29958834979948759064
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-11 16:08:38 +0100

    extract code for getting the wet section

Base directory -> /
 config.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)
-------------------------------------------------------------------------------
commit bf513a22380289480a1118883fb8b2b715fa7f95
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-11 14:29:57 +0100

    apply credentials on the wet iface

Base directory -> /
 config.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)
-------------------------------------------------------------------------------
commit b6a8626f3ed9c2fa44520d9e5f9d2a5edbfebfae
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-11 14:28:55 +0100

    debug the debug level numerical value

Base directory -> /
 netmoded.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 01078c90eb899a84e1db19863a98176ef21623f2
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2018-01-11 14:28:04 +0100

    initialize section to NULL

Base directory -> /
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-11 16:22:10 +01:00
Ionut-Alex Oprea
4501e63431 Merge branch 'devel-new-netmoded' into devel-new 2018-01-10 17:28:11 +01:00
Ionut-Alex Oprea
ac6fe3705e inteno-netmodes: add dependency for libuci 2018-01-10 16:54:56 +01:00
Ionut-Alex Oprea
8f5f80a54e inteno-netmode: install netmoded binary 2018-01-10 16:51:17 +01:00
Ke Hu
6ea457812e custom_release
add a new parameter to skip flash check
2018-01-10 15:13:18 +01:00
Jonas Höglund
f4cb6f3d54 Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 8d3b1b9 Callerid
-------------------------------------------------------------------------------
commit 8d3b1b9c2913bc39a1260ab13ee68361298b2e43
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-10 14:56:38 +0100

    Callerid

Base directory -> /
 src/astproxy  | Bin 0 -> 91516 bytes
 src/endpt.c   |  18 +++++++++++++-----
 src/endptmngr | Bin 0 -> 7250960 bytes
 3 files changed, 13 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
2018-01-10 15:03:19 +01:00
Ionut-Alex Oprea
70299670e4 inteno-netmodes: update to latest working version 2018-01-10 12:51:50 +01:00
Ionut-Alex Oprea
61de98d363 hotplug: iface: netmode: do not start netmode-client-detect 2018-01-10 12:49:15 +01:00
Ionut-Alex Oprea
6be2c24b30 netmode: init.d: start netmoded 2018-01-10 12:47:44 +01:00
Jonas Höglund
767c4891e6 Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 2c06c5c Add more signals
-------------------------------------------------------------------------------
commit 2c06c5c54e4a8ffe84f1074d79896da5dc3cd679
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-09 17:36:54 +0100

    Add more signals

Base directory -> /
 src/endpt.c | 4 ++++
 1 file changed, 4 insertions(+)
-------------------------------------------------------------------------------
2018-01-10 10:00:31 +01:00
Jonas Höglund
b447102151 Update templates for asterisk-13.18.4 2018-01-09 13:22:14 +01:00
Sukru Senli
97e3a03f37 dectmngr: removed; it is obselete; dectmngr2 replaces it 2018-01-09 11:07:24 +01:00
Sukru Senli
f433222d9f brcmslic: removed; it is obselete; endptmngr replaces it 2018-01-09 11:07:05 +01:00
Reidar Cederqvist
b5376237af update to latest generally working version 2018-01-09 09:21:27 +01:00
Ionut-Alex Oprea
969571f77a inteno-netmode: update repo hash 2018-01-09 09:19:29 +01:00
Reidar Cederqvist
4bfaf07b98 inteno-netmode: add repo for netmoded source code 2018-01-09 09:19:29 +01:00
Sukru Senli
50f93caf65 Merge remote-tracking branch 'origin/owsd' into devel-new 2018-01-08 19:28:21 +01:00
Ionut-Alex Oprea
8e075dd746 Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
* 1a815ef rewrite jsonrpc__req_ubuslist and jsonrpc_req_ubuslisten with json-c json_object refs #13595
-------------------------------------------------------------------------------
commit 1a815efff25ae4d52bfee67cc4642eb4627f1388
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2017-12-13 10:32:10 +0100

    rewrite jsonrpc__req_ubuslist and jsonrpc_req_ubuslisten with json-c
    json_object refs #13595

Base directory -> /
 src/util_jsonrpc.c | 125 ++++++++++++++++++++++++++++-------------------------
 src/ws_ubusproxy.c |   4 ++
 2 files changed, 69 insertions(+), 60 deletions(-)
-------------------------------------------------------------------------------
2018-01-08 19:27:40 +01:00
Ionut-Alex Oprea
0929485a45 owsd: update to newer version 2018-01-08 19:27:40 +01:00
Reidar Cederqvist
e6c4ac12d4 owsd: fix broken dependencies 2018-01-08 19:27:40 +01:00
Reidar Cederqvist
6d865ed960 OWSD build system compatible with openWRT build system 2018-01-08 19:27:40 +01:00
Ionut-Alex Oprea
296696a586 update owsd version 2018-01-08 19:27:40 +01:00
Ionut-Alex Oprea
31d25714bf update ubusproxy peer comment 2018-01-08 19:27:40 +01:00
Reidar Cederqvist
b29f8a9406 owsd: update config and init.d files to work with ubusproxy 2018-01-08 19:27:40 +01:00
Ionut-Alex Oprea
7dd5cf1864 owsd: update to latest version 2018-01-08 19:27:40 +01:00
Ionut-Alex Oprea
c7b863e916 owsd: config: fix typos and add missing ca option in /etc/config/owsd 2018-01-08 19:27:40 +01:00
Sukru Senli
74df26fb32 owsd: handle owsd acl in owsd init script and configure rpcd accordingly 2018-01-08 19:27:40 +01:00
Denis Osvald
44e10992bf Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
* 20fef42 make HTTP caching configurable and off-by-default
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
commit 20fef420d1796b47fb056e98113592471011a9de
Author: Denis Osvald <denis.osvald@sartura.hr>
Date: 2017-02-10 13:53:44 +0100

    make HTTP caching configurable and off-by-default

    Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>

Base directory -> /
 src/main.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
1e5d155104 owsd: to version with proxy features and SSL auth
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
3fd5294345 update owsd default config file with commented-out proxy options
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
357ef23c0d install /etc/config/owsd as ocnfig file to preserve it
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
b3810ba716 update owsd init script with new options
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
5f729b9eea owsd: update to version with client proxy
New version adds option -C to owsd, with respective option in config:

config owsd 'global'
	...
	list ubusproxy 'http://url1/'
	list ubusproxy 'http://url12/'
	...

Patch is removed since it's obsoleted in this version

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Sukru Senli
2f8768beaa owsd: wan https commented out 2018-01-08 19:27:40 +01:00
Denis Osvald
2bef8c073c owsd: update to latest version, tweaks debug output
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
3f80217975 owsd: fix origin whitelisting on https port 443
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
b38c7fda35 owsd: temporarily raise max vhosts to 30 until refactor
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
486112e022 libwebsockets, owsd: update to latest, addresses HTTP pipelining
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Sukru Senli
0d6a3fca83 owsd: auto populate for port 80 and 8080 2018-01-08 19:27:40 +01:00
Sukru Senli
74c70ba559 owsd: auto populate interfaces to listen on 2018-01-08 19:27:40 +01:00
Sukru Senli
1dccf9f8bf owsd: change url to http 2018-01-08 19:27:40 +01:00
Jonas Höglund
bbcaeda58d Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
* 841c0ef Fix compile error on openwrt master
-------------------------------------------------------------------------------
commit 841c0ef39de130dfda93bec6badea2255d26a528
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2016-09-22 14:58:40 +0200

    Fix compile error on openwrt master

Base directory -> /
 src/ws_http_serve.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
2018-01-08 19:27:40 +01:00
Denis Osvald
3419b149b8 owsd: update to latest, modify initscript to pass listen label
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Sukru Senli
9986a37299 owsd: listen on wan6 interface 2018-01-08 19:27:40 +01:00
Sukru Senli
6d7fe87ed3 owsd: whitelist dhcp domains only if set to 1 2018-01-08 19:27:40 +01:00
Denis Osvald
7fcbcd3930 owsd: add new localhost section
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
31f43a3194 owsd: separate listening ports for ipv4 and ipv6, #10027
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
554c997dd8 Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
* 6dd1429 raise max number of listen sockets to 10
* a6533b7 fix check for max number of listen sockets
-------------------------------------------------------------------------------
commit 6dd142943bc68e0e4b1f4a002ce7f281c1678813
Author: Denis Osvald <denis.osvald@sartura.hr>
Date: 2016-09-02 16:34:03 +0200

    raise max number of listen sockets to 10

    Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>

Base directory -> /
 src/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit a6533b794c27830dfc8a7dd3531e2344f258461c
Author: Denis Osvald <denis.osvald@sartura.hr>
Date: 2016-09-02 16:33:44 +0200

    fix check for max number of listen sockets

    Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>

Base directory -> /
 src/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Alex Oprea
31d8c188df Revert "use procd reload scripts instead of hotplug"
This reverts commit c02d4886a213903ad890e09eadd9575ea569c68d.
2018-01-08 19:27:40 +01:00
Sukru Senli
27ac0cd984 owsd: whitelist localhost 2018-01-08 19:27:40 +01:00
Denis Osvald
74a9f4c75c use procd reload scripts instead of hotplug
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Sukru Senli
33cb713044 owsd: does not trigger upon network config change because hotplug script handles it 2018-01-08 19:27:40 +01:00
Sukru Senli
4736212345 owsd: adapt to ip addr changes via hotplug script 2018-01-08 19:27:40 +01:00
Sukru Senli
88f38cf541 owsd: for now list origin * for lan interfaces 2018-01-08 19:27:40 +01:00
Alex Oprea
ad4b3de384 owsd: fix loading of dhcp entries refs #9908
- config_load dhcp was called while parsing owsd config,
	thus overwritting the latter.
	- fixed this by loading and parsing the dhcp config before
	loading and parsing the owsd config.
	- this issue resulted in owsd not loading the config for
	wan:80, thus no gui available, refs #9908.
2018-01-08 19:27:40 +01:00
Sukru Senli
96066cef33 owsd: redirect cgi-bin/luci to cacheflush.html 2018-01-08 19:27:40 +01:00
Sukru Senli
b14f889f5c owsd: set list origin * by default on wan side 2018-01-08 19:27:40 +01:00
Denis Osvald
bff3095937 owsd: update version to 1.0.2
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
83c4c884bc owsd: add commented-out example to disable origin filter
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
319f388fdd owsd: whitelist dhcp domains on lan
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
cf2810fcc5 owsd: support to add dhcp domains to origin whitelist so routerlogin.net works
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
c75dfd3d92 Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
* b30c45b support blob wildcards in origin filter
* bd8014a Merge branch 'fixes'
* fb3d1b0 malloc: do not access memory before checking it exists
-------------------------------------------------------------------------------
commit b30c45bace28a834a0634a8756345009ee6d2c5d
Author: Denis Osvald <denis.osvald@sartura.hr>
Date: 2016-08-19 16:40:23 +0200

    support blob wildcards in origin filter

    Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>

Base directory -> /
 src/wsubus.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
-------------------------------------------------------------------------------
commit bd8014a1909970b13a2bc84cf268e881c2e4a75e
Author: Denis Osvald <denis.osvald@sartura.hr>
Date: 2016-08-17 17:01:39 +0200

    Merge branch 'fixes'

Base directory -> /
 src/wsubus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit fb3d1b0ba2d0da225bfbffccaa96824e84f9b345
Author: Alex Oprea <alex.oprea@inteno.se>
Date: 2016-08-11 15:42:02 +0200

    malloc: do not access memory before checking it exists

Base directory -> /
 src/wsubus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-08 19:27:40 +01:00
Denis Osvald
1d999b07c3 owsd: update to latest version with redirect, refs #9910
latest version includes support for redirect:

	option redirect /cgi-bin/luci:/some/page

Add this to default config so LuCI -> JUCI migration works

Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Alex Oprea
181912ea63 owsd: add reload triggers on network and owsd configs changes refs #9776 2018-01-08 19:27:40 +01:00
Alex Oprea
4e632bf465 owsd: fix parameter order: first port, then interface refs #9775
fix owsd not starting on lan:8080, due to incorrectly using "-i"
parameter before "-p" parameter.
2018-01-08 19:27:40 +01:00
Sukru Senli
f7a365c830 owsd: skip binding interface if it is not available 2018-01-08 19:27:40 +01:00
Sukru Senli
c5d233a715 owsd: set whitelist_interface_as_origin 1 for listen on wan 2018-01-08 19:27:40 +01:00
Sukru Senli
85ac5095c4 owsd: listen on wan 2018-01-08 19:27:40 +01:00
Reidar Cederqvist
17e27eb287 Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
2018-01-08 19:27:40 +01:00
Reidar Cederqvist
5f24238648 Update feed [ feed_inteno_packages ] package [ owsd ]
-------------------------------------------------------------------------------
* f7d0ea8 added a check if characters are printable before sending it through socket
-------------------------------------------------------------------------------
commit f7d0ea8551ebc20afba4351a9f73045ff35ec32c
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2016-07-05 16:05:34 +0200

    added a check if characters are printable before sending it through socket

Base directory -> /
 src/wsubus_rpc_call.c | 7 +++++++
 1 file changed, 7 insertions(+)
-------------------------------------------------------------------------------
2018-01-08 19:27:40 +01:00
Sukru Senli
47c87cffa0 owsd: listen on port 80 and 8080 2018-01-08 19:27:40 +01:00
Denis Osvald
5ff16a4c44 owsd: new version improves ipv6 support
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
bbd6575748 owsd: new version fixes ipv6...
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
543baa4e04 owsd: update to new version with multiple ports
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
ea2abe2723 owsd: update to new version with ubus list
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
e593c613f2 owsd: update to new version
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
a4a906c8b3 owsd: new version with static file serving
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
564ca842cb clean Makefiles to use suboptions, not variants
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
2551545d74 owsd: new version with fixes
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
e22453b3e7 owsd: new version compatible with libwebsockets 1.7
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
e9054920b6 owsd: bump to 0.8 with test ACL moved to owsd-testdata
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
8bb705d288 owsd: update default config and init script
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
5bdb01b7cc owsd: new version 0.7 with SSL
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
16b8c61c33 owsd: new version 0.6 with event ACLs
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
d1e6c73990 owsd: new version with subscribe feature
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Mislav Novakovic
bd0d992cf9 owsd: new version with rpcd init scripts
Signed-off-by: Mislav Novakovic <mislav.novakovic@sartura.hr>
2018-01-08 19:27:40 +01:00
Denis Osvald
f054fe34c1 owsd: add package
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
2018-01-08 19:27:40 +01:00
Sukru Senli
dc8c7fbdcc layer2interface: dsl: do not add ifname to atm/ptm device config 2018-01-08 19:05:40 +01:00
Sukru Senli
2b0bd17bf9 layer2interface: dsl: create untagged VLAN for atm/ptm with .1 suffix if it does not exist 2018-01-08 18:57:56 +01:00
Sukru Senli
a462f37629 layer2interface: remove ifname from dsl config after creating untagged VLAN for it 2018-01-08 18:57:56 +01:00
Sukru Senli
003b48f7e6 layer2interface: dsl: use correct device name when converting from old config 2018-01-08 18:57:56 +01:00
Sukru Senli
63b17c6178 layer2interface: dsl: create ptm device properly 2018-01-08 18:57:56 +01:00
Sukru Senli
7a0d7f14f0 layer2interface: populate dsl config according to new format 2018-01-08 18:57:56 +01:00
Sukru Senli
4dfc123151 layer2interface: dsl: remove alternative config style and do not sed on/off 2018-01-08 18:57:56 +01:00
Sukru Senli
9f9d2d9360 layer2interface: new dsl config for dsl, atm and ptm settings + adaptation from old config style 2018-01-08 18:57:56 +01:00
Robin Stjerndorff
e4cb7a93cd Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 0e6ab5f fix parsing of conntrack files
-------------------------------------------------------------------------------
commit 0e6ab5fddd446790d2fd6d78cc51f121a27b8248
Author: Robin Stjerndorff <robin.stjerndorff@inteno.se>
Date: 2018-01-08 15:49:05 +0100

    fix parsing of conntrack files

Base directory -> /
 net.c | 90 +++++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 47 insertions(+), 43 deletions(-)
-------------------------------------------------------------------------------
2018-01-08 16:25:06 +01:00
Sukru Senli
85b0ba1605 inteno-netmodes: get wan device from db 2018-01-05 21:54:12 +01:00
Sukru Senli
2f40567ff4 inteno-netmodes: do netmode correction only if necessary 2018-01-05 21:49:08 +01:00
Sukru Senli
af1b66a3b7 inteno-netmodes: wait for netmode-conf taking over only if wificontrol is running 2018-01-05 21:36:07 +01:00
Jonas Höglund
dcbb63a9ae Update feed [ feed_inteno_packages ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 5fec171 Cleanup
* 966870d Merge ubus.c file
* 3f60a47 Sort packets by connection id
* e488e92 Add audio_tx bus
* 583df94 Fix spelling error
* 2c8ff4f Add audio_tx bus
-------------------------------------------------------------------------------
commit 5fec171d3e42f4f2fc42661e19cced08a1d9a6cf
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-04 17:54:25 +0100

    Cleanup

Base directory -> /
 src/endpt.c | 142 ++++++++++++++++++++++++++----------------------------------
 1 file changed, 62 insertions(+), 80 deletions(-)
-------------------------------------------------------------------------------
commit 966870d95db6d0e7e5932251031ce1621e9b3f39
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-04 16:56:37 +0100

    Merge ubus.c file

Base directory -> /
 src/Makefile |   2 +-
 src/endpt.c  | 505 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 src/ubus.c   | 512 -----------------------------------------------------------
 src/ubus.h   |   6 -
 4 files changed, 489 insertions(+), 536 deletions(-)
-------------------------------------------------------------------------------
commit 3f60a47e41f941aa0b0402f41aab606f66652cc0
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2018-01-04 15:55:39 +0100

    Sort packets by connection id

Base directory -> /
 src/endpt.c | 36 +++++++++++++++++-------------------
 src/ubus.c  | 46 +++++++++++++++++++++++++++++++++-------------
 2 files changed, 50 insertions(+), 32 deletions(-)
-------------------------------------------------------------------------------
commit e488e92e030104233b02e6b7c6f2791997237025
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2017-12-22 11:32:45 +0100

    Add audio_tx bus

Base directory -> /
 src/endpt.c |   4 +-
 src/ubus.c  | 122 +++++++++++++++++++-----------------------------------------
 2 files changed, 40 insertions(+), 86 deletions(-)
-------------------------------------------------------------------------------
commit 583df94ac848ae0ba04b47f3ff5635266d188211
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2017-12-22 10:53:35 +0100

    Fix spelling error

Base directory -> /
 src/ubus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 2c8ff4faa92a19358dddd093761a9114727c5873
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2017-12-21 17:32:23 +0100

    Add audio_tx bus

Base directory -> /
 src/endpt.c |  8 +++++---
 src/ubus.c  | 15 +++++++++------
 2 files changed, 14 insertions(+), 9 deletions(-)
-------------------------------------------------------------------------------
2018-01-05 16:02:08 +01:00
Ke Hu
3793d0b229 add a SKIPHASH for opensdk compiling
do not check hash value whiling compiling opensdk
2018-01-05 14:51:01 +01:00
Jonas Höglund
b5e9360d52 libpicoevent: Add package 2018-01-05 13:03:11 +01:00
Jonas Höglund
aada21cc2b endptmngr: Add package 2018-01-05 13:02:50 +01:00
Jonas Höglund
c4019ccfd9 voice-client: depend on asterisk13 2018-01-05 13:02:16 +01:00
Sukru Senli
9c5236ac27 iop: extract_core: add rpcd to extract list 2018-01-05 10:27:15 +01:00
Jonas Höglund
09fdb5cefa iop: Add extract_top command 2018-01-05 10:21:59 +01:00
Sukru Senli
3634b50514 inteno-netmodes: do not start netmode-client-detect 2018-01-04 20:28:45 +01:00
Sukru Senli
0bc8affb30 layer2interface: adapt to new dsl hotplug event 2018-01-04 18:41:32 +01:00
Sukru Senli
3bb9e81912 Update feed [ feed_inteno_packages ] package [ inbd ]
-------------------------------------------------------------------------------
* f81c146 inbd: convert dsl netlink events to dsl hotplug events
-------------------------------------------------------------------------------
commit f81c146f0b07540877545e5ab644ec8e29905a4d
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-04 18:16:03 +0100

    inbd: convert dsl netlink events to dsl hotplug events

Base directory -> /
 src/inbd.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-01-04 18:29:38 +01:00
Sukru Senli
d692ab5920 layer2interface: commit uci network changes before reloading network 2018-01-04 18:08:31 +01:00
Sukru Senli
1e1dc5ec35 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 6018b53 questd: system: platform independent way of getting previous bank firmware while keeping backwards compatibility
-------------------------------------------------------------------------------
commit 6018b531af4239368acc70c0a1dd2b1b42bc661d
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-03 20:17:29 +0100

    questd: system: platform independent way of getting previous bank firmware
    while keeping backwards compatibility

Base directory -> /
 system.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
2018-01-03 20:18:20 +01:00
Sukru Senli
d3f72c9edd layer2: comment out wan port powering down/up section 2018-01-03 17:33:59 +01:00
Sukru Senli
ce2ff74d79 layer2: adapt to new get_port_speed function 2018-01-03 17:19:59 +01:00
Sukru Senli
d187b85f13 port-management: strip out hw specific port functions; they are moved to /lib/network/port.sh 2018-01-03 17:19:37 +01:00
Ionut-Alex Oprea
883086ac48 iop: ssh_sysupgrade_latest: update for the new bin/ folder structure 2018-01-03 16:30:50 +01:00
Sukru Senli
b59db80b22 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 40dc7c0 questd: include bridge.h in network.c
-------------------------------------------------------------------------------
commit 40dc7c035982e37401f8b53bea9cfbb50dda071e
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-03 10:33:40 +0100

    questd: include bridge.h in network.c

Base directory -> /
 network.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
2018-01-03 10:34:41 +01:00
Sukru Senli
3170329911 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 3583983 questd: strip bridge functions from port.c as they are available in bridge.c
* b04017a questd: bridge handling functions
-------------------------------------------------------------------------------
commit 3583983afdefb3941aa92d2a96b138d78f6cd704
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-03 09:26:31 +0100

    questd: strip bridge functions from port.c as they are available in bridge.c

Base directory -> /
 Makefile |   8 +-
 port.c   | 315 +--------------------------------------------------------------
 port.h   |  50 ----------
 3 files changed, 7 insertions(+), 366 deletions(-)
-------------------------------------------------------------------------------
commit b04017ab476d4c183a5929d6b5e0a54ebf1a18a8
Author: Alex Oprea <alex.oprea@inteno.se>
Date: 2018-01-03 09:25:31 +0100

    questd: bridge handling functions

Base directory -> /
 bridge.c | 339 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 bridge.h |  50 ++++++++++
 2 files changed, 389 insertions(+)
-------------------------------------------------------------------------------
2018-01-03 09:34:58 +01:00
Sukru Senli
a1fadeb5d4 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 1de0a2d questd: port: if port speed cannot be fetched, set it to auto
-------------------------------------------------------------------------------
commit 1de0a2df53413a04c2a7f8169f0dcd4fd0722599
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2018-01-02 18:36:15 +0100

    questd: port: if port speed cannot be fetched, set it to auto

Base directory -> /
 port.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2018-01-02 18:36:52 +01:00
Sukru Senli
77e04ec08b port-management: adapt to new output format of ethctl media-type call 2018-01-02 18:19:43 +01:00
Sukru Senli
5666ca7c65 4g-support: remove the obsolete package 2018-01-02 16:49:13 +01:00
Sukru Senli
019d6c3a00 icwmp: do not use local out of function 2018-01-02 16:46:15 +01:00
Sukru Senli
cf5327b44c iup: do not use local out of function 2018-01-02 16:45:58 +01:00
Sukru Senli
27edf8ced1 voice-client: do not use local out of function 2018-01-02 16:45:40 +01:00
Sukru Senli
5f2cd6d185 inteno-netmodes: do not use local out of function 2018-01-02 16:45:21 +01:00
Erik Horemans
a3db17ba4d new ice-client version 5.0.2-RC1 2018-01-02 14:45:06 +01:00
Sukru Senli
d24ab904fd voice-client: remove dependency for now 2018-01-02 14:45:01 +01:00
Sukru Senli
2742edd708 voice-client: correct the dependency 2018-01-02 14:44:52 +01:00
Sukru Senli
feae7c47f8 voice-client depend on asterisk13 or asterisk18-mod 2018-01-02 14:44:35 +01:00
Sukru Senli
4114221ec2 peripheral_manager: remove peripheral_led_normal init script; its functionality is moved to done 2018-01-02 14:21:31 +01:00
Sukru Senli
2c89c33e2a iwatchdog: start earlier 10i < 1iw 2018-01-02 14:19:30 +01:00
Sukru Senli
cfbb84ef57 inteno-netmodes: make shiftrange script work with LEDE 2018-01-02 14:18:30 +01:00
Sukru Senli
77d8c53c77 layer2interface: when adding device to network config run ubus call network reload 2017-12-29 19:33:33 +01:00
Sukru Senli
1f9ba0a4fd inteno-netmodes: adapt to layer2 changes 2017-12-29 19:30:06 +01:00
Sukru Senli
bc96e7a362 iop: config: deselect qos-scripts 2017-12-28 13:57:34 +01:00
Sukru Senli
f21680f92b layer2interface: type anywan is not supported by netifd; make sure only one interface is set to wan ifname 2017-12-28 13:56:51 +01:00
Sukru Senli
38ef180037 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* f219a7b questd: adapt to new way of getting interfacename while keeping backwards compatibility
* 3813e30 questd: update gitignore
-------------------------------------------------------------------------------
commit f219a7b3292eda7effde0181edbdd9d3784200e4
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-28 10:54:57 +0100

    questd: adapt to new way of getting interfacename while keeping backwards
    compatibility

Base directory -> /
 port.c  | 11 ++++++++++-
 tools.c | 11 +++++++++++
 tools.h |  1 +
 3 files changed, 22 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 3813e30ccfedb69667cb8e2388caa3e807e6f047
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-28 10:32:59 +0100

    questd: update gitignore

Base directory -> /
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
2017-12-28 10:57:14 +01:00
Sukru Senli
6d37d875fb do not use /lib/network/config.sh directly, instead include /lib/network 2017-12-28 10:23:12 +01:00
Sukru Senli
73c1f62267 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 45d2d26 questd: add bspver (BSP Version) paramter to repace brcmver parameter over time
* 78d94fd questd: initial documentation
-------------------------------------------------------------------------------
commit 45d2d265a86a023bb0076f031176c4f4e6e4f3ef
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 18:12:16 +0100

    questd: add bspver (BSP Version) paramter to repace brcmver parameter over
    time

Base directory -> /
 dumper.c | 2 ++
 system.c | 1 +
 system.h | 1 +
 3 files changed, 4 insertions(+)
-------------------------------------------------------------------------------
commit 78d94fdc8128c2b7b7767dee3160ec1a3ed76af3
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 16:16:45 +0100

    questd: initial documentation

Base directory -> /
 docs/QUESTD.pdf | Bin 0 -> 153916 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
-------------------------------------------------------------------------------
2017-12-27 18:12:53 +01:00
Sukru Senli
12f33631de layer2interface: update switch hotplug event to work with LEDE 2017-12-27 17:49:05 +01:00
Sukru Senli
66bd741b2d Update feed [ feed_inteno_packages ] package [ inbd ]
-------------------------------------------------------------------------------
* 12cdd3e inbd: convert link events to hotplug actions
-------------------------------------------------------------------------------
commit 12cdd3e99db7c5020e5613a04ceff2a0a4f73106
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 17:29:24 +0100

    inbd: convert link events to hotplug actions

Base directory -> /
 src/inbd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
2017-12-27 17:31:09 +01:00
Sukru Senli
a89ab65148 Update feed [ feed_inteno_packages ] package [ inbd ]
-------------------------------------------------------------------------------
* a782908 inbd: send hotplug switch event if db switch config does not exist
* 1697128 inbd: start earlier
-------------------------------------------------------------------------------
commit a782908c33a5c134ab77844652f17119606460cc
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 17:22:16 +0100

    inbd: send hotplug switch event if db switch config does not exist

Base directory -> /
 src/inbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 169712887d842a582cd01e8774ae70c52596a32f
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 17:21:58 +0100

    inbd: start earlier

Base directory -> /
 files/etc/init.d/inbd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2017-12-27 17:23:28 +01:00
Sukru Senli
ab9093bda1 Update feed [ feed_inteno_packages ] package [ inbd ]
-------------------------------------------------------------------------------
* 0373efb inbd: send correct hotplug net event for both broadcom and mtk platforms
* 316bfcd inbd: gitignore file
-------------------------------------------------------------------------------
commit 0373efba3448d4eafd95170727f0b7d388c489fe
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 16:53:55 +0100

    inbd: send correct hotplug net event for both broadcom and mtk platforms

Base directory -> /
 src/inbd.c | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)
-------------------------------------------------------------------------------
commit 316bfcd4e680369b400166d3e82a718de2dfba9c
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-12-27 16:53:25 +0100

    inbd: gitignore file

Base directory -> /
 .gitignore | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
-------------------------------------------------------------------------------
2017-12-27 16:54:41 +01:00
Sukru Senli
b23a509d3d layer2interface: dsl: support disabling mods and profiles via config 2017-12-26 15:53:21 +01:00
Sukru Senli
563ab6b9ff layer2interface: dsl: corrected variable name 2017-12-26 15:38:06 +01:00
Sukru Senli
59699b0305 layer2interface: dsl: put profule in quot. marks and log device creation only when it actually creates 2017-12-26 15:21:04 +01:00
Sukru Senli
9cc93b9942 layer2interface: add untagged eth wan device only if it does not already exist 2017-12-26 14:22:56 +01:00
Sukru Senli
904bddc982 layer2interface: remove unused libraries 2017-12-26 13:25:51 +01:00
Sukru Senli
faf327efea layer2interface: dsl hotplug scripts 2017-12-26 13:19:30 +01:00
Sukru Senli
dcb010903d layer2interface: remove layer2_interface adsl and vdsl 2017-12-26 13:13:17 +01:00
Sukru Senli
c442ed85e7 layer2interface: merge layer2_interface, adsl and vdsl in dsl init script 2017-12-26 13:12:25 +01:00
Sukru Senli
2f0ad0bb2a iop: make generate_tarballs work for both iopsys 3 and 4 2017-12-26 12:18:15 +01:00
Sukru Senli
e39081a494 layer2interface: merge layer2_interface ethernet and vlan in layer2 2017-12-26 12:05:28 +01:00
Sukru Senli
ac21f3c757 netmode: enviroment->environment reload 2017-12-25 20:06:08 +01:00
Sukru Senli
060ba67030 layer2interface: run grep silence 2017-12-25 18:28:59 +01:00
Sukru Senli
1cbe737ca8 layer2interface: layer2 interface ethernet and vlan scripts run adaptation code to netifd way 2017-12-25 18:26:26 +01:00
Sukru Senli
5a8f5e841c layer2interface: create ethwan device with type untagged instead of attribute untagged 2017-12-25 13:07:24 +01:00
Sukru Senli
60dae510cc layer2interface: let netifd and vlanconf handle tagged and untagged vlans 2017-12-24 16:31:55 +01:00
Sukru Senli
dd22d60889 icwmp-4.0-2017-12-22 2017-12-24 14:16:57 +01:00
Omar Kallel
92328805fd Makefile and Config files of new icwmp version (modified) 2017-12-24 14:11:05 +01:00
Omar Kallel
5dd4c869a5 Makefile and Config files of new icwmp version 2017-12-24 14:11:05 +01:00
Sukru Senli
6477c4df36 iop: use ntpd package version 4.2.8p10 instead of busybox ntpd 2017-12-21 10:08:11 +01:00
Sukru Senli
b01acbc03f tptest: remove tptest.bredband.net from list 2017-12-20 20:31:05 +01:00
Kenneth Johansson
61fbbfe3d8 fatrace: we need to flush every line when using a pipe.
/sbin/fatrace -c -t -f W |  grep "/etc/"

produced no output until internal printf buffer full and that is not so
useful.
2017-12-20 18:19:04 +01:00
Kenneth Johansson
96aa7c4cab fatrace: add kernel config option and patch for correct O_LAGEFILE.
The program only worked on x86.
2017-12-20 18:19:04 +01:00
Kenneth Johansson
267a7a1be1 Add fatrace program. 2017-12-20 18:19:04 +01:00
Sukru Senli
8a356767ba iop: config: select OPENSSL_WITH_COMPRESSION 2017-12-20 17:35:14 +01:00
Erik Horemans
9e573f4823 new ice-client 5.0.1-RC1 2017-12-20 16:58:10 +01:00
Sukru Senli
284d3f41a0 icwmp: reload icwmp only if wan ipaddress changes 2017-12-20 16:56:29 +01:00
Sukru Senli
0f6832b2e5 Revert "icwmp-4.0-2017-11-30"
This reverts commit ec98087c13.
2017-12-20 16:55:47 +01:00
Sukru Senli
ec98087c13 icwmp-4.0-2017-11-30 2017-12-20 15:06:57 +01:00
Sukru Senli
07f9b4f21b iop: config: select inbd by default 2017-12-20 11:47:40 +01:00
Sukru Senli
07be960d6f questd: do not start imonitor 2017-12-19 19:55:52 +01:00
Sukru Senli
2b6bf58e12 questd: imonitor: do not do ubus router.network ports call check 2017-12-19 19:55:23 +01:00
Sukru Senli
e0d7c59065 layer2interface: temporarily set parent ethwan device as network wan ifname 2017-12-19 19:46:48 +01:00
Sukru Senli
2be51e0e3d layer2interface: remove brcmwifi.sh; added to targets 2017-12-19 18:58:58 +01:00
Jonas Höglund
4e7993931c Add nand-utils package 2017-12-19 12:06:14 +01:00
Sukru Senli
eb8db8b9e3 layer2interface: make layer2 config generator work with lede 2017-12-17 18:20:25 +01:00
Jonas Höglund
5b6c96ccec config: Disable ppp as it is not compiling nor used. 2017-12-17 13:14:16 +01:00
Jonas Höglund
cc9c65fd33 Module tools provided by ubox package in lede 2017-12-17 13:14:12 +01:00
Jonas Höglund
7ee675aa5c Override packets from feed_inteno_lede 2017-12-17 13:14:06 +01:00
Jonas Höglund
33f59b8fe7 Remove libstrophe as we have a later version in lede 2017-12-17 13:14:01 +01:00
Sukru Senli
498a53e080 questd-3.1.40 2017-12-17 13:09:40 +01:00
Sukru Senli
82f0e36033 questd: imonitor: do not restart quest if lan ifname is missing or is bridge 2017-12-17 13:07:30 +01:00
Erik Horemans
4c4c8dc576 new ice-client ice-client 5.0.1-RC0 2017-12-17 13:07:25 +01:00
Ionut-Alex Oprea
0ad032158b imonitor: increase questd memory limit to 20MB refs #13511 2017-12-17 13:07:25 +01:00
Anjan Chanda
1e957aeabf iop: select package wlng 2017-12-08 13:31:21 +01:00
Anjan Chanda
0a9e81aee6 Update feed [ feed_inteno_packages ] package [ wlng ]
-------------------------------------------------------------------------------
* e253b08 remove stray debug prints
-------------------------------------------------------------------------------
commit e253b080baac1ab0c81f1aa2c8faada254fbe484
Author: Anjan Chanda <anjan.chanda@inteno.se>
Date: 2017-12-08 12:53:49 +0100

    remove stray debug prints

Base directory -> /
 driver_mtk.c | 3 ---
 1 file changed, 3 deletions(-)
-------------------------------------------------------------------------------
2017-12-08 12:58:17 +01:00
Anjan Chanda
db6f345542 wlng: correct exported target flag 2017-12-08 16:14:32 +05:30
Anjan Chanda
85629b2009 wlng: include package 2017-12-07 20:55:49 +05:30
Reidar Cederqvist
a0c0cad5ee Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* a4c8de6 Merge remote-tracking branch 'origin/nvram_hv' into devel
* 16cb4dd questd: improve parsing
* 312ca10 questd: get nvram Hardware Version value
* 824c247 fix c99 warning
* 83a7011 questd: print rssi value from extender
* b554abd questd: get rssi value from extender
-------------------------------------------------------------------------------
commit a4c8de679ceae28dc418e1f779da7040b3c0e24f
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2017-12-06 14:56:33 +0100

    Merge remote-tracking branch 'origin/nvram_hv' into devel

Base directory -> /
 Makefile      |  2 +-
 dumper.c      | 19 +++++++++++++++
 network.c     | 30 ++++++++++++++---------
 network.h     |  7 +++++-
 system.c      |  5 ++++
 system.h      |  1 +
 wificontrol.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 7 files changed, 123 insertions(+), 17 deletions(-)
-------------------------------------------------------------------------------
commit 16cb4dda3909efef54b84d44fa11dc28f9763c8c
Author: Robin Stjerndorff <robin.stjerndorff@inteno.se>
Date: 2017-12-04 17:12:37 +0100

    questd: improve parsing

Base directory -> /
 dumper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 312ca10075347ea1ca4d4a051d079ff5643a934e
Author: Robin Stjerndorff <robin.stjerndorff@inteno.se>
Date: 2017-12-04 16:27:27 +0100

    questd: get nvram Hardware Version value

Base directory -> /
 dumper.c | 20 ++++++++++++++++++++
 system.c |  5 +++++
 system.h |  1 +
 3 files changed, 26 insertions(+)
-------------------------------------------------------------------------------
commit 824c24781123b0cc83216486732e5a03823ec5ed
Author: Robin Stjerndorff <robin.stjerndorff@inteno.se>
Date: 2017-11-30 16:13:31 +0100

    fix c99 warning

Base directory -> /
 wificontrol.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 83a7011877b6a7b1dcbcfd925037ffd77de5165f
Author: Robin Stjerndorff <robin.stjerndorff@inteno.se>
Date: 2017-11-23 15:37:56 +0100

    questd: print rssi value from extender

Base directory -> /
 network.c | 30 +++++++++++++++++++-----------
 network.h |  7 ++++++-
 2 files changed, 25 insertions(+), 12 deletions(-)
-------------------------------------------------------------------------------
commit b554abd3fa7e0898095bfb575803081f716d3723
Author: Robin Stjerndorff <robin.stjerndorff@inteno.se>
Date: 2017-11-23 15:35:06 +0100

    questd: get rssi value from extender

Base directory -> /
 Makefile      |  2 +-
 wificontrol.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 71 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
2017-12-06 15:00:43 +01:00
Reidar Cederqvist
23203274e1 Revert "inteno-netmode: add repo for netmoded source code"
This reverts commit f2701fc6c1.
2017-12-04 14:25:47 +01:00
Reidar Cederqvist
ca0e860aad Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* c434011 add missing close for ioctl socket
-------------------------------------------------------------------------------
commit c434011a45f130f485f73ab44a2bbe55d41f9955
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2017-12-04 12:47:24 +0100

    add missing close for ioctl socket

Base directory -> /
 network.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
2017-12-04 12:47:38 +01:00
Reidar Cederqvist
f2701fc6c1 inteno-netmode: add repo for netmoded source code 2017-12-04 09:08:57 +01:00
Ionut-Alex Oprea
42a8ce1819 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* d2f3a8f Merge branch 'uproxyd' into devel
* 10cba85 Define missing variable
* bc34921 mediatek: trigger auto channel selection based on busy time
-------------------------------------------------------------------------------
commit d2f3a8f4cbd812362906409c7022d31df908ac02
Author: Ionut-Alex Oprea <ionutalexoprea@gmail.com>
Date: 2017-12-01 15:37:29 +0100

    Merge branch 'uproxyd' into devel

Base directory -> /
 .gitignore |   3 +
 Makefile   |  11 +-
 network.c  |   2 +-
 uproxyd.c  | 368 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 381 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit 10cba850fb80668502ca5ce0bc57533089062741
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2017-11-23 16:14:17 +0100

    Define missing variable

Base directory -> /
 port.c | 3 +++
 1 file changed, 3 insertions(+)
-------------------------------------------------------------------------------
commit bc34921baff1f6bc9d76920d8863010fa6b4e3cd
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-11-17 09:28:55 +0100

    mediatek: trigger auto channel selection based on busy time

Base directory -> /
 mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2017-12-01 15:41:11 +01:00
Reidar Cederqvist
041b6ee88f questd: start uproxy with questd 2017-11-30 14:40:41 +01:00
Reidar Cederqvist
9cfa0c0ce9 questd: change questd to uproxyd version 2017-11-30 14:40:23 +01:00
Ionut-Alex Oprea
f09e3ea1e5 Merge branch 'devel' into devel-new 2017-11-30 14:13:07 +01:00
Kenneth Johansson
a57fa2b48e adsl: new arguments to xtmlctl. 2017-11-30 13:43:09 +01:00
Kenneth Johansson
0493459fc2 vdsl: new command line and output on xtmctl. 2017-11-29 21:51:08 +01:00
106 changed files with 2972 additions and 4360 deletions

View File

@@ -1,31 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=4g-support
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/4g-support
CATEGORY:=Network
TITLE:=4G Network Setup Tools
endef
define Package/4g-support/description
4g-support contains necessary tools to setup 4G WAN connection
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/4g-support/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,4g-support))

View File

@@ -1,62 +0,0 @@
opengt
set com 115200n81
set comecho off
set senddelay 0.05
waitquiet 1 0.2
:start
if $env("USE_DISCONNECT")="1" goto disconnect
send "AT^^NDISDUP=1,1,\""
send $env("USE_APN")
if $env("USE_AUTHTYPE")="-1" goto noauth
else goto auth
:noauth
send "\"^m"
goto result
:auth
send "\",\""
send $env("USE_USERID")
send "\",\""
send $env("USE_PASSWORD")
send "\","
send $env("USE_AUTHTYPE")
send "^m"
goto result
:result
waitfor 5 "OK","ERR","ERROR"
if % = 0 goto connok
if % = 1 goto connerr
if % = 2 goto connerr
:connok
print "WWAN connection established.\r\n"
goto done
:connerr
print "WWAN error. Connection failed.\r\n"
exit 1
:disconnect
send "AT^^NDISDUP=1,0,\""
send $env("USE_APN")
send "\"^m"
waitfor 5 "OK","ERR","ERROR"
if % = 0 goto disconnok
if % = 1 goto disconnerr
if % = 2 goto disconnerr
:disconnok
print "WWAN connection disconnected.\r\n"
goto done
:disconnerr
print "WWAN disconnection error.\r\n"
exit 1
:done
exit 0

View File

@@ -1,35 +0,0 @@
. /lib/network/config.sh
. /usr/share/libubox/jshn.sh
iface_status() {
local iface=$1
local up
json_load "$(ifstatus $iface)"
json_get_var up up
json_close_object
return $up
}
case "$ACTION" in
add|register)
if [ "${INTERFACE:0:4}" == "wwan" ]; then
netname=$(get_network_of "$INTERFACE")
for net in $netname; do
local service=$(uci -q get network.$net.service)
local cnt=0
while $(iface_status $net); do
ifup $net
if [ "$service" == "qmi" ]; then
cnt=$(($cnt+1))
# quit trying if still not online after three times
[ $cnt -eq 3 ] && break
sleep 5
else
break
fi
done
done
fi
;;
esac

View File

@@ -1,74 +0,0 @@
#!/bin/sh
local usb_dir uVid uPid uMa uPr uSe bConf bNumConfs vendor product mdmtyp netdev comdev cdcdev ttydev interface usbno usbbr
sanitize() {
sed -e 's/[[:space:]]\+$//; s/[[:space:]]\+/_/g' "$@"
}
find_usb_attrs() {
usb_dir="/sys/$DEVPATH"
[ -f "$usb_dir/idVendor" ] || usb_dir="${usb_dir%/*}"
uVid=$(cat "$usb_dir/idVendor")
uPid=$(cat "$usb_dir/idProduct")
uMa=$(sanitize "$usb_dir/manufacturer")
uPr=$(sanitize "$usb_dir/product")
uSe=$(sanitize "$usb_dir/serial")
bNumConfs=$(cat "$usb_dir/bNumConfigurations")
bConf=$(cat "$usb_dir/bConfigurationValue")
netdev=$(find $usb_dir -name wwan* | awk -F'/' '{print$NF}' | head -2 | tail -1)
cdcdev=$(find $usb_dir -name cdc-wdm* | awk -F'/' '{print$NF}' | head -2 | tail -1)
ttydev=$(ls $(find $usb_dir -name tty | head -2 | tail -1) | tail -1)
interface=$(cat $usb_dir/interface)
if [ -n "$cdcdev" ]; then
comdev=$cdcdev
mdmtyp=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$2}' | head -1)
vendor=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$3}' | head -1)
product=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$4}' | head -1)
else
comdev=$ttydev
mdmtyp=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$2}' | head -1)
vendor=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$3}' | head -1)
product=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$4}' | head -1)
fi
[ -n "$mdmtyp" ] || mdmtyp=$(grep $uVid:$uPid /etc/modemdb | awk '{print$2}' | head -1)
[ -n "$vendor" ] || vendor=$(grep $uVid:$uPid /etc/modemdb | awk '{print$3}' | head -1)
[ -n "$product" ] || product=$(grep $uVid:$uPid /etc/modemdb | awk '{print$4}' | head -1)
}
convert_to_mbim() {
if [ "$mdmtyp" == "mbim" ] && [ "$bNumConfs" == "2" ]; then
[ "$bConf" == "2" ] || echo 2 > $usb_dir/bConfigurationValue
fi
}
usbno=$(echo $DEVPATH | cut -d'/' -f5)
usbbr=$(echo $DEVPATH | cut -d'/' -f7)
case "$usbbr" in
*:*) usbbr=$(echo $DEVPATH | cut -d'/' -f6) ;;
esac
#devno=$(basename $DEVPATH)
find_usb_attrs
if [ "$ACTION" = add ]; then
convert_to_mbim "$uVid:$uPid"
if [ -n "$uVid" ] && [ -n "$uPid" ] && [ -n "$mdmtyp" ] && [ -n "$netdev" ] && [ -n "$comdev" ]; then
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
sed -i "/$usbno:$usbbr/ d" /var/usbnets
echo $usbno:$usbbr $uVid:$uPid $uMa $uPr $netdev $comdev $mdmtyp $vendor $product >> /var/usbnets
ubus send hotplug.usb "{'action': 'add', 'devpath': '$DEVPATH', 'manufacturer': '$uMa', 'product': '$uPr', 'serial': '$uSe', 'vendor_id': '$uVid', \
'product_id': '$uPid', 'driver_interface': '$interface', 'driver': '$DRIVER', 'devtype': '$DEVTYPE'}"
fi
fi
fi
if [ "$ACTION" = remove ]; then
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
sed -i "/$usbno:$usbbr/ d" /var/usbnets
ubus send hotplug.usb "{'action': 'remove', 'devpath': '$DEVPATH', 'manufacturer': '$uMa', 'product': '$uPr', 'serial': '$uSe', 'vendor_id': '$uVid', \
'product_id': '$uPid', 'driver_interface': '$interface', 'driver': '$DRIVER', 'devtype': '$DEVTYPE'}"
fi
fi

View File

@@ -1,100 +0,0 @@
1bbb:011e qmi
1a8d:1001 ecm
1a8d:100c ecm
1a8d:100d ecm
16d8:6280 qmi
16d8:6803 qmi
16d8:6804 qmi
16d8:7003 qmi
16d8:700a qmi
2001:7d01 mbim
2001:7d02 mbim
2001:7d03 mbim
12d1:14ac qmi
12d1:140c qmi
12d1:1506 qmi Huawei E367/392/398
12d1:1506 ncm Huawei E3276
12d1:14d2 qmi
12d1:1c07 ncm
12d1:1436 ecm
12d1:14c9 qmi
12d1:14db ecm
12d1:151d mbim
12d1:151e qmi Huawei E353
12d1:1c1e ncm
12d1:150c qmi
12d1:150f qmi
12d1:151b qmi
12d1:142d ecm
12d1:1432 ecm
12d1:1c1f ncm
12d1:1433 qmi
12d1:1465 ecm
12d1:14ca qmi
12d1:14cf ncm
12d1:14bc ecm
12d1:14ae ecm
12d1:1576 mbim
12d1:1577 mbim
12d1:1400 mbim
12d1:14f7 mbim
12d1:1464 qmi
12d1:14cb qmi
12d1:14cc qmi
12d1:14c6 qmi
12d1:14fa mbim
12d1:1578 mbim
12d1:14c8 qmi
12d1:14f8 mbim
12d1:1575 mbim
12d1:1579 mbim
12d1:157a mbim
12d1:157b mbim
12d1:157f mbim
12d1:1f16 mbim Vodafone K5150
12d1:1404 qmi
19f2:1700 ecm
1410:b001 qmi
1527:1000 ecm
0b3c:c005 qmi
0f3d:68a2 qmi
1199:68a2 qmi SierraWireless M7710
1199:68c0 qmi SierraWireless M7304
1349:1100 qmi
1349:1200 qmi
1199:683c qmi
2360:2100 qmi
2360:2200 qmi
2360:2300 qmi
2507:0000 qmi
19d2:0055 qmi
19d2:0052 qmi
19d2:0063 qmi
19d2:1008 qmi
19d2:1010 qmi
19d2:2002 qmi
19d2:1176 qmi
19d2:1023 mbim
19d2:0104 qmi
19d2:1018 qmi
19d2:1032 mbim
19d2:1402 qmi
19d2:1405 ecm
19d2:1426 qmi
19d2:0031 qmi
19d2:0124 qmi
19d2:1254 qmi
19d2:0017 qmi
19d2:0002 qmi
19d2:0121 qmi
19d2:1252 qmi
19d2:0157 qmi
19d2:0167 qmi
19d2:0199 qmi
19d2:0257 qmi
19d2:0326 qmi
19d2:0349 ecm
19d2:1408 ecm
19d2:0284 qmi
19d2:0019 qmi
19d2:0265 qmi

View File

@@ -1,159 +0,0 @@
#!/bin/sh
INCLUDE_ONLY=1
. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"
proto_4g_init_config() {
proto_config_add_string "modem"
proto_config_add_string "service"
proto_config_add_string "comdev"
proto_config_add_string "ipaddr"
proto_config_add_string "netmask"
proto_config_add_string "hostname"
proto_config_add_string "clientid"
proto_config_add_string "vendorid"
proto_config_add_boolean "broadcast"
proto_config_add_string "reqopts"
proto_config_add_string "apn"
proto_config_add_string "username"
proto_config_add_string "password"
proto_config_add_boolean "lte_apn_use"
proto_config_add_string "lte_apn"
proto_config_add_string "lte_username"
proto_config_add_string "lte_password"
proto_config_add_string "pincode"
proto_config_add_string "technology"
proto_config_add_string "auto"
}
proto_4g_setup() {
local config="$1"
local iface="$2"
local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
local opt dhcpopts
for opt in $reqopts; do
append dhcpopts "-O $opt"
done
for opt in $sendopts; do
append dhcpopts "-x $opt"
done
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
[ -n "$zone" ] && proto_export "ZONE=$zone"
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
json_get_var comdev comdev
json_get_var apn apn
json_get_var service service
json_get_var pincode pincode
# if [ -n "$modem" ]; then
# service=$(echo $modem | cut -d':' -f1)
# comdev=$(echo $modem | cut -d':' -f2)
# iface=$(echo $modem | cut -d':' -f3)
# fi
case "$service" in
ecm)
;;
eem)
;;
mbim)
local mbimdev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
local comdev="${comdev:-$mbimdev}"
[ -n "$pincode" ] && {
if ! mbimcli -d $comdev --query-pin-state 2>&1 | grep -q "unlocked"; then
set -o pipefail
if ! mbimcli -d $comdev --enter-pin="${pincode}" 2>&1; then
mbimcli -d $comdev --query-pin-state
proto_notify_error "$config" PIN_FAILED
proto_block_restart "$interface"
return 1
fi
fi
}
APN="$apn" mbim-network $comdev start
;;
ncm)
[ -n "$pincode" ] && echo $pincode | gcom -d $comdev
USE_APN="$apn" gcom -d $comdev -s /etc/gcom/ncmconnection.gcom
;;
qmi)
local qmidev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
local comdev="${comdev:-$qmidev}"
[ -n "$pincode" ] && {
if ! qmicli -d $comdev --dms-uim-get-pin-status 2>&1 | grep -q "enabled-verified\|disabled" >/dev/null; then
set -o pipefail
if ! qmicli -d $comdev --dms-uim-verify-pin="PIN,${pincode}" 2>&1; then
qmicli -d $comdev --dms-uim-get-pin-status
proto_notify_error "$config" PIN_FAILED
proto_block_restart "$interface"
return 1
fi
fi
}
APN="$apn" qmi-network $comdev start
;;
esac
proto_export "INTERFACE=$config"
proto_run_command "$config" udhcpc -R \
-p /var/run/udhcpc-$iface.pid \
-s /lib/netifd/dhcp.script \
-f -t 0 -i "$iface" \
${ipaddr:+-r $ipaddr} \
${hostname:+-H $hostname} \
${vendorid:+-V $vendorid} \
$clientid $broadcast $dhcpopts
}
proto_4g_teardown() {
local interface="$1"
local iface="$2"
local modem service comdev
config_load network
config_get service $interface service
config_get comdev $interface comdev
# config_get modem $interface modem
# if [ -n "$modem" ]; then
# service=$(echo $modem | cut -d':' -f1)
# comdev=$(echo $modem | cut -d':' -f2)
# iface=$(echo $modem | cut -d':' -f3)
# fi
case "$service" in
ecm)
;;
eem)
;;
mbim)
local mbimdev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
local comdev="${comdev:-$mbimdev}"
mbim-network $comdev stop
;;
ncm)
USE_DISCONNECT=1 gcom -d $comdev -s /etc/gcom/ncmconnection.gcom
;;
qmi)
local qmidev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
local comdev="${comdev:-$qmidev}"
qmi-network $comdev stop
;;
esac
proto_kill_command "$interface"
}
add_protocol 4g

View File

@@ -1,773 +0,0 @@
#
# Copyright (C) 2008-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk18-mod
PKG_VERSION:=1.8.10.1
PKG_SOURCE_VERSION:=ee99af0d91a2197529b13075d802ebc37e644e40
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/asterisk-1.8.x
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)-$(PKG_RELEASE).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-include $(INCLUDE_DIR)/ltqtapi.mk
include $(INCLUDE_DIR)/package.mk
define Package/asterisk18-mod/Default
SUBMENU:=Telephony
SECTION:=net
CATEGORY:=Network
URL:=http://www.asterisk.org/
endef
define Package/asterisk18-mod/Default/description
Asterisk is a complete PBX in software. It provides all of the features
you would expect from a PBX and more. Asterisk does voice over IP in three
protocols, and can interoperate with almost all standards-based telephony
equipment using relatively inexpensive hardware.
endef
define Package/asterisk18-mod
$(call Package/asterisk18-mod/Default)
TITLE:=Complete open source PBX, v1.8x
MENU:=1
DEPENDS:= +natalie-dect-h +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen +libopenssl +libncurses +libpopt +libpthread +uci +ubus +zlib @!TARGET_avr32
endef
define Package/asterisk18-mod/description
$(call Package/asterisk18-mod/Default/description)
endef
define Package/asterisk18-mod-sounds
$(call Package/asterisk18-mod/Default)
TITLE:=Sound files
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-sounds/description
$(call Package/asterisk18-mod/Default/description)
This package contains sound files for Asterisk.
endef
define Package/asterisk18-mod-voicemail
$(call Package/asterisk18-mod/Default)
TITLE:=Voicemail support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-voicemail/description
$(call Package/asterisk18-mod/Default/description)
This package contains voicemail related modules for Asterisk.
endef
define Package/asterisk18-mod-app-transfer
$(call Package/asterisk18-mod/Default)
TITLE:=Call transfer support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-app-transfer/description
$(call Package/asterisk18-mod/Default/description)
This package contains the call transfer support module for Asterisk.
endef
define Package/asterisk18-mod-app-softhangup
$(call Package/asterisk18-mod/Default)
TITLE:=SoftHangup application
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-app-softhangup/description
$(call Package/asterisk18-mod/Default/description)
This package contains the SoftHangup support module for Asterisk.
endef
define Package/asterisk18-mod-app-meetme
$(call Package/asterisk18-mod/Default)
TITLE:=conferencing support
DEPENDS:= asterisk18-mod +dahdi-tools-libtonezone +dahdi
endef
define Package/asterisk18-mod-app-meetme/description
$(call Package/asterisk18-mod/Default/description)
This package provides the MeetMe application driver Conferencing support to
Asterisk.
endef
define Package/asterisk18-mod-chan-iax2
$(call Package/asterisk18-mod/Default)
TITLE:=IAX support
DEPENDS:= asterisk18-mod +asterisk18-res-crypto
endef
define Package/asterisk18-mod-chan-iax2/description
$(call Package/asterisk18-mod/Default/description)
This package provides IAX support to
Asterisk.
endef
define Package/asterisk18-mod-cdr
$(call Package/asterisk18-mod/Default)
TITLE:=CDR support
DEPENDS:= asterisk18-mod +libsqlite3
endef
define Package/asterisk18-mod-cdr/description
$(call Package/asterisk18-mod/Default/description)
This package provides Call Detail Record support to
Asterisk.
endef
define Package/asterisk18-mod-res-musiconhold
$(call Package/asterisk18-mod/Default)
TITLE:=MOH support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-res-musiconhold/description
$(call Package/asterisk18-mod/Default/description)
This package provides Music On Hold support to
Asterisk.
endef
define Package/asterisk18-mod-res-voice
$(call Package/asterisk18-mod/Default)
TITLE:=Voice client/pbx support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-res-voice/description
$(call Package/asterisk18-mod/Default/description)
This package provides Voice Client/pbx support to
Asterisk.
endef
define Package/asterisk18-mod-res-srtp
$(call Package/asterisk18-mod/Default)
TITLE:=SRTP support
DEPENDS:= asterisk18-mod libsrtp +asterisk18-mod-res-crypto
endef
define Package/asterisk18-mod-res-srtp/description
$(call Package/asterisk18-mod/Default/description)
This package provides SRTP support to
Asterisk.
endef
define Package/asterisk18-mod-res-stun
$(call Package/asterisk18-mod/Default)
TITLE:=STUN support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-app-queue
$(call Package/asterisk18-mod/Default)
TITLE:=Queue support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-chan-gtalk
$(call Package/asterisk18-mod/Default)
TITLE:=GTalk support
DEPENDS:= asterisk18-mod +libiksemel
endef
define Package/asterisk18-mod-chan-gtalk/description
$(call Package/asterisk18-mod/Default/description)
This package provides the channel chan_gtalk and res_jabber for GTalk
support to Asterisk.
endef
define Package/asterisk18-mod-res-timing-timerfd
$(call Package/asterisk18-mod/Default)
TITLE:= Timerfd Timing Interface
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-res-timing-pthread
$(call Package/asterisk18-mod/Default)
TITLE:= pthread Timing Interface
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-res-fax
$(call Package/asterisk18-mod/Default)
TITLE:=Generic FAX Resource for FAX technology resource modules
DEPENDS:= asterisk18-mod +asterisk18-mod-res-timing-pthread
endef
define Package/asterisk18-mod-res-fax-spandsp
$(call Package/asterisk18-mod/Default)
TITLE:=Spandsp T.38 and G.711 FAX Resource
DEPENDS:= asterisk18-mod +asterisk18-mod-res-fax +libspandsp
endef
define Package/asterisk18-mod-chan-mgcp
$(call Package/asterisk18-mod/Default)
TITLE:=MGCP channel support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-chan-mgcp/description
$(call Package/asterisk18-mod/Default/description)
This package provides the channel chan_mgcp support to Asterisk.
endef
define Package/asterisk18-mod-chan-skinny
$(call Package/asterisk18-mod/Default)
TITLE:=Skinny channel support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-chan-skinny/description
$(call Package/asterisk18-mod/Default/description)
This package provides the channel chan_skinny support to Asterisk.
endef
define Package/asterisk18-mod-chan-brcm
$(call Package/asterisk18-mod/Default)
TITLE:=Broadcom channel support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-chan-brcm/description
$(call Package/asterisk18-mod/Default/description)
This package provides the channel chan_brcm support to Asterisk.
endef
define Package/asterisk18-mod-curl
$(call Package/asterisk18-mod/Default)
TITLE:=CURL support
DEPENDS:= asterisk18-mod +libcurl
endef
define Package/asterisk18-mod-curl/description
$(call Package/asterisk18-mod/Default/description)
This package provides CURL
support to Asterisk.
endef
define Package/asterisk18-mod-mysql
$(call Package/asterisk18-mod/Default)
TITLE:=MySQL support
DEPENDS:= asterisk18-mod +PACKAGE_asterisk18-mysql:libmysqlclient
endef
define Package/asterisk18-mod-mysql/description
$(call Package/asterisk18-mod/Default/description)
This package provides MySQL
support to Asterisk.
endef
define Package/asterisk18-mod-chan-lantiq
$(call Package/asterisk18-mod/Default)
TITLE:=Lantiq TAPI support
DEPENDS:= asterisk18-mod $(LTQ_TAPI_DEPENDS)
URL:=http://git.nanl.de/?p=asterisk_channel_lantiq.git
MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
endef
define Package/asterisk18-mod-chan-lantiq/description
$(call Package/asterisk18-mod/Default/description)
This package provides the channel chan_lantiq support to Asterisk.
endef
CONFIGURE_ARGS+= \
--without-inotify
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-app-meetme),)
CONFIGURE_ARGS+= \
--with-dahdi="$(STAGING_DIR)/usr"
else
CONFIGURE_ARGS+= \
--without-dahdi
endif
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-chan-gtalk),)
CONFIGURE_ARGS+= \
--with-gnutls="$(STAGING_DIR)/usr" \
--with-iksemel="$(STAGING_DIR)/usr"
SITE_VARS+= \
ac_cv_lib_iksemel_iks_start_sasl=yes \
ac_cv_lib_gnutls_gnutls_bye=yes
else
CONFIGURE_ARGS+= \
--without-gnutls \
--without-iksemel
endif
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-curl),)
CONFIGURE_ARGS+= \
--with-curl="$(STAGING_DIR)/usr"
else
CONFIGURE_ARGS+= \
--without-curl
endif
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-mysql),)
CONFIGURE_ARGS+= \
--with-mysqlclient="$(STAGING_DIR)/usr/bin"
else
CONFIGURE_ARGS+= \
--without-mysqlclient
endif
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-res-fax-spandsp),)
CONFIGURE_ARGS+= \
--with-spandsp="$(STAGING_DIR)/usr"
else
CONFIGURE_ARGS+= \
--without-spandsp
endif
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-res-srtp),)
CONFIGURE_ARGS+= \
--with-srtp="$(STAGING_DIR)/usr"
else
CONFIGURE_ARGS+= \
--without-srtp
endif
ifeq ($(CONFIG_TARGET_IBOARDID),"D301")
EXTRA_CFLAGS += -DNTR_SUPPORT
endif
CONFIGURE_ARGS+= \
--without-curses \
--with-gsm=internal \
--without-cap \
--without-gtk \
--without-gtk2 \
--without-isdnnet \
--without-kde \
--without-misdn \
--without-nbs \
--with-ncurses="$(STAGING_DIR)/usr" \
--without-netsnmp \
--without-newt \
--without-odbc \
--without-ogg \
--without-osptk \
--with-popt="$(STAGING_DIR)/usr" \
--without-pri \
--without-qt \
--without-radius \
--without-sdl \
--without-suppserv \
--without-tds \
--without-termcap \
--without-tinfo \
--without-vorbis \
--without-vpb \
--with-z="$(STAGING_DIR)/usr" \
--with-sounds-cache="$(DL_DIR)" \
--disable-xmldoc
# I've had strange errors with -fno-caller-saves
# in global CFLAGS so revert it. /Ronny
EXTRA_CFLAGS+= -O2 -fcaller-saves
EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
EXTRA_LDFLAGS+= $(TARGET_LDFLAGS)
define Build/Prepare
$(call Build/Prepare/Default)
ifneq ($(CONFIG_TARGET_lantiq),)
$(CP) ./src-lantiq/* $(PKG_BUILD_DIR)/
endif
endef
define Build/Configure
-rm $(PKG_BUILD_DIR)/menuselect.makeopts
$(call Build/Configure/Default,,$(SITE_VARS))
endef
define Build/Compile
$(MAKE) -C "$(PKG_BUILD_DIR)" \
include/asterisk/version.h \
include/asterisk/buildopts.h defaults.h \
makeopts.embed_rules
ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
$(MAKE) -C "$(PKG_BUILD_DIR)" \
ASTVARLIBDIR="/usr/lib/asterisk" \
ASTDATADIR="/usr/lib/asterisk" \
ASTKEYDIR="/usr/lib/asterisk" \
ASTDBDIR="/usr/lib/asterisk" \
NOISY_BUILD="1" \
DEBUG="" \
OPTIMIZE="" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all install samples
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/asterisk-1.8/include/asterisk/
$(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk-1.8/include/asterisk/
$(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/asterisk-1.8/include/
endef
define Package/asterisk18-mod/conffiles
/etc/asterisk/asterisk.conf
/etc/asterisk/modules.conf
/etc/asterisk/extensions.conf
/etc/asterisk/sip.conf
/etc/asterisk/sip_notify.conf
/etc/asterisk/features.conf
/etc/asterisk/indications.conf
/etc/asterisk/logger.conf
/etc/asterisk/manager.conf
/etc/asterisk/rtp.conf
/etc/default/asterisk
/etc/init.d/asterisk
endef
define Package/asterisk18-mod/install
$(INSTALL_DIR) $(1)/etc/asterisk/ssl
for f in asterisk extensions features \
indications logger manager modules \
sip sip_notify rtp; do \
$(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
done
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
for f in app_dial app_echo app_playback app_macro \
chan_sip res_rtp_asterisk res_rtp_multicast \
codec_ulaw codec_gsm \
format_gsm format_pcm format_wav format_wav_gsm \
pbx_config \
func_strings func_timeout func_callerid func_logic; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
done
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/default
$(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/asterisk.hotplug $(1)/etc/hotplug.d/iface/80-asterisk
endef
define Package/asterisk18-mod-sounds/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
rm -f $(1)/usr/lib/asterisk/sounds/vm-*
rm -f $(1)/usr/lib/asterisk/sounds/conf-*
endef
define Package/asterisk18-mod-voicemail/conffiles
/etc/asterisk/voicemail.conf
endef
define Package/asterisk18-mod-voicemail/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_smdi.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
endef
define Package/asterisk18-mod-app-meetme/conffiles
/etc/asterisk/meetme.conf
endef
define Package/asterisk18-mod-app-meetme/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
endef
define Package/asterisk18-mod-chan-iax2/conffiles
/etc/asterisk/iax.conf
/etc/asterisk/iaxprov.conf
endef
define Package/asterisk18-mod-cdr/conffiles
/etc/asterisk/cdr.conf
/etc/asterisk/cdr_custom.conf
/etc/asterisk/cdr_manager.conf
/etc/asterisk/cdr_odbc.conf
/etc/asterisk/cdr_pgsql.conf
/etc/asterisk/cdr_tds.conf
endef
define Package/asterisk18-mod-res-musiconhold/conffiles
/etc/asterisk/musiconhold.conf
endef
define Package/asterisk18-mod-chan-iax2/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-cdr/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-musiconhold/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-voice/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_voice.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-chan-gtalk/conffiles
/etc/asterisk/gtalk.conf
/etc/asterisk/jabber.conf
endef
define Package/asterisk18-mod-chan-gtalk/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-timing-timerfd/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_timing_timerfd.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-timing-pthread/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_timing_pthread.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-fax/conffiles
/etc/asterisk/res_fax.conf
endef
define Package/asterisk18-mod-res-fax/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_fax.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_fax.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-fax-spandsp/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_fax_spandsp.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-chan-mgcp/conffiles
/etc/asterisk/mgcp.conf
endef
define Package/asterisk18-mod-chan-mgcp/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mgcp.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mgcp.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-chan-skinny/conffiles
/etc/asterisk/skinny.conf
endef
define Package/asterisk18-mod-chan-skinny/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/skinny.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_skinny.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-chan-brcm/conffiles
/etc/asterisk/brcm.conf
endef
define Package/asterisk18-mod-chan-brcm/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/brcm.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_brcm.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-curl/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/func_curl.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_curl.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-app-transfer/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_transfer.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-app-softhangup/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_softhangup.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-mysql/conffiles
/etc/asterisk/app_mysql.conf
/etc/asterisk/res_config_mysql.conf
/etc/asterisk/cdr_mysql.conf
endef
define Package/asterisk18-mod-mysql/install
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/app_mysql.conf $(1)/etc/asterisk/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_config_mysql.conf $(1)/etc/asterisk/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr_mysql.conf $(1)/etc/asterisk/
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_mysql.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_mysql.so $(1)/usr/lib/asterisk/modules/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_mysql.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-chan-lantiq/conffiles
/etc/asterisk/lantiq.conf
endef
define Package/asterisk18-mod-chan-lantiq/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_DIR) $(1)/etc/asterisk
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/lantiq.conf $(1)/etc/asterisk/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_lantiq.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-srtp/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_srtp.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-res-stun/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_stun_monitor.so $(1)/usr/lib/asterisk/modules/
endef
define Package/asterisk18-mod-app-queue/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_queue.so $(1)/usr/lib/asterisk/modules/
endef
define Buildasterisk18-modModuleTemplate
define Package/asterisk18-mod-$(subst _,-,$(1))
$$(call Package/asterisk18-mod/Default)
TITLE:=$(2) support
DEPENDS:= asterisk18-mod $(4)
endef
define Package/asterisk18-mod-$(subst _,-,$(1))/description
$$(call Package/asterisk18-mod/Default/description)
This package provides support $(3) in Asterisk.
endef
define Package/asterisk18-mod-$(subst _,-,$(1))/install
$(INSTALL_DIR) $$(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$(1).so $$(1)/usr/lib/asterisk/modules/
endef
$$(eval $$(call BuildPackage,asterisk18-mod-$(subst _,-,$(1))))
endef
$(eval $(call BuildPackage,asterisk18-mod))
$(eval $(call BuildPackage,asterisk18-mod-voicemail))
$(eval $(call BuildPackage,asterisk18-mod-sounds))
$(eval $(call BuildPackage,asterisk18-mod-app-meetme))
$(eval $(call BuildPackage,asterisk18-mod-app-transfer))
$(eval $(call BuildPackage,asterisk18-mod-app-softhangup))
$(eval $(call BuildPackage,asterisk18-mod-chan-iax2))
$(eval $(call BuildPackage,asterisk18-mod-cdr))
$(eval $(call BuildPackage,asterisk18-mod-res-musiconhold))
$(eval $(call BuildPackage,asterisk18-mod-res-voice))
$(eval $(call BuildPackage,asterisk18-mod-chan-gtalk))
$(eval $(call BuildPackage,asterisk18-mod-res-fax))
$(eval $(call BuildPackage,asterisk18-mod-res-fax-spandsp))
$(eval $(call BuildPackage,asterisk18-mod-res-timing-timerfd))
$(eval $(call BuildPackage,asterisk18-mod-res-timing-pthread))
$(eval $(call BuildPackage,asterisk18-mod-chan-mgcp))
$(eval $(call BuildPackage,asterisk18-mod-chan-skinny))
$(eval $(call BuildPackage,asterisk18-mod-chan-brcm))
$(eval $(call BuildPackage,asterisk18-mod-curl))
$(eval $(call BuildPackage,asterisk18-mod-mysql))
$(eval $(call BuildPackage,asterisk18-mod-chan-lantiq))
$(eval $(call BuildPackage,asterisk18-mod-res-srtp))
$(eval $(call BuildPackage,asterisk18-mod-res-stun))
$(eval $(call BuildPackage,asterisk18-mod-app-queue))
$(eval $(call Buildasterisk18-modModuleTemplate,app_authenticate,Authenticate,support for executing arbitrary authenticate commands))
$(eval $(call Buildasterisk18-modModuleTemplate,app_chanisavail,Channel availability check,support for checking if a channel is available))
$(eval $(call Buildasterisk18-modModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel))
$(eval $(call Buildasterisk18-modModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup))
$(eval $(call Buildasterisk18-modModuleTemplate,app_exec,Exec application,support for application execution))
$(eval $(call Buildasterisk18-modModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system))
$(eval $(call Buildasterisk18-modModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable))
$(eval $(call Buildasterisk18-modModuleTemplate,app_read,Variable read,a trivial application to read a variable))
$(eval $(call Buildasterisk18-modModuleTemplate,app_sayunixtime,Say Unix time,an application to say Unix time))
$(eval $(call Buildasterisk18-modModuleTemplate,app_sms,SMS,SMS support (ETSI ES 201 912 protocol 1)))
$(eval $(call Buildasterisk18-modModuleTemplate,app_stack,Stack applications, stack applications Gosub Return etc., +asterisk18-res-agi))
$(eval $(call Buildasterisk18-modModuleTemplate,app_system,System exec,support for executing system commands))
$(eval $(call Buildasterisk18-modModuleTemplate,app_talkdetect,File playback with audio detect,for file playback with audio detect))
$(eval $(call Buildasterisk18-modModuleTemplate,app_waituntil,Sleep,support sleeping until the given epoch))
$(eval $(call Buildasterisk18-modModuleTemplate,app_while,While loop,a while loop implementation))
$(eval $(call Buildasterisk18-modModuleTemplate,chan_agent,Agents proxy channel, an implementation of agents proxy channel))
$(eval $(call Buildasterisk18-modModuleTemplate,chan_local,Local proxy channel, an implementation of local proxy channel))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_alaw,Signed linear to alaw translation,translation between signed linear and alaw codecs))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_ulaw,Signed linear to ulaw translation,translation between signed linear and ulaw codecs))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_a_mu,Alaw to ulaw translation,translation between alaw and ulaw codecs))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_g722,G.722,a high bit rate 48/56/64Kbps ITU standard codec))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_ilbc,iLBC,internet Low Bitrate Codec))
$(eval $(call Buildasterisk18-modModuleTemplate,codec_gsm,GSM,GSM codec))
$(eval $(call Buildasterisk18-modModuleTemplate,format_g726,G.726,support for headerless G.726 16/24/32/40kbps data format))
$(eval $(call Buildasterisk18-modModuleTemplate,format_g729,G.729,support for raw headerless G729 data))
$(eval $(call Buildasterisk18-modModuleTemplate,format_sln,Raw slinear format,support for raw slinear format))
$(eval $(call Buildasterisk18-modModuleTemplate,format_sln16,Raw slinear 16 format,support for Raw slinear 16 format))
$(eval $(call Buildasterisk18-modModuleTemplate,func_db,Database interaction,functions for interaction with the database))
$(eval $(call Buildasterisk18-modModuleTemplate,func_devstate,Blinky lights control,functions for manually controlled blinky lights))
$(eval $(call Buildasterisk18-modModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function))
$(eval $(call Buildasterisk18-modModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control))
$(eval $(call Buildasterisk18-modModuleTemplate,func_global,Global variable,global variable dialplan functions))
$(eval $(call Buildasterisk18-modModuleTemplate,func_shell,Shell,support for shell execution))
$(eval $(call Buildasterisk18-modModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic))
$(eval $(call Buildasterisk18-modModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules))
$(eval $(call Buildasterisk18-modModuleTemplate,pbx_spool,Call Spool,outgoing call spool support))
$(eval $(call Buildasterisk18-modModuleTemplate,res_agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension))
$(eval $(call Buildasterisk18-modModuleTemplate,res_crypto,Provide Crypto,Cryptographic Signature capability))
$(eval $(call Buildasterisk18-modModuleTemplate,app_alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID))
$(eval $(call Buildasterisk18-modModuleTemplate,app_setcallerid,Set callerid,support for setting callerid))
$(eval $(call Buildasterisk18-modModuleTemplate,app_verbose,Verbose logging,Verbose logging application))
$(eval $(call Buildasterisk18-modModuleTemplate,func_channel,Channel info,Channel info dialplan function))
$(eval $(call Buildasterisk18-modModuleTemplate,func_blacklist,Blacklist on callerid,looking up the callerid number and see if it is blacklisted))
$(eval $(call Buildasterisk18-modModuleTemplate,app_originate,Originate a call,originating an outbound call and connecting it to a specified extension or application))
$(eval $(call Buildasterisk18-modModuleTemplate,func_uri,URI encoding and decoding,Encodes and decodes URI-safe strings))
$(eval $(call Buildasterisk18-modModuleTemplate,app_disa,Direct Inward System Access,Direct Inward System Access))
$(eval $(call Buildasterisk18-modModuleTemplate,app_senddtmf,Send DTMF digits,Sends arbitrary DTMF digits))
$(eval $(call Buildasterisk18-modModuleTemplate,func_cut,CUT function,CUT function))
$(eval $(call Buildasterisk18-modModuleTemplate,res_clioriginate,Calls via CLI,Originate calls via the CLI))
$(eval $(call Buildasterisk18-modModuleTemplate,app_mixmonitor,Record a call and mix the audio,record a call and mix the audio during the recording))
$(eval $(call Buildasterisk18-modModuleTemplate,app_playtones,Playtones application,play a tone list))
$(eval $(call Buildasterisk18-modModuleTemplate,app_record,Record sound file,to record a sound file))

View File

@@ -1,4 +0,0 @@
## startup options for /etc/init.d/asterisk
ENABLE_ASTERISK="yes"
OPTIONS=""

View File

@@ -1,19 +0,0 @@
#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
config_load voice_client
config_get bindintf SIP bindintf
[ "$INTERFACE" == "$bindintf" ] || exit 0
. /lib/functions/network.sh
if [ -n "$bindintf" ]; then
network_get_ipaddr bindaddr "$bindintf"
[ -z "$bindaddr" ] && network_get_ipaddr6 bindaddr "$bindintf"
bindaddr="${bindaddr:-0.0.0.0}"
sed -i "s/bindaddr=.*/bindaddr=$bindaddr/g" /etc/asterisk/sip.conf
[ -e /var/run/asterisk/asterisk.ctl ] && /etc/init.d/asterisk reload
fi

View File

@@ -1,56 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=10
. /usr/share/libubox/jshn.sh
. /lib/functions/network.sh
USE_PROCD=1
NAME=asterisk
PROG=/usr/sbin/asterisk
DEFAULT=/etc/default/asterisk
CONFDIR=/etc/asterisk
init_asterisk() {
[ -f $DEFAULT ] && . $DEFAULT
[ -d /var/run/asterisk ] || mkdir -p /var/run/asterisk
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
[ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
# does the board have a fxs relay?
local fxsRelayGpio=$(db -q get hw.board.fxsRelayGpio)
if [ "$fxsRelayGpio" != "" ]; then
/sbin/brcm_fw_tool set -x $fxsRelayGpio -p 1
fi
}
service_triggers() {
procd_add_reload_trigger voice_client
}
start_service() {
init_asterisk
procd_open_instance
procd_set_param command "$PROG" -f
procd_set_param respawn
procd_close_instance
# service_start /usr/sbin/asterisk
}
reload_service() {
asterisk -rx "config reload $CONFDIR/sip.conf"
sleep 1
asterisk -rx "core reload"
asterisk -rx "dialplan reload"
asterisk -rx "brcm reload"
}
restart() {
reload
}
stop_service() {
service_stop /usr/sbin/asterisk
}

View File

@@ -1,66 +0,0 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=1.0.23
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=90aff0da98c626d58201c14c34b3b3a64878ceee
PKG_NAME:=dectmngr
LDFLAGS+= \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
-Wl,-rpath-link=$(STAGING_DIR)/lib
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
define Package/dectmngr
CATEGORY:=Utilities
TITLE:=Broadcom endpoint test application
URL:=
DEPENDS:= +libevent2 +libjson +natalie-dect-h bcmkernel
endef
define Package/dectmngr/description
Dect proxy, manager and tools
endef
define Package/dectmngr/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_DIR) $(1)/etc/hotplug.d/
$(INSTALL_DIR) $(1)/etc/hotplug.d/dect
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/etc/dect/
$(INSTALL_DIR) $(1)/etc/config/
cp $(PKG_BUILD_DIR)/dectmngr $(1)/usr/bin/
cp $(PKG_BUILD_DIR)/atohx $(1)/usr/bin/
cp $(PKG_BUILD_DIR)/dectproxy $(1)/usr/bin/
cp $(PKG_BUILD_DIR)/dectdbgd $(1)/usr/bin/
cp $(PKG_BUILD_DIR)/dect $(1)/usr/bin/
cp $(PKG_BUILD_DIR)/dectcalib $(1)/usr/bin/
cp $(PKG_BUILD_DIR)/dect_testmode $(1)/usr/bin/
cp files/etc/init.d/* $(1)/etc/init.d/
cp files/etc/hotplug.d/dect/* $(1)/etc/hotplug.d/dect/
cp files/etc/dect/* $(1)/etc/dect/
cp files/etc/config/* $(1)/etc/config/
cp files/sbin/dectreg $(1)/sbin/
endef
$(eval $(call BuildPackage,dectmngr))

View File

@@ -1,3 +0,0 @@
config dect 'dect'
option 'radio' 'auto'

Binary file not shown.

View File

@@ -1,15 +0,0 @@
#!/bin/sh
if [ "$ACTION" == "led_blink" ]; then
ubus call led.dect set '{"state":"notice"}'
fi
if [ "$ACTION" == "led_on" ]; then
ubus call led.dect set '{"state":"ok"}'
fi
if [ "$ACTION" == "led_off" ]; then
ubus call led.dect set '{"state":"off"}'
fi

View File

@@ -1,60 +0,0 @@
#!/bin/sh /etc/rc.common
START=97
STOP=10
USE_PROCD=1
DEST=
DEFAULT=
OPTIONS=""
start_service() {
# avoid fp timing problem
echo 1 > /proc/sys/kernel/printk_with_interrupt_enabled
# setup board specific dect parameters
cat /proc/nvram/rfpi | tr -d ' ' | atohx > /tmp/rfpi
cat /proc/nvram/fixed_emc | tr -d ' ' | atohx > /tmp/fixed_emc
cat /proc/nvram/bcm_def_freq | tr -d ' ' | atohx > /tmp/bcm_def_freq
DECTANTDIV=`db get hw.board.DectAntennaDiversity`
case "$DECTANTDIV" in
1|off) echo -ne "\x01" > /tmp/dect_antenna_diversity ;;
2) echo -ne "\x02" > /tmp/dect_antenna_diversity ;;
*) echo -ne "\x00" > /tmp/dect_antenna_diversity ;;
esac
if [ ! -f /etc/dect/nvs ]; then
cp /etc/dect/nvs_default /etc/dect/nvs
dd of=/etc/dect/nvs if=/tmp/rfpi conv=notrunc bs=1 seek=0
dd of=/etc/dect/nvs if=/tmp/fixed_emc conv=notrunc bs=1 seek=10
dd of=/etc/dect/nvs if=/tmp/bcm_def_freq conv=notrunc bs=1 seek=6
dd of=/etc/dect/nvs if=/tmp/dect_antenna_diversity conv=notrunc bs=1 seek=32
fsync /etc/dect/nvs
fi
# init dectproxy
dectproxy > /dev/null 2>&1 &
dectmngr > /tmp/dectmngr 2>&1 &
}
stop_service() {
killall -9 dectproxy
killall -9 dectmngr
}
restart_service() {
echo "restarting dect"
killall dectmngr
dectmngr > /tmp/dectmngr 2>&1 &
}
reload_service() {
# reload config
dect -c
}
service_triggers() {
procd_add_reload_trigger dect
}

View File

@@ -1,17 +0,0 @@
#!/bin/sh
# This script is likely not used. Just exit with
# an error and see if someone screems... If not,
# we can delete this file.
exit 1
[ -f /var/dectisregistering ] || {
touch /var/dectisregistering 2>/dev/null
/usr/bin/dectmngr -r
ubus call led.dect set '{"state" : "notice"}'
sleep 20
rm /var/dectisregistering 2>/dev/null
/usr/bin/dectmngr -s
ubus call led.dect set '{"state" : "ok"}'
}

View File

@@ -11,7 +11,7 @@ PKG_RELEASE:=1
PKG_VERSION:=1.1.0
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=13da1568d57b8e6732dadc16de828d64c81906b8
PKG_SOURCE_VERSION:=ace6a3dcb6aa463cf5a34ad39ac37a5bc7d4ce5e
PKG_NAME:=dectmngr2

View File

@@ -1,4 +0,0 @@
config ENDPT_OPEN
bool "Use pre-compiled version for Open SDK"
default n

View File

@@ -1,92 +0,0 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=endptcfg
PKG_VERSION:=0.2
PKG_SOURCE_VERSION:=1194b05278bd0945ca5c76436e56617b86871a65
ifeq ($(CONFIG_ENDPT_OPEN),y)
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
PKG_SOURCE:=$(PKG_NAME)-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
PKG_NAME:=endptcfg-open
else
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=git@private.inteno.se:endptcfg
PKG_SOURCE_PROTO:=git
endif
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
LDFLAGS+= \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
-Wl,-rpath-link=$(STAGING_DIR)/lib
BCMKERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
export BCMKERNEL_DIR
TARGET_LDFLAGS += $(BCMKERNEL_DIR)/userspace/private/apps/vodsl/telephonyProfiles/telephonyProfiles.o \
$(BCMKERNEL_DIR)/userspace/private/apps/vodsl/voip/util/log/vodslLog.o \
$(BCMKERNEL_DIR)/userspace/private/apps/vodsl/endpoint/endpoint_user.o \
$(BCMKERNEL_DIR)/userspace/private/apps/vodsl/bos/bos.o \
-lpthread
TARGET_CFLAGS += -DFAKE_SSP
RSTRIP:=true
export BUILD_DIR
include $(INCLUDE_DIR)/package.mk
define Package/endptcfg
CATEGORY:=Utilities
TITLE:=Broadcom endpoint driver configuration application
URL:=
DEPENDS:=+libpthread bcmkernel
endef
define Package/endptcfg/description
Broadcom endpoint driver configuration application
endef
define Package/endptcfg/config
source "$(SOURCE)/Config.in"
endef
ifneq ($(CONFIG_ENDPT_OPEN),y)
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) LINUX_DIR=$(LINUX_DIR) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS) \
-I$(LINUX_DIR)/include \
-I$(STAGING_DIR)/usr/include \
-DRS_ENDIAN_TYPE=RS_BIG_ENDIAN \
-DBOS_OS_LINUXUSER -DBOS_CFG_TIME \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/broadcom/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/endpt/inc \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/inc \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/codec \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/xchg_common/bos/publicInc \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/casCtl/inc \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/xchg_drivers/inc \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/private/apps/vodsl/voip/inc \
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/xchg_common/bos/LinuxUser"
endef
else
define Build/Compile
endef
endif
define Package/endptcfg/install
$(INSTALL_DIR) $(1)/usr/bin
cp $(PKG_BUILD_DIR)/endptcfg $(1)/usr/bin/
endef
$(eval $(call BuildPackage,endptcfg))

View File

@@ -9,11 +9,10 @@ include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=0.1
PKG_SOURCE_URL:=git@private.inteno.se:brcmslic
PKG_SOURCE_URL:=git@private.inteno.se:endptmngr
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=837ec19e37650e424e77c921672a0806e198ba7b
PKG_NAME:=brcmslic
PKG_SOURCE_VERSION:=e14f741c9c7ecdc6584ce109bed22d3f85a29a16
PKG_NAME:=endptmngr
RSTRIP:=true
export BUILD_DIR
@@ -24,24 +23,22 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
define Package/brcmslic
define Package/endptmngr
CATEGORY:=Utilities
TITLE:=Brcmslic
URL:=
DEPENDS:=
DEPENDS:= +libubox +ubus +libpicoevent
endef
define Package/brcmslic/description
Brcmslic
define Package/endptmngr/description
endptmngr
endef
define Package/brcmslic/install
define Package/endptmngr/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/brcmslic $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endpt $(1)/usr/sbin/
cp $(PKG_BUILD_DIR)/files/etc/init.d/* $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,brcmslic))
$(eval $(call BuildPackage,endptmngr))

58
fatrace/Makefile Normal file
View File

@@ -0,0 +1,58 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=fatrace
PKG_VERSION:=0.12
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=98af6019a4a1b478a6fa35f74528cb3cd404ae40
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.launchpad.net/fatrace
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
# support parallel build
#PKG_BUILD_PARALLEL:=1
#re create configure scripts if not present.
#PKG_FIXUP:=autoreconf
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
# this way we don't need to pick out the resulting files from the build dir.
PKG_INSTALL:=1
PKG_CONFIG_DEPENDS := CONFIG_KERNEL_FANOTIFY
include $(INCLUDE_DIR)/package.mk
define Package/fatrace
CATEGORY:=Utilities
TITLE:=Report system wide file access events
URL:=
DEPENDS := +@KERNEL_FANOTIFY
endef
define Package/fatrace/description
Report system wide file access events.
endef
MAKE_INSTALL_FLAGS += PREFIX="/"
define Package/fatrace/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fatrace $(1)/sbin/
# $(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,fatrace))

View File

@@ -0,0 +1,14 @@
diff --git a/fatrace.c b/fatrace.c
index 1c0899a..b7d1560 100644
--- a/fatrace.c
+++ b/fatrace.c
@@ -44,7 +44,8 @@
* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e2ee49f7
* O_LARGEFILE is usually 0, so hardcode it here
*/
-#define KERNEL_O_LARGEFILE 00100000
+//#define KERNEL_O_LARGEFILE 00100000
+#define KERNEL_O_LARGEFILE O_LARGEFILE
/* command line options */
static char* option_output = NULL;

View File

@@ -0,0 +1,12 @@
diff --git a/fatrace.c b/fatrace.c
index b7d1560..6179272 100644
--- a/fatrace.c
+++ b/fatrace.c
@@ -149,6 +149,7 @@ print_event(const struct fanotify_event_metadata *data,
printf ("%li.%06li ", event_time->tv_sec, event_time->tv_usec);
}
printf ("%s(%i): %s %s\n", procname, data->pid, mask2str (data->mask), pathname);
+ fflush(stdout);
}
/**

View File

@@ -19,20 +19,21 @@ export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
export LOGIN:=$(shell whoami)
BASE_PKG_VERSION:=5.0.0
PKG_RELEASE:=RC8
BASE_PKG_VERSION:=5.1.9
PKG_RELEASE:=RC5
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
export PKG_VERSION
###########################--RELEASE--################################
PKG_SOURCE_VERSION:=57b19721eb8906cb0c5e34a28eba080bc5b74a26
PKG_SOURCE_VERSION:=3002de0a3511f7da0fe20c3f183212a84aa964bf
ifeq ($(CONFIG_ICE_OPEN),y)
TARGET_PROFILE=$(shell echo $(CONFIG_TARGET_BOARD) | sed s/\"//g)
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
PKG_SOURCE:=$(PKG_NAME)-$(TARGET_PROFILE)-$(BASE_PKG_VERSION)$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
SKIPHASH=1
export SKIPHASH
else
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@private.inteno.se:ice-client.git

24
icwmp/Config.in → icwmp/Config_cwmp.in Normal file → Executable file
View File

@@ -15,33 +15,17 @@ config CWMP_ACS_HDM
bool "HDM"
endchoice
choice
prompt "Select Data Model"
default tr098
config DATAMODEL_TR098
bool "TR-098"
config DATAMODEL_TR181
bool "TR-181"
endchoice
config CWMP_DEBUG
bool "Compile with debug options"
default y
choice
prompt "enable xmpp feature"
default disable
config XMPP_DISABLE
bool "disable"
config XMPP_ENABLE
bool "enable"
endchoice
bool "enable xmpp feature"
default n
config CWMP_DEVEL_DEBUG
bool "Compile with development debug options"
default n
endif

17
icwmp/Config_datamodel.in Executable file
View File

@@ -0,0 +1,17 @@
if PACKAGE_libdatamodel
choice
prompt "Select Data Model"
default tr098
config DATAMODEL_TR098
bool "TR-098"
config DATAMODEL_TR181
bool "TR-181"
endchoice
config UPNP_TR064
bool "Compile with tr064 features"
default n
endif

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=3.0-2017-11-24
PKG_VERSION:=4.0-2018-02-12
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=d74b88913f676ebf9a210c4674555d080e57ff52
PKG_SOURCE_VERSION:=81a05e57b242a82781301d0bd132bd88a14c131e
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -30,11 +30,19 @@ CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
include $(INCLUDE_DIR)/package.mk
define Package/libdatamodel
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for broadband-forum data model
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
endef
define Package/icwmp/Default
SECTION:=utils
CATEGORY:=Utilities
TITLE:=CWMP client
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +libstrophe +curl +libtrace
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +libstrophe +curl +libtrace +libdatamodel
endef
define Package/icwmp/description
@@ -56,7 +64,11 @@ define Package/icwmp-zstream
endef
define Package/icwmp-zstream/config
source "$(SOURCE)/Config.in"
source "$(SOURCE)/Config_cwmp.in"
endef
define Package/libdatamodel/config
source "$(SOURCE)/Config_datamodel.in"
endef
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
@@ -66,7 +78,7 @@ define Build/Prepare
endef
endif
ifeq ($(CONFIG_TARGET_IBOARDID),"EX400")
ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
TARGET_CFLAGS += -DEX400
endif
@@ -89,9 +101,18 @@ CONFIGURE_ARGS += \
--with-uci-include-path=$(STAGING_DIR)/usr/include \
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
--with-libubus-include-path=$(STAGING_DIR)/usr/include
ifeq ($(CONFIG_UPNP_TR064),y)
CONFIGURE_ARGS += \
--enable-upnptr064
endif
ifeq ($(CONFIG_XMPP_ENABLE),y)
CONFIGURE_ARGS += \
--enable-xmpp
endif
CONFIGURE_ARGS += $(if $(CONFIG_DATAMODEL_TR181),--enable-datamodel=tr181,--enable-datamodel=tr098)
CONFIGURE_ARGS += $(if $(CONFIG_XMPP_ENABLE),--enable-xmpp=enable,--enable-xmpp=disable)
ifeq ($(BUILD_VARIANT),zstream)
CONFIGURE_ARGS += \
@@ -124,30 +145,45 @@ CONFIGURE_ARGS += \
--enable-devel
endif
define Package/libdatamodel/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.so* $(1)/lib/
endef
define Package/icwmp-$(BUILD_VARIANT)/install
$(INSTALL_DIR) $(1)/etc/icwmpd
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/icwmpd
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/bin/.libs/icwmpd $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp $(1)/etc/config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/icwmpd
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/firewall.cwmp $(1)/etc/firewall.cwmp
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/90-cwmpfirewall
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(CP) ./files/icwmp.hotplug $(1)/etc/hotplug.d/iface/90-icwmp
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/90-cwmpfirewall
ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
$(INSTALL_DIR) $(1)/usr/share/icwmp
$(CP) $(PKG_BUILD_DIR)/scripts/defaults $(1)/usr/share/icwmp
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/icwmp
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/iwepkeygen $(1)/usr/sbin/iwepkeygen
endif
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libdatamodel
$(CP) $(PKG_BUILD_DIR)/dm/*.h $(1)/usr/include/libdatamodel
$(CP) $(PKG_BUILD_DIR)/dm/dmtree/common/root.h $(1)/usr/include/libdatamodel
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.so* $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.a $(1)/lib
endef
define Package/icwmp-$(BUILD_VARIANT)/postinst
#!/bin/sh
echo "$(CWMP_BKP_FILE)" >> $${IPKG_INSTROOT}/etc/sysupgrade.conf
@@ -169,4 +205,5 @@ endef
$(eval $(call BuildPackage,icwmp-curl))
$(eval $(call BuildPackage,libdatamodel))
$(eval $(call BuildPackage,icwmp-zstream))

View File

@@ -1,44 +1,65 @@
#!/bin/sh
grep -q "Designated" /etc/banner || exit 0
. /lib/functions/network.sh
[ "$ACTION" == "ifup" ] || exit 0
local islan="$(uci -q get network.$INTERFACE.is_lan)"
[ "$islan" == "1" ] && exit 0
[ -f /etc/config/cwmp ] || exit 0
local proto="$(uci -q get network.$INTERFACE.proto)"
[ "$proto" == "none" ] && exit 0
handle_icwmp_restart() {
[ -f /tmp/70-shiftrange.lock ] && exit 0
[ -f /tmp/switching_mode ] && exit 0
[ -f /tmp/wificontrol.txt -a ! -f /tmp/netmode_done ] && exit 0
local ifname="$(uci -q get network.$INTERFACE.ifname)"
[ "${ifname:0:1}" == "@" ] && exit 0
[ "$INTERFACE" == "loopback" ] && exit 0
mkdir -p /tmp/ipv4
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
local previpaddr=""
local curipaddr=""
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
previpaddr=$(cat $ipaddrfile 2>/dev/null)
network_get_ipaddr curipaddr $INTERFACE
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
local islan="$(uci -q get network.$INTERFACE.is_lan)"
[ "$islan" == "1" ] && exit 0
local prevgateway=""
local curgateway=""
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
prevgateway=$(cat $gatewayfile 2>/dev/null)
network_get_gateway curgateway $INTERFACE
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
local proto="$(uci -q get network.$INTERFACE.proto)"
[ "$proto" == "none" ] && exit 0
local prevsubnets=""
local cursubnets=""
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
prevsubnets=$(cat $subnetsfile 2>/dev/null)
network_get_subnets cursubnets $INTERFACE
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
local ifname="$(uci -q get network.$INTERFACE.ifname)"
[ "${ifname:0:1}" == "@" ] && exit 0
[ "$previpaddr" = "$curipaddr" -a "$prevgateway" = "$curgateway" -a "$prevsubnets" = "$cursubnets" ] && exit 0
mkdir -p /tmp/ipv4
[ -f /etc/config/cwmp ] && /etc/init.d/icwmpd reload &
network_flush_cache
local previpaddr=""
local curipaddr=""
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
previpaddr=$(cat $ipaddrfile 2>/dev/null)
network_get_ipaddr curipaddr $INTERFACE
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
local prevgateway=""
local curgateway=""
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
prevgateway=$(cat $gatewayfile 2>/dev/null)
network_get_gateway curgateway $INTERFACE
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
local prevsubnets=""
local cursubnets=""
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
prevsubnets=$(cat $subnetsfile 2>/dev/null)
network_get_subnets cursubnets $INTERFACE
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
local prevdev=""
local curdev=""
local devfile=/tmp/ipv4/$INTERFACE-dev
prevdev=$(cat $devfile 2>/dev/null)
network_get_device curdev $INTERFACE
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
[ "$prevdev" == "$curdev" -a "$previpaddr" = "$curipaddr" -a "$prevgateway" = "$curgateway" -a "$prevsubnets" = "$cursubnets" ] && exit 0
/etc/init.d/icwmpd reload &
}
handle_icwmp_restart

View File

@@ -12,7 +12,7 @@ PKG_NAME:=inbd
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=92f918d26c0ffc22d1704f5ea6cbb0bd7fdbdab9
PKG_SOURCE_VERSION:=f81c146f0b07540877545e5ab644ec8e29905a4d
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se/inbd

View File

@@ -5,31 +5,32 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=inteno-netmodes
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_VERSION:=0.2.0
PKG_SOURCE_VERSION:=fbd7dcfab03df19b3c32675940e0aee708c7cf75
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/netmoded
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/inteno-netmodes
CATEGORY:=Base system
DEPENDS:=+fping
TITLE:=Predefined Network Modes
CATEGORY:=Base system
DEPENDS:=+fping +ubus +libubox +libuci
TITLE:=Predefined Network Modes
endef
define Package/inteno-netmodes/description
Predefined Network Modes
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/inteno-netmodes/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netmoded $(1)/sbin/
endef
$(eval $(call BuildPackage,inteno-netmodes))

View File

@@ -2,118 +2,43 @@
[ "$INTERFACE" != "wan" ] && exit
. /lib/functions.sh
. /lib/functions/network.sh
. /lib/functions/netmode.sh
network_get_ipaddr ipaddr $INTERFACE
[ -z "$ipaddr" ] && exit
network_get_ipaddr ip $INTERFACE
repeaterready="$(uci -q get netmode.setup.repeaterready)"
curmode="$(uci -q get netmode.setup.curmode)"
[ -z "$ip" ] && exit
if [ "$(netmode_get_ip_type $ipaddr)" == "private" ]; then
if [ "$repeaterready" == "1" -o "${curmode:0:8}" == "repeater" ]; then
# flush the ip on br-lan; br-lan will anyhow be deleted.
# this is needed if the ip received on the wan is also from the same net
ip addr flush dev br-lan 2>/dev/null
toggle_firewall() {
local section=$1
local disable=$2
config_get name "$1" name
if [ "$name" == "wan" ]; then
uci -q set firewall.settings.disabled=$disable
if [ "$disable" == "1" ]; then
uci -q set firewall.$section.input="ACCEPT"
else
uci -q set firewall.$section.input="REJECT"
fi
uci -q commit firewall
# flush iptables in case the MASTER
# tries to configure us before
# firewall is disabled the proper way
iptables -F
disable_firewall 1
fi
}
else
disable_firewall 0
fi
set_disabled() {
config_load firewall
config_foreach toggle_firewall zone $1
/etc/init.d/firewall reload
}
is_inteno_macaddr()
{
macaddr=$1
echo $macaddr | grep -i -e "^00:22:07" \
-e "^02:22:07" \
-e "^44:D4:37" \
-e "^00:0C:07" \
-e "^02:0C:07" \
-e "^06:0C:07" \
-e "^00:0C:43" \
-e "^02:0C:43" \
-e "^06:0C:43" \
&& return
false
}
switch_mode() {
[ "$repeaterready" == "1" ] || return
# flush the ip on br-lan; br-lan will anyhow be deleted.
# this is needed if the ip received on the wan is also from the same net
ip addr flush dev br-lan
# flush iptables in case the MASTER
# tries to configure us before
# firewall is disabled the proper way
iptables -F
ubus call leds set '{"state" : "allflash"}'
local ret=0
# let netmode-conf up to 20 seconds before switching mode
for tm in 2 4 6 8; do
if [ -f /tmp/wificontrol.txt ]; then
ret=1
break
fi
sleep $tm
done
# let netmode-conf take over
[ $ret -eq 1 ] && return
# go head with switching mode
touch -f /tmp/switching_mode
echo "Switching to 'extender' mode" > /dev/console
uci -q set netmode.setup.curmode='repeater'
uci set netmode.setup.repeaterready=0
uci commit netmode
/etc/init.d/netmode reload
echo "Restarting network services" > /dev/console
ubus call network reload
wifi reload nodat
ubus call router.network reload
ubus call leds set '{"state" : "normal"}'
rm -f /tmp/switching_mode
}
test_ip() {
if [ -n "$(echo $ip | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ]; then
# private IP
switch_mode
set_disabled 1
else
# public IP
set_disabled 0
[ "$1" -eq "1" ] && {
uci set netmode.setup.repeaterready=0
uci commit netmode
local pid="$(ps | grep wificontro[l] | awk '/repeater/ {print $1}')"
[ "$pid" != "" ] && kill -9 $pid
pid="$(pidof netmode-client-detect)"
[ "$pid" == "" ] && /sbin/netmode-client-detect &
# set default JUCI page to overview
uci -q set juci.juci.homepage="overview"
uci commit juci
}
fi
}
case "$(uci -q get netmode.setup.curmode)" in
repeater*) test_ip ;;
*) [ "$repeaterready" == "1" ] && test_ip 1;;
case "$curmode" in
repeater*)
;;
*)
[ "$repeaterready" == "1" ] || return
if [ "$(netmode_get_ip_type $ipaddr)" == "private" ]; then
wificontrol_takes_over || switch_netmode repeater
else
switch_netmode routed
fi
;;
esac

View File

@@ -0,0 +1,22 @@
#!/bin/sh
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 0
interface_check() {
local islan="$(uci -q get network.$INTERFACE.is_lan)"
[ "$islan" == "1" ] && exit 0
local proto="$(uci -q get network.$INTERFACE.proto)"
[ "$proto" == "none" ] && exit 0
local defroute="$(uci -q get network.$INTERFACE.defaultroute)"
[ "$defroute" == "0" ] && exit 0
}
interface_check
if [ -n "$(pidof testnet)" ]; then
testnet once
else
testnet &
fi

View File

@@ -5,10 +5,9 @@
. /lib/functions.sh
. /lib/functions/network.sh
local lockfile="/tmp/70-shiftrange.lock"
local restricted_nets=""
local all_nets=""
LOCKFILE="/tmp/70-shiftrange.lock"
RESTRICTED_NETS=""
ALL_NETS=""
#####
##### initial functions
@@ -30,8 +29,8 @@ initial_check()
finish()
{
lock -u $lockfile
rm -f $lockfile
lock -u $LOCKFILE
rm -f $LOCKFILE
}
# just one instance of this script at a time
@@ -41,13 +40,13 @@ just_one_instance()
local limit=10
#wait for the lock to become free
while [ -e $lockfile ] ; do
while [ -e $LOCKFILE ] ; do
sleep 1
counter=$((counter + 1))
[ "$counter" -gt "$limit" ] && exit 1
done
lock $lockfile
lock $LOCKFILE
trap finish EXIT INT TERM
}
@@ -95,7 +94,7 @@ next_network_address()
local ip4=${ip%%/*}
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
local one=$((1 << (32-$prefix)))
local one="$((1 << (32-$prefix)))"
local new=$(($ip + $one))
local n1=$((($new & 0xFF000000) >> 24))
@@ -135,7 +134,7 @@ shift_range()
{
local net="$1"
while true ; do
if [ "$restricted_nets" == "${restricted_nets//$net/}" ] && [ "$all_nets" == "${all_nets//$net/}" ]; then
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] && [ "$ALL_NETS" == "${ALL_NETS//$net/}" ]; then
# found a net that is not in restricted nets nor in all nets
break
fi
@@ -150,8 +149,8 @@ shift_range()
##### parse all interfaces section
#####
# restricted_nets = all the IPs on wan interfaces
# all_nets = all the IPs on any interface
# RESTRICTED_NETS = all the IPs on wan interfaces
# ALL_NETS = all the IPs on any interface
parse_interface()
{
local interface=$1
@@ -165,13 +164,13 @@ parse_interface()
networks="$networks $(get_network_address $n)"
done
[ "$is_lan" != "1" ] && restricted_nets="$restricted_nets $networks"
all_nets="$all_nets $networks"
[ "$is_lan" != "1" ] && RESTRICTED_NETS="$RESTRICTED_NETS $networks"
ALL_NETS="$ALL_NETS $networks"
}
# parse all the interfaces
# get all the IPs on wan interfaces and store them in restrict_nets
# get all the IPs on all interfaces and store them in all_nets
# get all the IPs on all interfaces and store them in ALL_NETS
parse_interfaces()
{
config_foreach parse_interface "interface"
@@ -199,14 +198,14 @@ parse_lan()
for ip in $ips ; do
net="$(get_network_address $ip)"
if [ "$restricted_nets" == "${restricted_nets//$net/}" ] ; then
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] ; then
# net is not in restricted nets
# append ip to newips
[ -z "$newips" ] && newips="${ip%/*}" || newips="$newips ${ip%/*}"
continue
fi
#net is in restricted_nets
#net is in RESTRICTED_NETS
local newnet=$(shift_range $net)
local newip="$(first_host_in_network $newnet)"
# append newip to newips
@@ -229,7 +228,6 @@ parse_lans()
config_foreach parse_lan "interface"
}
#####
##### main
#####

View File

@@ -1,23 +1,16 @@
#!/bin/sh
. /lib/functions.sh
include /lib/network
. /lib/functions/netmode.sh
ps | grep hotplug | grep button && exit
MTK=0
[ "$(db -q get hw.board.hardware)" == "EX400" ] && MTK=1
WANDEV="$(uci get layer2_interface_ethernet.Wan.ifname)"
[ $MTK -eq 1 ] && WANDEV="eth0.2"
[ "$INTERFACE" != "$WANDEV" ] && exit
[ -z "$INTERFACE" ] && exit
defroute=$(ip route | grep default | awk '{print$3}')
case "$(uci get netmode.setup.curmode)" in
repeater*)
echo "Preparing to switch mode"
;;
*)
ping -c 1 -w 5 $defroute >/dev/null 2>&1 || killall -USR1 udhcpc
@@ -25,78 +18,7 @@ case "$(uci get netmode.setup.curmode)" in
;;
esac
get_wifi_wet_interface() {
handle_interface() {
config_get mode "$1" mode
if [ "$mode" == "sta" -o "$mode" == "wet" ] ; then
config_get ifname "$1" ifname
echo "$ifname"
fi
}
config_load wireless
config_foreach handle_interface wifi-iface
}
get_wifi_iface_cfgstr() {
get_cfgno() {
config_get ifname "$1" ifname
[ "$ifname" == "$2" ] && echo "wireless.$1"
}
config_load wireless
config_foreach get_cfgno wifi-iface $1
}
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
[ $MTK -eq 1 ] && link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
case "$ACTION" in
add|register)
[ "$link" == "down" ] && return
ubus call leds set '{"state" : "allflash"}'
echo "Autoswitch to Extender mode" > /dev/console
sleep 2
wetif="$(get_wifi_wet_interface)"
# remove wifi client interface
case "$(uci get netmode.setup.curmode)" in
repeater*)
uci -q set $(get_wifi_iface_cfgstr $wetif).disabled=1
;;
esac
uci commit wireless
#add wan ethernet port
uci set network.wan.ifname="$(echo $WANDEV $(uci get network.wan.ifname) | sed 's/$/ /' | sed -r "s/$wetif //g" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
uci commit network
ubus call network reload
[ -f /usr/sbin/wlctl ] && wlctl -i $wetif bss down 2>/dev/null
ping -c 1 -w 10 $defroute >/dev/null 2>&1 || killall -USR1 udhcpc
ubus call router.network reload
ubus call leds set '{"state" : "normal"}'
;;
remove|unregister)
[ "$link" == "up" ] && return
ubus call leds set '{"state" : "allflash"}'
echo "Autoswitch to Repeater mode" > /dev/console
sleep 2
wetif="$(get_wifi_wet_interface)"
# add wifi client interface
case "$(uci get netmode.setup.curmode)" in
repeater*)
uci -q set $(get_wifi_iface_cfgstr $wetif).disabled=0
;;
esac
uci commit wireless
#remove wan ethernet port
uci set network.wan.ifname="$(echo $wetif $(uci get network.wan.ifname) | sed 's/$/ /' | sed -r "s/$WANDEV //g" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
uci commit network
ubus call network reload
[ -f /usr/sbin/wlctl ] && wlctl -i $wetif bss up 2>/dev/null
ping -c 1 -w 10 $defroute >/dev/null 2>&1 || {
killall -9 wifi
wifi reload nodat
killall -USR1 udhcpc
}
ubus call router.network reload
ubus call leds set '{"state" : "normal"}'
;;
add|register|remove|unregister) correct_uplink $INTERFACE;;
esac

View File

@@ -3,321 +3,39 @@
START=10
USE_PROCD=1
TMPDIR=/var/netmodes
OLD_MODE_FILE=/var/netmodes/old_mode
NETMODED="/sbin/netmoded"
. /usr/share/libubox/jshn.sh
. /lib/network/config.sh
. /lib/functions.sh
. /lib/functions/netmode.sh
local modedir=$(uci -q get netmode.setup.dir)
[ -n "$modedir" ] || modedir="/etc/netmodes"
start_netmoded() {
procd_open_instance
procd_set_param command $NETMODED
get_device() {
local PORT_NAMES=$(db get hw.board.ethernetPortNames)
local PORT_ORDER=$(db get hw.board.ethernetPortOrder)
local cnt=1
local idx=0
procd_append_param command --verbose debug
procd_set_param stdout 1
procd_set_param stderr 1
local pnum=$(echo $PORT_NAMES | wc -w)
if [ $pnum -le 2 ]; then
PORT_NAMES=$(echo $PORT_NAMES | sed 's/LAN/LAN1/g')
fi
# get index of interface name
for i in $PORT_NAMES; do
if [ "$i" == "$1" ]; then
idx=$cnt
fi
cnt=$((cnt+1))
done
# get port name from index
cnt=1
for i in $PORT_ORDER; do
if [ "$cnt" == "$idx" ]; then
echo $i
fi
cnt=$((cnt+1))
done
}
populate_netmodes() {
[ -f /etc/config/netmode -a -d $modedir ] || return
local curmode
config_load netmode
config_get curmode setup curmode
mkdir -p $TMPDIR
if [ "$curmode" == "routed" ]; then
local hw="$(db -q get hw.board.hardware)"
if [ "$hw" == "EX400" ]; then
curmode="routed_mtk"
else
curmode="routed_brcm"
fi
fi
echo $curmode > $OLD_MODE_FILE
delete_netmode() {
uci delete netmode.$1
}
config_foreach delete_netmode netmode
uci commit netmode
wan=$(get_device WAN)
lan1=$(get_device LAN1)
lan2=$(get_device LAN2)
lan3=$(get_device LAN3)
lan4=$(get_device LAN4)
lan5=$(get_device LAN5)
for file in $(find $modedir -type f); do
conf="$(echo $file | cut -d'/' -f5)"
if [ "$conf" == "layer2_interface_ethernet" ]; then
grep -q "\$WAN" $file && sed -i "s/\$WAN/$wan/g" $file
fi
if [ "$conf" == "network" ]; then
grep -q "\$WAN" $file && sed -i "s/\$WAN/$wan/g" $file
grep -q "\$LAN1" $file && sed -i "s/\$LAN1/$lan1/g" $file
grep -q "\$LAN2" $file && sed -i "s/\$LAN2/$lan2/g" $file
grep -q "\$LAN3" $file && sed -i "s/\$LAN3/$lan3/g" $file
grep -q "\$LAN4" $file && sed -i "s/\$LAN4/$lan4/g" $file
ifname="$(uci -q get $file.wan.ifname | sed 's/[ \t]*$//')"
uci -q set $file.wan.ifname="$ifname"
uci -q commit $file
fi
done
local hardware=$(db get hw.board.hardware)
local keys lang desc exp exclude
for mode in $(ls $modedir); do
case "$mode" in
repeater*)
wlctl -i wl1 ap >/dev/null 2>&1 || ifconfig rai0 2>/dev/null | grep -q rai0 || continue
;;
esac
lang=""
desc=""
exp=""
uci -q set netmode.$mode=netmode
json_load "$(cat $modedir/$mode/DETAILS)"
if json_select excluded_boards; then
exclude=0
_i=1
while json_get_var board $_i; do
case "$hardware" in
$board)
uci -q delete netmode.$mode
exclude=1
break
;;
esac
_i=$((_i+1))
done
json_select ..
[ $exclude -eq 1 ] && continue
fi
if json_select acl; then
_i=1
while json_get_var user $_i; do
uci add_list netmode.$mode._access_r="$user"
_i=$((_i+1))
done
json_select ..
fi
json_select description
json_get_keys keys
for k in $keys; do
json_get_keys lang $k
lang=$(echo $lang | sed 's/^[ \t]*//;s/[ \t]*$//')
json_select $k
json_get_var desc $lang
uci -q set netmode.$mode."desc_$lang"="$desc"
[ "$lang" == "en" ] && uci -q set netmode.$mode."desc"="$desc"
json_select ..
done
json_select ..
json_select explanation
json_get_keys keys
for k in $keys; do
json_get_keys lang $k
lang=$(echo $lang | sed 's/^[ \t]*//;s/[ \t]*$//')
json_select $k
json_get_var exp $lang
uci -q set netmode.$mode."exp_$lang"="$exp"
[ "$lang" == "en" ] && uci -q set netmode.$mode."exp"="$exp"
json_select ..
done
json_select ..
json_get_var cred credentials
uci -q set netmode.$mode.askcred="$cred"
json_get_var ulb uplink_band
uci -q set netmode.$mode.uplink_band="$ulb"
json_get_var reboot reboot
uci -q set netmode.$mode.reboot="$reboot"
done
config_get curmode setup curmode
[ -d /etc/netmodes/$curmode ] || {
[ "$(db -q get hw.board.hardware)" == "EX400" ] && uci -q set netmode.setup.curmode="routed_mtk" || uci -q set netmode.setup.curmode="routed_brcm"
}
uci commit netmode
}
switch_netmode() {
[ -f /etc/config/netmode -a -d $modedir ] || return
local netreload="$1"
local curmode conf repeaterready old_mode
config_load netmode
config_get curmode setup curmode
config_get repeaterready setup repeaterready "0"
if [ "$repeaterready" == "1" ] ; then
uci -q set netmode.setup.repeaterready="0"
uci commit netmode
fi
if [ "$curmode" == "repeater" ]; then
local hw="$(db -q get hw.board.hardware)"
if [ "$hw" == "EX400" ]; then
curmode="repeater_mtk_5g_up_dual_down"
else
curmode="repeater_brcm_2g_up_dual_down"
fi
uci set netmode.setup.curmode="$curmode"
uci commit netmode
fi
if [ "$curmode" == "routed" ]; then
local hw="$(db -q get hw.board.hardware)"
if [ "$hw" == "EX400" ]; then
curmode="routed_mtk"
else
curmode="routed_brcm"
fi
uci set netmode.setup.curmode="$curmode"
uci commit netmode
fi
old_mode=`cat $OLD_MODE_FILE 2>/dev/null`
# if curmode has not changed do not copy configs
if [ "$curmode" == "$old_mode" ]; then
/etc/init.d/enviroment reload
return
fi
echo $curmode >$OLD_MODE_FILE
[ -d "/etc/netmodes/$curmode" ] || return
cp /etc/netmodes/$curmode/* /etc/config/
rm -f /etc/config/DETAILS
sync
local reboot=$(uci -q get netmode.$curmode.reboot)
local askcred=$(uci -q get netmode.$curmode.askcred)
if [ "$reboot" == "0" ]; then
/etc/init.d/enviroment reload
case "$curmode" in
routed*)
ubus call uci commit '{"config":"network"}'
;;
repeater*)
if [ -f /etc/init.d/omcproxy ]; then
/etc/init.d/omcproxy stop
fi
if [ "$netreload" != "0" ]; then
ubus call uci commit '{"config":"network"}'
fi
;;
esac
else
reboot &
fi
}
start_client_listener() {
local curmode repeaterready ulcpid
config_load netmode
config_get repeaterready setup repeaterready 0
ulcpid=$(ps | grep "ubus listen client" | grep -v grep | awk '{print$1}')
[ $repeaterready -eq 1 ] && {
killall -SIGKILL netmode-client-detect >/dev/null 2>&1
kill -9 $ulcpid >/dev/null 2>&1
return
}
config_get curmode setup curmode
case "$curmode" in
repeater*)
killall -SIGKILL netmode-client-detect >/dev/null 2>&1
kill -9 $ulcpid >/dev/null 2>&1
;;
*)
pidof netmode-client-detect || /sbin/netmode-client-detect &
;;
esac
}
start_netmode_discover() {
local curmode repeaterready
killall -9 netmode-discover >/dev/null 2>&1
config_load netmode
config_get repeaterready setup repeaterready 0
[ $repeaterready -eq 1 ] && return
config_get curmode setup curmode
case "$curmode" in
repeater*)
/sbin/netmode-discover &
;;
esac
procd_set_param respawn
procd_close_instance
}
start_service() {
populate_netmodes
start_client_listener
start_netmode_discover
start_netmoded
start_netmode_tools
}
reload_service() {
switch_netmode "$1"
switch_netmode
# set default JUCI page to overview
uci -q set juci.juci.homepage="overview"
uci commit juci
start_client_listener
start_netmode_discover
start_netmoded
start_netmode_tools
}
stop_service() {
killall -SIGKILL netmode-client-detect >/dev/null 2>&1
killall -9 netmode-discover >/dev/null 2>&1
stop_netmode_tools
}
service_triggers()

View File

@@ -11,7 +11,8 @@
"excluded_boards" : [
"CG300",
"CG301",
"EX400"
"EX400",
"SDX*"
],
"acl" : [
"admin",

View File

@@ -12,7 +12,8 @@
"CG300",
"CG301",
"EX400",
"F*"
"F*",
"SDX*"
],
"acl" : [
"admin",

View File

@@ -1,39 +0,0 @@
config owsd 'global'
option sock '/var/run/ubus.sock'
option www '/www'
option redirect '/cgi-bin/luci:/cacheflush.html'
config owsd-listen 'loopback'
option port '80'
option interface 'loopback'
option ipv6 'on'
list origin '*'
config owsd-listen 'lan'
option port '80'
option interface 'lan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
option whitelist_dhcp_domains '1'
config owsd-listen 'wan'
option port '80'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8080'
option port '8080'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8181'
option port '8181'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'

View File

@@ -1,39 +0,0 @@
config owsd 'global'
option sock '/var/run/ubus.sock'
option www '/www'
option redirect '/cgi-bin/luci:/cacheflush.html'
config owsd-listen 'loopback'
option port '80'
option interface 'loopback'
option ipv6 'on'
list origin '*'
config owsd-listen 'lan'
option port '80'
option interface 'lan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
option whitelist_dhcp_domains '1'
config owsd-listen 'wan'
option port '80'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8080'
option port '8080'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8181'
option port '8181'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'

View File

@@ -1,39 +0,0 @@
config owsd 'global'
option sock '/var/run/ubus.sock'
option www '/www'
option redirect '/cgi-bin/luci:/cacheflush.html'
config owsd-listen 'loopback'
option port '80'
option interface 'loopback'
option ipv6 'on'
list origin '*'
config owsd-listen 'lan'
option port '80'
option interface 'lan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
option whitelist_dhcp_domains '1'
config owsd-listen 'wan'
option port '80'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8080'
option port '8080'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8181'
option port '8181'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'

View File

@@ -12,6 +12,7 @@
"F*"
],
"uplink_band" : 'a',
"downlink_band" : 'a b',
"credentials" : 1,
"reboot" : 0
}

View File

@@ -1,39 +0,0 @@
config owsd 'global'
option sock '/var/run/ubus.sock'
option www '/www'
option redirect '/cgi-bin/luci:/cacheflush.html'
config owsd-listen 'loopback'
option port '80'
option interface 'loopback'
option ipv6 'on'
list origin '*'
config owsd-listen 'lan'
option port '80'
option interface 'lan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
option whitelist_dhcp_domains '1'
config owsd-listen 'wan'
option port '80'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8080'
option port '8080'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8181'
option port '8181'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'

View File

@@ -11,7 +11,7 @@ config interface 'lan'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option ifname 'eth0.1 ra0 rai0'
option ifname 'eth0.1'
config device 'lan_dev'
option name 'eth0.1'
@@ -20,6 +20,8 @@ config device 'lan_dev'
config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'
option hostname '$IOPHOSTNAME-$MAC'
option vendorid '$HARDWAREID-INTENO'
option reqopts '66 67 128 224'
config device 'wan_dev'

View File

@@ -0,0 +1,430 @@
#!/bin/sh
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
NMTMPDIR=/var/netmodes
OLD_MODE_FILE=/var/netmodes/old_mode
SWITCHMODELOCK="/tmp/switching_mode"
MODEDIR=$(uci -q get netmode.setup.dir)
MTK=0
case "$(db -q get hw.board.hardware)" in
EX400|SDX_500AP) MTK=1 ;;
esac
[ -n "$MODEDIR" ] || MODEDIR="/etc/netmodes"
toggle_firewall() {
local section=$1
local disable=$2
config_get name "$1" name
if [ "$name" == "wan" ]; then
uci -q set firewall.settings.disabled=$disable
if [ "$disable" == "1" ]; then
uci -q set firewall.$section.input="ACCEPT"
else
uci -q set firewall.$section.input="REJECT"
fi
uci -q commit firewall
fi
}
disable_firewall() {
config_load firewall
config_foreach toggle_firewall zone $1
/etc/init.d/firewall reload
}
is_inteno_macaddr()
{
macaddr=$1
echo $macaddr | grep -i -e "^00:22:07" \
-e "^02:22:07" \
-e "^44:D4:37" \
-e "^00:0C:07" \
-e "^02:0C:07" \
-e "^06:0C:07" \
-e "^00:0C:43" \
-e "^02:0C:43" \
-e "^06:0C:43" \
&& return
false
}
get_wifi_wet_interface() {
local ifname=""
handle_interface() {
[ -n "$ifname" ] && return
config_get mode "$1" mode
if [ "$mode" == "sta" -o "$mode" == "wet" ]; then
config_get ifname "$1" ifname
fi
}
config_load wireless
config_foreach handle_interface wifi-iface
echo "$ifname"
}
get_wifi_iface_cfgstr() {
get_cfgno() {
config_get ifname "$1" ifname
[ "$ifname" == "$2" ] && echo "wireless.$1"
}
config_load wireless
config_foreach get_cfgno wifi-iface $1
}
correct_uplink() {
local IFACE="$1"
local WANDEV="$(db -q get hw.board.ethernetWanPort)"
local WETIF="$(get_wifi_wet_interface)"
local link wetcfg wetnet wetmac
[ $MTK -eq 1 ] || WANDEV="$WANDEV.1"
[ -n "$IFACE" -a "$IFACE" != "$WANDEV" -a "$IFACE" != "$WETIF" ] && return
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
[ $MTK -eq 1 ] && link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
if [ ! -f /tmp/netmodes/uplink-macaddr-corrected ]; then
wetcfg="$(get_wifi_iface_cfgstr $WETIF)"
wetnet="$(uci -q get $wetcfg.network)"
wetmac="$(ifconfig $WETIF | grep HWaddr | awk '{print$NF}')"
if [ -d /sys/class/net/br-$wetnet ]; then
ifconfig br-$wetnet hw ether $wetmac
#touch -f /tmp/netmodes/uplink-macaddr-corrected
fi
fi
if [ "$link" == "up" ]; then
ubus call network.device set_state "{\"name\":\"$WETIF\", \"defer\":true}"
ifconfig $WETIF down
ubus call network.device set_state "{\"name\":\"$WANDEV\", \"defer\":false}"
else
ubus call network.device set_state "{\"name\":\"$WETIF\", \"defer\":false}"
ifconfig $WETIF up
ubus call network.device set_state "{\"name\":\"$WANDEV\", \"defer\":true}"
ubus call led.internet set '{"state" : "notice"}'
fi
}
switch_netmode() {
local newmode="$1"
[ -f /etc/config/netmode -a -d $MODEDIR ] || return
[ -n "$newmode" ] && uci -q set netmode.setup.curmode="$newmode"
local curmode conf old_mode
# NETMODE CONFIG #
config_load netmode
config_get curmode setup curmode
uci -q set netmode.setup.repeaterready="0"
# set default JUCI page to overview
uci -q set juci.juci.homepage="overview"
uci commit juci
if [ "$curmode" == "repeater" ]; then
if [ $MTK -eq 1 ]; then
curmode="repeater_mtk_5g_up_dual_down"
else
curmode="repeater_brcm_2g_up_dual_down"
fi
uci set netmode.setup.curmode="$curmode"
fi
if [ "$curmode" == "routed" ]; then
if [ $MTK -eq 1 ]; then
curmode="routed_mtk"
else
curmode="routed_brcm"
fi
uci set netmode.setup.curmode="$curmode"
fi
uci commit netmode
# end of NETMODE CONFIG #
old_mode="$(cat $OLD_MODE_FILE 2>/dev/null)"
# if curmode has not changed do not copy configs
if [ "$curmode" == "$old_mode" ]; then
/etc/init.d/environment reload
return
fi
echo $curmode >$OLD_MODE_FILE
[ -d "/etc/netmodes/$curmode" ] || return
cp /etc/netmodes/$curmode/* /etc/config/
rm -f /etc/config/DETAILS
sync
local reboot=$(uci -q get netmode.$curmode.reboot)
if [ "$reboot" == "1" ]; then
reboot &
exit
fi
/etc/init.d/environment reload
case "$curmode" in
routed*)
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
ubus call uci commit '{"config":"network"}'
;;
repeater*)
touch $SWITCHMODELOCK
echo "Switching to $curmode mode" > /dev/console
ubus call leds set '{"state" : "allflash"}'
[ -f /etc/init.d/omcproxy ] && /etc/init.d/omcproxy stop
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
ubus call network reload
wifi reload nodat
ubus call router.network reload
rm -f /tmp/netmodes/uplink-macaddr-corrected
correct_uplink
ubus call leds set '{"state" : "normal"}'
rm -f $SWITCHMODELOCK
;;
esac
}
wificontrol_takes_over() {
local ret
[ -f /sbin/wificontrol ] || return
ubus call leds set '{"state" : "allflash"}'
if pidof wificontrol >/dev/null; then
ret=0
# let netmode-conf up to 20 seconds before switching mode
for tm in 2 4 6 8; do
if [ -f /tmp/wificontrol.txt ]; then
ret=1
break
fi
sleep $tm
done
# let netmode-conf take over
[ $ret -eq 1 ] && return 0
fi
return 1
}
wait_for_netmode_handler() {
for tm in 2 4 6 8; do
if [ ! -f $SWITCHMODELOCK ]; then
break
fi
sleep $tm
done
}
netmode_get_ip_type() {
[ -n "$(echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ] && echo "private" || echo "public"
}
get_device_of() {
local PORT_NAMES=$(db get hw.board.ethernetPortNames)
local PORT_ORDER=$(db get hw.board.ethernetPortOrder)
local cnt=1
local idx=0
local pnum=$(echo $PORT_NAMES | wc -w)
if [ $pnum -le 2 ]; then
PORT_NAMES=$(echo $PORT_NAMES | sed 's/LAN/LAN1/g')
fi
# get index of interface name
for i in $PORT_NAMES; do
if [ "$i" == "$1" ]; then
idx=$cnt
fi
cnt=$((cnt+1))
done
# get port name from index
cnt=1
for i in $PORT_ORDER; do
if [ "$cnt" == "$idx" ]; then
echo $i
fi
cnt=$((cnt+1))
done
}
populate_netmodes() {
[ -f /etc/config/netmode -a -d $MODEDIR ] || return
local curmode
config_load netmode
config_get curmode setup curmode
mkdir -p $NMTMPDIR
if [ "$curmode" == "routed" ]; then
if [ $MTK -eq 1 ]; then
curmode="routed_mtk"
else
curmode="routed_brcm"
fi
fi
echo $curmode > $OLD_MODE_FILE
delete_netmode() {
uci delete netmode.$1
}
config_foreach delete_netmode netmode
uci commit netmode
wan=$(get_device_of WAN)
lan1=$(get_device_of LAN1)
lan2=$(get_device_of LAN2)
lan3=$(get_device_of LAN3)
lan4=$(get_device_of LAN4)
lan5=$(get_device_of LAN5)
for file in $(find $MODEDIR -type f); do
conf="$(echo $file | cut -d'/' -f5)"
if [ "$conf" == "layer2_interface_ethernet" ]; then
grep -q "\$WAN" $file && sed -i "s/\$WAN/$wan/g" $file
fi
if [ "$conf" == "network" ]; then
grep -q "\$WAN" $file && sed -i "s/\$WAN/$wan/g" $file
grep -q "\$LAN1" $file && sed -i "s/\$LAN1/$lan1/g" $file
grep -q "\$LAN2" $file && sed -i "s/\$LAN2/$lan2/g" $file
grep -q "\$LAN3" $file && sed -i "s/\$LAN3/$lan3/g" $file
grep -q "\$LAN4" $file && sed -i "s/\$LAN4/$lan4/g" $file
ifname="$(uci -q get $file.wan.ifname | sed 's/[ \t]*$//')"
uci -q set $file.wan.ifname="$ifname"
uci -q commit $file
fi
done
local hardware=$(db get hw.board.hardware)
local keys lang desc exp exclude
for mode in $(ls $MODEDIR); do
case "$mode" in
repeater*)
wlctl -i wl1 ap >/dev/null 2>&1 || ifconfig rai0 2>/dev/null | grep -q rai0 || continue
;;
esac
lang=""
desc=""
exp=""
uci -q set netmode.$mode=netmode
json_load "$(cat $MODEDIR/$mode/DETAILS)"
if json_select excluded_boards; then
exclude=0
_i=1
while json_get_var board $_i; do
case "$hardware" in
$board)
uci -q delete netmode.$mode
exclude=1
break
;;
esac
_i=$((_i+1))
done
json_select ..
[ $exclude -eq 1 ] && continue
fi
if json_select acl; then
_i=1
while json_get_var user $_i; do
uci add_list netmode.$mode._access_r="$user"
_i=$((_i+1))
done
json_select ..
fi
json_select description
json_get_keys keys
for k in $keys; do
json_get_keys lang $k
lang=$(echo $lang | sed 's/^[ \t]*//;s/[ \t]*$//')
json_select $k
json_get_var desc $lang
uci -q set netmode.$mode."desc_$lang"="$desc"
[ "$lang" == "en" ] && uci -q set netmode.$mode."desc"="$desc"
json_select ..
done
json_select ..
json_select explanation
json_get_keys keys
for k in $keys; do
json_get_keys lang $k
lang=$(echo $lang | sed 's/^[ \t]*//;s/[ \t]*$//')
json_select $k
json_get_var exp $lang
uci -q set netmode.$mode."exp_$lang"="$exp"
[ "$lang" == "en" ] && uci -q set netmode.$mode."exp"="$exp"
json_select ..
done
json_select ..
json_get_var cred credentials
uci -q set netmode.$mode.askcred="$cred"
json_get_var ulb uplink_band
uci -q set netmode.$mode.uplink_band="$ulb"
json_get_var reboot reboot
uci -q set netmode.$mode.reboot="$reboot"
done
config_get curmode setup curmode
[ -d /etc/netmodes/$curmode ] || {
[ $MTK -eq 1 ] && uci -q set netmode.setup.curmode="routed_mtk" || uci -q set netmode.setup.curmode="routed_brcm"
}
uci commit netmode
}
start_netmode_tools() {
local curmode repeaterready
killall -9 wificontrol >/dev/null 2>&1
killall -9 netmode-discover >/dev/null 2>&1
config_load netmode
config_get_bool repeaterready setup repeaterready 0
[ $repeaterready -eq 1 ] && {
/sbin/netmode-discover &
/sbin/wificontrol --repeater &
return
}
config_get curmode setup curmode
case "$curmode" in
repeater*)
/sbin/netmode-discover &
/sbin/wificontrol --repeater &
;;
*)
/sbin/netmode-client-detect &
;;
esac
}
stop_netmode_tools() {
/sbin/netmode-client-detect stop
killall -9 netmode-discover >/dev/null 2>&1
killall -9 wificontrol >/dev/null 2>&1
}

View File

@@ -3,18 +3,21 @@
# receive new client events
# and trigger wificontrol in --router mode for that client
NCDPF="/tmp/netmode-client-detector.pid"
if [ -f $NCDPF ]; then
kill -9 $(cat $NCDPF) 2>/dev/null
rm -f $NCDPF
fi
[ "$1" == "stop" ] && exit
. /usr/share/libubox/jshn.sh
local action ipaddr macaddr network
timed_check() {
while true; do
network=${network:-lan}
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}'
wificontrol --router
sleep $1
done
}
action=
ipaddr=
macaddr=
network=
is_inteno_macaddr()
{
@@ -33,24 +36,23 @@ is_inteno_macaddr()
false
}
timed_check 60 &
ubus listen client | \
while read event ; do
#echo "netmode-client-detect got event: $event" >/dev/console
json_load "$event"
json_select client
json_get_var action action
[ "$action" == "connect" ] || continue
json_get_var macaddr macaddr
json_get_var ipaddr ipaddr
json_get_var network network "lan"
while true ; do
ubus listen client | \
while read event ; do
#echo "netmode-client-detect got event: $event" >/dev/console
json_load "$event"
json_select client
json_get_var action action
[ "$action" == "connect" ] || continue
json_get_var macaddr macaddr
json_get_var ipaddr ipaddr
json_get_var network network "lan"
if is_inteno_macaddr $macaddr; then
echo "netmode-client-detect: a new Inteno device detected on '$network' network (MACAddr:$macaddr IPAddr:$ipaddr)" >/dev/console
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}' >/dev/null
grep -q ssid /tmp/wificontrol.txt && /sbin/wificontrol --router --destination $ipaddr
fi
done &
echo $(($!-1)) $! > $NCDPF
if is_inteno_macaddr $macaddr; then
echo "netmode-client-detect: a new Inteno device detected on '$network' network (MACAddr:$macaddr IPAddr:$ipaddr)" >/dev/console
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}'
/sbin/wificontrol --router --destination $ipaddr
fi
done
done

View File

@@ -2,6 +2,7 @@
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
. /lib/functions/netmode.sh
state="exit"
TMPPATH="/tmp/netmode_config_backup"
@@ -86,6 +87,7 @@ restore() {
uci set juci.juci.homepage='netmode-wizard'
uci commit juci
cp $TMPPATH/* /etc/config/
sync
uci set netmode.setup.curmode=$CURMODE
uci commit netmode
ubus call network reload
@@ -107,23 +109,21 @@ backup() {
file="$1"
from_gui="$2"
done_file="/tmp/netmode_done"
[ -f "$file" ] || exit
[ -f "$done_file" ] && rm $done_file
# let netmode-handler up to 20 seconds to finish switching mode
for tm in 2 4 6 8; do
if [ ! -f /tmp/switching_mode ]; then
break
fi
sleep $tm
done
wait_for_netmode_handler
[ "$from_gui" == "true" ] && backup
json_load "`cat $file`"
json_select "wifi_ifaces"
local curmode repmode
curmode=""
repmode=""
config_load netmode
config_get curmode setup curmode
@@ -138,14 +138,20 @@ case $curmode in
;;
esac
local apcliband="a"
apcliband="a"
case $curmode in
*_2g_*) apcliband="b";;
esac
i=1
local dummy band ssid key encryption device iface_num
dummy=
band=
ssid=
key=
encryption=
device=
iface_num=
while json_get_var dummy $i; do
json_select $i
@@ -157,6 +163,7 @@ done
[ "$apcliband" == "$band" -o "$band" == "" ] || {
[ "$from_gui" == "true" ] && restore "back"
touch $done_file
exit
}
@@ -164,6 +171,7 @@ repeater_iface_num=$(uci -q show wireless | grep -e ".mode='wet'" -e ".mode='sta
[ -z "$repeater_iface_num" ] && {
[ "$from_gui" == "true" ] && restore "back"
touch $done_file
exit
}
@@ -177,8 +185,8 @@ json_load "`cat $file`"
json_select "wifi_ifaces"
config_load wireless
local b_num=0
local a_num=0
b_num=0
a_num=0
i=1
while json_get_var dummy $i; do
@@ -193,6 +201,7 @@ while json_get_var dummy $i; do
a_num=$((a_num+1))
[ -z $iface_num ] && {
[ "$from_gui" == "true" ] && restore "back"
touch $done_file
exit
}
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
@@ -201,6 +210,7 @@ while json_get_var dummy $i; do
b_num=$((b_num+1))
[ -z $iface_num ] && {
[ "$from_gui" == "true" ] && restore "back"
touch $done_file
exit
}
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
@@ -218,6 +228,7 @@ while json_get_var dummy $i; do
esac
[ -z $iface_num ] && {
[ "$from_gui" == "true" ] && restore "back"
touch $done_file
exit
}
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
@@ -251,8 +262,9 @@ uci commit wireless
if [ "$from_gui" == "true" ]; then
# check for connectivity
wifi reload
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
i=$SLEEPTIME;
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
correct_uplink
i=$SLEEPTIME
while [ $i -gt 0 ]; do
ip=`route -n | awk '/^0.0.0.0/{print $2}'`
@@ -264,6 +276,7 @@ if [ "$from_gui" == "true" ]; then
ping -w1 $ip
if [ $? -eq 0 ]; then
restore
touch $done_file
exit
else
i=$((i-10))
@@ -273,6 +286,7 @@ if [ "$from_gui" == "true" ]; then
restore "back"
else
if [ "$state" == "exit" ]; then
touch $done_file
return
fi
ubus call leds set '{"state":"allflash"}'
@@ -283,6 +297,10 @@ else
# wifi reload
wifi reload
fi
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
correct_uplink
ubus call leds set '{"state":"normal"}'
touch $done_file
# we need to trigger a reload of icwmp but ONLY if ip or device has changed
[ -f "/etc/hotplug.d/iface/90-icwmp" ] && INTERFACE=wan ACTION=ifup sh /etc/hotplug.d/iface/90-icwmp
fi

View File

@@ -1,7 +1,5 @@
#!/bin/sh
local unlisted mac ipaddr netmask mask
mask_to_cidr() {
nbits=0
IFS=.
@@ -23,9 +21,14 @@ mask_to_cidr() {
}
while true; do
[ -e /sys/class/net/br-wan ] || {
sleep 5
continue
}
unlisted=0
ps | grep -q wifi | grep -q reload || {
ps | grep wifi | grep -q reload || {
for mac in $(brctl showmacs br-wan 2>/dev/null | tail -n +2 | grep no | awk '{print$2}'); do
grep -q "$mac" /proc/net/arp || unlisted=$((unlisted+1))
done
@@ -35,10 +38,10 @@ while true; do
mask=$(mask_to_cidr $netmask)
}
if [ $unlisted -gt 0 -a -n "$ipaddr" -a -n "$netmask" ]; then
if [ $unlisted -gt 0 -a -n "$ipaddr" -a -n "$netmask" -a $mask -ge 24 ]; then
fping -c 1 -t 1000 -g $ipaddr/$mask -q >/dev/null 2>&1
fi
sleep 20
sleep 30
done

View File

@@ -1,19 +0,0 @@
#!/bin/sh
MTK=0
[ "$(db -q get hw.board.hardware)" == "EX400" ] && MTK=1
if [ $MTK -eq 1 ]; then
WANDEV="eth0.2"
link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
else
WANDEV="$(uci get layer2_interface_ethernet.Wan.ifname)"
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
fi
[ "$link" == "up" ] && action=add
[ "$link" == "down" ] && action=remove
[ -z "$action" ] && exit
# trigger a fake hotplug net event
INTERFACE=$WANDEV ACTION=$action /sbin/hotplug-call net

View File

@@ -0,0 +1,3 @@
#!/bin/sh
netmode-conf "$1" "$2" &

View File

@@ -0,0 +1,257 @@
#!/bin/sh
. /lib/functions.sh
NETCON=0
TVCON=0
WANIP=0
LASTSTATUS=""
CURSTATUS=""
ETHWAN="$(db -q get hw.board.ethernetWanPort)"
SLEEP_TIME=30
enableCounter=0
AccessPolicy=0
get_wifi_iface_cfgstr() {
get_cfgno() {
config_get ifname "$1" ifname
[ "$ifname" == "$2" ] && echo "wireless.$1"
}
config_load wireless
config_foreach get_cfgno wifi-iface $1
}
ping_uplink()
{
local hasip hasdev hasmode
local ipaddr=""
local device=""
local rready=""
local wetif=""
local assoclist=""
local rv=0
[ -f /tmp/wps_client_mode_active ] && {
ubus call led.internet set '{"state" : "off"}'
return
}
ipaddr="$(ip r | grep default | awk '{print$3}')"
[ -n "$ipaddr" ] && hasip=1 || hasip=0
device="$(ip r | grep default | awk '{print$5}')"
[ -n "$device" ] && hasdev=1 || hasdev=0
rready="$(uci -q get netmode.setup.repeaterready)"
[ "$rready" == "1" ] && hasmode=0 || hasmode=1
if [ "$hasmode" == "1" ] && [ "$hasip" == "0" -o "$hasdev" == "0" ]; then
rv=0
elif [ "$hasmode" == "1" ]; then
ping $ipaddr -I $device -W 3 -c 1 -q >/dev/null 2>&1
[ $? -eq 1 ] && rv=0 || rv=1
else
SLEEP_TIME=5
ubus call led.internet set '{"state" : "off"}'
return
fi
if [ $rv -eq 0 ]; then
echo "{ \"online\" : false }" > /tmp/internet_connection_status
SLEEP_TIME=10
wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
# If there is an uplink IP address but no connection for 5 minutes, reboot
if [ $enableCounter -gt 32 ]; then
logger -t "testnet" "No uplink connection; reboot"
ubus call led.internet set '{"state" : "error"}'
reboot &
elif [ $((enableCounter % 8)) -eq 0 -a $enableCounter -ge 8 -o $enableCounter -eq 0 ]; then
ps | grep -v grep | grep -q 'wifi reload\|wifi import\|wifi.credentials\|iwpriv' && return
logger -t "testnet" "No uplink connection; try to re-connect"
if [ -f /usr/sbin/wlctl ]; then
assoclist="$(wlctl -i $wetif assoclist | head -1 | awk '{print$2}')"
wlctl -i $wetif reassoc $assoclsit
elif [ -f /usr/sbin/iwpriv ]; then
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
wetssid="$(uci -q get $wetcfg.ssid)"
wetkey="$(uci -q get $wetcfg.key)"
if [ -n "$wetkey" ]; then
wetauth="WPA2PSK"
wetenc="AES"
else
wetauth="OPEN"
wetenc="NONE"
fi
iwpriv $wetif set ApCliEnable=0
iwpriv $wetif set ApCliSsid="$wetssid"
iwpriv $wetif set ApCliAuthMode="$wetauth"
iwpriv $wetif set ApCliEncrypType="$wetenc"
iwpriv $wetif set ApCliWPAPSK="$wetkey"
iwpriv $wetif set ApCliEnable=1
iwpriv $wetif set ApCliAutoConnect=1
fi
ubus call led.internet set '{"state" : "notice"}'
# touch /tmp/netmodes/repeater_trying_to_connect
# else
# if [ -f /tmp/netmodes/repeater_trying_to_connect ]; then
# rm -f /tmp/netmodes/repeater_trying_to_connect
# else
# ubus call led.internet set '{"state" : "error"}'
# fi
fi
enableCounter=$((enableCounter+1))
if [ $AccessPolicy -eq 1 ]; then
return
fi
AccessPolicy=1
if [ -f /usr/sbin/iwpriv ]; then
grep -q up /sys/class/net/$ETHWAN/operstate 2>/dev/null || {
logger -t "testnet" "Disconnect all stations and disable WiFi access on downlink wireless interfaces"
# Do not allow clients to connect on 2.4GHz radio
iwpriv ra0 set AccessPolicy=$AccessPolicy
# Do not allow clients to connect on 5GHz radio
iwpriv rai0 set AccessPolicy=$AccessPolicy
# Disconnect clients on 2.4GHz radio
iwpriv ra0 set DisConnectAllSta=2
# Disconnect clients on 5GHz radio
iwpriv rai0 set DisConnectAllSta=2
}
fi
else
grep -q "true" /tmp/internet_connection_status 2>/dev/null || logger -t "testnet" "Uplink connection is gained"
echo "{ \"online\" : true }" > /tmp/internet_connection_status
ubus call led.internet set '{"state" : "eok"}'
SLEEP_TIME=5
enableCounter=0
if [ $AccessPolicy -eq 0 ]; then
return
fi
# Uplink working, allow clients to connect
AccessPolicy=0
if [ -f /usr/sbin/iwpriv ]; then
logger -t "testnet" "Enable WiFi access on downlink wireless interfaces"
iwpriv ra0 set AccessPolicy=$AccessPolicy
iwpriv rai0 set AccessPolicy=$AccessPolicy
fi
fi
}
test_connection() {
local addr="$1"
local defroute="$(ip r | grep default | awk '{print$3}' | head -1)"
local def6route="$(ip -f inet6 r | grep default | awk '{print$3}')"
local ping6dev="$(ip -f inet6 r | grep default | awk '{print$5}')"
if [ -n "$addr" ]; then
ping -q -w 5 -c 1 $addr >/dev/null 2>&1 && return 0
elif [ -n "$defroute" ]; then
ping -q -w 5 -c 1 $defroute >/dev/null 2>&1 && return 0
for nmsrv in $(grep nameserver /var/resolv.conf.auto | awk '{print$2}'); do
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
done
elif [ -n "$def6route" ] && [ -n "$ping6dev" ]; then
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
fi
return 1
}
wan_have_ip() {
[ -d /sys/class/net/$ETHWAN ] || return
ubus list led.wan >/dev/null 2>&1 || return
local addr=$(ip a show dev $ETHWAN | grep "inet "| awk '{print $2}')
if [ -n "$addr" ]; then
WANIP=1
ubus call led.wan set '{"state" : "ok"}'
else
WANIP=0
fi
# don't set wan here status is set from hotplug, only set when ip is detected.
}
internet_test() {
local link dest
dest="$(uci -q get system.@system[0].netping_addr)"
test_connection $dest
if [ "$?" -eq 0 ]; then
NETCON=1
ubus call led.internet set '{"state" : "ok"}'
echo "{ \"online\" : true }" > /tmp/internet_connection_status
else
NETCON=0
ubus call led.internet set '{"state" : "error"}'
echo "{ \"online\" : false }" > /tmp/internet_connection_status
fi
}
iptvtest() {
ubus list led.ext >/dev/null 2>&1 && TVCON=1 || return
local dest="$(uci -q get system.@system[0].tvping_addr)"
test_connection $dest
if [ "$?" -eq 0 ]; then
TVCON=1
[ -n "$dest" ] && ubus call led.ext set '{"state" : "ok"}'
else
TVCON=0
[ -n "$dest" ] && ubus call led.ext set '{"state" : "off"}'
fi
}
netmode_check() {
local curmode="$(uci -q get netmode.setup.curmode)"
local uplinkband="$(uci -q get netmode.$curmode.uplink_band)"
local rready="$(uci -q get netmode.setup.repeaterready)"
[ "$rready" == "1" ] && uplinkband="a"
echo "$uplinkband"
}
connectivity_test() {
if [ "$(netmode_check)" != "" ]; then
ping_uplink
return
fi
SLEEP_TIME=30
internet_test
if [ $NETCON -eq 1 ]; then
CURSTATUS=1
[ "$CURSTATUS" == "$LASTSTATUS" ] || ubus send internet '{"status" : "online"}'
LASTSTATUS=1
else
CURSTATUS=0
[ "$CURSTATUS" == "$LASTSTATUS" ] || ubus send internet '{"status" : "offline"}'
LASTSTATUS=0
fi
}
if [ "$1" == "once" ]; then
connectivity_test
exit 0
fi
while true; do
connectivity_test
sleep $SLEEP_TIME
done

View File

@@ -129,12 +129,12 @@ case "$1" in
json_load "`cat $file`" || write_error "invalid file content"
json_select "wifi_ifaces" || write_error "invalid file content"
start-netmode-conf "$file" "$from_gui" >/dev/null 2>/dev/null
json_init
json_add_string "status" success
json_dump
netmode-conf "$file" "$from_gui" >/dev/null 2>&1 &
;;
esac
;;

View File

@@ -32,6 +32,7 @@ CONFIG_PACKAGE_ice-client-netrounds=m
CONFIG_PACKAGE_ice-client-rshell=m
CONFIG_PACKAGE_ice-client-texec=m
CONFIG_PACKAGE_icwmp-curl=y
CONFIG_PACKAGE_inbd=y
CONFIG_PACKAGE_inteno-netmodes=y
CONFIG_PACKAGE_iperf-mt=y
CONFIG_PACKAGE_ipset=y
@@ -62,7 +63,7 @@ CONFIG_PACKAGE_juci-igmpinfo=y
CONFIG_PACKAGE_juci-inteno-backup=y
CONFIG_PACKAGE_juci-mwan3=y
CONFIG_PACKAGE_juci-inteno-provisioning=y
CONFIG_PACKAGE_juci-inteno-qos=y
# CONFIG_PACKAGE_juci-inteno-qos is not set
CONFIG_PACKAGE_juci-inteno-voice-client=y
CONFIG_PACKAGE_juci-macdb=y
CONFIG_PACKAGE_juci-minidlna=y
@@ -104,11 +105,14 @@ CONFIG_PACKAGE_mtd-utils-imagewrite=y
CONFIG_PACKAGE_mtd-utils-mkfs.jffs2=y
CONFIG_PACKAGE_mtd-utils-nanddump=y
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_nand-utils=y
CONFIG_PACKAGE_ndisc6=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_ntpd=y
CONFIG_PACKAGE_odhcp6c=y
CONFIG_PACKAGE_odhcpd=y
CONFIG_PACKAGE_openssl-util=y
CONFIG_OPENSSL_WITH_COMPRESSION=y
CONFIG_PACKAGE_openvpn-easy-rsa=y
CONFIG_PACKAGE_openvpn-openssl=y
CONFIG_PACKAGE_p910nd=y
@@ -116,11 +120,12 @@ CONFIG_PACKAGE_peripheral_manager=y
CONFIG_PACKAGE_port-management=y
CONFIG_PACKAGE_power-management=y
CONFIG_PACKAGE_ppp-mod-pppoa=y
# CONFIG_PACKAGE_ppp-mod-pppoe is not set
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
CONFIG_PACKAGE_ppp-mod-pptp=y
CONFIG_PACKAGE_ppp-multilink=y
# CONFIG_PACKAGE_ppp is not set
CONFIG_PACKAGE_qos-scripts=y
# CONFIG_PACKAGE_qos-scripts is not set
CONFIG_PACKAGE_questd=y
CONFIG_PACKAGE_rdisc6=y
CONFIG_PACKAGE_rdnssd=y
@@ -142,6 +147,7 @@ CONFIG_PACKAGE_usb-modeswitch=y
CONFIG_PACKAGE_usbreset=y
CONFIG_PACKAGE_wget=y
CONFIG_PACKAGE_wwan=y
CONFIG_PACKAGE_wlng=y
CONFIG_PACKAGE_xl2tpd=y
CONFIG_PACKAGE_zoneinfo-core=y
CONFIG_PACKAGE_zoneinfo-europe=y
@@ -158,9 +164,9 @@ CONFIG_BUSYBOX_CONFIG_DELUSER=y
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
CONFIG_BUSYBOX_CONFIG_HTTPD=y
CONFIG_BUSYBOX_CONFIG_INSMOD=y
CONFIG_BUSYBOX_CONFIG_MODINFO=y
CONFIG_BUSYBOX_CONFIG_MODPROBE=y
# CONFIG_BUSYBOX_CONFIG_INSMOD is not set
# CONFIG_BUSYBOX_CONFIG_MODINFO is not set
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
CONFIG_BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST=y
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS=y
@@ -169,11 +175,11 @@ CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
CONFIG_BUSYBOX_CONFIG_LOGIN=y
CONFIG_BUSYBOX_CONFIG_LSMOD=y
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
CONFIG_BUSYBOX_CONFIG_LSPCI=y
CONFIG_BUSYBOX_CONFIG_LSUSB=y
CONFIG_BUSYBOX_CONFIG_MICROCOM=y
CONFIG_BUSYBOX_CONFIG_RMMOD=y
# CONFIG_BUSYBOX_CONFIG_RMMOD is not set
CONFIG_BUSYBOX_CONFIG_STTY=y
CONFIG_BUSYBOX_CONFIG_TFTP=y
# CONFIG_BUSYBOX_CONFIG_FEATURE_2_4_MODULES is not set
@@ -203,6 +209,8 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
# CONFIG_BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD is not set
# CONFIG_BUSYBOX_CONFIG_PAM is not set
# CONFIG_BUSYBOX_CONFIG_TFTP_DEBUG is not set
# CONFIG_BUSYBOX_CONFIG_NTPD is not set
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
CONFIG_LIBCURL_CRYPTO_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
# CONFIG_SAMBA3_CONFIG_NO_PRINTING is not set

View File

@@ -6,13 +6,15 @@ function extract_core {
topdir=$(pwd)
# Paths to packages that should be exported.
paths+='package/network/services/base-files '
paths+='package/network/services/dnsmasq '
paths+='package/network/config/firewall '
paths+='package/network/config/netifd '
paths+='package/network/config/qos-scripts '
paths+='package/system/procd '
paths+='package/utils/busybox '
paths+='package/base-files '
paths+='package/system/procd '
paths+='package/system/rpcd '
paths+='package/network/services/openvpn '
function print_usage {
echo "Usage: $0 extract_core"

71
iop/scripts/extract_top.sh Executable file
View File

@@ -0,0 +1,71 @@
#!/bin/bash
function extract_top {
tmp_dir=extract_top_tmp
# Paths to packages that should be ignored.
paths+='package/network/services/dnsmasq '
paths+='package/network/config/firewall '
paths+='package/network/config/netifd '
paths+='package/network/config/qos-scripts '
paths+='package/utils/busybox '
paths+='package/base-files '
paths+='package/system/procd '
paths+='package/system/rpcd '
paths+='package/network/services/openvpn '
function extract {
current_branch=$(git rev-parse --abbrev-ref HEAD)
git format-patch $start_commit -o $tmp_dir #> /dev/null
ls $tmp_dir |
while read file; do
# Remove feed patches.
# echo $file | grep -i Update-feed > /dev/null && \
# rm $tmp_dir/$file && continue
cat $tmp_dir/$file | grep "+++ b/feeds.conf" > /dev/null && \
rm $tmp_dir/$file && continue
# Remove core patches.
for path in $paths; do
cat $tmp_dir/$file | grep $path > /dev/null && \
rm $tmp_dir/$file && break
done
done
git checkout -b ${current_branch}-new $start_commit
git am $tmp_dir/*
git checkout $current_branch
rm -rf $tmp_dir
}
function print_usage {
echo "Usage:"
echo " $0 -s <start_commit>"
}
# Execute user command
while getopts "s:" opt; do
case $opt in
s)
start_commit=${OPTARG}
;;
\?)
print_usage
exit 1
;;
esac
done
if [ ! -n "$start_commit" ]; then
print_usage
exit 1
fi
extract
}
register_command "extract_top" "Extract commits made to top repo"

View File

@@ -28,7 +28,8 @@ function feeds_update {
# replace core packages with iopsys versions
if [ $override == 1 ]; then
./scripts/feeds install -f -p feed_inteno_openwrt -a
./scripts/feeds install -f -p feed_inteno_openwrt -a
./scripts/feeds install -f -p feed_inteno_lede -a
fi
# targets need to be installed explicitly

View File

@@ -16,7 +16,7 @@ function genconfig {
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25 hpc_hu02"
iopsys_brcm63xx_arm="dg400 eg400 f104w f104 dg400prime dg400primeb 963138REF_P502"
iopsys_ramips="ex400"
iopsys_ramips="ex400 sdx_500ap"
ramips="mt7621"
target="bogus"
masterconfig=1

View File

@@ -4,11 +4,12 @@
build_bcmkernel_consumer() {
local tarfile bcmkernelcommith sdkversion
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/feed_inteno_broadcom/bcmkernel/$sdkversion.mk | cut -d'=' -f2)
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/feed_inteno_broadcom/bcmkernel/${sdkversion:0:4}*.mk | cut -d'=' -f2)
# do not build bcmopen sdk if it was already built before
[ -n "$board" -a -n "$bcmkernelcommith" ] || return
ssh $SERVER "ls $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz" && return
cd ./build_dir/target-*_uClibc-0.9.33.*/bcmkernel-3.4-$sdkversion/bcm963xx/release
sh do_consumer_release -p $profile -y
cd ./build_dir/target-*/bcmkernel-*-${sdkversion:0:4}*/bcm963xx/release
sh do_consumer_release -p $profile -y -F
tarfile='out/bcm963xx_*_consumer.tar.gz'
[ $(ls -1 $tarfile |wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
scp $tarfile $SERVER:$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz
@@ -22,8 +23,9 @@ build_natalie_consumer() {
grep -q "CONFIG_TARGET_NO_DECT=y" .config && return
natalieversion=$(grep -w "PKG_VERSION:" ./feeds/feed_inteno_packages/natalie-dect/Makefile | cut -d'=' -f2)
nataliecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/feed_inteno_packages/natalie-dect/Makefile | cut -d'=' -f2)
[ -n "$profile" -a -n "$natalieversion" -a -n "$nataliecommith" ] || return
ssh $SERVER "ls $FPATH/natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz" && return
cd ./build_dir/target-*_uClibc-0.9.33.*/natalie-dect-$natalieversion/
cd ./build_dir/target-*/natalie-dect-$natalieversion/
mkdir natalie-dect-open-$natalieversion
cp NatalieFpCvm6362/Src/Projects/NatalieV3/FpCvm/Linux6362/dects.ko natalie-dect-open-$natalieversion/dect.ko
tar -czv natalie-dect-open-$natalieversion/ -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
@@ -40,8 +42,9 @@ build_endptcfg_consumer() {
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
endptversion=$(grep -w "PKG_VERSION:" ./feeds/feed_inteno_packages/endptcfg/Makefile | cut -d'=' -f2)
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/feed_inteno_packages/endptcfg/Makefile | cut -d'=' -f2)
[ -n "$profile" -a -n "$endptversion" -a -n "$endptcommith" ] || return
ssh $SERVER "ls $FPATH/endptcfg-$profile-$endptversion-$endptcommith.tar.gz" && return
cd ./build_dir/target-*_uClibc-0.9.33.*/endptcfg-$endptversion/
cd ./build_dir/target-*/endptcfg-$endptversion/
mkdir endptcfg-open-$endptversion
cp endptcfg endptcfg-open-$endptversion/
tar -czv endptcfg-open-$endptversion/ -f endptcfg-$profile-$endptversion-$endptcommith.tar.gz
@@ -59,8 +62,9 @@ build_ice_consumer() {
icebasever=$(grep -w "BASE_PKG_VERSION:" ./feeds/feed_inteno_packages/ice-client/Makefile | cut -d'=' -f2)
icerelease=$(grep -w "PKG_RELEASE:" ./feeds/feed_inteno_packages/ice-client/Makefile | cut -d'=' -f2)
iceversion=$icebasever$icerelease
[ -n "$target" -a -n "$iceversion" -a -n "$icecommith" ] || return
ssh $SERVER "ls $FPATH/ice-client-$target-$iceversion-$icecommith.tar.gz" && return
cd ./build_dir/target-*_uClibc-0.9.33.*/ice-client-$icebasever/ipkg-* || cd ./build_dir/target-mips*musl-*/ice-client-$icebasever/ipkg-*
cd ./build_dir/target-*/ice-client-$icebasever/ipkg-* || cd ./build_dir/target-mips*musl-*/ice-client-$icebasever/ipkg-*
tar -czv ice-client -f ice-client-$target-$iceversion-$icecommith.tar.gz
scp ice-client-$target-$iceversion-$icecommith.tar.gz $SERVER:$FPATH/
cp ice-client-$target-$iceversion-$icecommith.tar.gz $curdir/
@@ -74,6 +78,7 @@ build_mediatek_kernel() {
mediatek_commit=$(grep CONFIG_KERNEL_GIT_COMMIT .config | cut -d '=' -f2 | tr -d '"')
kernel_version=$(grep KERNEL_PATCHVER target/linux/iopsys-ramips/Makefile | cut -d '=' -f2)
kernel=linux-${kernel_version}.*
[ -n "$mediatek_commit" ] || return
ssh $SERVER "ls $FPATH/mediatek-kernel-open-$mediatek_commit.tar.gz" && return
echo "Building mediatek kernel tarball from kernel commit:"
echo $mediatek_commit

View File

@@ -34,7 +34,7 @@ function ssh_sysupgrade_latest {
exit 1
fi
{ cd `dirname $0`
IMAGE=`ls -Art bin/*/*.y[23] | tail -n1`
IMAGE=`ls -Art bin/*/*/*/*.y[23] | tail -n1`
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop ssh_sysupgrade $1 $IMAGE $2
}
}

View File

@@ -23,8 +23,7 @@ export RANGE=10
export RETRYSTOP=5
export SLEEP=10
local sysinfo=$(ubus call router.system info)
json_load "$sysinfo"
json_load "$(ubus call router.system info)"
json_select system
json_get_var MAC basemac
json_select ..

View File

@@ -1,6 +1,6 @@
#!/bin/sh /etc/rc.common
START=01
START=10
STOP=99
USE_PROCD=1

View File

@@ -0,0 +1,48 @@
# DSL Modes
config dsl-line line
list mode gdmt
list mode glite
list mode t1413
list mode adsl2
list mode adsl2p
list mode annexl
list mode annexm
list mode vdsl2
list mode gfast
list profile 8a
list profile 8b
list profile 8c
list profile 8d
list profile 12a
list profile 12b
list profile 17a
list profile 30a
list profile 35b
option bitswap 1
option sra 1
option trellis
option sesdrop
# VDSL2 only
option us0
option dynamicd
option dynamicf
option sos
config atm-device atm0
option name 'ATM'
option vpi '8'
option vci '35'
option device atm0
option link_type 'eoa' # EoA, IPoA, PPPoA, CIP
option encapsulation 'llc' # llc, vcmux
option qos_class 'ubr' # ubr, cbr, gfr, vbr-nrt, vbr-rt, ubr+, abr
# option pcr '512'
# option scr '256'
# option mbs '1024'
config ptm-device ptm0
option name 'PTM'
option device 'ptm0'
option priority '1'
option portid '1'

View File

@@ -0,0 +1,2 @@
[ "$STATUS" == "up" -o "$STATUS" == "down" ] && /etc/init.d/dsl reload

View File

@@ -0,0 +1,8 @@
if [ "$STATUS" == "up" ]; then
ubus call led.dsl set '{"state":"ok"}'
elif [ "$STATUS" == "down" ]; then
ubus call led.dsl set '{"state":"off"}'
elif [ "$STATUS" == "training" ]; then
ubus call led.dsl set '{"state":"alert"}'
fi

View File

@@ -1,27 +1,4 @@
. /lib/network/config.sh
# FIX: for EG300 WAN port for release 3.13.1 - 4.x
if [ "$INTERFACE" == "eth2" ]; then
touch /var/update.eth2
fi
# end FIX
addif() {
# check if wan had a event and start all related services
wan=`uci -q get layer2_interface_ethernet.Wan.baseifname`
if [ "$INTERFACE" == "$wan" ]; then
/etc/init.d/layer2_interface_ethernet start
/etc/init.d/layer2_interface_vlan start
fi
}
delif() {
##remove ethernet wan and nuke any vlans associated
wan=`uci -q get layer2_interface_ethernet.Wan.baseifname`
if [ "$INTERFACE" == "$wan" ]; then
/etc/init.d/layer2_interface_ethernet stop
fi
}
include /lib/network
# true if speed on interface is Gbit
gigatest() {
@@ -34,9 +11,8 @@ gigatest() {
# true if there is a link on any lan port
lan_test () {
local landev=$(db get hw.board.ethernetLanPorts)
local ledontest
for dev in $landev; do
for dev in $(db get hw.board.ethernetLanPorts); do
ledontest=$(cat /sys/class/net/$dev/operstate)
if [ "$ledontest" == "up" ]; then
return 0
@@ -45,26 +21,13 @@ lan_test () {
return 1
}
# true if adsl or vdsl is up.
dsltest() {
if cat /var/state/layer2_interface 2>/dev/null | grep 'adsl\|vdsl' | grep up; then
return 0
else
return 1
fi
}
case "$ACTION" in
add|register)
case "$PHYSDEVDRIVER" in
natsemi) sleep 1 ;;
esac
addif
local interfname=$(interfacename $INTERFACE)
local operstate=$(cat /sys/class/net/$INTERFACE/operstate)
# if [ "$operstate" == "up" ]; then
INTFNAME=$(interfacename $INTERFACE)
OPERSTATE=$(cat /sys/class/net/$INTERFACE/operstate)
# if [ "$OPERSTATE" == "up" ]; then
if true ; then
case "$interfname" in
case "$INTFNAME" in
GbE*)
ubus call led.lan set '{"state" : "ok"}'
ubus call led.gbe set '{"state" : "ok"}'
@@ -85,10 +48,10 @@ case "$ACTION" in
fi
;;
remove|unregister)
local interfname=$(interfacename $INTERFACE)
local operstate=$(cat /sys/class/net/$INTERFACE/operstate)
if [ "$operstate" == "down" ]; then
case "$interfname" in
INTFNAME=$(interfacename $INTERFACE)
OPERSTATE=$(cat /sys/class/net/$INTERFACE/operstate)
if [ "$OPERSTATE" == "down" ]; then
case "$INTFNAME" in
GbE*)
ubus call led.gbe set '{"state" : "off"}'
ubus call led.gbe_phy_link set '{"state" : "off"}'
@@ -102,12 +65,9 @@ case "$ACTION" in
ubus call led.wan set '{"state" : "off"}'
ubus call led.wan_phy_speed set '{"state" : "off"}'
ubus call led.wan_phy_link set '{"state" : "off"}'
# is this needed here ?? don't the dsl hotplug event control this ???
# $(dsltest) || ubus call led.dsl set '{"state":"off"}'
;;
esac
fi
delif
;;
esac

View File

@@ -0,0 +1,515 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/network
START=20
USE_PROCD=1
DEVICE_ADDED=0
device_config_exists() {
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$1" && return 0
return 1
}
configure_untagged_vlan() {
local name="$1"
local device="$2"
local ifname="$3"
[ -n "$ifname" -a -n "$name" ] || return
device_config_exists "$ifname" && return
uci -q set network.$name=device
uci -q set network.$name.type=untagged
uci -q set network.$name.ifname="$device"
uci -q set network.$name.name="$ifname"
uci -q commit network
DEVICE_ADDED=1
}
# ATM #
check_pvc() {
local vpi=$1
local vci=$2
local ret
ret=$(xtmctl operate conn --show | awk -v test="$vpi/$vci" '{if ($3==test ) print $5 }')
case $ret in
''|*[!0-9]*) return 0 ;;
*) return $ret ;;
esac
}
check_xtm_list() {
local qclass=$1
local pcr scr mbs
local ret
case $# in
1)
pcr=0
scr=0
mbs=0
;;
2)
pcr=$2
scr=0
mbs=0
;;
4)
pcr=$2
scr=$3
mbs=$4
;;
esac
ret=$(xtmctl operate tdte --show | awk -v test="$qclass" -v pcr="$pcr" -v scr="$scr" -v mbs="$mbs" '{if ($2==test && $3==pcr && $4==scr && $5==mbs ) print $1 }')
case $ret in
''|*[!0-9]*) return 0 ;;
*) return $ret ;;
esac
}
configure_atm_device() {
local name vpi vci device link_type encapsulation qos_class pcr mbs scr
config_get name $1 name "ATM"
config_get vpi $1 vpi "8"
config_get vci $1 vci "35"
config_get device $1 device "atm0"
config_get link_type $1 link_type "eoa"
config_get encapsulation $1 encapsulation "llc"
config_get qos_class $1 qos_class "ubr"
config_get pcr $1 pcr
config_get mbs $1 mbs
config_get scr $1 scr
check_pvc $vpi $vci
ret=$?
if [ "$ret" -eq 0 ]; then
check_xtm_list $qos_class $pcr $scr $mbs
ret=$?
if [ "$ret" -eq 0 ]; then
case $qos_class in # ubr, cbr, gfr, vbr-nrt, vbr-rt, ubr+, abr
ubr)
xtmctl operate tdte --add "$qos_class"
;;
ubr_pcr|ubr+)
xtmctl operate tdte --add "$qos_class" $pcr
;;
cbr)
xtmctl operate tdte --add "$qos_class" $pcr
;;
nrtvbr|vbr-nrt)
xtmctl operate tdte --add "$qos_class" $pcr $scr $mbs
;;
rtvbr|vbr-rt)
xtmctl operate tdte --add "$qos_class" $pcr $scr $mbs
;;
gfr)
;;
abr)
;;
esac
fi
case $link_type in # EoA, IPoA, PPPoA, CIP
EoA|eoa)
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_eth" || encapsulation="llcsnap_eth"
;;
PPPoA|pppoa)
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_pppoa" || encapsulation="llcencaps_ppp"
;;
IPoA|ipoa)
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_ipoa" || encapsulation="llcsnap_rtip"
;;
CIP|cip)
;;
esac
check_xtm_list $qos_class $pcr $scr $mbs
ret="$?"
xtmctl operate conn --add 1.$vpi.$vci aal5 $encapsulation 0 1 $ret
xtmctl operate conn --addq 1.$vpi.$vci 0 wrr 1 dt # low priority queue
xtmctl operate conn --addq 1.$vpi.$vci 1 wrr 1 dt # mid priority queue upstream ACK's and ping from LAN will use this queue
xtmctl operate conn --addq 1.$vpi.$vci 7 wrr 1 dt # high priority queue, internal traffic dhcp igmp dns and icmp
xtmctl operate conn --createnetdev 1.$vpi.$vci $device
xtmctl operate intf --state 1 enable
configure_untagged_vlan "$name" "$device" "$device.1"
[ $DEVICE_ADDED -eq 1 ] && ubus call network reload
fi
}
remove_atm_devices() {
local vpi vci rest
local vpivci=`xtmctl operate conn --show | grep "ATM\|mode" | awk '{if (NR!=1 && $1!="PTM") {print $3}}'`
for i in $vpivci
do
rest=${i#\/}
vpi=${rest%%\/*}
vci=${rest#*\/}
echo "xtmctl operate conn --delete 1.$vpi.$vci"
xtmctl operate conn --delete 1.$vpi.$vci
echo "xtmctl operate conn --deletenetdev 1.$vpi.$vci"
xtmctl operate conn --deletenetdev 1.$vpi.$vci
done
}
create_atm_devices() {
echo "Creating ATM Device(s)"
config_load dsl
config_foreach configure_atm_device atm-device
}
# ATM END #
# PTM #
check_ptm() {
local ret
local ptmprio=$1
local dslat=$2
if [ "$ptmprio" -eq 2 ]; then
ptmprio="high"
else
ptmprio="low"
fi
ret=$(xtmctl operate conn --show | awk -v dslat="$dslat" -v ptmprio="$ptmprio" '{if ($2 == dslat && $3 == ptmprio ) print $2 }')
case $ret in
''|*[!0-9]*) return 0 ;;
*) return $ret ;;
esac
}
configure_ptm_device() {
local name device priority portid
config_get name $1 name "PTM"
config_get device $1 device "ptm0"
config_get priority $1 priority 1
config_get portid $1 portid 1
check_ptm $priority $portid
ret=$?
if [ "$ret" -eq 0 ]; then
xtmctl operate conn --add $portid.$priority
xtmctl operate conn --addq $portid.$priority 0 wrr 1 dt -1 -1 3000 # low priority queue
xtmctl operate conn --addq $portid.$priority 1 wrr 1 dt -1 -1 3000 # mid priority queue upstream ACK's and ping from LAN will use this queue
xtmctl operate conn --addq $portid.$priority 7 wrr 1 dt -1 -1 3000 # high priority queue, internal traffic dhcp igmp dns and icmp
echo "xtmctl operate conn --createnetdev $portid.$priority $device"
xtmctl operate conn --createnetdev $portid.$priority $device
xtmctl operate intf --state 1 enable
configure_untagged_vlan "$name" "$device" "$device.1"
[ $DEVICE_ADDED -eq 1 ] && ubus call network reload
fi
}
remove_ptm_devices() {
local delptm
local x=0
IFS=$'\n'
for i in `xtmctl operate conn --show | grep "PTM\|mode"`
do
if [ $x -eq 1 ]; then
delptm=$(echo $i | awk '{if ($1!="ATM") print $2"."$11}')
echo "xtmctl operate conn --delete $delptm"
xtmctl operate conn --delete $delptm
xtmctl operate conn --deletenetdev $delptm
fi
x=1
done
unset IFS
}
create_ptm_devices() {
echo "Creating PTM Device(s)"
config_load dsl
config_foreach configure_ptm_device ptm-device
}
# PTM END #
prioritize_arp()
{
ebtables -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
ebtables -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
}
remove_devices() {
remove_atm_devices
remove_ptm_devices
}
create_devices() {
local tpstc="$(xdslctl info --show | grep TPS-TC)"
if echo "$tpstc" | grep -q "ATM Mode"; then
create_atm_devices
elif echo "$tpstc" | grep -q "PTM Mode"; then
create_ptm_devices
fi
}
start_dsl() {
local VDSL=0
local GFAST=0
local mod=""
local modes=""
local profile=""
config_load dsl
# Modes
config_get mode line mode
for mod in $mode; do
[ $mod == "gdmt" ] && "${modes}d"
[ $mod == "glite" ] && modes="${modes}l"
[ $mod == "t1413" ] && modes="${modes}t"
[ $mod == "adsl2" ] && modes="${modes}2"
[ $mod == "adsl2p" ] && modes="${modes}p"
[ $mod == "annexl" ] && modes="${modes}e"
[ $mod == "annexm" ] && modes="${modes}m"
[ $mod == "vdsl2" ] && modes="${modes}v" && VDSL=1
[ $mod == "gfast" ] && modes="${modes}f" && GFAST=1
done
# VDSL Profiles
config_get profile line profile
profile="$(echo $profile | sed 's/35b/BrcmPriv1/g')"
# Capabilities
config_get_bool bitswap line bitswap 1
[ $bitswap -eq 1 ] && bitswap="on" || bitswap="off"
config_get_bool sra line sra 1
[ $sra -eq 1 ] && sra="on" || sra="off"
# config_get_bool trellis line trellis 1
# config_get_bool sesdrop line sesdrop 1
# VDSL2 only
config_get_bool us0 line us0 1
[ $us0 -eq 1 ] && us0="on" || us0="off"
# config_get_bool dynamicd line dynamicd 1
# config_get_bool dynamicf line dynamicf 1
# config_get_bool sos line sos 1
echo "Starting DSL"
xtmctl start
xtmctl operate intf --state 1 enable
if [ $VDSL -eq 1 -o $GFAST -eq 1 ]; then
echo "xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0"
xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0
else
echo "xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap"
xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap
fi
if [ $GFAST -eq 1 ]; then
# enable V43 tone set for GFAST
echo "xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x400000 0x400000"
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x400000 0x400000
fi
}
# CONVERT OLD CONFIG #
convert_old_atm() {
local name ifname baseifname
local vpi vci link_type atmtype pcr scr mbs
local encapseoa encapspppoa encapsipoa encapsulation
config_get atmtype $1 atmtype "ubr"
config_get link_type $1 link_type "EoA"
config_get pcr $1 pcr
config_get scr $1 scr
config_get mbs $1 mbs
config_get vpi $1 vpi "8"
config_get vci $1 vci "35"
config_get encapseoa $1 encapseoa
config_get encapspppoa $1 encapspppoa
config_get encapsipoa $1 encapsipoa
config_get baseifname $1 baseifname "atm0"
config_get name $1 name "ATM$vpi$vci"
uci -q set dsl.$baseifname=atm-device
uci -q set dsl.$baseifname.name="$name"
uci -q set dsl.$baseifname.device="$baseifname"
uci -q set dsl.$baseifname.qos_class="$atmtype"
uci -q set dsl.$baseifname.vpi="$vpi"
uci -q set dsl.$baseifname.vci="$vci"
uci -q set dsl.$baseifname.pcr="$pcr"
uci -q set dsl.$baseifname.mbs="$mbs"
uci -q set dsl.$baseifname.scr="$scr"
case $link_type in
EoA)
uci -q set dsl.$baseifname.link_type="eoa"
[ "$encapseoa" == "vcmux_eth" ] && encapsulation="vcmux" || encapsulation="llc"
uci -q set dsl.$baseifname.encapsulation="$encapsulation"
;;
PPPoA)
uci -q set dsl.$baseifname.link_type="pppoa"
[ "$encapspppoa" == "vcmux_pppoa" ] && encapsulation="vcmux" || encapsulation="llc"
uci -q set dsl.$baseifname.encapsulation="$encapsulation"
;;
IPoA)
uci -q set dsl.$baseifname.link_type="ipoa"
[ "$encapsipoa" == "vcmux_ipoa" ] && encapsulation="vcmux" || encapsulation="llc"
uci -q set dsl.$baseifname.encapsulation="$encapsulation"
;;
esac
}
convert_old_ptm() {
local name ifname baseifname
local dslat ptmprio
config_get name $1 name "PTM"
config_get baseifname $1 baseifname "ptm0"
config_get dslat $1 dslat
config_get ptmprio $1 ptmprio
uci -q set dsl.$baseifname=ptm-device
uci -q set dsl.$baseifname.name="$name"
uci -q set dsl.$baseifname.device="$baseifname"
uci -q set dsl.$baseifname.priority="$ptmprio"
uci -q set dsl.$baseifname.portid="$dslat"
}
convert_old_dsl() {
local cap
sed -i 's/Enabled/1/g' /etc/config/layer2_interface
sed -i 's/Disabled/0/g' /etc/config/layer2_interface
uci -q delete dsl.line.mode
uci -q delete dsl.line.profile
uci -q delete dsl.line.us0
uci -q delete dsl.line.sra
uci -q delete dsl.line.bitswap
config_load layer2_interface
# Mode
config_get_bool cap capabilities GDmt 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=gdmt
config_get_bool cap capabilities Glite 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=glite
config_get_bool cap capabilities T1413 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=t1413
config_get_bool cap capabilities ADSL2 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=adsl2
config_get_bool cap capabilities ADSL2plus 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=adsl2p
config_get_bool cap capabilities AnnexL 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=annexl
config_get_bool cap capabilities AnnexM 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=annexm
config_get_bool cap capabilities VDSL2 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=vdsl2
config_get_bool cap capabilities GFast 0
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=gfast
# Profile
config_get_bool cap capabilities 8a 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8a
config_get_bool cap capabilities 8b 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8b
config_get_bool cap capabilities 8c 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8c
config_get_bool cap capabilities 8d 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8d
config_get_bool cap capabilities 12a 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=12a
config_get_bool cap capabilities 12b 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=12b
config_get_bool cap capabilities 17a 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=17a
config_get_bool cap capabilities 30a 1
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=30a
config_get_bool cap capabilities 35b 0
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=35b
# Capability
config_get_bool cap capabilities US0 1
uci -q set dsl.line.us0=$cap
config_get_bool cap capabilities bitswap 1
uci -q set dsl.line.bitswap=$cap
config_get_bool cap capabilities sra 1
uci -q set dsl.line.sra=$cap
}
convert_old_config() {
[ -f /etc/config/dsl ] || touch /etc/config/dsl
# DSL
if uci -q get layer2_interface.capabilities >/dev/null; then
convert_old_dsl
fi
# ATM Devices
if uci -q get layer2_interface_adsl.@atm_bridge[0] >/dev/null; then
config_load layer2_interface_adsl
config_foreach convert_old_atm atm_bridge
fi
# PTM Devices
if uci -q get layer2_interface_vdsl.@vdsl_interface[0] >/dev/null; then
config_load layer2_interface_vdsl
config_foreach convert_old_ptm vdsl_interface
fi
uci -q commit dsl
# rm -f /etc/config/layer2_interface
# rm -f /etc/config/layer2_interface_adsl
# rm -f /etc/config/layer2_interface_vdsl
}
# CONVERT OLD CONFIG END#
start_service() {
create_devices
}
stop_service() {
remove_devices
# echo "Stopping DSL"
# stop causes IRQ issues
# xdslctl stop
}
boot() {
local HASADSL="$(db -q get hw.board.hasAdsl)"
local HASVDSL="$(db -q get hw.board.hasVdsl)"
[ "$HASADSL" == "1" -o "$HASVDSL" == "1" ] || return
convert_old_config
prioritize_arp
start_dsl
start
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger dsl layer2_interface layer2_interface_adsl layer2_interface_vdsl
}

View File

@@ -0,0 +1,119 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/network
START=20
USE_PROCD=1
DEVICE_ADDED=0
device_config_exists() {
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$1" && return 0
return 1
}
configure_ethernet_iface() {
local name baseifname ifname
config_get name $1 name
config_get baseifname $1 baseifname
config_get ifname $1 ifname
[ -n "$ifname" -a -n "$name" ] || return
device_config_exists "$ifname" && return
uci -q set network.$name=device
uci -q set network.$name.type=untagged
uci -q set network.$name.ifname="$baseifname"
uci -q set network.$name.name="$ifname"
DEVICE_ADDED=1
}
configure_vlan_iface() {
local name baseifname ifname
local vlan8021p vlan8021q
config_get name $1 name
config_get baseifname $1 baseifname
config_get ifname $1 ifname
config_get vlan8021p $1 vlan8021p
config_get vlan8021q $1 vlan8021q
[ -n "$ifname" -a -n "$name" ] || return
device_config_exists "$ifname" && return
uci -q set network.$name=device
uci -q set network.$name.type=8021q
uci -q set network.$name.priority=$vlan8021p
uci -q set network.$name.vid="$vlan8021q"
uci -q set network.$name.ifname="$baseifname"
uci -q set network.$name.name="$ifname"
uci -q commit network
DEVICE_ADDED=1
}
start_service() {
config_load layer2_interface_ethernet
config_foreach configure_ethernet_iface ethernet_interface
config_load layer2_interface_vlan
config_foreach configure_vlan_iface vlan_interface
[ $DEVICE_ADDED -eq 1 ] && ubus call network reload
}
boot() {
local baseifname port unit uplinkport
config_load layer2_interface_ethernet
config_get baseifname Wan baseifname
[ -n "$baseifname" ] || baseifname="$(db -q get hw.board.ethernetWanPort)"
uplinkport=$(uci show ports | grep "uplink='1'" | cut -d'.' -f2)
if [ -n "$uplinkport" ]; then
baseifname="$(uci -q get ports.$uplinkport.ifname)"
else
uplinkport=$(uci show ports | grep "ifname='$baseifname'" | cut -d'.' -f2)
[ -n "$uplinkport" ] && uci -q set ports.$uplinkport.uplink=1 && uci commit ports
fi
# if [ "$(db get hw.board.hardware)" != "EG300" ]; then
# if [ "$(get_port_speed $baseifname)" != "1000FD" ]; then
# ethctl $baseifname phy-power down
# ethctl $baseifname phy-power up
# fi
# fi
for interf in $(db get hw.board.ethernetPortOrder); do
ethswctl -c wan -i $interf -o disable
done
unit=$(echo $(get_port_number $baseifname) | cut -d ' ' -f 1)
port=$(echo $(get_port_number $baseifname) | cut -d ' ' -f 2)
ethswctl -c pause -n $unit -p $port -v 1
ethswctl -c hw-switching -o enable
if [ -n "$baseifname" ]; then
ethswctl -c wan -i $baseifname -o enable
fi
if [ "$(db get hw.board.tm)" == "1" ]; then
for interf in $(db get hw.board.ethernetPortOrder); do
tmctl porttminit --devtype ETH --if $interf --flag 1 || echo "ERROR: porttminit $interf failed!" > /dev/kmsg
done
fi
start
}
service_triggers() {
procd_add_reload_trigger layer2_interface_ethernet layer2_interface_vlan
}

View File

@@ -1,132 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
. /usr/share/libubox/jshn.sh
include /lib/network
START=22
USE_PROCD=1
start_service() {
local AnnexM
local GDmt
local Glite
local T1413
local ADSL2
local AnnexL
local ADSL2plus
local VDSL2
local GFast
local a8a
local b8b
local c8c
local d8d
local a12a
local b12b
local a17a
local a30a
local b35b
local US0
local bitswap
local sra
local vdsl
config_load layer2_interface
config_get Glite capabilities Glite
config_get GDmt capabilities GDmt
config_get T1413 capabilities T1413
config_get ADSL2 capabilities ADSL2
config_get ADSL2plus capabilities ADSL2plus
config_get AnnexL capabilities AnnexL
config_get VDSL2 capabilities VDSL2
config_get GFast capabilities GFast
config_get AnnexM capabilities AnnexM
config_get a8a capabilities 8a
config_get b8b capabilities 8b
config_get c8c capabilities 8c
config_get d8d capabilities 8d
config_get a12a capabilities 12a
config_get b12b capabilities 12b
config_get a17a capabilities 17a
config_get a30a capabilities 30a
config_get b35b capabilities 35b
config_get BrcmPriv1 capabilities BrcmPriv1
config_get US0 capabilities US0
config_get bitswap capabilities bitswap
config_get sra capabilities sra
GDmt=$(echo $GDmt | sed 's/Enabled\|1/d/g')
Glite=$(echo $Glite | sed 's/Enabled\|1/l/g')
T1413=$(echo $T1413 | sed 's/Enabled\|1/t/g')
ADSL2=$(echo $ADSL2 | sed 's/Enabled\|1/2/g')
AnnexL=$(echo $AnnexL | sed 's/Enabled\|1/e/g')
ADSL2plus=$(echo $ADSL2plus | sed 's/Enabled\|1/p/g')
AnnexM=$(echo $AnnexM | sed 's/Enabled\|1/m/g')
VDSL2=$(echo $VDSL2 | sed 's/Enabled\|1/v/g')
GFast=$(echo $GFast | sed 's/Enabled\|1/f/g')
a8a=$(echo $a8a | sed 's/Enabled\|1/8a/g')
b8b=$(echo $b8b | sed 's/Enabled\|1/8b/g')
c8c=$(echo $c8c | sed 's/Enabled\|1/8c/g')
d8d=$(echo $d8d | sed 's/Enabled\|1/8d/g')
a12a=$(echo $a12a | sed 's/Enabled\|1/12a/g')
b12b=$(echo $b12b | sed 's/Enabled\|1/12b/g')
a17a=$(echo $a17a | sed 's/Enabled\|1/17a/g')
a30a=$(echo $a30a | sed 's/Enabled\|1/30a/g')
b35b=$(echo $b35b | sed 's/Enabled\|1/BrcmPriv1/g')
BrcmPriv1=$(echo $BrcmPriv1 | sed 's/Enabled\|1/BrcmPriv1/g')
[ -n "$b35b" ] && BrcmPriv1=""
US0=$(echo $US0 | sed 's/1/on/g')
US0=$(echo $US0 | sed 's/0/off/g')
bitswap=$(echo $bitswap | sed 's/1/on/g')
bitswap=$(echo $bitswap | sed 's/0/off/g')
sra=$(echo $sra | sed 's/1/on/g')
sra=$(echo $sra | sed 's/0/off/g')
echo "Starting DSL"
xtmctl start
xtmctl operate intf --state 1 enable
json_load "$(ubus call router.system info)"
json_select specs
json_get_var vdsl vdsl
if [ $vdsl -eq 1 ]; then
echo "xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM$VDSL2$GFast --profile \"$a8a $b8b $c8c $d8d $a12a $b12b $a17a $a30a $b35b $BrcmPriv1\" --sra $sra --bitswap $bitswap --us0 $US0"
xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM$VDSL2$GFast --profile "$a8a $b8b $c8c $d8d $a12a $b12b $a17a $a30a $b35b $BrcmPriv1" --sra $sra --bitswap $bitswap --us0 $US0
else
echo "xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM --sra $sra --bitswap $bitswap"
xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM --sra $sra --bitswap $bitswap
fi
if [ "$GFast" == "f" ]; then
# enable V43 tone set for GFAST
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x400000 0x400000
fi
}
stop_service() {
echo "Stopping DSL"
# stop causes IRQ issues
#xdslctl stop
}
boot() {
vlanctl --if-suffix .
add_ebtables_default_arp
start
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger layer2_interface
}

View File

@@ -1,163 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/network
START=22
USE_PROCD=1
checkpvc() {
local retur
local vpi=$1
local vci=$2
retur=$(xtmctl operate conn --show | awk -v test="$vpi/$vci" '{if ($3 ==test ) print $5 }')
case $retur in
''|*[!0-9]*) return 0 ;;
*) return $retur ;;
esac
}
checkxtmlist() {
local dtype=$1
local pcr
local scr
local mbs
local retur
case $# in
1)
pcr=0
scr=0
mbs=0
;;
2)
pcr=$2
scr=0
mbs=0
;;
4)
pcr=$2
scr=$3
mbs=$4
;;
esac
retur=$(xtmctl operate tdte --show | awk -v test="$dtype" -v pcr="$pcr" -v scr="$scr" -v mbs="$mbs" '{if ($2 ==test && $3==pcr && $4==scr && $5==mbs ) print $1 }')
case $retur in
''|*[!0-9]*) return 0 ;;
*) return $retur ;;
esac
}
atm_inf_conf() {
local vpi
local vci
local link_type
local atmtype
local pcr
local scr
local mbs
local encaps
local ifname
local ret
local baseifname
config_get atmtype $1 atmtype
config_get link_type $1 link_type
config_get pcr $1 pcr
config_get scr $1 scr
config_get mbs $1 mbs
config_get vpi $1 vpi
config_get vci $1 vci
config_get ifname $1 ifname
config_get baseifname $1 baseifname
config_get name $1 name
config_get bridge $1 bridge
checkpvc $vpi $vci
ret=$?
ifname="${ifname:-$baseifname.1}"
if [ "$ret" -eq 0 ]; then
checkxtmlist $atmtype $pcr $scr $mbs
ret=$?
if [ "$ret" -eq 0 ]; then
case $atmtype in
ubr) xtmctl operate tdte --add "$atmtype";;
ubr_pcr ) xtmctl operate tdte --add "$atmtype" $pcr;;
cbr) xtmctl operate tdte --add "$atmtype" $pcr;;
nrtvbr) xtmctl operate tdte --add "$atmtype" $pcr $scr $mbs;;
rtvbr)xtmctl operate tdte --add "$atmtype" $pcr $scr $mbs;;
esac
fi
case $link_type in
EoA)config_get encaps $1 encapseoa;;
PPPoA)config_get encaps $1 encapspppoa;;
IPoA)config_get encaps $1 encapsipoa;;
esac
checkxtmlist $atmtype $pcr $scr $mbs
ret="$?"
xtmctl operate conn --add 1.$vpi.$vci aal5 $encaps 0 1 $ret
xtmctl operate conn --addq 1.$vpi.$vci 0 wrr 1 # low priority queue
xtmctl operate conn --addq 1.$vpi.$vci 1 wrr 1 # mid priority queue upstream ACK's and ping from LAN will use this queue
xtmctl operate conn --addq 1.$vpi.$vci 7 wrr 1 # high priority queue, internal traffic dhcp igmp dns and icmp
xtmctl operate conn --createnetdev 1.$vpi.$vci ${ifname%%.*}
xtmctl operate intf --state 1 enable
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
fi
}
remove_netdevices() {
local vpi
local vci
local rest
local x=0
#local baseifname
local vpivci=`xtmctl operate conn --show | grep "ATM\|mode" | awk '{if (NR!=1 && $1!="PTM") {print $3}}'`
for i in $vpivci
do
rest=${i#\/}
vpi=${rest%%\/*}
vci=${rest#*\/}
echo "xtmctl operate conn --delete 1.$vpi.$vci"
xtmctl operate conn --delete 1.$vpi.$vci
echo "xtmctl operate conn --deletenetdev 1.$vpi.$vci"
xtmctl operate conn --deletenetdev 1.$vpi.$vci
done
}
start_service() {
local adslstatus
echo "Starting ADSL"
config_load layer2_interface
config_get adslstatus adsl device
if [ "$adslstatus" == "up" ]; then
xtmctl start
config_load layer2_interface_adsl
config_foreach atm_inf_conf atm_bridge
fi
}
stop_service() {
echo "Stopping ADSL"
#xtmctl stop causes IRQ issues"
# xtmctl stop
remove_netdevices
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger layer2_interface_adsl
}

View File

@@ -1,116 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/network
START=22
USE_PROCD=1
get_current_status() {
local port="$1"
local media="$(ethctl $port media-type 2>&1)"
if echo $media | grep "1000" >/dev/null; then
return 0
elif echo $media | grep "100" >/dev/null; then
return 1
elif echo $media | grep "10" >/dev/null; then
return 1
fi
}
removeethernet() {
config_get baseifname $1 baseifname
config_get ifname $1 ifname
ifname="${ifname:-$baseifname.1}"
vlanctl --if-delete $ifname
config_load layer2_interface_vlan
#kill all vlans related to this interface
config_foreach removevlan vlan_interface
}
removevlan() {
local baseifname
local ifname
local wan=`uci -q get layer2_interface_ethernet.Wan.baseifname`
config_get baseifname $1 baseifname
config_get ifname $1 ifname
ifname="${ifname:-$baseifname.1}"
if [ "$wan" == "$baseifname" ]; then
echo "vlanctl --if-delete $ifname"
vlanctl --if-delete $ifname
fi
}
addethernet() {
config_get baseifname $1 baseifname
config_get ifname $1 ifname
config_get bridge $1 bridge
config_get mac2 $1 mac2
ifname="${ifname:-$baseifname.1}"
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge" "$mac2"
}
boot() {
local baseifname wanport portnum
config_load layer2_interface_ethernet
config_get baseifname Wan baseifname
if [ "$(db get hw.board.hardware)" != "EG300" ]; then
get_current_status $baseifname
local ret=$?
if [ $ret -eq 1 ]; then
ethctl $baseifname phy-power down
ethctl $baseifname phy-power up
fi
fi
for interf in `db get hw.board.ethernetPortOrder`; do ethswctl -c wan -i $interf -o disable ; done
wanport=$(db get hw.board.ethernetWanPort)
unit=$(echo $(get_port_number $wanport) | cut -d ' ' -f 1)
port=$(echo $(get_port_number $wanport) | cut -d ' ' -f 2)
ethswctl -c pause -n $unit -p $port -v 1
ethswctl -c hw-switching -o enable
if [ $baseifname ]; then
ethswctl -c wan -i $baseifname -o enable
fi
if [ "`db get hw.board.tm`" == "1" ]; then
for interf in `db get hw.board.ethernetPortOrder`; do
tmctl porttminit --devtype ETH --if $interf --flag 1 || \
echo "ERROR: porttminit $interf failed!" > /dev/kmsg
done
fi
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
ifconfig $baseifname up
}
start_service() {
local baseifname
echo "Setting up Ethernet WAN"
config_load layer2_interface_ethernet
config_foreach addethernet ethernet_interface
}
stop_service() {
local ifname
config_load layer2_interface_ethernet
config_foreach removeethernet ethernet_interface
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger layer2_interface_ethernet
}

View File

@@ -1,105 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/network
START=22
USE_PROCD=1
checkptm() {
local retur
local ptmprio=$1
local dslat=$2
if [ "$ptmprio" -eq 2 ]; then
ptmprio="high"
else
ptmprio="low"
fi
retur=$(xtmctl operate conn --show | awk -v dslat="$dslat" -v ptmprio="$ptmprio" '{if ($2 == dslat && $3 == ptmprio ) print $2 }')
case $retur in
''|*[!0-9]*) return 0 ;;
*) return $retur ;;
esac
}
ptm_inf_conf() {
local ret
local ptmprio
local dslat
local ifname
local bridge
config_get ptmprio $1 ptmprio
config_get dslat $1 dslat
config_get ifname $1 ifname
config_get baseifname $1 baseifname
config_get bridge $1 bridge
ifname="${ifname:-$baseifname.1}"
checkptm $ptmprio $dslat
ret=$?
if [ "$ret" -eq 0 ]; then
xtmctl operate conn --add $dslat.$ptmprio 0 1
xtmctl operate conn --addq $dslat.$ptmprio 0 wrr 1 -1 -1 3000 # low priority queue
xtmctl operate conn --addq $dslat.$ptmprio 1 wrr 1 -1 -1 3000 # mid priority queue upstream ACK's and ping from LAN will use this queue
xtmctl operate conn --addq $dslat.$ptmprio 7 wrr 1 -1 -1 3000 # high priority queue, internal traffic dhcp igmp dns and icmp
xtmctl operate conn --createnetdev $dslat.$ptmprio ${ifname%%.*}
xtmctl operate intf --state 1 enable
xtmctl start
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
fi
}
remove_netdevices() {
local delptm
local x=0
IFS=$'\n'
for i in `xtmctl operate conn --show | grep "PTM\|mode"`
do
if [ $x -eq 1 ]; then
delptm=$(echo $i | awk '{if ($1!="ATM") print $2"."$10}')
echo "xtmctl operate conn --delete $delptm"
xtmctl operate conn --delete $delptm
xtmctl operate conn --deletenetdev $delptm
fi
x=1
done
unset IFS
}
start_service() {
local vdslstatus
echo "Starting VDSL"
config_load layer2_interface
config_get vdslstatus vdsl device
if [ "$vdslstatus" == "up" ]; then
xtmctl start
config_load layer2_interface_vdsl
config_foreach ptm_inf_conf vdsl_interface
fi
}
stop_service() {
echo "Stopping VDSL"
# bug in broadcom stop casues IRQ issue
# xtmctl stop
remove_netdevices
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger layer2_interface_vdsl
}

View File

@@ -1,50 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/network
START=22
USE_PROCD=1
vlan_inf_conf() {
local baseifname
local vlan8021p
local vlan8021q
local routed
config_get baseifname $1 baseifname
config_get ifname $1 ifname
config_get vlan8021p $1 vlan8021p
config_get vlan8021q $1 vlan8021q
config_get bridge $1 bridge
ifname="${ifname:-$baseifname.$vlan8021q}"
addbrcmvlan "$baseifname" "$vlan8021p" "$vlan8021q" "$bridge" "$ifname"
}
boot() {
echo "VLAN does not run at boot"
}
start_service() {
local vdslstatus
echo "Starting VLAN"
config_load layer2_interface_vlan
config_foreach vlan_inf_conf vlan_interface
}
stop_service() {
echo "Stopping VLAN"
removeall_vlandevices
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger layer2_interface_vlan
}

View File

@@ -1,115 +1,167 @@
#!/bin/sh
local hasEthWan="$(db -q get hw.board.hasEthWan)"
hasEthWan="$(db -q get hw.board.hasEthWan)"
hasEthWan=${hasEthWan:-1}
local hasAdsl="$(db -q get hw.board.hasAdsl)"
local hasVdsl="$(db -q get hw.board.hasVdsl)"
hasAdsl="$(db -q get hw.board.hasAdsl)"
hasVdsl="$(db -q get hw.board.hasVdsl)"
local LANPORTS="$(db -q get hw.board.ethernetLanPorts)"
local WANPORTS=""
LANPORTS="$(db -q get hw.board.ethernetLanPorts)"
# populate layer2_interface #
if [ "$hasAdsl" == "1" ]; then
if [ ! -f /etc/config/layer2_interface -o -z "$(uci -q get layer2_interface.capabilities)" ]; then
cat > /etc/config/layer2_interface <<EOF
config dsltype 'vdsl'
option 'enabled' 'on'
ETHDEV=""
PTMDEV=""
ATMDEV=""
WANIFACE=""
config dsltype 'adsl'
option 'enabled' 'on'
device_config_exists() {
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$1" && return 0
return 1
}
config dslsettings 'capabilities'
option 'GDmt' 'Enabled'
option 'Glite' 'Enabled'
option 'T1413' 'Enabled'
option 'ADSL2' 'Enabled'
option 'AnnexL' 'Enabled'
option 'ADSL2plus' 'Enabled'
option 'VDSL2' 'Enabled'
option '8a' 'Enabled'
option '8b' 'Enabled'
option '8c' 'Enabled'
option '8d' 'Enabled'
option '12a' 'Enabled'
option '12b' 'Enabled'
option '17a' 'Enabled'
option '30a' 'Enabled'
option 'US0' 'on'
option 'bitswap' 'on'
option 'sra' 'on'
EOF
populate_dsl_settings() {
if [ "$hasAdsl" == "0" -a "$hasVdsl" == "0" ]; then
rm -f /etc/config/dsl
return
else
touch /etc/config/dsl
fi
elif [ "$hasAdsl" == "0" -a "$hasVdsl" == "0" ]; then
echo "" > /etc/config/layer2_interface
fi
# populate layer2_interface_vdsl #
if [ "$hasVdsl" == "1" ]; then
local wanVdslPort=$(db -q get hw.board.vdslWanPort)
wanVdslPort="${wanVdslPort:-ptm0}"
if [ ! -f /etc/config/layer2_interface_vdsl -o -z "$(uci -q get layer2_interface_vdsl.@vdsl_interface[0].ifname)" ]; then
cat > /etc/config/layer2_interface_vdsl <<EOF
config vdsl_interface
option 'unit' '0'
option 'ifname' '${wanVdslPort}.1'
option 'baseifname' '${wanVdslPort}'
option 'name' 'VDSL2'
option 'dslat' '1'
option 'ptmprio' '1'
option 'ipqos' '1'
EOF
if ! uci -q get dsl.line >/dev/null; then
uci -q set dsl.line="dsl-line"
if [ "$hasAdsl" == "1" ]; then
# Mode
uci -q add_list dsl.line.mode=gdmt
uci -q add_list dsl.line.mode=glite
uci -q add_list dsl.line.mode=t1413
uci -q add_list dsl.line.mode=adsl2
uci -q add_list dsl.line.mode=adsl2p
uci -q add_list dsl.line.mode=annexl
uci -q add_list dsl.line.mode=annexm
uci -q add_list dsl.line.mode=vdsl2
#uci -q add_list dsl.line.mode=gfast
fi
if [ "$hasVdsl" == "1" ]; then
# Mode
uci -q add_list dsl.line.mode=vdsl2
# Profile
uci -q add_list dsl.line.profile=8a
uci -q add_list dsl.line.profile=8b
uci -q add_list dsl.line.profile=8c
uci -q add_list dsl.line.profile=8d
uci -q add_list dsl.line.profile=12a
uci -q add_list dsl.line.profile=12b
uci -q add_list dsl.line.profile=17a
uci -q add_list dsl.line.profile=30a
#uci -q add_list dsl.line.profile=35b
# Capability
uci -q set dsl.line.us0=1
fi
# Capability
uci -q set dsl.line.bitswap=1
uci -q set dsl.line.sra=1
fi
local ifname="$(uci -q get layer2_interface_vdsl.@vdsl_interface[0].ifname)"
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
elif [ "$hasVdsl" == "0" ]; then
echo "" > /etc/config/layer2_interface_vdsl
fi
# populate layer2_interface_adsl #
if [ "$hasAdsl" == "1" ]; then
local wanAdslPort=$(db -q get hw.board.adslWanPort)
wanAdslPort="${wanAdslPort:-atm0}"
if [ ! -f /etc/config/layer2_interface_adsl -o -z "$(uci -q get layer2_interface_adsl.@atm_bridge[0].ifname)" ]; then
cat > /etc/config/layer2_interface_adsl <<EOF
config atm_bridge
option 'link_type' 'EoA'
option 'encapseoa' 'llcsnap_eth'
option 'unit' '0'
option 'ifname' '${wanAdslPort}.1'
option 'baseifname' '${wanAdslPort}'
option 'vpi' '8'
option 'vci' '35'
option 'name' 'DSL8_35'
option 'atmtype' 'ubr'
EOF
uci -q commit dsl
}
populate_atm_device() {
[ "$hasAdsl" == "0" ] && return
# ATM Device
if ! uci -q get dsl.@atm-device[0] >/dev/null; then
uci -q set dsl.atm0=atm-device
uci -q set dsl.atm0.name="ATM835"
uci -q set dsl.atm0.device="atm0"
uci -q set dsl.atm0.vpi="8"
uci -q set dsl.atm0.vci="35"
uci -q set dsl.atm0.qos_class="ubr"
uci -q set dsl.atm0.link_type="eoa"
uci -q set dsl.atm0.encapsulation="llc"
uci -q commit dsl
else
ATMDEV="$(uci -q get dsl.@atm-device[0].device)"
fi
local ifname="$(uci -q get layer2_interface_adsl.@atm_bridge[0].ifname)"
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
elif [ "$hasAdsl" == "0" ]; then
echo "" > /etc/config/layer2_interface_adsl
fi
# populate layer2_interface_ethernet #
if [ "$hasEthWan" == "1" ]; then
local wanEthernetPort="$(db -q get hw.board.ethernetWanPort)"
wanEthernetPort="${wanEthernetPort:-eth0}"
if [ ! -f /etc/config/layer2_interface_ethernet -o -z "$(uci -q get layer2_interface_ethernet.@ethernet_interface[0].ifname)" ]; then
cat > /etc/config/layer2_interface_ethernet <<EOF
config ethernet_interface 'Wan'
option name 'WAN'
option baseifname '${wanEthernetPort}'
option ifname '${wanEthernetPort}.1'
EOF
ATMDEV="${ATMDEV:-atm0}"
WANIFACE="$ATMDEV.1"
device_config_exists "$WANIFACE" && return
uci -q set network.atmwan=device
uci -q set network.atmwan.type=untagged
uci -q set network.atmwan.ifname="$ATMDEV"
uci -q set network.atmwan.name="$WANIFACE"
}
populate_ptm_device() {
[ "$hasVdsl" == "0" ] && return
# PTM Device
if ! uci -q get dsl.@ptm-device[0] >/dev/null; then
uci -q set dsl.ptm0=atm-device
uci -q set dsl.ptm0.name="PTM"
uci -q set dsl.ptm0.device="ptm0"
uci -q set dsl.ptm0.priority="1"
uci -q set dsl.ptm0.portid="1"
uci -q commit dsl
else
PTMDEV="$(uci -q get dsl.@ptm-device[0].device)"
fi
local ifname="$(uci -q get layer2_interface_ethernet.@ethernet_interface[0].ifname)"
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
elif [ "$hasEthWan" == "0" ]; then
echo "" > /etc/config/layer2_interface_ethernet
fi
# populate network config ifnames #
uci -q get network.lan.ifname >/dev/null || uci -q set network.lan.ifname="$LANPORTS"
uci -q get network.wan.ifname >/dev/null || uci -q set network.wan.ifname="$WANPORTS"
uci commit network
PTMDEV="${PTMDEV:-ptm0}"
sync
WANIFACE="$PTMDEV.1"
device_config_exists "$PTMDEV" && return
uci -q set network.ptmwan=device
uci -q set network.ptmwan.type=untagged
uci -q set network.ptmwan.ifname="$PTMDEV"
uci -q set network.ptmwan.name="$WANIFACE"
}
populate_eth_device() {
[ "$hasEthWan" == "0" ] && return
ETHDEV="$(db -q get hw.board.ethernetWanPort)"
WANIFACE="$ETHDEV.1"
device_config_exists "$WANIFACE" && return
uci -q set network.ethwan=device
uci -q set network.ethwan.type=untagged
uci -q set network.ethwan.ifname="$ETHDEV"
uci -q set network.ethwan.name="$WANIFACE"
}
populate_network_config_ifnames() {
# LAN ports
uci -q get network.lan.ifname >/dev/null || uci -q set network.lan.ifname="$LANPORTS"
[ $((hasEthWan+hasAdsl+hasVdsl)) -eq 0 ] && {
uci -q commit network
return
}
WANTYPE="$(uci -q get network.wan.type)"
[ "$WANTYPE" == "anywan" ] && {
uci -q delete network.wan.type
uci -q set network.wan.ifname="$WANIFACE"
}
uci -q get network.wan.ifname >/dev/null || uci -q set network.wan.ifname="$WANIFACE"
uci -q commit network
}
populate_dsl_settings
populate_atm_device
populate_ptm_device
populate_eth_device
populate_network_config_ifnames

View File

@@ -1,386 +0,0 @@
wlmngr_setupTPs() {
local pid_nic0=$(pgrep wl0-kthrd)
local pid_nic1=$(pgrep wl1-kthrd)
local pid_dhd0=$(pgrep dhd0_dpc)
local pid_dhd1=$(pgrep dhd1_dpc)
local pid_wfd0=$(pgrep wfd0-thrd)
local pid_wfd1=$(pgrep wfd1-thrd)
local pid_wl0=${pid_dhd0:-$pid_nic0}
local pid_wl1=${pid_dhd1:-$pid_nic1}
# set affinity
if [ -n "$pid_wl0" -a -n "$pid_wl1" ]; then
# bind to TP0
taskset -p 1 $pid_wl0
# bind to TP1
taskset -p 2 $pid_wl1
else
if [ "$pid_wl0" == "$pid_dhd0" ]; then
# bind to TP0
taskset -p 1 $pid_wl0
else
# bind to TP1
taskset -p 2 $pid_wl0
fi
fi
# set priority
local pid pids
pids="$pid_wl0 $pid_wl1 $pid_wfd0 $pid_wfd1"
for pid in $pids; do
chrt -rp 5 $pid
done
}
wlmngr_stopServices() {
local idx=$1
killall -q -9 lld2d 2>/dev/null
killall -q -9 wps_ap 2>/dev/null
killall -q -9 wps_enr 2>/dev/null
killall -q -15 wps_monitor 2>/dev/null # Kill Child Thread first, -15: SIGTERM to force to remove WPS IE
killall -15 bcmupnp 2>/dev/null # -15: SIGTERM, force bcmupnp to send SSDP ByeBye message out (refer to CR18802)
rm -rf /var/bcmupnp.pid
killall -q -9 nas 2>/dev/null
killall -q -9 eapd 2>/dev/null
killall -q -9 acsd 2>/dev/null
nvram unset acs_ifnames # remove wlidx only
killall -q -15 wapid
killall -q -15 hspotap
killall -q -15 bsd
killall -q -15 ssd
killall -q -9 vis-datacollector
killall -q -9 vis-dcon
}
wlmngr_WlConfDown() {
local idx=$1
wlconf wl$idx down
wlctl -i wl$idx chanspec 36/80
}
wlmngr_setSsid() {
# local idx=$1
# for vif in $(nvram get "wl$idx"_vifs); do
# wlctl -i wl$idx ssid -C $vifno $(nvram get "$vif"_ssid)
# done
return
}
wlmngr_wlIfcDown() {
local idx=$1
for vif in wl$idx $(nvram get "wl$idx"_vifs); do
ifconfig $vif down
done
}
wlmngr_doWlConf() {
local idx=$1;
#wlctl -i wl$idx nreqd $nreqd
wlconf wl$idx up
wlctl -i wl$idx obss_coex 1
}
wlmngr_setupMbssMacAddr() {
local idx=$1
local hwaddr
for vif in $(nvram get "wl$idx"_vifs); do
hwaddr=$(nvram get "$vif"_hwaddr)
ifconfig $vif hw ether $hwaddr 2>/dev/null
wlctl -i $vif cur_etheraddr $hwaddr 2>/dev/null
done
}
#enableSSD() {
# nvram set ssd_enable=0
# [ act_wl_cnt == 0 ] && return FALSE
# for i in wl0 wl1; do
# if [ m_instance_wl[i].m_wlVar.wlEnbl == TRUE && m_instance_wl[i].m_wlVar.ssdEnable > 0 ]; then
# nvram set ssd_enable=m_instance_wl[i].m_wlVar.ssdEnable
# return TRUE
# fi
# done
# return FALSE
#}
wlmngr_startServices() {
local idx=$1
#bcmupnp -D
lld2d br-lan # $(nvram get lan_ifname)
eapd
nas
acsd
# wlmngr_startWsc() {
# return
# }
# wlmngr_startSes() {
# if [ m_instance_wl[idx].m_wlVar.wlSesEnable == FALSE ]; then
# return
# fi
# ses -f
# }
# wlmngr_startSesCl() {
# if [ m_instance_wl[idx].m_wlVar.wlSesClEnable == FALSE ]; then
# return
# fi
# ses_cl -f
# }
# wapid
# wlmngr_BSDCtrl() {
# killall -q -15 bsd 2>/dev/null
# if [ "$(enableBSD)" == "TRUE" ]; then
# bsd&
# fi
# }
# wlmngr_SSDCtrl(){
# killall -q -15 ssd 2>/dev/null
# if [ "$(enableSSD)" == "TRUE" ]; then
# ssd&
# fi
# }
}
enableBSD() {
local wdev wdev_to_steer
local enabled policy
local rssi_threshold bw_util
nvram set bsd_role=0
nvram unset bsd_ifnames
enabled="$(uci -q get wireless.bandsteering.enabled)"
[ "$enabled" == "1" ] || return 1
policy="$(uci -q get wireless.bandsteering.policy)"
policy=${policy:-0}
rssi_threshold="$(uci -q get wireless.bandsteering.rssi_threshold)"
rssi_threshold=${rssi_threshold:--75}
bw_util="$(uci -q get wireless.bandsteering.bw_util)"
bw_util=${bw_util:--60}
nvram set bsd_role=3
nvram set bsd_pport=9878
nvram set bsd_hpport=9877
nvram set bsd_helper=192.168.1.2
nvram set bsd_primary=192.168.1.1
nvram set bsd_scheme=2
nvram set bsd_poll_interval=1
nvram set bsd_bounce_detect="180 2 3600"
nvram set bsd_msglevel=0
nvram set bsd_status_poll=5
nvram set bsd_status=3
nvram set bsd_actframe=1
nvram set bsd_steer_no_deauth=1
for wdev in wl0 wl1; do
#if [ "$(uci -q get wireless.$wdev.band_steering)" == "1" ]; then
nvram set bsd_ifnames="$(nvram get bsd_ifnames) $wdev"
[ "$wdev" == "wl0" ] && wdev_to_steer="wl1" || wdev_to_steer="wl0"
if [ "$policy" == "0" ]; then
# RSSI Threshold based policy #
if [ "$(nvram get ${wdev}_nband)" == "2" ]; then
# 2.4G
nvram set ${wdev}_bsd_if_qualify_policy="0 0x0"
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
nvram set ${wdev}_bsd_sta_select_policy="20 -60 0 0 1 0 0 0 0 0x42"
nvram set ${wdev}_bsd_steer_prefix=$wdev
nvram set ${wdev}_bsd_steering_policy="0 0 0 -60 0 0x52"
else
# 5G
nvram set ${wdev}_bsd_if_qualify_policy="30 0x0"
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
nvram set ${wdev}_bsd_sta_select_policy="20 $rssi_threshold 0 0 1 0 0 0 0 0x40"
nvram set ${wdev}_bsd_steer_prefix=$wdev
nvram set ${wdev}_bsd_steering_policy="80 5 3 $rssi_threshold 0 0x40"
fi
else
# Bandwidth Usage based policy #
if [ "$(nvram get ${wdev}_nband)" == "2" ]; then
# 2.4G
nvram set ${wdev}_bsd_if_qualify_policy="0 0x0 -75"
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
nvram set ${wdev}_bsd_sta_select_policy="0 0 0 0 0 1 0 0 0 0x600"
nvram set ${wdev}_bsd_steer_prefix=$wdev
nvram set ${wdev}_bsd_steering_policy="0 5 3 0 0 0x10"
else
# 5G
nvram set ${wdev}_bsd_if_qualify_policy="40 0x0 -75"
nvram set ${wdev}_bsd_if_select_policy=$wdev_to_steer
nvram set ${wdev}_bsd_sta_select_policy="0 0 0 0 0 1 0 0 0 0x240"
nvram set ${wdev}_bsd_steer_prefix=$wdev
nvram set ${wdev}_bsd_steering_policy="$bw_util 5 3 0 0 0x40"
fi
fi
#fi
done
return 0
}
wlmngr_BSDCtrl() {
killall -q -15 bsd 2>/dev/null
if $(enableBSD); then
bsd&
fi
}
wlmngr_startWsc()
{
local idx=$1
local wlunit
wlunit=$(nvram get wl_unit)
[ -n $wlunit ] && nvram set wl_unit=0
nvram set wps_mode=enabled # "enabled/disabled"
nvram set wl_wps_config_state=1 # "1/0"
nvram set wl_wps_reg="enabled"
nvram set lan_wps_reg=enabled #"enabled/disabled"
nvram set wps_uuid=0x000102030405060708090a0b0c0d0ebb
nvram set wps_device_name=Inteno
nvram set wps_mfstring=Broadcom
nvram set wps_modelname=Broadcom
nvram set wps_modelnum=123456
nvram set boardnum=1234
nvram set wps_timeout_enable=0
#nvram get wps_config_method
nvram set wps_version2=enabled # extra
nvram set wps_oob_configured=1
nvram set lan_wps_oob=disabled # extra
nvram set lan_wps_reg=enabled # extra
if [ "$(nvram get wps_version2)" == "enabled" ]; then
nvram set _wps_config_method=sta-pin
else
nvram set _wps_config_method=pbc
fi
nvram set wps_config_command=0
nvram set wps_status=0
nvram set wps_method=1
nvram set wps_proc_mac=""
if [ "$(nvram get wps_restart)" == "1" ]; then
nvram set wps_restart=0
else
nvram set wps_restart=0
nvram set wps_proc_status=0
fi
nvram set wps_sta_pin=00000000
nvram set wps_currentband=""
nvram set wps_autho_sta_mac="00:00:00:00:00:00"
wps_monitor&
}
wlmngr_issueWpsCmd() {
return
}
wlmngr_WlConfStart() {
local idx=$1
wlconf wl$idx up
}
wlmngr_wlIfcUp() {
local idx=$1
for vif in wl$idx $(nvram get "wl$idx"_vifs); do
if [ "$(nvram get "$vif"_bss_enabled)" == "1" ]; then
ifconfig $vif up 2>/dev/null
wlctl -i $vif bss up # extra
else
ifconfig $vif down
fi
done
case "$(uci -q get wireless.wl$idx.monitor)" in
1)
wlctl -i wl$idx monitor 1
ifconfig prism$idx up
;;
2)
wlctl -i wl$idx monitor 2
ifconfig radiotap$idx up
;;
*)
wlctl -i wl$idx monitor 0
;;
esac
}
wlmngr_doWds() {
return
}
wlmngr_doQoS() {
local idx=$1
for vif in wl$idx $(nvram get "wl$idx"_vifs); do
ebtables -t nat -D POSTROUTING -o $vif -p IPV4 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $vif -p IPV6 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $vif -p 802_1Q -j wmm-mark --wmm-marktag vlan 2>/dev/null
if [ "$(nvram get "$vif"_bss_enabled)" == "1" ]; then
ebtables -t nat -A POSTROUTING -o $vif -p IPV4 -j wmm-mark 2>/dev/null
ebtables -t nat -A POSTROUTING -o $vif -p IPV6 -j wmm-mark 2>/dev/null
ebtables -t nat -A POSTROUTING -o $vif -p 802_1Q -j wmm-mark --wmm-marktag vlan 2>/dev/null
fi
done
}
wlmngr_finalize() {
local idx=$1
wlctl -i wl$idx phy_watchdog 1
wlctl -i wl$idx fcache 1
# RADAR THRESHOLD VALUES #
local pcid="$(wlctl -i wl$idx revinfo | awk 'FNR == 2 {print}' | cut -d'x' -f2)"
local isac="$(db get hw.$pcid.is_ac)"
if [ "$isac" == "1" ]; then
wlctl -i wl$idx msglevel +radar +dfs 2>/dev/null
dhdctl -i wl$idx dconpoll 200 2>/dev/null
fi
local rdrthrs="$(db get hw.$pcid.radarthrs)"
if [ -n "$rdrthrs" ]; then
wlctl -i wl$idx radarthrs $rdrthrs
fi
# send ARP packet with bridge IP and hardware address to device
# this piece of code is -required- to make br-lan's mac work properly
# in all cases
sendarp -s br-lan -d br-lan
}
wlmngr_issueServiceCmd() {
return
}
wlmngr_HspotCtrl() {
killall -q -15 hspotap 2>/dev/null
if [ "$(enableHspot)" == "TRUE" ]; then
hspotap&
fi
}
wlmngr_postStart() {
return
}

View File

@@ -1,42 +0,0 @@
#!/bin/sh
remove_ebtables_bridge_rules ()
{
ebtables -D FORWARD -p ip --ip-protocol 17 --ip-destination-port 68 -j SKIPLOG 2>/dev/null
ebtables -D FORWARD -p ip --ip-destination 255.255.255.255 -j SKIPLOG 2>/dev/null
}
#bypass fap acceleration forwarding for dhcp in bridge mode
create_ebtables_bridge_rules ()
{
ebtables -A FORWARD -p ip --ip-protocol 17 --ip-destination-port 68 -j SKIPLOG
ebtables -A FORWARD -p ip --ip-destination 255.255.255.255 -j SKIPLOG
}
# is called when a Wifi SSID is enabled with wme, which automatically
# enables its QoS queues
remove_ebtables_wme_rules ()
{
local wifi_int=$1
ebtables -t nat -D POSTROUTING -o $wifi_int -p IPV4 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $wifi_int -p IPV6 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $wifi_int -p 802_1Q -j wmm-mark --wmm-marktag vlan 2>/dev/null
}
add_ebtables_wme_rules ()
{
local wifi_int=$1
ebtables -t nat -A POSTROUTING -o $wifi_int -p IPV4 -j wmm-mark >/dev/null
ebtables -t nat -A POSTROUTING -o $wifi_int -p IPV6 -j wmm-mark >/dev/null
ebtables -t nat -A POSTROUTING -o $wifi_int -p 802_1Q -j wmm-mark --wmm-marktag vlan >/dev/null
}
add_ebtables_default_arp ()
{
ebtables -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
}
remove_ebtables_default_arp ()
{
ebtables -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
}

View File

@@ -1,266 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/network/ebtables.sh
removeall_vlandevices()
{
local vif
local i
for i in `ls /proc/sys/net/ipv4/conf`; do
case "$i" in
[eap][t][mh][0-9].v1)
;;
[eap][t][mh][0-9].1)
;;
[eap][t][mh][0-9].[v0-9]*)
vlanctl --if-delete $i
;;
esac
done
}
removevlan()
{
vlanctl --if-delete $1
}
ifvlanexits()
{
local vif=$1
local i
for i in `ls /proc/sys/net/ipv4/conf`; do
if [ "$i" == "$vif" ]; then
return 1
fi
done
return 0
}
ifbaseexists()
{
local if=$1
if [ -d /sys/class/net/$if ]; then
ifcarrier="/sys/class/net/$if/carrier"
if [ -f $ifcarrier ] && [ "$(cat $ifcarrier)" == "1" ]; then
return 1
else
json_load "$(devstatus "$if")"
json_get_var link link
if [ "$link" == "1" ]; then
return 1
fi
fi
fi
return 0
}
check_mac_address()
{
local baseifname="$1"
local vlan="$2"
local basemac
local mac=$(ifconfig -a | grep "^${baseifname}.${vlan} " | awk '{print $NF}')
local mac_in_use=$(ifconfig -a | grep "$mac" | grep -v "^${baseifname}.${vlan}[ ]")
if [ "$mac_in_use" ]; then
basemac=$(ifconfig -a | grep "^$baseifname " | awk '{print $NF}')
ifconfig ${baseifname}.${vlan} hw ether $basemac
fi
}
addbrcmvlan()
{
local baseifname=$1
local vlan8021p=$2
local vlan8021q=$3
local bridge=$4
local ifname=$5
bridge="${bridge:-0}"
ifbaseexists $baseifname
ret=$?
if [ "$ret" -eq 1 ]; then
ifvlanexits "$ifname"
ret=$?
echo "first ret=$ret"
if [ "$ret" -eq 0 ]; then
ifconfig $baseifname up
echo "vlanctl --if-create $ifname" > /dev/console
local unmanaged=0
local nets net typ proto
nets=$(get_network_of "$ifname")
for net in $nets; do
typ=$(uci -q get network."$net".type)
proto=$(uci -q get network."$net".proto)
proto="${proto:-none}"
if [ "$typ" == "bridge" ]; then
bridge=1
if [ "$proto" == "none" ]; then
unmanaged=1
break
fi
fi
done
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
ifconfig $baseifname up
if [ "$bridge" -eq 1 ]; then
if [ "$unmanaged" == "1" ]; then
vlanctl --if-create $baseifname $vlan8021q
else
vlanctl --dhcp-bridged --if-create $baseifname $vlan8021q
check_mac_address $baseifname $vlan8021q
fi
else
vlanctl --routed --if-create $baseifname $vlan8021q
check_mac_address $baseifname $vlan8021q
fi
if [ "$bridge" -eq 1 ]; then
vlanctl --if $baseifname --set-if-mode-rg
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
# tags 0 tx
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 1 tx
vlanctl --if $baseifname --tx --tags 1 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 2 tx
vlanctl --if $baseifname --tx --tags 2 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
else
vlanctl --if $baseifname --set-if-mode-rg
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
# tags 0 tx
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 0 rx
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --filter-vlan-dev-mac-addr 1 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --filter-vlan-dev-mac-addr 1 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
fi
ifconfig $ifname up
ifconfig $ifname multicast
fi
fi
}
update_last_mac_group()
{
local ifname=$1
local last_mac_group=$2
local full_mac modified_mac dev_mac
full_mac="$(ifconfig $ifname | awk '{print $NF; exit}')"
[ "${full_mac}" == "" ] && return
modified_mac="${full_mac:0:15}${last_mac_group}"
devs="wl0 wl1 bcmsw"
for dev in $devs; do
dev_mac="$(ifconfig $dev | awk '{print $NF; exit}')"
if [ "$dev_mac" == "$modified_mac" ]; then
return
fi
done
ifconfig $ifname hw ether "${modified_mac}"
}
brcm_virtual_interface_rules()
{
local baseifname=$1
local ifname=$2
local bridge=$3
local last_mac_group=$4
bridge="${bridge:-0}"
local unmanaged=0
local nets net typ proto
nets=$(get_network_of "$ifname")
for net in $nets; do
typ=$(uci -q get network."$net".type)
proto=$(uci -q get network."$net".proto)
proto="${proto:-none}"
if [ "$typ" == "bridge" ]; then
bridge=1
if [ "$proto" == "none" ]; then
unmanaged=1
break
fi
fi
done
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
ifconfig $baseifname up
if [ "$bridge" -eq 1 ]; then
if [ "$unmanaged" == "1" ]; then
vlanctl --if-create-name $baseifname $ifname
else
vlanctl --dhcp-bridged --if-create-name $baseifname $ifname
fi
else
vlanctl --routed --if-create-name $baseifname $ifname
fi
[ "$bridge" -eq 1 ] && create_ebtables_bridge_rules
#set default RG mode
vlanctl --if $baseifname --set-if-mode-rg
#Set Default Droprules
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --rule-insert-before -1
if [ "$bridge" -eq 1 ]; then
# tags 1 tx
vlanctl --if $baseifname --tx --tags 1 --filter-txif $ifname --rule-insert-before -1
# tags 2 tx
vlanctl --if $baseifname --tx --tags 2 --filter-txif $ifname --rule-insert-before -1
# tags 0 rx
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --rule-insert-last
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --rule-insert-last
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --rule-insert-last
else
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 0 rx
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 1 --rule-insert-before -1
fi
if [ "$last_mac_group" != "" ]; then
update_last_mac_group $ifname $last_mac_group
fi
ifconfig $ifname up
ifconfig $ifname multicast
}

42
libpicoevent/Makefile Normal file
View File

@@ -0,0 +1,42 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=0.1
PKG_SOURCE_URL:=git@public.inteno.se:libpicoevent.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c96770b32f66c6e799f8430d8e85d94780358135
PKG_NAME:=libpicoevent
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
define Package/libpicoevent
CATEGORY:=Libraries
TITLE:=Libpicoevent
URL:=
DEPENDS:=
endef
define Package/libpicoevent/description
Minimal event library
endef
define Package/libpicoevent/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
$(CP) $(PKG_BUILD_DIR)/libpicoevent.h $(STAGING_DIR)/usr/include
$(CP) $(PKG_BUILD_DIR)/libpicoevent.so $(STAGING_DIR)/usr/lib
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libpicoevent.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,libpicoevent))

View File

@@ -1,14 +0,0 @@
choice
depends on PACKAGE_libstrophe
prompt "Select XML library"
default libstrophe-expat
config libstrophe-expat
bool "expat"
select PACKAGE_libexpat
config libstrophe-libxml2
bool "libxml2"
select PACKAGE_libxml2
endchoice

View File

@@ -1,61 +0,0 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libstrophe
PKG_VERSION:=0.8.8
PKG_RELEASE=1
PKG_SOURCE_URL:=https://github.com/strophe/libstrophe/archive/
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_libstrophe-libxml2 \
CONFIG_libstrophe-expat
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_libstrophe-libxml2),y)
CONFIGURE_ARGS += \
--with-libxml2
endif
define Package/libstrophe
SECTION:=libs
CATEGORY:=Libraries
TITLE:=XMPP client library
URL:=http://strophe.im/libstrophe
DEPENDS:= +libopenssl +libstrophe-libxml2:libxml2 +libstrophe-expat:libexpat
MENU:=1
endef
define Package/libstrophe/description
A simple, lightweight C library for writing XMPP clients
endef
define Package/libstrophe/config
source "$(SOURCE)/Config.in"
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/
$(CP) $(PKG_INSTALL_DIR)/usr/include/ $(1)/usr/
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrophe.{la,a,so*} $(1)/usr/lib/
endef
define Package/libstrophe/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libstrophe.so.* $(1)/usr/lib
endef
$(eval $(call BuildPackage,libstrophe))

View File

@@ -1,221 +0,0 @@
diff --git a/src/auth.c b/src/auth.c
index b3056a2..2673bdf 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -455,7 +455,7 @@ static int _handle_scram_sha1_challenge(xmpp_conn_t * const conn,
if (!text)
goto err;
- challenge = (char *)base64_decode(conn->ctx, text, strlen(text));
+ challenge = (char *)strophe_base64_decode(conn->ctx, text, strlen(text));
xmpp_free(conn->ctx, text);
if (!challenge)
goto err;
@@ -515,7 +515,7 @@ static char *_get_nonce(xmpp_ctx_t *ctx)
*(time_t *)(buffer + sizeof(clock_t)) = (time_t)rand();
}
- return base64_encode(ctx, buffer, sizeof(buffer));
+ return strophe_base64_encode(ctx, buffer, sizeof(buffer));
}
static char *_make_scram_sha1_init_msg(xmpp_conn_t * const conn)
@@ -662,7 +662,7 @@ static void _auth(xmpp_conn_t * const conn)
return;
}
- str = (char *)base64_encode(conn->ctx, (unsigned char *)scram_init,
+ str = (char *)strophe_base64_encode(conn->ctx, (unsigned char *)scram_init,
strlen(scram_init));
if (!str) {
xmpp_free(conn->ctx, scram_init);
diff --git a/src/sasl.c b/src/sasl.c
index 3d83fd0..b6f2b89 100644
--- a/src/sasl.c
+++ b/src/sasl.c
@@ -46,7 +46,7 @@ char *sasl_plain(xmpp_ctx_t *ctx, const char *authid, const char *password) {
memcpy(msg+1, authid, idlen);
msg[1+idlen] = '\0';
memcpy(msg+1+idlen+1, password, passlen);
- result = base64_encode(ctx, (unsigned char *)msg, 2 + idlen + passlen);
+ result = strophe_base64_encode(ctx, (unsigned char *)msg, 2 + idlen + passlen);
xmpp_free(ctx, msg);
}
@@ -92,7 +92,7 @@ static hash_t *_parse_digest_challenge(xmpp_ctx_t *ctx, const char *msg)
char *key, *value;
unsigned char *s, *t;
- text = base64_decode(ctx, msg, strlen(msg));
+ text = strophe_base64_decode(ctx, msg, strlen(msg));
if (text == NULL) {
xmpp_error(ctx, "SASL", "couldn't Base64 decode challenge!");
return NULL;
@@ -344,7 +344,7 @@ char *sasl_digest_md5(xmpp_ctx_t *ctx, const char *challenge,
hash_release(table); /* also frees value strings */
/* reuse response for the base64 encode of our result */
- response = base64_encode(ctx, (unsigned char *)result, strlen(result));
+ response = strophe_base64_encode(ctx, (unsigned char *)result, strlen(result));
xmpp_free(ctx, result);
return response;
@@ -396,7 +396,7 @@ char *sasl_scram_sha1(xmpp_ctx_t *ctx, const char *challenge,
goto out;
}
- sval = (char *)base64_decode(ctx, s, strlen(s));
+ sval = (char *)strophe_base64_decode(ctx, s, strlen(s));
if (!sval) {
goto out;
}
@@ -426,7 +426,7 @@ char *sasl_scram_sha1(xmpp_ctx_t *ctx, const char *challenge,
sign[j] ^= key[j];
}
- sign_b64 = base64_encode(ctx, sign, sizeof(sign));
+ sign_b64 = strophe_base64_encode(ctx, sign, sizeof(sign));
if (!sign_b64) {
goto out_response;
}
@@ -439,7 +439,7 @@ char *sasl_scram_sha1(xmpp_ctx_t *ctx, const char *challenge,
strcat(response, sign_b64);
xmpp_free(ctx, sign_b64);
- response_b64 = base64_encode(ctx, (unsigned char *)response,
+ response_b64 = strophe_base64_encode(ctx, (unsigned char *)response,
strlen(response));
if (!response_b64) {
goto out_response;
@@ -501,7 +501,7 @@ int base64_encoded_len(xmpp_ctx_t *ctx, const unsigned len)
return ((len + 2)/3) << 2;
}
-char *base64_encode(xmpp_ctx_t *ctx,
+char *strophe_base64_encode(xmpp_ctx_t *ctx,
const unsigned char * const buffer, const unsigned len)
{
int clen;
@@ -579,7 +579,7 @@ int base64_decoded_len(xmpp_ctx_t *ctx,
return 3 * (len >> 2) - nudge;
}
-unsigned char *base64_decode(xmpp_ctx_t *ctx,
+unsigned char *strophe_base64_decode(xmpp_ctx_t *ctx,
const char * const buffer, const unsigned len)
{
int dlen;
diff --git a/src/sasl.h b/src/sasl.h
index bc7511a..98c27bf 100644
--- a/src/sasl.h
+++ b/src/sasl.h
@@ -32,13 +32,13 @@ char *sasl_scram_sha1(xmpp_ctx_t *ctx, const char *challenge,
int base64_encoded_len(xmpp_ctx_t *ctx, const unsigned len);
-char *base64_encode(xmpp_ctx_t *ctx,
+char *strophe_base64_encode(xmpp_ctx_t *ctx,
const unsigned char * const buffer, const unsigned len);
int base64_decoded_len(xmpp_ctx_t *ctx,
const char * const buffer, const unsigned len);
-unsigned char *base64_decode(xmpp_ctx_t *ctx,
+unsigned char *strophe_base64_decode(xmpp_ctx_t *ctx,
const char * const buffer, const unsigned len);
#endif /* _LIBXMPP_SASL_H__ */
diff --git a/tests/test_base64.c b/tests/test_base64.c
index 9e16862..82995b4 100644
--- a/tests/test_base64.c
+++ b/tests/test_base64.c
@@ -45,31 +45,31 @@ static const char base64_5[] =
int test_encode(xmpp_ctx_t *ctx)
{
char *result;
- result = base64_encode(ctx, text_1, strlen(text_1));
+ result = strophe_base64_encode(ctx, text_1, strlen(text_1));
if (result == NULL) return 2;
if (strlen(result) != strlen(base64_1)) return 1;
if (strncmp(base64_1, result, strlen(base64_1))) return 1;
xmpp_free(ctx,result);
- result = base64_encode(ctx, text_2, strlen(text_2));
+ result = strophe_base64_encode(ctx, text_2, strlen(text_2));
if (result == NULL) return 2;
if (strlen(result) != strlen(base64_2)) return 1;
if (strncmp(base64_2, result, strlen(base64_2))) return 1;
xmpp_free(ctx,result);
- result = base64_encode(ctx, text_3, strlen(text_3));
+ result = strophe_base64_encode(ctx, text_3, strlen(text_3));
if (result == NULL) return 2;
if (strlen(result) != strlen(base64_3)) return 1;
if (strncmp(base64_3, result, strlen(base64_3))) return 1;
xmpp_free(ctx,result);
- result = base64_encode(ctx, text_4, strlen(text_4));
+ result = strophe_base64_encode(ctx, text_4, strlen(text_4));
if (result == NULL) return 2;
if (strlen(result) != strlen(base64_4)) return 1;
if (strncmp(base64_4, result, strlen(base64_4))) return 1;
xmpp_free(ctx,result);
- result = base64_encode(ctx, text_5, strlen(text_5));
+ result = strophe_base64_encode(ctx, text_5, strlen(text_5));
if (result == NULL) return 2;
if (strlen(result) != strlen(base64_5)) return 1;
if (strncmp(base64_5, result, strlen(base64_5))) return 1;
@@ -83,31 +83,31 @@ int test_decode(xmpp_ctx_t *ctx)
{
unsigned char *result;
- result = base64_decode(ctx, base64_1, strlen(base64_1));
+ result = strophe_base64_decode(ctx, base64_1, strlen(base64_1));
if (result == NULL) return 2;
if (strlen(result) != strlen(text_1)) return 1;
if (strncmp(text_1, result, strlen(text_1))) return 1;
xmpp_free(ctx,result);
- result = base64_decode(ctx, base64_2, strlen(base64_2));
+ result = strophe_base64_decode(ctx, base64_2, strlen(base64_2));
if (result == NULL) return 2;
if (strlen(result) != strlen(text_2)) return 1;
if (strncmp(text_2, result, strlen(text_2))) return 1;
xmpp_free(ctx,result);
- result = base64_decode(ctx, base64_3, strlen(base64_3));
+ result = strophe_base64_decode(ctx, base64_3, strlen(base64_3));
if (result == NULL) return 2;
if (strlen(result) != strlen(text_3)) return 1;
if (strncmp(text_3, result, strlen(text_3))) return 1;
xmpp_free(ctx,result);
- result = base64_decode(ctx, base64_4, strlen(base64_4));
+ result = strophe_base64_decode(ctx, base64_4, strlen(base64_4));
if (result == NULL) return 2;
if (strlen(result) != strlen(text_4)) return 1;
if (strncmp(text_4, result, strlen(text_4))) return 1;
xmpp_free(ctx,result);
- result = base64_decode(ctx, base64_5, strlen(base64_5));
+ result = strophe_base64_decode(ctx, base64_5, strlen(base64_5));
if (result == NULL) return 2;
if (strlen(result) != strlen(text_5)) return 1;
if (strncmp(text_5, result, strlen(text_5))) return 1;
@@ -130,13 +130,13 @@ int main(int argc, char *argv[])
printf("testing encode... ");
ret = test_encode(ctx);
- if (ret) printf("base64_encode failed!\n");
+ if (ret) printf("strophe_base64_encode failed!\n");
if (ret) return ret;
printf("ok.\n");
printf("testing decode... ");
ret = test_decode(ctx);
- if (ret) printf("base64_decode failed!\n");
+ if (ret) printf("strophe_base64_decode failed!\n");
if (ret) return ret;
printf("ok.\n");

17
owsd/Config.in Normal file
View File

@@ -0,0 +1,17 @@
choice
prompt "Select Bus"
default OWSD_USE_UBUS
depends on PACKAGE_owsd
help
Select which bus to compile owsd for
config OWSD_USE_DBUS
bool "Use DBUS"
config OWSD_USE_UBUS
bool "Use UBUS"
config OWSD_USE_DBUS_UBUS
bool "Use UBUS and DBUS"
endchoice

111
owsd/Makefile Normal file
View File

@@ -0,0 +1,111 @@
#
# Copyright (C) 2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=owsd
PKG_VERSION:=1.1.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO=git
PKG_SOURCE_URL:=http://public.inteno.se/owsd.git
PKG_SOURCE_VERSION:=1a815efff25ae4d52bfee67cc4642eb4627f1388
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
PKG_MAINTAINER:=Sartura Support for Inteno <support-inteno@sartura.hr>
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS
USE_UBUS-y:=-DWSD_HAVE_UBUS=ON
USE_DBUS-y:=-DWSD_HAVE_DBUS=ON
USE_BOTH-y:=${USE_UBUS-y} ${USE_DBUS-y}
CMAKE_OPTIONS:=${USE_UBUS-${CONFIG_OWSD_USE_UBUS}} \
${USE_DBUS-${CONFIG_OWSD_USE_DBUS}} \
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}}
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/owsd
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libjson-c +libblobmsg-json +libwebsockets +ubox \
+OWSD_USE_UBUS:ubus \
+OWSD_USE_DBUS:libdbus \
+OWSD_USE_DBUS:libxml2 \
+OWSD_USE_DBUS:dbus \
+OWSD_USE_DBUS_UBUS:ubus \
+OWSD_USE_DBUS_UBUS:libdbus \
+OWSD_USE_DBUS_UBUS:libxml2 \
+OWSD_USE_DBUS_UBUS:dbus
TITLE:=owsd daemon
MENU:=1
endef
define Package/owsd/config
source "$(SOURCE)/Config.in"
endef
define Package/owsd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owsd $(1)/usr/bin/owsd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/owsd.init $(1)/etc/init.d/owsd
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/owsd.config $(1)/etc/config/owsd
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/owsd.hotplug $(1)/etc/hotplug.d/iface/55-owsd
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
endef
define Package/owsd-testdata
$(call Package/owsd)
TITLE += (Test certs and rpcd ACLs for running automated tests)
DEPENDS := owsd +rpcd-mod-file
endef
define Package/owsd/description
Web socket ubus daemon
endef
define Package/owsd-testdata/install
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
$(INSTALL_DATA) $(PKG_BUILD_DIR)/res/owsd-test.json $(1)/usr/share/rpcd/acl.d/owsd-test.json
$(INSTALL_DIR) $(1)/usr/share/owsd/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/res/cert.pem $(1)/usr/share/owsd/cert.pem
$(INSTALL_DATA) $(PKG_BUILD_DIR)/res/key.pem $(1)/usr/share/owsd/key.pem
$(INSTALL_DIR) $(1)/www/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/res/webdemo/index.html $(1)/www/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/res/webdemo/script.js $(1)/www/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/res/webdemo/style.css $(1)/www/
endef
define Package/owsd-testdata/postinst
#!/bin/sh
set -e
uci delete rpcd.owsd_test 2>/dev/null || true
uci set rpcd.owsd_test=login
uci set rpcd.owsd_test.username="owsd_test"
uci set rpcd.owsd_test.password="x"
uci add_list rpcd.owsd_test.read='test-calls'
uci add_list rpcd.owsd_test.read='test-events'
uci commit
endef
define Package/owsd-testdata/prerm
#!/bin/sh
set -e
uci delete rpcd.owsd_test
uci commit
endef
$(eval $(call BuildPackage,owsd))
$(eval $(call BuildPackage,owsd-testdata))

77
owsd/files/owsd.config Normal file
View File

@@ -0,0 +1,77 @@
config owsd 'global'
option sock '/var/run/ubus.sock'
option www '/www'
option redirect '/cgi-bin/luci:/cacheflush.html'
# option www_maxage '3600'
# ubusproxy is enbaled if: enable = 1 or peer exists or path exists
config ubusproxy 'ubusproxy'
option enable '0'
# list peer 'wss://repeater_hostname/'
# list peer 'wss://192.168.1.101/'
# list object 'router.*'
# list object 'system'
# option peer_cert '/etc/ssl/certs/owsd-repeater-control-cert.pem'
# option peer_key '/etc/ssl/private/owsd-repeater-control-key.pem'
# option peer_ca '/etc/ssl/certs/owsd-server-ca.pem'
config owsd-listen 'loopback'
option port '80'
option interface 'loopback'
option ipv6 'on'
list origin '*'
config owsd-listen 'lan'
option port '80'
option interface 'lan'
option ipv6 'on'
# option ipv6only 'off'
option whitelist_interface_as_origin '1'
option whitelist_dhcp_domains '1'
config owsd-listen 'lan_8080'
option port '8080'
option interface 'lan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
option whitelist_dhcp_domains '1'
#config owsd-listen 'lan_https'
# option port '443'
# option interface 'lan'
# option cert '/etc/ssl/certs/owsd-https-lan-cert.pem'
# option key '/etc/ssl/private/owsd-https-lan-key.pem'
# option ca '/etc/ssl/certs/owsd-ca-for-clients.pem'
# option whitelist_interface_as_origin '1'
#config owsd-listen 'wan_https'
# option port '443'
# option interface 'wan'
# option cert '/etc/ssl/certs/cert.pem'
# option key '/etc/ssl/private/key.pem'
# option ca '/etc/ssl/certs/owsd-ca-for-clients.pem'
# option whitelist_interface_as_origin '1'
# list origin '*'
config owsd-listen 'wan'
option port '80'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan_8080'
option port '8080'
option interface 'wan'
option ipv6 'on'
option whitelist_interface_as_origin '1'
list origin '*'
config owsd-listen 'wan6'
option port '80'
option interface 'wan6'
option ipv6 'on'
option ipv6only 'on'
option whitelist_interface_as_origin '1'
list origin '*'

17
owsd/files/owsd.hotplug Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
compare_owsd_iface() {
local interface
config_get interface $1 interface
if [ "$INTERFACE" == "$interface" ]; then
/etc/init.d/owsd reload
exit
fi
}
config_load owsd
config_foreach compare_owsd_iface "owsd-listen" "$INTERFACE"

309
owsd/files/owsd.init Normal file
View File

@@ -0,0 +1,309 @@
#!/bin/sh /etc/rc.common
. /lib/functions/network.sh
START=90
STOP=10
USE_PROCD=1
PROG=/usr/bin/owsd
UPROXYD="/sbin/uproxyd"
CONFIGFILE="/etc/config/owsd"
DHCP_DOMAINS=""
USERS=""
OWLNUM=0
owsd_acl() {
local section=$1
local username=$2
local user=""
acl_add_user() {
local user=$1
if [ "$user" == "$username" ]; then
json_add_string "" $section
fi
}
config_get user $section user
if [ -n "$user" ]; then
config_list_foreach "$section" "user" acl_add_user
else
for usr in $USERS; do
acl_add_user $usr
done
fi
OWLNUM=$((OWLNUM+1))
}
append_users() {
local section=$1
config_get username $section username
USERS="$USERS $username"
}
rpcd_acl() {
local section=$1
local owl=""
local _i=1
config_get username $section username
json_select $username
uci -q delete rpcd.$section.owsd_listen
while json_get_var owl $_i; do
uci -q add_list rpcd.$section.owsd_listen="$owl"
_i=$((_i+1))
done
[ $((OWLNUM+1)) -eq $_i ] && uci -q delete rpcd.$section.owsd_listen
json_select ..
}
handle_owsd_acl() {
config_load rpcd
config_foreach append_users "login"
config_load owsd
json_init
for USR in $USERS; do
json_add_array "$USR"
OWLNUM=0
config_foreach owsd_acl "owsd-listen" "$USR"
json_close_array
done
json_dump > /tmp/owsd_acl
json_load "$(cat /tmp/owsd_acl)"
config_load rpcd
config_foreach rpcd_acl "login"
uci commit rpcd
/etc/init.d/rpcd reload
}
load_dhcp_domains() {
append_domain() {
local domain=$1
DHCP_DOMAINS="$DHCP_DOMAINS $domain"
}
dhcp_domain_section() {
local section=$1
local ip
config_get ip "$section" ip
[ -z "$ip" ] && config_list_foreach "$section" "name" append_domain
}
config_load dhcp # note: do not overload a config while parsing it
config_foreach dhcp_domain_section "domain"
}
validate_owsd_ubusproxy() {
uci_validate_section "owsd" "ubusproxy" "ubusproxy" \
'enable:bool:1' \
'peer:list(string)' \
'object:list(string)' \
'peer_key:file' \
'peer_cert:file' \
'peer_ca:file' \
}
validate_owsd_global() {
uci_validate_section "owsd" "owsd" "global" \
'sock:string' \
'redirect:string' \
'www:string' \
'www_maxage:integer' \
}
append_origin() {
procd_append_param command -o"$1"
}
append_origin_parts() {
local proto host port
proto="$1"
host="$2"
port="$3"
if [ "${proto}" = "https" -a "${port}" -eq 443 -o "${proto}" = "http" -a "${port}" -eq 80 ]; then
append_origin "${proto}://${host}"
else
append_origin "${proto}://${host}:${port}"
fi
}
validate_owsd_iface() {
uci_validate_section "owsd" "owsd-listen" "$1" \
'port:port' \
'interface:network' \
'origin:list(string)' \
'whitelist_interface_as_origin:bool:0' \
'whitelist_dhcp_domains:bool:0' \
'ipv6:bool:1' \
'ipv6only:bool:0' \
'cert:file' \
'key:file' \
'ca:file' \
'restrict_to_user:list(string)' \
&&
[ -n "${port}" ]
}
parse_owsd_iface() {
local port interface whitelist_interface_as_origin whitelist_dhcp_domains ipv6 ipv6only
local cert key ca
local restrict_to_user
validate_owsd_iface "$1" || {
echo "Validation failed"
return 1
}
# utility function
new_listen_socket() {
procd_append_param command -p "${port}"
procd_append_param command -L"$1"
[ -n "${cert}" ] && procd_append_param command -c"${cert}"
[ -n "${key}" ] && procd_append_param command -k"${key}"
[ -n "${ca}" ] && procd_append_param command -a"${ca}"
[ -n "${restrict_to_user}" ] && procd_append_param command -u"${restrict_to_user}"
[ -n "$2" ] && procd_append_param command -i"$2"
}
append_whitelists () {
config_list_foreach "$1" "origin" append_origin
if [ "$whitelist_dhcp_domains" -eq 1 ]; then
for domain in $DHCP_DOMAINS; do
append_origin_parts "${http}" "${domain}" "${port}"
done
fi
if [ -n "${interface}" -a -n "${addr}" -a "${whitelist_interface_as_origin}" -eq 1 ]; then
append_origin_parts "${http}" "${addr}" "${port}"
fi
}
local http="http${cert:+s}"
local ip4addrs ip6addrs
# bind to some network
if [ -n "${interface}" ]; then
# 1 listen-socket (vhost) for each IP address on that network's iface
# ipv4 addresses
if [ "${ipv6only}" -eq 0 ]; then
network_get_ipaddrs ip4addrs "${interface}";
fi
for addr in ${ip4addrs}; do
new_listen_socket "$1" "${addr}"
append_whitelists "$1"
done
# ipv6 addresses
if [ "${ipv6}" -eq 1 ]; then
network_get_ipaddrs6 ip6addrs "${interface}"
fi
for addr in ${ip6addrs}; do
new_listen_socket "$1" "${addr}"
addr="\\[${addr}]"
append_whitelists "$1"
procd_append_param command -66
done
else
new_listen_socket "$1"
if [ "${ipv6}" -eq 1 ]; then procd_append_param command -6; fi
if [ "${ipv6}" -eq 1 -a "${ipv6only}" -eq 1 ]; then procd_append_param command -6; fi
append_whitelists "$1"
fi
}
start_service() {
# update rpcd config according to owsd acl
handle_owsd_acl
# preload dhcp domains list, in case any interface config requires it
load_dhcp_domains
config_load owsd # note: do not overload a config while parsing it
procd_open_instance
procd_set_param command $PROG
local sock www redirect www_maxage
local enable peer_cert peer_key peer_ca
validate_owsd_global || {
echo "Global validation failed"
return 1
}
[ -n "${sock}" ] && procd_append_param command -s"${sock}"
[ -n "${www}" ] && procd_append_param command -w"${www}"
[ -n "${redirect}" ] && procd_append_param command -r"${redirect}"
[ -n "${www_maxage}" ] && procd_append_param command -t"${www_maxage}"
validate_owsd_ubusproxy || {
echo "Ubusproxy validation failed"
return 1
}
if [ "${enable}" -eq 1 ]; then
procd_append_param command -U
[ -n "${peer_cert}" ] && procd_append_param command -C"${peer_cert}"
[ -n "${peer_key}" ] && procd_append_param command -K"${peer_key}"
[ -n "${peer_ca}" ] && procd_append_param command -A"${peer_ca}"
append_peer () {
[ -n "$1" ] && procd_append_param command -P"$1"
}
append_object () {
[ -n "$1" ] && procd_append_param command -U"$1"
}
config_list_foreach "ubusproxy" "peer" append_peer
config_list_foreach "ubusproxy" "object" append_object
fi
config_foreach parse_owsd_iface "owsd-listen"
# procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
# Start uproxyd
procd_open_instance
procd_set_param command $UPROXYD
procd_set_param respawn
procd_close_instance
}
stop_service()
{
service_stop ${PROG}
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger owsd
}

View File

@@ -0,0 +1,87 @@
#!/bin/sh
. /lib/functions.sh
MGMT_INTERFACES=""
OWSD_INTERFACES=""
NOT_DEFAULT=0
mgmt_interfaces() {
local interface=$1
[ "$interface" == "loopback" ] && return
[ "$interface" == "lan" ] && return
[ "$interface" == "wan" ] && return
[ "$interface" == "wan6" ] && return
local type proto
config_get type $interface type
config_get proto $interface proto "none"
[ "$type" == "bridge" -a "$proto" == "none" ] && return
local is_lan
config_get is_lan $interface is_lan
[ "$is_lan" == "1" ] && return
local ifname
config_get ifname $interface ifname
[ "${ifname:0:1}" == "@" ] && return
MGMT_INTERFACES="$MGMT_INTERFACES $interface"
}
owsd_interfaces() {
local config=$1
local interface
config_get interface $config interface
[ "$interface" == "loopback" ] && return
[ "$interface" == "lan" ] && return
[ "$interface" == "wan" ] && return
[ "$interface" == "wan6" ] && return
OWSD_INTERFACES="$OWSD_INTERFACES $interface"
NOT_DEFAULT=1
}
not_owsd() {
local interface=$1
local there=0
for owsd in $OWSD_INTERFACES; do
if [ "$interface" == "$owsd" ]; then
there=1
break
fi
done
return $there
}
config_load network
config_foreach mgmt_interfaces interface
config_load owsd
config_foreach owsd_interfaces owsd-listen
if [ $NOT_DEFAULT -eq 0 ]; then
for mgmt in $MGMT_INTERFACES; do
if $(not_owsd $mgmt); then
uci -q set owsd.$mgmt=owsd-listen
uci -q set owsd.$mgmt.port=80
uci -q set owsd.$mgmt.interface="$mgmt"
uci -q set owsd.$mgmt.ipv6="on"
uci -q set owsd.$mgmt.whitelist_interface_as_origin="1"
uci -q set owsd.$mgmt.origin="*"
uci -q set owsd.$mgmt"_8080"=owsd-listen
uci -q set owsd.$mgmt"_8080".port=8080
uci -q set owsd.$mgmt"_8080".interface="$mgmt"
uci -q set owsd.$mgmt"_8080".ipv6="on"
uci -q set owsd.$mgmt"_8080".whitelist_interface_as_origin="1"
uci -q set owsd.$mgmt"_8080".origin="*"
uci commit owsd
fi
done
fi
exit 0

View File

@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=959eca8ab2b50eaccfff9c710cffe5b317bb6ad1
PKG_SOURCE_VERSION:=fe43108d986a02d3a14f079d58bfa666c1089471
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se/peripheral_manager

View File

@@ -1,15 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=0
NAME=peripheral_led_normal
start_service() {
ubus -t 2 wait_for led.status
ubus call led.status set '{"state":"ok"}'
ubus -t 2 wait_for button
}

View File

@@ -4,7 +4,7 @@ START=15
USE_PROCD=1
. /lib/functions.sh
. /lib/network/config.sh
include /lib/network
check_for_config(){
if [ -s "/etc/config/ports" ]
@@ -17,7 +17,7 @@ check_for_config(){
fi
fi
touch /etc/config/ports
local fiberorder="$(db get hw.board.fiberPortOrder)"
local portorder="$(db get hw.board.ethernetPortOrder)"
for port in $portorder
do
@@ -33,6 +33,8 @@ check_for_config(){
uci set ports.@ethport[-1].pause=0
fi
done
local fiberorder="$(db get hw.board.fiberPortOrder)"
for fiber in $fiberorder; do
uci add ports sfpport
uci rename ports.@sfpport[-1]="$(fibername $fiber)"
@@ -41,105 +43,26 @@ check_for_config(){
uci set ports.@sfpport[-1].speed='auto'
uci set ports.@sfpport[-1].pause=1
done
uci commit ports
[ $DEBUG ] && cat /etc/config/ports
}
get_current_status() {
local port="$1"
local flag="$2"
local media="$(ethctl $port media-type $flag 2>&1)"
if echo $media | grep "Auto-negotiation enabled" >/dev/null; then
echo "auto"
elif echo $media | grep "100 mbps, full-duplex" >/dev/null; then
echo "100FD"
elif echo $media | grep "100 mbps, half-duplex" >/dev/null; then
echo "100HD"
elif echo $media | grep "10 mbps, full-duplex" >/dev/null; then
echo "10FD"
elif echo $media | grep "10 mbps, half-duplex" >/dev/null; then
echo "10HD"
fi
}
get_flag(){
local port=$1
local sfptype=$2
local eg300="$(ethctl $port media-type 2>&1 | grep 'This is probably wrong')"
local eg400="$(ethctl $port media-type 2>&1 | grep 'Error: Interface eth0 has sub ports, please specified one')"
if [ -n "$eg300" ]; then
echo "sfp copper"
elif [ -n "$eg400" ]; then
echo "port 10"
else
echo ""
fi
}
set_port_status() {
local port="$1"
local status="$2"
local flag=$(get_flag $port)
local curstatus=$(get_current_status "$port" "$flag")
ifconfig $port >/dev/null 2>&1 || return
case "$status" in
disabled)
ethctl $port phy-power down
;;
*)
if [ "$status" != "$curstatus" ]; then
case "$status" in
1000*)
local unit=$(echo $(get_port_number $port) | cut -d ' ' -f 1)
local port=$(echo $(get_port_number $port) | cut -d ' ' -f 2)
case "$status" in
1000FD) ethswctl -c phymode -n $unit -p $port -y 1000 -z 1 ;;
1000HD) ethswctl -c phymode -n $unit -p $port -y 1000 -z 0 ;;
esac
;;
10*AUTO)
ethctl $port media-type advertise $status $flag
;;
10*)
ethctl $port media-type $status $flag
;;
*)
ethctl $port media-type advertise 1000FDAUTO $flag
ethctl $port media-type auto $flag
;;
esac
else
ethctl $port phy-power up
fi
;;
esac
}
configure_ethports(){
local port ifname pause speed
name=$1
config_get speed $name speed
config_get ifname $name ifname
config_get pause $name pause
set_port_status $ifname $speed
set_port_speed $ifname $speed
set_port_pause $ifname $pause
}
#arg1: ethX
#arg2: 0 or 1
set_port_pause() {
local pause="$2"
unit=$(echo $(get_port_number $1) | cut -d ' ' -f 1)
port=$(echo $(get_port_number $1) | cut -d ' ' -f 2)
ethswctl -c pause -n $unit -p $port -v $pause
}
start_service() {
[ -f /sbin/db ] && check_for_config
[ -f /sbin/db -a -f /lib/db/config/hw ] && check_for_config
[ -f /usr/sbin/ethswctl -a -f /usr/sbin/ethctl ] || return
[ -f /lib/network/port.sh ] || return
config_load ports
config_foreach configure_ethports ethport

View File

@@ -4,65 +4,7 @@ START=97
USE_PROCD=1
. /lib/functions.sh
. /lib/network/config.sh
get_current_status() {
local port="$1"
local flag="$2"
local media="$(ethctl $port media-type $flag 2>&1)"
if echo $media | grep "Auto-negotiation enabled" >/dev/null; then
echo "auto"
elif echo $media | grep "100 mbps, full-duplex" >/dev/null; then
echo "100FD"
elif echo $media | grep "100 mbps, half-duplex" >/dev/null; then
echo "100HD"
elif echo $media | grep "10 mbps, full-duplex" >/dev/null; then
echo "10FD"
elif echo $media | grep "10 mbps, half-duplex" >/dev/null; then
echo "10HD"
fi
}
get_flag(){
local port=$1
local eg300="$(ethctl $port media-type 2>&1 | grep 'This is probably wrong')"
local eg400="$(ethctl $port media-type 2>&1 | grep 'Error: Interface eth0 has sub ports, please specified one')"
if [ -n "$eg300" ]; then
echo "sfp fiber"
elif [ -n "$eg400" ]; then
echo "port 9"
else
echo ""
fi
}
set_fiber_status() {
local port="$1"
local status="$2"
local flag=$(get_flag $port)
local curstatus=$(get_current_status "$port" "$flag")
case "$status" in
disabled)
ethctl $port phy-power down
;;
*)
if [ "$status" != "$curstatus" ]; then
case "$status" in
100*FD|auto)
ethctl $port media-type $status $flag
ethctl $port phy-power up
;;
*)
ethctl $port media-type advertise 1000FDAUTO $flag
ethctl $port media-type auto $flag
;;
esac
fi
ethctl $port phy-power up
;;
esac
}
include /lib/network
configure_sfpports(){
local port ifname pause speed
@@ -70,19 +12,10 @@ configure_sfpports(){
config_get speed $name speed
config_get ifname $name ifname
config_get pause $name pause
set_fiber_status $ifname $speed
set_fiber_speed $ifname $speed
set_port_pause $ifname $pause
}
#arg1: ethX
#arg2: 0 or 1
set_port_pause() {
local pause="$2"
unit=$(echo $(get_port_number $1) | cut -d ' ' -f 1)
port=$(echo $(get_port_number $1) | cut -d ' ' -f 2)
ethswctl -c pause -n $unit -p $port -v $pause
}
start_service() {
config_load ports
config_foreach configure_sfpports sfpport

View File

@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=questd
PKG_VERSION:=3.1.39
PKG_VERSION:=3.1.40
PKG_SOURCE_VERSION:=10cba850fb80668502ca5ce0bc57533089062741
PKG_SOURCE_VERSION:=4bb88410200d26780dae58e624da23d32f48b942
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/questd
@@ -27,7 +27,7 @@ else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
QUESTD_TARGET:=-DIOPSYS_MARVELL
else ifeq ($(CONFIG_TARGET_lantiq_xrx500),y)
QUESTD_TARGET:=-DIOPSYS_LANTIQ
else ifeq ($(CONFIG_TARGET_iopsys_ramips_ex400),y)
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
QUESTD_TARGET:=-DIOPSYS_MEDIATEK
QUESTD_CFLAGS:=\
-I$(STAGING_DIR)/usr/include \
@@ -43,7 +43,7 @@ export QUESTD_CFLAGS
define Package/questd
CATEGORY:=Utilities
DEPENDS:=+libuci +libubox +ubus +libpthread +(TARGET_iopsys_ramips_ex400):swconfig +(TARGET_iopsys_ramips_ex400):libnl-tiny +libopenssl
DEPENDS:=+libuci +libubox +ubus +libpthread +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_ramips:libnl-tiny +libopenssl
TITLE:=router info daemon
endef
@@ -58,6 +58,7 @@ define Package/questd/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/questd $(1)/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wificontrol $(1)/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/graphd $(1)/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netcheck $(1)/usr/bin/
endef

View File

@@ -17,7 +17,7 @@ start_service() {
procd_set_param respawn
procd_close_instance
pidof imonitor > /dev/null 2>&1 || /sbin/imonitor &
# pidof imonitor > /dev/null 2>&1 || /sbin/imonitor &
}
stop() {
@@ -33,4 +33,3 @@ service_triggers()
reload_service() {
ubus -t 5 call router.network reload
}

View File

@@ -23,7 +23,7 @@ NPROC_COUNT=4 # number of time that the NPROC_LIMIT has to be hit to trigger a p
NPROC_NFAIL=0 # current consecutive Number of FAILures. process restarts when NPROC_NFAIL == NPROC_COUNT
# memmory limit
MEM_LIMIT=15000
MEM_LIMIT=20000
MEM_COUNT=4
MEM_NFAIL=0
@@ -129,6 +129,8 @@ check_ubus_network_call() {
json_load "$(ifstatus lan)" || return 0
json_get_var up up
[ $up -eq 1 ] || return 0
local ifname="$(uci -q get network.lan.ifname)"
[ -z "$ifname" -o "${ifname:0:3}" == "br-" ] && return 0
ubus -t 5 call router.network ports '{"network":"lan"}' | grep -q statistics || {
NNET_NFAIL=1
return 1
@@ -210,10 +212,10 @@ main()
"$restart_pcpu" = "1" ]
then
restart_questd
else
if [ "$sample" -ge "$SAMPLES" ]; then
check_ubus_network_call || restart_questd
fi
# else
# if [ "$sample" -ge "$SAMPLES" ]; then
# check_ubus_network_call || restart_questd
# fi
fi
if [ "$BSDBIN" ] ; then

View File

@@ -1,8 +1,5 @@
config testserver '1'
option server 'tptest.bredband.net'
option port '1640'
config testserver '2'
config testserver '1'
option server 'referens.sth.ip-performance.se'
option port '1642'

View File

@@ -12,7 +12,7 @@ PKG_VERSION:=2016.08
PKG_RELEASE:=4
PKG_SOURCE_URL:=http://public.inteno.se:/uboot
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=f502d1b589f14142bf7d7719e8434014f180d03f
PKG_SOURCE_VERSION:=b0a0b127f0848e191b80979ad7de5f10c3e01a1b
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -20,8 +20,11 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
# we currently do not use OpenWRT u_boot make files
#include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
CONFIG:=
@@ -32,8 +35,13 @@ define uboot/ex400
TITLE:=U-Boot for the ex400
endef
define uboot/sdx_500ap
TITLE:=U-Boot for the sdx-500ap
endef
UBOOTS := \
ex400
ex400 \
sdx_500ap
define Package/uboot/template
define Package/uboot-$(1)

View File

@@ -16,7 +16,7 @@ define Package/voice-client
SECTION:=net
CATEGORY:=Network
TITLE:=voice-client
DEPENDS:=+asterisk18-mod
DEPENDS:=+asterisk13
endef
define Package/voice-client/description

View File

@@ -1,14 +1,15 @@
[directories]
[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /usr/lib/asterisk
astdbdir => /usr/lib/asterisk
astkeydir => /usr/lib/asterisk
astdatadir => /usr/lib/asterisk
astagidir => /usr/lib/asterisk/agi-bin
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /usr/share/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
[options]
;verbose = 3
@@ -17,7 +18,7 @@ astlogdir => /var/log/asterisk
;nofork = yes ; Same as -f at startup.
;quiet = yes ; Same as -q at startup.
;timestamp = yes ; Same as -T at startup.
execincludes = yes ; Support #exec in config files.
;execincludes = yes ; Support #exec in config files.
;console = yes ; Run as console (same as -c at startup).
;highpriority = yes ; Run realtime priority (same as -p at
; startup).
@@ -27,12 +28,14 @@ execincludes = yes ; Support #exec in config files.
;dontwarn = yes ; Disable some warnings.
;dumpcore = yes ; Dump core on crash (same as -g at startup).
;languageprefix = yes ; Use the new sound prefix path syntax.
;internal_timing = yes
;systemname = my_system_name ; Prefix uniqueid with a system name for
; Global uniqueness issues.
;autosystemname = yes ; Automatically set systemname to hostname,
; uses 'localhost' on failure, or systemname if
; set.
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
; If we get shorter DTMF messages, these will be
; changed to the minimum duration
;maxcalls = 10 ; Maximum amount of calls allowed.
;maxload = 0.9 ; Asterisk stops accepting new calls if the
; load average exceed this limit.
@@ -73,7 +76,35 @@ documentation_language = en_US ; Set the language you want documentation
;lockconfdir = no ; Protect the directory containing the
; configuration files (/etc/asterisk) with a
; lock.
mindtmfduration=60
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
; macro - Invoke the stdexten using a macro as
; done by legacy Asterisk versions.
; gosub - Invoke the stdexten using a gosub as
; documented in extensions.conf.sample.
; Default gosub.
;live_dangerously = no ; Enable the execution of 'dangerous' dialplan
; functions from external sources (AMI,
; etc.) These functions (such as SHELL) are
; considered dangerous because they can allow
; privilege escalation.
; Default no
;entityid=00:11:22:33:44:55 ; Entity ID.
; This is in the form of a MAC address.
; It should be universally unique.
; It must be unique between servers communicating
; with a protocol that uses this value.
; This is currently is used by DUNDi and
; Exchanging Device and Mailbox State
; using protocols: XMPP, Corosync and PJSIP.
;rtp_pt_dynamic = 96 ; Normally the Dynamic RTP Payload Type numbers
; are 96-127, which allow 32 formats. When you
; use more and receive the message "No Dynamic
; RTP mapping available", extend the dynamic
; range by going for 35 (or 0) instead of 96.
; This allows 29 (or 64) more formats. 96 is the
; default because any number below might be
; rejected by a remote implementation; although
; no such broken implementation is known, yet.
; Changing the following lines may compromise your security.
;[files]
@@ -81,8 +112,3 @@ mindtmfduration=60
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl
[compat]
pbx_realtime=1.6
res_agi=1.6
app_set=1.6

View File

@@ -42,6 +42,41 @@ exten => s,n, Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-create_cw]
;
; ${ARG1} - Associated SIP peer
;
exten => s,1, System(/lib/cw.sh ${ARG1} 1)
exten => s,n, System(asterisk -rx 'brcm reload')
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-delete_cw]
;
; ${ARG1} - Associated SIP peer
;
exten => s,1, System(/lib/cw.sh ${ARG1} 0)
exten => s,n, System(asterisk -rx 'brcm reload')
exten => s,n, Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-status_cw]
;
; ${ARG1} - Associated SIP peer
;
exten => s,1, Set(result=${SHELL(/lib/cw.sh ${ARG1} ?)})
exten => s,n, GotoIf(${result}?cwon:cwoff)
;If call waiting on play beep and hang up
exten => s,n(cwon), Playback(beep)
exten => s,n, Hangup()
exten => s,n, MacroExit()
;If call waiting off play two beep and hang up
exten => s,n(cwoff), Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
exten => s,n, MacroExit()
[macro-call_return]
;
; Return call to last incoming caller

View File

@@ -6,7 +6,9 @@
include => clir
include => local_extensions
include => |PROVIDER|-callforwarding
include => |PROVIDER|-callwaiting
include => |PROVIDER|-outgoing
include => |PROVIDER|-direct
[|PROVIDER|-transfer]
; Context used for call transfer for this Provider

Some files were not shown because too many files have changed in this diff Show More