Compare commits

..

65 Commits

Author SHA1 Message Date
Jakob Olsson
2117bc1903 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 1b8501d fix enable pin, add get signal strength
* 6db2741 add set_pin, disable_pin
-------------------------------------------------------------------------------
commit 1b8501d5a24fcdf784678e8f864964fc0138254c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-04 14:04:47 +0200

    fix enable pin, add get signal strength

Base directory -> /
 dongle_network.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 dongle_pin.c     | 58 ++++++++++++++++++++++++++++++++++++++++++++-
 libmobile.c      |  4 ++--
 libmobile.h      |  2 +-
 4 files changed, 131 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
commit 6db274197ef6151d119335d99e85dbbbbc788978
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-04 12:54:09 +0200

    add set_pin, disable_pin

Base directory -> /
 dongle_pin.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 libmobile.c  | 112 +++++++++++++++++++++++++++++++++++++++++++++---
 libmobile.h  |   4 ++
 3 files changed, 238 insertions(+), 15 deletions(-)
-------------------------------------------------------------------------------
2018-05-04 14:05:25 +02:00
Jakob Olsson
b553a6bb9f new binary to add 2018-05-04 14:05:10 +02:00
Jakob Olsson
6a2e0a259e Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 01d0e03 accomodate for splitting files, some test code for pin
* 5eb1ecb rename file and object
* f01ee70 remove remaining curls from dongle.c, remove duplicate function, TODO: naming scheme, run cppcheck, checkpatch
* 911c050 move (most) curl code to libmobile, still some remaining in dongle, write_func duplicate, TODO: consistent returns, clean memory?
* 76f11f2 add delete, set (default apn), and show current apn, some cleanup
* c39d839 add list_apn_profiles, listing the APN_config names, essentiall listing their names
* 89d9e82 dynamically find index fix
* 634b533 can send post request to add new APN profile, TODO: add dynamic idx, set_default(), apply()
* 85beb1d add preliminary functionality & ubus method for setting APN
* 2a6dd7c Merge branch 'jakob' of private.inteno.se:iopsys-onboarding into HEAD
* 28356f4 add referer to dongle
-------------------------------------------------------------------------------
commit 01d0e038fd26a2fc5a483ad4bf2c7f7accd5820c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-04 09:14:16 +0200

    accomodate for splitting files, some test code for pin

Base directory -> /
 Makefile     | 16 ++++++-----
 dongle_apn.c | 48 +--------------------------------
 dongle_pin.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libmobile.c  | 74 +++++++++++++++++++++++++++++++--------------------
 4 files changed, 143 insertions(+), 82 deletions(-)
-------------------------------------------------------------------------------
commit 5eb1ecbb3fd267917df4ed5b387f840d59db8ba1
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 16:52:24 +0200

    rename file and object

Base directory -> /
 dongle.c     | 255 -----------------------------------------------------------
 dongle_apn.c | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 255 insertions(+), 255 deletions(-)
-------------------------------------------------------------------------------
commit f01ee707753f66ed918f9603d4e9f98975ba882b
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 16:48:31 +0200

    remove remaining curls from dongle.c, remove duplicate function, TODO:
    naming scheme, run cppcheck, checkpatch

Base directory -> /
 dongle.c    | 53 +++++------------------------------------------------
 libmobile.c | 35 +++++++++++++++++++++++++++++++++++
 libmobile.h |  3 ++-
 3 files changed, 42 insertions(+), 49 deletions(-)
-------------------------------------------------------------------------------
commit 911c05069f03c08dd45692333318134c4a00cc9e
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 16:35:20 +0200

    move (most) curl code to libmobile, still some remaining in dongle,
    write_func duplicate, TODO: consistent returns, clean memory?

Base directory -> /
 Makefile    |  12 ++-
 dongle.c    | 224 +++++---------------------------------------------------
 libmobile.c | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libmobile.h |  17 +++++
 4 files changed, 282 insertions(+), 209 deletions(-)
-------------------------------------------------------------------------------
commit 76f11f2f6fd746d36b0a5f8def09153e0ddb77c1
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 14:54:01 +0200

    add delete, set (default apn), and show current apn, some cleanup

Base directory -> /
 dongle.c | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 205 insertions(+), 22 deletions(-)
-------------------------------------------------------------------------------
commit c39d83953dba361d676e247002b7f63e5c4851bf
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 12:22:06 +0200

    add list_apn_profiles, listing the APN_config names, essentiall listing
    their names

Base directory -> /
 dongle.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 61 insertions(+), 16 deletions(-)
-------------------------------------------------------------------------------
commit 89d9e82bf0d68adbd110774f989a557a500eabee
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 11:20:02 +0200

    dynamically find index fix

Base directory -> /
 dongle.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 65 insertions(+), 16 deletions(-)
-------------------------------------------------------------------------------
commit 634b5338b59cf65e22d645996d785ce9260862c0
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-03 09:25:33 +0200

    can send post request to add new APN profile, TODO: add dynamic idx,
    set_default(), apply()

Base directory -> /
 dongle.c | 74 +++++++++++++++++++++++++++++-----------------------------------
 1 file changed, 34 insertions(+), 40 deletions(-)
-------------------------------------------------------------------------------
commit 85beb1d0cccc607802d46af01ab3bae2f695f18f
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-02 16:10:13 +0200

    add preliminary functionality & ubus method for setting APN

Base directory -> /
 dongle.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 2a6dd7c10342831238ad9b123824be10a8714601
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-02 12:12:19 +0200

    Merge branch 'jakob' of private.inteno.se:iopsys-onboarding into HEAD

Base directory -> /
 dongle.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
commit 28356f4b967693740071e99af1592429073dfb8a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-05-02 12:11:54 +0200

    add referer to dongle

Base directory -> /
 dongle.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
2018-05-04 09:17:53 +02:00
Jakob Olsson
9d1540df1d accomodate for splitting dongle file into several 2018-05-04 09:12:04 +02:00
Jakob Olsson
547a955cfe Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 33af504 change from verbose to loglevel, from -v to -l
-------------------------------------------------------------------------------
commit 33af50474ee9f9ef9b7fdf80f43de31f69bd6014
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-30 12:52:12 +0200

    change from verbose to loglevel, from -v to -l

Base directory -> /
 parse_args.c | 8 ++++----
 parser.c     | 2 +-
 watcher.c    | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
2018-04-30 12:52:54 +02:00
Jakob Olsson
4f9594a6d1 change verbose to loglevel for all files 2018-04-30 12:32:31 +02:00
Jakob Olsson
86487e8c23 add object from bash script, status and set_configurations available 2018-04-30 12:26:27 +02:00
Jakob Olsson
0caad1b5c7 publishes and prints status 2018-04-30 11:50:54 +02:00
Jakob Olsson
101224dd31 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 7424f4a fix restart and update configurations from publishing event, other minor fixes
* 8d9286f typo
* b774f37 fix some compile errors
* 3ff8fa6 some name scheme changes, send new flags by event
* 77a2cb7 fix receiving events - listener required to be global or static
* d7e3c62 parser crash crash when receive event
* 825e628 add listener for events
* 6674802 consistent header and c declarations
* b322927 add send event method
* d9266c7 documentation addition, style change
*   3be1f4f fix merge conflicts
|\
| * 88e8a18 fix regarding error handling
| * 229f367 change if-case in check_for_change to prevent multiple printouts on restart, minor style and error handling fixes
| * 15ecc8d changes according to cppcheck, add some error handling in watcher
| * b3d0151 fix to compile - plenty warnings and not tested with cppcheck
| * 3c19c3c small style changes and makefile fix
| * 260bc4a error handling and general style changes -untested!
| * 7242c3c initial changes, test if limits.h is correct
* | 18366b5 add documentation
|/
* f12fdbb minor fixes
* 6aa5b34 some stylistic changes - untested
* caf59c5 print dongle response on ubus, minor style fixes
* 287a85a add struct to keep track of len instead, as in libcurl example
* a2fe80d unfinished, print garbage + response
-------------------------------------------------------------------------------
commit 7424f4adcaac30925ca7f36f78e90136af8be8fa
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-27 13:20:36 +0200

    fix restart and update configurations from publishing event, other minor
    fixes

Base directory -> /
 parser.c  | 10 ++++++----
 watcher.c | 43 +++++++++++++++++++++++--------------------
 watcher.h |  1 +
 3 files changed, 30 insertions(+), 24 deletions(-)
-------------------------------------------------------------------------------
commit 8d9286ff4bb421a21dbe5d945b5f1867068343e4
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-27 09:11:26 +0200

    typo

Base directory -> /
 watcher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit b774f37a70134158290bbcc389166d6b884dafef
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-27 09:03:57 +0200

    fix some compile errors

Base directory -> /
 watcher.c | 34 ++++++++++------------------------
 1 file changed, 10 insertions(+), 24 deletions(-)
-------------------------------------------------------------------------------
commit 3ff8fa611ce6541cbefa0d72b86bd403a941aa61
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-27 08:52:20 +0200

    some name scheme changes, send new flags by event

Base directory -> /
 parser.c  | 30 +++++++++++++-----------------
 watcher.c | 61 ++++++++++++++++++++++++++++++++++++++++---------------------
 2 files changed, 53 insertions(+), 38 deletions(-)
-------------------------------------------------------------------------------
commit 77a2cb7762a2140a55437377ed9ae779049394f1
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 15:56:38 +0200

    fix receiving events - listener required to be global or static

Base directory -> /
 parser.c  | 47 +++++++++++++++++++++++------------------------
 watcher.c |  8 ++++----
 2 files changed, 27 insertions(+), 28 deletions(-)
-------------------------------------------------------------------------------
commit d7e3c6221fb648d6ff4966d8fed078bbb6421b91
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 11:25:34 +0200

    parser crash crash when receive event

Base directory -> /
 parser.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit 825e6288af7757dda7cb1a229e36b95281fb6f2e
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 10:57:28 +0200

    add listener for events

Base directory -> /
 parser.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 6674802533ebd5e86692acde93295d24d648198d
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 10:24:25 +0200

    consistent header and c declarations

Base directory -> /
 watcher.c |  5 +++--
 watcher.h | 14 +++++++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
commit b322927957e294867eaf16296d5d1253e6e6efe6
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 10:17:03 +0200

    add send event method

Base directory -> /
 dongle.c  |  4 ++--
 watcher.c | 21 ++++++++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit d9266c7f4c2af00073cfa35d0dd4552961ff767c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 09:26:08 +0200

    documentation addition, style change

Base directory -> /
 .gitignore |  4 ++++
 parser.c   | 18 +++++++--------
 parser.h   |  2 +-
 watcher.c  | 52 ++++++++++++++++++++++++++---------------
 watcher.h  | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 5 files changed, 123 insertions(+), 31 deletions(-)
-------------------------------------------------------------------------------
commit 3be1f4f09875baaa665389dc34c002303fdf46ba
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 08:45:52 +0200

    fix merge conflicts

Base directory -> /
 Makefile     |   6 ++
 common.h     |   6 ++
 dongle.c     |   6 +-
 parse_args.c |  10 +--
 parser.c     | 256 +++++++++++++++++++++++++++++++++++++++++------------------
 parser.h     |  28 +++++--
 watcher.c    | 215 ++++++++++++++++++++++++++++++++-----------------
 watcher.h    |  22 ++++-
 8 files changed, 384 insertions(+), 165 deletions(-)
-------------------------------------------------------------------------------
commit 18366b5fa66e6c9126d583b88a9794a3cbc2fa4c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-26 08:39:43 +0200

    add documentation

Base directory -> /
 parse_args.h |  7 +++++++
 parser.h     | 33 ++++++++++++++++++++++-----------
 watcher.c    | 26 ++++++--------------------
 watcher.h    | 10 ++++++++--
 4 files changed, 43 insertions(+), 33 deletions(-)
-------------------------------------------------------------------------------
commit 88e8a18867c9dd1ff389a8e0b94e5bae93abd8b1
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-25 11:43:33 +0200

    fix regarding error handling

Base directory -> /
 parser.c  | 78 ++++++++++++++++++++++++++++++++++++++++++++++--------------
 parser.h  |  3 ++-
 watcher.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-----------------
 watcher.h |  4 ++--
 4 files changed, 123 insertions(+), 43 deletions(-)
-------------------------------------------------------------------------------
commit 229f36701dea502fab841166c18b5a04168f47de
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-25 10:35:05 +0200

    change if-case in check_for_change to prevent multiple printouts on restart,
    minor style and error handling fixes

Base directory -> /
 parser.c  | 18 ++++++++----------
 watcher.c | 26 ++++++++++++++------------
 2 files changed, 22 insertions(+), 22 deletions(-)
-------------------------------------------------------------------------------
commit 15ecc8d0f703b8facf4221bf21693c1387589a50
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-25 09:20:57 +0200

    changes according to cppcheck, add some error handling in watcher

Base directory -> /
 parser.c  |  15 ++-----
 watcher.c | 141 +++++++++++++++++++++++++++++++++++++++-----------------------
 watcher.h |   2 +-
 3 files changed, 94 insertions(+), 64 deletions(-)
-------------------------------------------------------------------------------
commit b3d015126ae1d817c283ab4be0fe5cc89b778526
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 16:53:59 +0200

    fix to compile - plenty warnings and not tested with cppcheck

Base directory -> /
 parser.c | 8 ++++----
 parser.h | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit 3c19c3c30148fa995c84fb6fbdee0aa903035461
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 16:43:35 +0200

    small style changes and makefile fix

Base directory -> /
 Makefile     |  4 ++--
 dongle.c     |  6 +++---
 parse_args.c | 10 ++++------
 parser.c     |  9 ++++-----
 4 files changed, 13 insertions(+), 16 deletions(-)
-------------------------------------------------------------------------------
commit 260bc4a5bc5e22e29b0352187c8a5682a8c4ad4b
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 16:35:20 +0200

    error handling and general style changes -untested!

Base directory -> /
 common.h  |   6 ++
 parser.c  | 197 ++++++++++++++++++++++++++++++++++++++++++++------------------
 parser.h  |   2 +
 watcher.h |   1 +
 4 files changed, 151 insertions(+), 55 deletions(-)
-------------------------------------------------------------------------------
commit 7242c3c2b8537f09ae8e87a17e2690c8f24fe13a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 14:09:42 +0200

    initial changes, test if limits.h is correct

Base directory -> /
 Makefile  |  6 ++++++
 parser.c  | 21 +--------------------
 parser.h  | 16 +++++++++++++++-
 watcher.c | 20 --------------------
 watcher.h | 19 +++++++++++++++++++
 5 files changed, 41 insertions(+), 41 deletions(-)
-------------------------------------------------------------------------------
commit f12fdbb07029cbfa69f7b8976474f88046fb4e2a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 12:09:29 +0200

    minor fixes

Base directory -> /
 parser.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit 6aa5b3402ad216f4428f171c390a52d5ed0e8b61
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 12:04:39 +0200

    some stylistic changes - untested

Base directory -> /
 dongle.c |  6 +-----
 parser.c | 53 ++++++++++++++++++++++++++++-------------------------
 2 files changed, 29 insertions(+), 30 deletions(-)
-------------------------------------------------------------------------------
commit caf59c521938b8bcc083379015e98b5e0d217f8d
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 11:24:17 +0200

    print dongle response on ubus, minor style fixes

Base directory -> /
 Makefile  |   2 +-
 dongle.c  | 102 +++++++++++++++++++++++++++++++++++++++++++++-----------------
 parser.c  |   1 -
 watcher.c |   3 +-
 4 files changed, 77 insertions(+), 31 deletions(-)
-------------------------------------------------------------------------------
commit 287a85a5c2f3762f510e5ce83c658e3ac2c64e61
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-24 10:26:18 +0200

    add struct to keep track of len instead, as in libcurl example

Base directory -> /
 .gitignore |  1 +
 dongle.c   | 39 ++++++++++++++++++++++++++-------------
 2 files changed, 27 insertions(+), 13 deletions(-)
-------------------------------------------------------------------------------
commit a2fe80d5ad7a85ad3301fbce08bce1e003d2a0d1
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 16:52:01 +0200

    unfinished, print garbage + response

Base directory -> /
 dongle.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2018-04-30 10:29:23 +02:00
Jakob Olsson
7382667fc1 attempt to publish ubus object through script 2018-04-30 10:21:06 +02:00
Jakob Olsson
24e497b471 add dongle binary to makefile 2018-04-26 11:28:02 +02:00
Jakob Olsson
7c2ba26b8c Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 4567e2f minor bug fix
* d00214e some dongle test with curl
* 354a426 small improvement to parsing loglevel flag
* cb71185 consistency change for flags
-------------------------------------------------------------------------------
commit 4567e2f38f3f85222bd44c4810bb9bade824dbca
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 15:43:28 +0200

    minor bug fix

Base directory -> /
 dongle.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit d00214e63a827d0731c4b73a402fd7dcc12bf20b
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 15:24:12 +0200

    some dongle test with curl

Base directory -> /
 Makefile | 11 ++++++---
 dongle.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit 354a42605ede034f54243212a455f00d1f8ebbb6
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 13:39:46 +0200

    small improvement to parsing loglevel flag

Base directory -> /
 parse_args.c | 9 +++++----
 watcher.c    | 6 +++++-
 2 files changed, 10 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit cb7118580c39418c23a2248e790d359806c32235
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 09:55:19 +0200

    consistency change for flags

Base directory -> /
 .gitignore |  3 +--
 parser.c   | 35 ++++++++++++++++++++---------------
 watcher.c  | 34 ++++++++++++++++++++--------------
 3 files changed, 41 insertions(+), 31 deletions(-)
-------------------------------------------------------------------------------
2018-04-23 15:44:43 +02:00
Jakob Olsson
ccbf01013b test for some dongle 2018-04-23 15:44:23 +02:00
Jakob Olsson
2b4cef1cb4 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 9b7f1d4 clean some printouts
* 3e3d127 change some loglevel printouts
-------------------------------------------------------------------------------
commit 9b7f1d4e7ceefc205e799cc6fa8d231363c6f48d
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 09:31:22 +0200

    clean some printouts

Base directory -> /
 parser.c  |  5 ++---
 watcher.c | 39 ++++++++++++---------------------------
 2 files changed, 14 insertions(+), 30 deletions(-)
-------------------------------------------------------------------------------
commit 3e3d12778eb03315ca6a2554271df9a6cbffbbaf
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 09:24:06 +0200

    change some loglevel printouts

Base directory -> /
 parser.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)
-------------------------------------------------------------------------------
2018-04-23 09:39:44 +02:00
Jakob Olsson
0674212035 start with loglevel 0 2018-04-23 09:39:01 +02:00
Jakob Olsson
da55d5ef09 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 27bb443 move bash-scripts to test folder, remove capital files pathes
* 71c8008 move uloop_timeout struct outside restart application, now restarts with correct flags, add files to gitignore
* 58ee177 try to restart parser with execv, unsccessful adding to uloop, crashesh with uloop, does not without
* d242006 kill and replace process with new start flags
-------------------------------------------------------------------------------
commit 27bb443eb1380e142b827c9a413adcddd0e964e5
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 08:57:29 +0200

    move bash-scripts to test folder, remove capital files pathes

Base directory -> /
 bash-tests/multiple-addremove.sh | 10 ++++++++++
 bash-tests/nested-array.sh       | 21 +++++++++++++++++++++
 bash-tests/nested-objects.sh     | 19 +++++++++++++++++++
 bash-tests/ssid.sh               | 13 +++++++++++++
 common.h                         |  4 ++--
 multiple-addremove.sh            | 10 ----------
 nested-array.sh                  | 21 ---------------------
 nested-objects.sh                | 19 -------------------
 parse_args.c                     |  4 ++--
 ssid.sh                          | 13 -------------
 10 files changed, 67 insertions(+), 67 deletions(-)
-------------------------------------------------------------------------------
commit 71c80083e3ee35d8ea71fd12e923783a75300f22
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-23 08:33:42 +0200

    move uloop_timeout struct outside restart application, now restarts with
    correct flags, add files to gitignore

Base directory -> /
 .gitignore | 12 +++++++++++-
 parser.c   | 30 ++++++++----------------------
 2 files changed, 19 insertions(+), 23 deletions(-)
-------------------------------------------------------------------------------
commit 58ee1775d3ec4d5c5979687a1262a227d828b83e
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-20 16:01:36 +0200

    try to restart parser with execv, unsccessful adding to uloop, crashesh with
    uloop, does not without

Base directory -> /
 parser.c  | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 watcher.c | 41 ++++++++++++++++++++++++-------------
 2 files changed, 92 insertions(+), 19 deletions(-)
-------------------------------------------------------------------------------
commit d2420069fdda2d38b47ab1d7e06143ad5e05e52f
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-20 11:34:51 +0200

    kill and replace process with new start flags

Base directory -> /
 parser.c  |  5 ++--
 watcher.c | 98 ++++++++++++++++++++++++---------------------------------------
 2 files changed, 39 insertions(+), 64 deletions(-)
-------------------------------------------------------------------------------
2018-04-23 09:11:57 +02:00
Jakob Olsson
fc2d33ec4d remove capitalization 2018-04-23 09:01:49 +02:00
Jakob Olsson
99ac1c3c41 manual hash change 2018-04-19 14:04:56 +02:00
Jakob Olsson
79e09f6627 manual change of hash 2018-04-19 12:05:58 +02:00
Jakob Olsson
fb29645dbe add mosquitto package and adjust Makefile in onboardingd to accomodate 2018-04-19 10:51:40 +02:00
Jakob Olsson
35dee9de2e Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 258865c attempting execv solution that keeps pid
* aba0a7f some style change, documentation and name scheme changes
* f77798f swap functionality of set_configurations from parser to watcher and all corresponding changes
* 66b18db add timeout prior to lookup, small error fixes
* d5ad23f add restart from wtihin application functionality for watcher, some more small error fixes
* dc9a03e correct error printouts for invoking ubus from watcher, also provide preliminary restart functions in order to change paths and loglevel from within applications
* f914252 set buf mem to 0 prior to initializing, invoking ubus calls from separate binary works, however will not invoke after restart
* 9ac0215 add uloop and ubus object to watcher, currently incomplete
* e413469 small fix to make ubus IPC work through invoking ubus call
* b9135c8 attempt at invoking ubus method from outside binary that registers it
* a3001e0 update according to checkpatch errors and added some documentation
* c48bd84 added ubus IPC by system() from watcher
* 4ec1230 correction to parser header for declaration of check_pipe (should rename)
* 8bef035 does not compile -- fix header at monday
* 3227782 small fixes
* 07218dc prepare for ubus ipc, untested
* b02592a can change both arguments from single call to set_configuration with both arguments
* 0b2f4ec cleaned up and can now use same method to change configuration file and loglevel
* 6666a31 change config through UCI c API
* 877a72d add support for path through uci, loglevel timing out
* 3ff7676 delete binary
* dc74ccc forgot to add parser.c, test
* ee27697 add functionality to change configuration file through UCI api
* 4968afd some minor errors
* 24921f6 test stackoverflow code to see uci functionality
* 0cc6235 add return to prevent request timeout
* 5618a04 restart from init.d and add paranthesis
* 1e699fe fixed small errors
-------------------------------------------------------------------------------
commit 258865c880870d87fc90917140ab883e73d9c38a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-18 11:00:06 +0200

    attempting execv solution that keeps pid

Base directory -> /
 parse_args.c | 12 ++++++-----
 watcher.c    | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 70 insertions(+), 10 deletions(-)
-------------------------------------------------------------------------------
commit aba0a7f0ebf8663f9181c274fde4744e7673bff2
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-18 09:04:39 +0200

    some style change, documentation and name scheme changes

Base directory -> /
 Makefile     | 16 +++++-----
 debug.c      | 50 -------------------------------
 debug.h      |  8 -----
 parse_args.c | 50 +++++++++++++++++++++++++++++++
 parse_args.h |  8 +++++
 parser.c     | 55 +++++++++++++++++-----------------
 parser.h     | 43 ++++++++++++++++++++++++++-
 watcher.c    | 97 ++++++++++++++++--------------------------------------------
 8 files changed, 160 insertions(+), 167 deletions(-)
-------------------------------------------------------------------------------
commit f77798fdb527019b251044c63e01c685e64e4369
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-17 16:54:55 +0200

    swap functionality of set_configurations from parser to watcher and all
    corresponding changes

Base directory -> /
 parser.c  | 234 +++++++++++++-------------------------------------------------
 watcher.c | 136 ++++++++++++++++++++++++++++++++----
 2 files changed, 171 insertions(+), 199 deletions(-)
-------------------------------------------------------------------------------
commit 66b18dbc824259721fb1c628a28367fca1bcee44
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-17 15:39:55 +0200

    add timeout prior to lookup, small error fixes

Base directory -> /
 parser.c  | 2 +-
 watcher.c | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
commit d5ad23f9a91b021109082210d35f949ff4423eab
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-17 14:14:47 +0200

    add restart from wtihin application functionality for watcher, some more
    small error fixes

Base directory -> /
 parser.c  |  9 +++++----
 watcher.c | 26 ++++++++++++++++++++------
 2 files changed, 25 insertions(+), 10 deletions(-)
-------------------------------------------------------------------------------
commit dc9a03ea2309acb0a3d8077bf4a67cf42bb95b5f
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-17 13:32:27 +0200

    correct error printouts for invoking ubus from watcher, also provide
    preliminary restart functions in order to change paths and loglevel from
    within applications

Base directory -> /
 parser.c  | 61 +++++++++++++++++++++++++++++++++++++++++++++++++------------
 watcher.c | 41 +++++++++++++++++++++++++++++++----------
 2 files changed, 80 insertions(+), 22 deletions(-)
-------------------------------------------------------------------------------
commit f914252a366c6d253a0ad31ed9ddff11a0c59def
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-17 09:59:18 +0200

    set buf mem to 0 prior to initializing, invoking ubus calls from separate
    binary works, however will not invoke after restart

Base directory -> /
 watcher.c | 58 +++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 21 deletions(-)
-------------------------------------------------------------------------------
commit 9ac0215fa11dd9b5fd89c97dd2e52e0d8d8b5bf5
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-16 16:25:14 +0200

    add uloop and ubus object to watcher, currently incomplete

Base directory -> /
 parser.c  |   2 ++
 watcher.c | 103 +++++++++++++++++++++++++++++++++++++++++---------------------
 watcher.h |  10 ++++--
 3 files changed, 78 insertions(+), 37 deletions(-)
-------------------------------------------------------------------------------
commit e41346923ce263deadbb8c806fa41a876a1b6b70
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-16 14:39:43 +0200

    small fix to make ubus IPC work through invoking ubus call

Base directory -> /
 watcher.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit b9135c8eb608d2203f6820fe940609ce24b6dd21
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-16 12:33:31 +0200

    attempt at invoking ubus method from outside binary that registers it

Base directory -> /
 watcher.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit a3001e08a77a7a4597628f3a754eb7c30cdb4012
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-16 10:41:04 +0200

    update according to checkpatch errors and added some documentation

Base directory -> /
 parser.c  | 81 ++++++++++++++++++++++++---------------------------------------
 parser.h  | 74 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 watcher.c |  2 +-
 watcher.h |  2 +-
 4 files changed, 97 insertions(+), 62 deletions(-)
-------------------------------------------------------------------------------
commit c48bd844a11904a9cb9d73bffb4041b17a918b30
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-16 09:51:36 +0200

    added ubus IPC by system() from watcher

Base directory -> /
 parser.c  | 45 ++++++++++++++++++++++++++++++---------------
 watcher.c | 24 +++++++++++++-----------
 2 files changed, 43 insertions(+), 26 deletions(-)
-------------------------------------------------------------------------------
commit 4ec1230d5d98dac7a33b37191f2470aeca3cb34f
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-16 08:29:58 +0200

    correction to parser header for declaration of check_pipe (should rename)

Base directory -> /
 parser.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 8bef0353a661578d5358d315430e632bcb0d958c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 16:53:22 +0200

    does not compile -- fix header at monday

Base directory -> /
 parser.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit 3227782da6e164111ab121e875e165f8fe69bca4
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 16:49:30 +0200

    small fixes

Base directory -> /
 parser.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit 07218dc0e73b500aa586511296c3087153258d1a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 16:47:32 +0200

    prepare for ubus ipc, untested

Base directory -> /
 parser.c | 97 ++++++++++++++++++++++++++++------------------------------------
 1 file changed, 42 insertions(+), 55 deletions(-)
-------------------------------------------------------------------------------
commit b02592a3efac991ca7836bcf365570352f634c34
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 15:58:43 +0200

    can change both arguments from single call to set_configuration with both
    arguments

Base directory -> /
 parser.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 0b2f4ecbfe469acc974da9c15aa72afca913851a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 14:49:52 +0200

    cleaned up and can now use same method to change configuration file and
    loglevel

Base directory -> /
 parser.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
-------------------------------------------------------------------------------
commit 6666a31f3e3fb4045c087a94bd0ac80bcc5b21a9
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 14:11:13 +0200

    change config through UCI c API

Base directory -> /
 parser.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
-------------------------------------------------------------------------------
commit 877a72dc5d490578b47ddcd26d114352724a97c4
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 11:57:57 +0200

    add support for path through uci, loglevel timing out

Base directory -> /
 parser.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit 3ff76761d2dc05061d9d68282cfa93bfbe1e971c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 10:32:43 +0200

    delete binary

Base directory -> /
 parser | Bin 57260 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
-------------------------------------------------------------------------------
commit dc74ccc90b12899a92b34f39314fd489ceeda26b
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 10:32:06 +0200

    forgot to add parser.c, test

Base directory -> /
 parser.c | 78 ++++++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 46 insertions(+), 32 deletions(-)
-------------------------------------------------------------------------------
commit ee276970030b3a53cc041df0596c32615ce1a2de
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-13 10:26:26 +0200

    add functionality to change configuration file through UCI api

Base directory -> /
 Makefile |   2 +-
 parser   | Bin 0 -> 57260 bytes
 2 files changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 4968afd535bf929c4783cb593ad7d19ba2078b5c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 16:47:49 +0200

    some minor errors

Base directory -> /
 parser.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
commit 24921f64ca06a077fd35018b8e8ccda69e5d9899
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 16:35:38 +0200

    test stackoverflow code to see uci functionality

Base directory -> /
 parser.c | 53 +++++++++++++++++++++++++++++++++++++++++++++--------
 parser.h | 42 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 85 insertions(+), 10 deletions(-)
-------------------------------------------------------------------------------
commit 0cc623501d20bc7e11e0c441e6ef70d4f78cd2e3
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 14:42:47 +0200

    add return to prevent request timeout

Base directory -> /
 parser.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit 5618a04628e3d1ac147461d0aa1fd39e8c03e84c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 13:57:55 +0200

    restart from init.d and add paranthesis

Base directory -> /
 parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 1e699fe9cc0810470e3445af39ff32d09ce93600
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 13:28:04 +0200

    fixed small errors

Base directory -> /
 parser.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
2018-04-18 11:36:24 +02:00
Jakob Olsson
6553804000 change verbose flag to take number 2018-04-18 11:01:11 +02:00
Jakob Olsson
a525ba8db1 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 7801606 take integer as input for ubus method
* ba0c6fa change set_loglevel to accept int
* f061d83 add null termination to strings prior to strcat, add to publish ubus method to alter loglevel, and some minor typoes
-------------------------------------------------------------------------------
commit 7801606c2a529348a08b32e6fc9aaffd324cbe50
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 12:08:42 +0200

    take integer as input for ubus method

Base directory -> /
 parser.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit ba0c6fada99fd51b09752753b1fe06d12229c4e9
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 10:58:23 +0200

    change set_loglevel to accept int

Base directory -> /
 parser.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
commit f061d8312861c46fcf27ef159dc9bf795aac5e55
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 10:49:33 +0200

    add null termination to strings prior to strcat, add to publish ubus method
    to alter loglevel, and some minor typoes

Base directory -> /
 parser.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
839b785329 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 3ffa4fd typo
-------------------------------------------------------------------------------
commit 3ffa4fdfe060b15ee21628d5bd3ed2b6563b1018
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 10:39:42 +0200

    typo

Base directory -> /
 parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
dae114b97b add JSON folder to copy to router so dont have to write it manually all the time to test 2018-04-12 13:49:55 +02:00
Jakob Olsson
f6ec7a3f58 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 36a4757 fix array format
*   e6451c7 Merge branch 'jakob' of private.inteno.se:iopsys-onboarding into jakob
|\
| * 7fe3e74 can send argument and print data
* | 0678b94 add functionality to pass path or verbose argument, alters configuration file and restarts daemon
|/
* 017a6de smaller error fixes
* 3509854 attempt at ubus method with argument
* 6b350fe add table brackets surrounding each element in an array
* c5f9df1 remove test printouts
* 2a72406 open table inside explore object rather than prior
* bca5404 additional printout tests
* 49a7de6 manual blobmsg addition to test print
* 1617af6 should now record empty arrays
* 0b31324 code errors fix
* 6e225cb keep track of current json structure in blobmsg
* 70eb760 ubus method call and application now both work, small bug fix and small code readability improvement.
* 58a34ac additional confusion regarding file path and pipe fixes
* 001926b mixed up file path and pipe path
* 1523a26 fix minor typoes and errors
* 8a3837e move main, add uloop
* 5c68335 additional test.
* 353fd54 print dummy info to ubus onboarding.parser status
* 17a77e5 missed to change name and add context, publish objects works
* c76006c corrected to ubus_add_object...
*   9216101 attempt to publish ubus objects
|\
| * 74c5b96 minor trivial fixes to watcher, parser & makefile. Does not publish ubus objects.
* b43931b attempt to publish ubus object
-------------------------------------------------------------------------------
commit 36a47571c015cb4e5c8b778f2e6d27f2343260e8
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 09:21:33 +0200

    fix array format

Base directory -> /
 parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit e6451c7c6cfc7d263c2830be64d19c6852482975
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 09:17:42 +0200

    Merge branch 'jakob' of private.inteno.se:iopsys-onboarding into jakob

Base directory -> /
 parser.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit 0678b945d6d2d72216627d7c43646a208140fdfb
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-12 09:16:08 +0200

    add functionality to pass path or verbose argument, alters configuration
    file and restarts daemon

Base directory -> /
 parser.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 parser.h |  4 ++--
 2 files changed, 50 insertions(+), 8 deletions(-)
-------------------------------------------------------------------------------
commit 7fe3e743a2b181ea9227efcfb98a1c7f58f3d480
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 16:49:54 +0200

    can send argument and print data

Base directory -> /
 parser.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit 017a6de37338fcfd9c4e6d8f3a20c44f47b14322
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 16:19:59 +0200

    smaller error fixes

Base directory -> /
 parser.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
-------------------------------------------------------------------------------
commit 350985405f9561ff5ec7ed0396babe5b5a2a233a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 16:13:43 +0200

    attempt at ubus method with argument

Base directory -> /
 parser.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 61 insertions(+), 11 deletions(-)
-------------------------------------------------------------------------------
commit 6b350feff33782b29a5b49956d211dcf3990bed9
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 13:39:44 +0200

    add table brackets surrounding each element in an array

Base directory -> /
 parser.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
commit c5f9df159ade9619b25829857929d71291720410
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 13:24:13 +0200

    remove test printouts

Base directory -> /
 parser.c | 37 +------------------------------------
 parser.h |  1 +
 2 files changed, 2 insertions(+), 36 deletions(-)
-------------------------------------------------------------------------------
commit 2a72406c8aecfdb7d5ce83320d94ab108806ae61
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 13:10:06 +0200

    open table inside explore object rather than prior

Base directory -> /
 parser.c | 52 +++++++++++++++++++++++++++++-----------------------
 1 file changed, 29 insertions(+), 23 deletions(-)
-------------------------------------------------------------------------------
commit bca54040f1faa6a795194ac8c8f7303e381a24a4
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 11:30:12 +0200

    additional printout tests

Base directory -> /
 parser.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
-------------------------------------------------------------------------------
commit 49a7de6e7bc854072f877469e103a86c6dd2563c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 11:14:16 +0200

    manual blobmsg addition to test print

Base directory -> /
 parser.c | 31 +++++++++++++++++--------------
 parser.h |  2 +-
 2 files changed, 18 insertions(+), 15 deletions(-)
-------------------------------------------------------------------------------
commit 1617af6cde6ea57a635ba31258093c1a70464a54
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 10:48:40 +0200

    should now record empty arrays

Base directory -> /
 parser.c | 26 ++++++++++++++------------
 parser.h |  1 +
 2 files changed, 15 insertions(+), 12 deletions(-)
-------------------------------------------------------------------------------
commit 0b31324d9a2be85b00757cde2ec5b0a7d4e504a2
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 09:39:47 +0200

    code errors fix

Base directory -> /
 parser.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
-------------------------------------------------------------------------------
commit 6e225cb6c62da2987925c2da59408b3fc67b1278
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 09:36:11 +0200

    keep track of current json structure in blobmsg

Base directory -> /
 parser.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit 70eb760c7e2492e1a133519617a7c2952d547234
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 09:17:01 +0200

    ubus method call and application now both work, small bug fix and small code
    readability improvement.

Base directory -> /
 parser.c  | 65 ++++++++++++++++++++++++++++++---------------------------------
 watcher.h |  4 ++--
 2 files changed, 33 insertions(+), 36 deletions(-)
-------------------------------------------------------------------------------
commit 58a34ac88530330de97df1e256da00fb8b65b6ce
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 08:40:19 +0200

    additional confusion regarding file path and pipe fixes

Base directory -> /
 watcher.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
commit 001926b0cc8e0648df60fa5c4ed372bec0e42707
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-11 08:29:34 +0200

    mixed up file path and pipe path

Base directory -> /
 watcher.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
commit 1523a26640a5db09e78c042403ec3738006c99ab
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 16:50:32 +0200

    fix minor typoes and errors

Base directory -> /
 parser.c  | 9 +++++----
 parser.h  | 3 +++
 watcher.c | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
-------------------------------------------------------------------------------
commit 8a3837ec132c9c4bf850f046057e1c93c44d6fb3
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 16:43:57 +0200

    move main, add uloop

Base directory -> /
 parser.c | 127 ++++++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 77 insertions(+), 50 deletions(-)
-------------------------------------------------------------------------------
commit 5c68335f6fa4a5e0015756e2f174415545af778f
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 13:49:12 +0200

    additional test.

Base directory -> /
 parser.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 353fd547584c58316b475e2b00297ffc63dce1b8
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 12:27:22 +0200

    print dummy info to ubus onboarding.parser status

Base directory -> /
 parser.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 17a77e56d7a7a4200917cb7b4ad17c60d20e2665
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 11:07:58 +0200

    missed to change name and add context, publish objects works

Base directory -> /
 parser.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit c76006c38cb1dbefea92cfab49d84b1bf3a83b17
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 10:55:32 +0200

    corrected to ubus_add_object...

Base directory -> /
 parser.c  | 5 ++++-
 watcher.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 921610133314811605955335f91f997d7173a62b
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 10:41:48 +0200

    attempt to publish ubus objects

Base directory -> /
 Makefile  | 2 +-
 parser.c  | 4 ++--
 watcher.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
commit b43931b44d94855015c77cb0c309bd6aa6140a47
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 09:30:57 +0200

    attempt to publish ubus object

Base directory -> /
 parser.c  | 25 +++++++++++++++++++------
 parser.h  |  8 ++++----
 watcher.c | 25 +++++++++++++++++++------
 watcher.h |  2 +-
 4 files changed, 43 insertions(+), 17 deletions(-)
-------------------------------------------------------------------------------
commit 74c5b96edb5d25d139322d7dfb82978abbe965a2
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-10 08:46:18 +0200

    minor trivial fixes to watcher, parser & makefile. Does not publish ubus
    objects.

Base directory -> /
 Makefile  | 2 +-
 parser.c  | 6 +++---
 watcher.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
f8a92990b0 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* e7129e9 add ubus library to makefile
* e6f93e0 publish ubus objects
* fc0af41 changes to style, also accordance to checkpatch
-------------------------------------------------------------------------------
commit e7129e9f5a2145e20f2011e08233471a4c8ce73b
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-09 16:28:32 +0200

    add ubus library to makefile

Base directory -> /
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit e6f93e00ae413f5d0b5520397e59b159f958cfba
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-09 15:59:40 +0200

    publish ubus objects

Base directory -> /
 parser.c  | 21 +++++++++++++++++++++
 watcher.c | 21 +++++++++++++++++++++
 2 files changed, 42 insertions(+)
-------------------------------------------------------------------------------
commit fc0af41610d1ad2e10b254b4e641de5b248938a0
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-09 15:37:40 +0200

    changes to style, also accordance to checkpatch

Base directory -> /
 parser.c  | 71 ++++++++++++++++++---------------------------------------------
 parser.h  |  1 +
 watcher.c | 39 ++++++++++++++---------------------
 watcher.h |  4 ++--
 4 files changed, 39 insertions(+), 76 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
e7bceaacbb Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* e6f93e0 publish ubus objects
* fc0af41 changes to style, also accordance to checkpatch
-------------------------------------------------------------------------------
commit e6f93e00ae413f5d0b5520397e59b159f958cfba
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-09 15:59:40 +0200

    publish ubus objects

Base directory -> /
 parser.c  | 21 +++++++++++++++++++++
 watcher.c | 21 +++++++++++++++++++++
 2 files changed, 42 insertions(+)
-------------------------------------------------------------------------------
commit fc0af41610d1ad2e10b254b4e641de5b248938a0
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-09 15:37:40 +0200

    changes to style, also accordance to checkpatch

Base directory -> /
 parser.c  | 71 ++++++++++++++++++---------------------------------------------
 parser.h  |  1 +
 watcher.c | 39 ++++++++++++++---------------------
 watcher.h |  4 ++--
 4 files changed, 39 insertions(+), 76 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
cb2527007b forgot ! on shebang... 2018-04-12 13:49:55 +02:00
Jakob Olsson
6b92fe1d67 new name 2018-04-12 13:49:55 +02:00
Jakob Olsson
64f92411a6 test please dont look 2018-04-12 13:49:55 +02:00
Jakob Olsson
5f29bb8c6a re-add start and stop 2018-04-12 13:49:55 +02:00
Jakob Olsson
82addbb34f minor errors 2018-04-12 13:49:55 +02:00
Jakob Olsson
aad6415b66 change to naming convention 2018-04-12 13:49:55 +02:00
Jakob Olsson
b427c7b75c Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* aeca1e5 add blob list.h linked list library
* 1a1ea5b push common.h
* 6ed19ae swap to libubox test... dont look thanks
-------------------------------------------------------------------------------
commit aeca1e5f1385feef723af4955d665f244b75f5cd
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-09 09:50:43 +0200

    add blob list.h linked list library

Base directory -> /
 Makefile |  2 +-
 parser.c | 80 +++++++++++++++++++++++++++++-----------------------------------
 parser.h | 27 ++++++++--------------
 3 files changed, 47 insertions(+), 62 deletions(-)
-------------------------------------------------------------------------------
commit 1a1ea5bdc4033bbf3adbb1991572abdd2fff6f96
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-06 15:37:03 +0200

    push common.h

Base directory -> /
 common.h | 4 ++++
 1 file changed, 4 insertions(+)
-------------------------------------------------------------------------------
commit 6ed19ae13fb39e4b3a38c10b8eee307c46854a0a
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-06 15:35:20 +0200

    swap to libubox test... dont look thanks

Base directory -> /
 Makefile  |   4 +-
 debug.c   |   4 +-
 debug.h   |   2 +-
 parser.c  | 152 +++++++++++++++++++++++++++-----------------------------------
 parser.h  |   4 ++
 watcher.c |  49 ++++++++++----------
 watcher.h |  13 +++---
 7 files changed, 105 insertions(+), 123 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
a0afd51889 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 4c3b4b4 minor bug fix, faulty variable order
* 2195e87 get file path from flag
-------------------------------------------------------------------------------
commit 4c3b4b446c2c244d3dfee0a6fd9a18f97a56bfcf
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-06 10:20:49 +0200

    minor bug fix, faulty variable order

Base directory -> /
 debug.h   | 2 +-
 watcher.c | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
commit 2195e87d017b174db3107e9b9d17d1b4520307be
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-06 09:57:33 +0200

    get file path from flag

Base directory -> /
 debug.c  | 65 ++++++++++++++++++++++++++++++++++++----------------------------
 debug.h  |  6 +++++-
 parser.c | 36 +++++++++++------------------------
 parser.h | 16 ++++++++--------
 4 files changed, 61 insertions(+), 62 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
c35d6e7db3 add file_path check to init.d script 2018-04-12 13:49:55 +02:00
Jakob Olsson
338465db4c add file path 2018-04-12 13:49:55 +02:00
Jakob Olsson
c4d04e1650 correct config structure 2018-04-12 13:49:55 +02:00
Jakob Olsson
7e0ee31372 config load typo... 2018-04-12 13:49:55 +02:00
Jakob Olsson
65eb95290e correct if cases and minor errors 2018-04-12 13:49:55 +02:00
Jakob Olsson
818c5f19c6 add possibility to stop and start 2018-04-12 13:49:55 +02:00
Jakob Olsson
aeb6c29f32 add configuration, make daemon depend on config for debug options 2018-04-12 13:49:55 +02:00
Jakob Olsson
9e6144f9d6 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 0f39861 correct json include
-------------------------------------------------------------------------------
commit 0f3986168f978d435c1dc0798ead921c18e913d1
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-05 15:20:50 +0200

    correct json include

Base directory -> /
 parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
48d8788fba Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 43c64d2 correct watcher in Make
* 66bbf23 add my own debug library to enable --verbose debug
-------------------------------------------------------------------------------
commit 43c64d2ccbd69c8135f975c389bb04ce23ead66c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-05 15:03:53 +0200

    correct watcher in Make

Base directory -> /
 Makefile | 3 +++
 debug.c  | 1 +
 2 files changed, 4 insertions(+)
-------------------------------------------------------------------------------
commit 66bbf23c9bac0882047f322b02a90f84cfd4a06f
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-05 14:43:41 +0200

    add my own debug library to enable --verbose debug

Base directory -> /
 JSON/APs.json |   6 +--
 Makefile      |  16 ++++---
 debug.c       |  40 ++++++++++++++++
 debug.h       |   4 ++
 parser.c      | 148 ++++++++++++++++++++++++++++++++++++++++------------------
 parser.h      |   5 +-
 watcher.c     |  32 ++++++++-----
 watcher.h     |   2 +-
 8 files changed, 185 insertions(+), 68 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
effd2ebb48 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 7359cac forget to change path...
-------------------------------------------------------------------------------
commit 7359cac711a4f3f0c882381aecf03f8ecefe4d40
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-05 10:28:06 +0200

    forget to change path...

Base directory -> /
 parser.c  | 2 +-
 watcher.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
e45b093cc5 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 647ef53 add correct messages and fixed some faulty behaviour (infinitely reading pipe)
-------------------------------------------------------------------------------
commit 647ef53d88bc941dbb0b14855e8ae38d7a4c7fbb
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-05 10:18:02 +0200

    add correct messages and fixed some faulty behaviour (infinitely reading
    pipe)

Base directory -> /
 JSON/APs.json |  2 +-
 parser.c      | 16 ++++++++++------
 watcher.c     | 45 +++++++++++----------------------------------
 watcher.h     |  9 ++++++---
 4 files changed, 28 insertions(+), 44 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
bbbf1327c4 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 1ff31b2 will try again in 30s if file did not exist
-------------------------------------------------------------------------------
commit 1ff31b20be62ff71d8a0697c5655003ed2b795c4
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-05 08:32:55 +0200

    will try again in 30s if file did not exist

Base directory -> /
 watcher.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
f26fd5d994 change to redirect stdout and stderr to logd 2018-04-12 13:49:55 +02:00
Jakob Olsson
10a8938afd add prints to functions - will hopefully solve starting as daemon 2018-04-12 13:49:55 +02:00
Jakob Olsson
b6e0983d92 remove duplicate start service 2018-04-12 13:49:55 +02:00
Jakob Olsson
d7973f4ede Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 500f481 Merge branch 'jakob' of private.inteno.se:iopsys-onboarding into jakob
* 4a05d44 move struct definition to header
-------------------------------------------------------------------------------
commit 500f4815385b8d434d0be997c9a31556025b8d21
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-04 15:53:38 +0200

    Merge branch 'jakob' of private.inteno.se:iopsys-onboarding into jakob

Base directory -> /
 parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 4a05d44da39640af324321ff42b66c03da9cf431
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-04 15:53:01 +0200

    move struct definition to header

Base directory -> /
 parser.c | 32 +++++++++++++++++---------------
 parser.h | 38 ++++++++++++++++++++++++++------------
 2 files changed, 43 insertions(+), 27 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
3dffcf6401 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* 8a35b40 change include to fit openWRT
-------------------------------------------------------------------------------
commit 8a35b40d95f98d6944c98f7dc7be620c5a1fd1f5
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-04 14:43:18 +0200

    change include to fit openWRT

Base directory -> /
 parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
3dafd0d521 Update feed [ feed_inteno_packages ] package [ onboardingd ]
-------------------------------------------------------------------------------
* fecd251 remove garbage file
* 38bb4ef add gitignore
* 5ae1d88 removed some options
-------------------------------------------------------------------------------
commit fecd251a7b36e03ce809be54b29ce7676bf8f00c
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-04 14:24:34 +0200

    remove garbage file

Base directory -> /
 JSON/.APs.json.swp | Bin 1024 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
-------------------------------------------------------------------------------
commit 38bb4ef90680e494376a06adfdef506182a9f5c7
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-04 14:22:39 +0200

    add gitignore

Base directory -> /
 .gitignore | 4 ++++
 1 file changed, 4 insertions(+)
-------------------------------------------------------------------------------
commit 5ae1d88c43c3cc03f940db254637d78196a5429d
Author: Jakob Olsson <jakobols@kth.se>
Date: 2018-04-04 13:57:46 +0200

    removed some options

Base directory -> /
 parser.c  |  4 ++--
 watcher.c | 15 ++-------------
 2 files changed, 4 insertions(+), 15 deletions(-)
-------------------------------------------------------------------------------
2018-04-12 13:49:55 +02:00
Jakob Olsson
6e76de6519 added parser and watcher in procd 2018-04-12 13:49:55 +02:00
Jakob Olsson
6c5e065975 changed hash manually again ?? 2018-04-12 13:49:55 +02:00
Jakob Olsson
f4d2993bac removed some typo error 2018-04-12 13:49:55 +02:00
Jakob Olsson
d3e1350ee4 changed to most recent hash manually 2018-04-12 13:49:55 +02:00
Jakob Olsson
58a8256ee2 makefile changes 2018-04-12 13:49:55 +02:00
Jakob Olsson
09a486f90a hash update manual test 2018-04-12 13:49:55 +02:00
Jakob Olsson
9e55257916 change of hash manually test 2018-04-12 13:49:55 +02:00
Jakob Olsson
4118abd13e correct url for private folder 2018-04-12 13:49:55 +02:00
Jakob Olsson
95e4761eea some changes 2018-04-12 13:49:55 +02:00
Jakob Olsson
59bbfe6bf8 corrections within makefile addresses 2018-04-12 13:49:55 +02:00
Jakob Olsson
03df688e0e first commit 2018-04-12 13:49:55 +02:00
588 changed files with 20187 additions and 29746 deletions

67
ated/Makefile Normal file
View File

@@ -0,0 +1,67 @@
#
# Copyright (C) 2016 inteno
#
# 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:=ated
PKG_VERSION:=1.2.2
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=f614cba983d827d5185c60a6a5a35530621d44d2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/ated
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
include $(INCLUDE_DIR)/package.mk
define Package/ated
CATEGORY:=Utilities
TITLE:=Daemon for handling wifi calibration
URL:=
DEPENDS:= libc
endef
define Package/ated/description
Daemon for handling wifi calibration
endef
#TARGET_CFLAGS += -I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include
MAKE_FLAGS += \
v=2 \
m=3
#TARGET_CPPFLAGS := \
# -I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
# -I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
# $(TARGET_CPPFLAGS)
# we donot wwant to have any install.
define Build/Install/Default
endef
define Package/ated/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ated $(1)/sbin/
endef
$(eval $(call BuildPackage,ated))

View File

@@ -13,9 +13,6 @@ PKG_MD5SUM:=b72c17870bfab2fd791b1f6de4d79f9e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)

View File

@@ -1,23 +0,0 @@
config BBF_VENDOR_EXTENSION
bool "Enable Vendor Extension"
default y
config BBF_VENDOR_LIST
string "Vendor List"
default "iopsys"
config BBF_VENDOR_PREFIX
string "Vendor Prefix"
default "X_IOPSYS_EU_"
config BBF_TR143
bool "Enable TR-143 Data Model Support"
default y
config BBF_TR471
bool "Enable TR-471 Data Model Support"
default y
config BBF_MAX_OBJECT_INSTANCES
int "Maximum number of instances per object"
default 255

View File

@@ -1,252 +0,0 @@
#
# Copyright (C) 2023 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.4.4
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=3c0f416653781f04e2b73e7da6ccaddf6ab691de
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libbbfdm-api
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
ABI_VERSION:=1.0
endef
define Package/libbbfdm/default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for broadband forum data model support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbfdm-api \
+BBF_TR471:obudpst
endef
define Package/libbbfdm
$(Package/libbbfdm/default)
TITLE += (default)
VARIANT:=default
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
DEFAULT_VARIANT:=1
endef
define Package/libbbfdm-mbedtls
$(Package/libbbfdm/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
VARIANT:=mbedtls
CONFLICTS := libbbfdm libbbfdm-openssl libbbfdm-wolfssl
endef
define Package/libbbfdm-openssl
$(Package/libbbfdm/default)
TITLE += (openssl)
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
VARIANT:=openssl
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-wolfssl
endef
define Package/libbbfdm-wolfssl
$(Package/libbbfdm/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
VARIANT:=wolfssl
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-openssl
endef
define Package/bbfdmd
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +PACKAGE_libbbfdm-mbedtls:libbbfdm-mbedtls \
+PACKAGE_libbbfdm-openssl:libbbfdm-openssl +PACKAGE_libbbfdm-wolfssl:libbbfdm-wolfssl \
+PACKAGE_libbbfdm:libbbfdm
endef
define Package/userinterface
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Package to add Device.UserInterface. datamodel support
endef
define Package/userinterface/description
Package to add Device.UserInterface. datamodel support
endef
define Package/libbbfdm/config
source "$(SOURCE)/Config_bbfdm.in"
endef
define Package/libbbfdm-api/description
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
endef
define Package/libbbfdm/description
Library contains the data model tree. It includes TR181, TR143 data models
endef
ifeq ($(USE_LOCAL),1)
define Build/Prepare
$(CP) ~/git/bbfdm/* $(PKG_BUILD_DIR)/
endef
endif
CMAKE_OPTIONS += \
-DBBF_TR181=ON
-DBBF_WIFI_DATAELEMENTS=ON
ifeq ($(CONFIG_BBF_TR143),y)
CMAKE_OPTIONS += \
-DBBF_TR143=ON
endif
ifeq ($(CONFIG_BBF_TR471),y)
CMAKE_OPTIONS += \
-DBBF_TR471=ON
endif
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
CMAKE_OPTIONS += \
-DBBF_VENDOR_EXTENSION=ON
CMAKE_OPTIONS += \
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
-DDAEMON_JSON_INPUT:String="/etc/bbfdm/input.json" \
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
endif ##CONFIG_BBF_VENDOR_EXTENSION
ifeq ($(BUILD_VARIANT),default)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),openssl)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
endif
ifeq ($(BUILD_VARIANT),mbedtls)
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
endif
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
CMAKE_OPTIONS += \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
endif
define Package/libbbfdm-api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
endef
define Package/libbbfdm/default/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/lib/
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
$(INSTALL_BIN) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/97-firewall-service
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
ifeq ($(CONFIG_BBF_TR143),y)
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
endif
endef
define Package/libbbfdm/default/prerm
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
endef
define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
endef
define Package/userinterface/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/userinterface $(1)/lib/upgrade/keep.d/userinterface
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
endef
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/tr181/device.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/vendor.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
# Work around for backward compatibility
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbf_api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/libbbfdm_api.h $(1)/usr/include/libbbf_api.h
endef
$(eval $(call BuildPackage,libbbfdm-api))
$(eval $(call BuildPackage,libbbfdm))
$(eval $(call BuildPackage,libbbfdm-openssl))
$(eval $(call BuildPackage,libbbfdm-wolfssl))
$(eval $(call BuildPackage,libbbfdm-mbedtls))
$(eval $(call BuildPackage,bbfdmd))
$(eval $(call BuildPackage,userinterface))

View File

@@ -1,9 +0,0 @@
#
# Copyright (C) 2023 IOPSYS
#
define BbfdmInstallPlugin
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
endef

View File

@@ -1,17 +0,0 @@
#!/bin/sh
BBFDMD="/usr/sbin/bbfdmd"
bbfdm_add_service()
{
local name path
name="${1}"
path="${2}"
if [ -z "${name}" -o -z "$path" ]; then
return 0;
fi
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
}

View File

@@ -1,7 +0,0 @@
config bbfdmd 'bbfdmd'
option enabled '1'
option loglevel '1'
option refresh_time '10'
option transaction_timeout '30'

View File

@@ -1,3 +0,0 @@
config userinterface 'global'
option enable '1'

View File

@@ -1,74 +0,0 @@
#!/bin/sh
. /lib/functions.sh
log() {
echo "${@}"|logger -t firewall.dnat -p info
}
exec_cmd() {
if ! eval "$*"; then
log "Failed to run [$*]"
fi
}
reorder_dnat_rules() {
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
for chain in ${nat_chains}; do
# Collect empty remote host & empty dport rules
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect empty remote host but non empty dport rules
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Collect non empty remote host but empty dport rules
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
exec_cmd $cmd1
done
fi
# Now add rules as per datamodel precedence shown below
## Non empty remote host, empty dport
## empty remote host, non empty dport
## empty remote host, empty dport
if [ -n "${EMPTY_PORT}" ]; then
echo "${EMPTY_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
if [ -n "${EMPTY_HOST}" ]; then
echo "${EMPTY_HOST}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
if [ -n "${EMPTY_HOST_PORT}" ]; then
echo "${EMPTY_HOST_PORT}" | while read cmd; do
cmd1="iptables -t nat $(echo $cmd)"
exec_cmd $cmd1
done
fi
done
}
# Re-order portmapping rules according to precedence hierarchy
reorder_dnat_rules

View File

@@ -1,163 +0,0 @@
#!/bin/sh
. /lib/functions.sh
log() {
echo "${@}"|logger -t firewall.service -p info
}
exec_cmd() {
if ! eval "$*"; then
log "Failed to run [$*]"
echo "-1"
return 0
fi
echo "0"
return 0
}
add_iptable_rule() {
chain_name=$1
protocol=$2
dest_port=$3
icmp_type=$4
family=$5
src_prefix=$6
action=$7
res=-1
cmd="-I ${chain_name}"
if [ -n "${protocol}" ]; then
cmd="${cmd} -p $protocol"
if [ "${protocol}" -eq 41 ] || [ "${protocol}" -eq 43 ] || [ "${protocol}" -eq 44 ] ||
[ "${protocol}" -eq 58 ] || [ "${protocol}" -eq 59 ] || [ "${protocol}" -eq 60 ]; then
# Explicit v6 protocols
if [ "${family}" = "ipv4" ]; then
echo $res
return 0
else
family="ipv6"
fi
elif [ "${protocol}" -eq 1 ]; then
# Explicit v4 protocols
if [ "${family}" = "ipv6" ]; then
echo $res
return 0
else
family="ipv4"
fi
fi
# Limitation:: iptables do not accept dport without specific protocol
count=$(echo "${dest_port}" | sed -n "/-1/p" | wc -l)
if [ "${count}" -eq 0 ]; then
# dest_port not contains -1 so need to have this match criteria
count=$(echo "${dest_port}" | wc -w)
if [ "${count}" -gt 1 ]; then
# multiple ports present
port=$(echo "${dest_port}" | sed "s/ /,/g")
cmd="${cmd} -m multiport --dports ${port}"
else
cmd="${cmd} --dport ${dest_port}"
fi
fi
fi
if [ "${family}" = "ipv4" ] || [ "${family}" = "-1" ]; then
if [ "${protocol}" -eq 1 ] && [ "${icmp_type}" -ge 0 ]; then
cmd="${cmd} --icmp-type ${icmp_type}"
fi
if [ -z "${src_prefix}" ]; then
res=$(exec_cmd "iptables ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
else
#Add ipv4 sources if any
src_list=""
for src in $src_prefix; do
ret=$(echo $src | grep ":" | wc -l)
if [ "${ret}" -eq 0 ]; then
src_list="$src,$src_list"
fi
done
if [ -n "$src_list" ]; then
src_list=$(echo "${src_list}" | sed "s/,$//")
res=$(exec_cmd "iptables -s $src_list ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
fi
fi
fi
if [ "${family}" = "ipv6" ] || [ "${family}" = "-1" ]; then
if [ "${protocol}" -eq 58 ] && [ "${icmp_type}" -ge 0 ]; then
cmd="${cmd} --icmpv6-type ${icmp_type}"
fi
if [ -z "${src_prefix}" ]; then
res=$(exec_cmd "ip6tables ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
else
#Add ipv6 sources if any
src_list=""
for src in $src_prefix; do
ret=$(echo $src | grep ":" | wc -l)
if [ "${ret}" -eq 1 ]; then
src_list="$src,$src_list"
fi
done
if [ -n "$src_list" ]; then
src_list=$(echo "${src_list}" | sed "s/,$//")
res=$(exec_cmd "ip6tables -s $src_list ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
fi
fi
fi
echo $res
}
add_service() {
local enable proto family dest_port interface target icmp_type
config_get enable "$1" enable "0"
config_get icmp_type "$1" icmp_type "-1"
config_get target "$1" target "Accept"
config_get interface "$1" interface ""
config_get family "$1" family "-1"
config_get dest_port "$1" dest_port "-1"
config_get proto "$1" proto "-1"
config_get src_prefix "$1" src_prefix ""
if [ "${enable}" -eq 0 ] || [ -z "${interface}" ]; then
return 0
fi
action=$(echo "${target}" | tr a-z A-Z)
chain_name="zone_${interface}_input"
res=0
count=$(echo "${proto}" | sed -n "/-1/p" | wc -l)
if [ "${count}" -eq 0 ]; then
# proto not contains -1 so need to have this match criteria
for protocol in $proto; do
res=$(add_iptable_rule "$chain_name" "$protocol" "$dest_port" "$icmp_type" "$family" "$src_prefix" "$action")
done
else
# proto contains -1 so no need to have this match criteria
res=$(add_iptable_rule "$chain_name" "" "$dest_port" "$icmp_type" "$family" "$src_prefix" "$action")
fi
if [ "${res}" -ne 0 ]; then
uci -q set firewall."${1}".status="Error"
else
uci -q set firewall."${1}".status=""
fi
uci commit firewall
}
config_load firewall
config_foreach add_service "service"

View File

@@ -1,125 +0,0 @@
#!/bin/sh
. /lib/functions.sh
IDENTIFIER="UI-REMOTE-ACCESS-WAN"
log() {
echo "${@}"|logger -t firewall.userinterface -p info
}
if [ ! -f "/etc/config/userinterface" ] || [ ! -f "/etc/config/nginx" ]; then
exit 0;
fi
exec_cmd() {
if ! "$@"; then
log "Failed to run [$*]"
fi
}
delete_ui_firewall_rules() {
input_chains=$(iptables -S | grep -E "^-N zone[a-zA-Z0-9_]+input$" | cut -d' ' -f 2)
output_chains=$(iptables -S | grep -E "^-N zone[a-zA-Z0-9_]+output$" | cut -d' ' -f 2)
for chain in ${input_chains}; do
CMD="iptables -w 1 -t filter -nL ${chain} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd iptables -w 1 -t filter -D "${chain}" "${rule_num}";
fi
done
done
for chain in ${output_chains}; do
CMD="iptables -w 1 -t filter -nL ${chain} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd iptables -w 1 -t filter -D "${chain}" "${rule_num}";
fi
done
done
input6_chains=$(ip6tables -S | grep -E "^-N zone[a-zA-Z0-9_]+input$" | cut -d' ' -f 2)
output6_chains=$(ip6tables -S | grep -E "^-N zone[a-zA-Z0-9_]+output$" | cut -d' ' -f 2)
for chain in ${input6_chains}; do
CMD="ip6tables -w 1 -t filter -nL ${chain} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd ip6tables -w 1 -t filter -D "${chain}" "${rule_num}";
fi
done
done
for chain in ${output6_chains}; do
CMD="ip6tables -w 1 -t filter -nL ${chain} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd ip6tables -w 1 -t filter -D "${chain}" "${rule_num}";
fi
done
done
}
configure_ui_firewall_rule() {
local sec="${1}"
local enabled access interface
local port=""
config_get_bool enabled "${sec}" uci_enable '1'
config_get access "${sec}" uci_access ""
config_get interface "${sec}" uci_interface ""
if [ "${enabled}" -eq "1" ] && [ "${access}" == "remote" ] && [ -n "${interface}" ]; then
port_list=$(uci -q show nginx."${1}".listen|cut -d'=' -f 2|sed "s/'/ /g"|sed "s/\[\:\:\]\://g")
for item in ${port_list}; do
if [ -z "${item##[0-9]*}" ]; then
port="${item}"
break
fi
done
if [ -z "${port}" ]; then
return 0
fi
zone="zone_${interface}_input"
iptables -w 1 -t filter -nL ${zone} 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
iptables -w 1 -I "${zone}" -p tcp -m multiport --dports "${port}" -m conntrack --ctstate NEW,ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
ip6tables -w 1 -t filter -nL ${zone} 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
ip6tables -w 1 -I "${zone}" -p tcp -m multiport --dports "${port}" -m conntrack --ctstate NEW,ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
zone="zone_${interface}_output"
iptables -w 1 -t filter -nL "${zone}" 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
iptables -w 1 -I "${zone}" -p tcp -m multiport --dports "${port}" -m conntrack --ctstate ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
ip6tables -w 1 -t filter -nL "${zone}" 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
ip6tables -w 1 -I "${zone}" -p tcp -m multiport --dports "${port}" -m conntrack --ctstate ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
fi
}
# Delete existing remote access rules
delete_ui_firewall_rules
config_load userinterface
config_get_bool serv_enable global enable 1
if [ "${serv_enable}" -eq "1" ]; then
config_load nginx
# Configure the User Interface rule
config_foreach configure_ui_firewall_rule server
fi

View File

@@ -1,17 +0,0 @@
#!/bin/sh
[ "$ACTION" = "ifup" ] || exit 0
apply_sysctl_configuration() {
local sysctl_conf
sysctl_conf="/etc/bbfdm/sysctl.conf"
[ -f "${sysctl_conf}" ] || touch "${sysctl_conf}"
sysctl -e -p "${sysctl_conf}" >&-
}
ubus -t 10 wait_for network.device
apply_sysctl_configuration

View File

@@ -1,92 +0,0 @@
#!/bin/sh /etc/rc.common
START=65
STOP=10
USE_PROCD=1
PROG=/usr/sbin/bbfdmd
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
BBFDM_TEMP_JSON="/tmp/bbfdm.json"
log() {
echo "${@}"|logger -t bbfdmd.init -p info
}
validate_bbfdm_bbfdmd_section()
{
uci_validate_section bbfdm bbfdmd "bbfdmd" \
'enabled:bool:true' \
'sock:string' \
'debug:bool:false' \
'loglevel:uinteger:1' \
'refresh_time:uinteger:0' \
'transaction_timeout:uinteger:30' \
'subprocess_level:uinteger'
}
configure_bbfdmd()
{
local enabled debug sock update
local jlog jrefresh jtimeout
update=0
config_load bbfdm
validate_bbfdm_bbfdmd_section || {
log "Validation of bbfdmd section failed"
return 1;
}
[ "${enabled}" -eq 0 ] && return 0
[ ! -f "${BBFDM_JSON_INPUT}" ] && return 0
jlog="$(jq '.daemon.config.loglevel' ${BBFDM_JSON_INPUT})"
if [ "\"${loglevel}\"" != "${jlog}" ]; then
update=1
fi
jrefresh="$(jq '.daemon.config.refresh_time' ${BBFDM_JSON_INPUT})"
if [ "\"${refresh_time}\"" != "${jrefresh}" ]; then
update=1
fi
jtimeout="$(jq '.daemon.config.transaction_timeout' ${BBFDM_JSON_INPUT})"
if [ "\"${transaction_timeout}\"" != "${jtimeout}" ]; then
update=1
fi
if [ "${update}" -eq "1" ]; then
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
mv ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
fi
procd_set_param command ${PROG}
if [ "${debug}" -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
fi
if [ -f "${sock}" ]; then
procd_append_param command -s "${sock}"
fi
}
start_service()
{
procd_open_instance "bbfdm"
configure_bbfdmd
procd_set_param respawn
procd_close_instance "bbfdm"
ubus call service state '{"name":"bbfdm.services", "spawn":true}'
}
stop_service()
{
ubus call service state '{"name":"bbfdm.services", "spawn":false}'
}
service_triggers()
{
procd_add_reload_trigger "bbfdm"
}

View File

@@ -1,33 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
STOP=01
USE_PROCD=1
start_service() {
local enable
config_load userinterface
config_get_bool enable global enable 1
if [ ! -f "/etc/config/nginx" ]; then
return 0
fi
if [ "${enable}" -eq "1" ]; then
ubus call service state '{"name":"nginx", "spawn":true}'
else
ubus call service state '{"name":"nginx", "spawn":false}'
fi
# Inject firewall rules
procd_open_instance userinterface
/etc/firewall.userinterface
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "userinterface" "nginx"
}

View File

@@ -1,12 +0,0 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.userinterface
set firewall.userinterface=include
set firewall.userinterface.path=/etc/firewall.userinterface
set firewall.userinterface.reload=1
commit firewall
EOT
exit 0

View File

@@ -1,9 +0,0 @@
#!/bin/sh
# This deletes the userinterface json plugin if exists in case of upgrade
if [ -f "/etc/bbfdm/json/UserInterface.json" ]; then
rm /etc/bbfdm/json/UserInterface.json
fi
exit 0

View File

@@ -1,12 +0,0 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.port_hook
set firewall.port_hook=include
set firewall.port_hook.path=/etc/firewall.portmap
set firewall.port_hook.reload=1
commit firewall
EOT
exit 0

View File

@@ -1,62 +0,0 @@
#!/bin/sh
. /lib/functions.sh
bbfdm_sysctl_conf="/etc/bbfdm/sysctl.conf"
update_device_section() {
local section="${1}"
local dev_name="${2}"
local ipv6="${3}"
local name
# Get name value
config_get name "${section}" name
# Retrun if the name value is different to the dev_name value
[ "${name}" != "${dev_name}" ] && return
if [ "${ipv6}" = "0" ]; then
ipv6="1"
else
ipv6="0"
fi
# Add ipv6 option
uci -q set network.${section}.ipv6="${ipv6}"
}
parse_bbfdm_sysctl_conf_file() {
# Check if the file exists
[ -f "${bbfdm_sysctl_conf}" ] || return
# Create a temporary file
tmpfile=$(mktemp)
# Load network config
config_load network
# Read each line of the file
while read -r line; do
if echo "$line" | grep -Eq '^net\.ipv6\.conf\.(.+)\.disable_ipv6=([0-1])$'; then
name=$(echo "$line" | sed -n 's/^net\.ipv6\.conf\.\(.*\)\.disable_ipv6=[0-1]$/\1/p')
value=$(echo "$line" | sed -n 's/^net\.ipv6\.conf\.\(.*\)\.disable_ipv6=\([0-1]\)$/\2/p')
config_foreach update_device_section device "${name}" "${value}"
else
# If the line doesn't match, preserve it in the temporary file
echo "$line" >> "$tmpfile"
fi
done < "${bbfdm_sysctl_conf}"
# Replace the original file with the modified content
mv "$tmpfile" "${bbfdm_sysctl_conf}"
# Apply the changes
uci commit network
sysctl -e -p "${bbfdm_sysctl_conf}" >&-
}
parse_bbfdm_sysctl_conf_file
exit 0

View File

@@ -1,12 +0,0 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.service_hook
set firewall.service_hook=include
set firewall.service_hook.path=/etc/firewall.service
set firewall.service_hook.reload=1
commit firewall
EOT
exit 0

View File

@@ -1,18 +0,0 @@
#!/bin/sh
UNIFIED_PATH="/etc/bbfdm/plugins/"
# Link JSON plugins
for f in `ls -1 /etc/bbfdm/json/*.json`; do
echo "# BBFDM JSON plugin ${f} not aligned #"
ln -s ${f} "${UNIFIED_PATH}"
done
# Link DotSo plugins
for f in `ls -1 /usr/lib/bbfdm/*.so`; do
echo "# BBFDM DotSO plugin ${f} not aligned #"
ln -s ${f} "${UNIFIED_PATH}"
done
exit 0

View File

@@ -1 +0,0 @@
/etc/bbfdm/sysctl.conf

View File

@@ -1 +0,0 @@
/etc/nginx/allow_host_*

View File

@@ -1,42 +0,0 @@
#
# Copright (C) 2018 The Internet Foundation In Sweden
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bbk_cli
PKG_SOURCE_VERSION:=7b810a696c78b746185c11282bdbe3fb7f8c5d4b
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/dotse/bbk.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/bbk_cli
CATEGORY:=Utilities
DEPENDS:=+libpthread +libstdcpp
TITLE:=Bredbandskollen CLI - A bandwidth measurement tool
endef
define Package/bbk_cli/description
To measure connection speed in an environment that is missing a web browser,
for example, in a server, you can use our command line interface bbk_cli,
which is available for some of the most common operating systems.
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/src/cli CROSS_COMPILE="$(TARGET_CROSS)"
endef
define Package/bbk_cli/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cli/cli $(1)/sbin/bbk_cli
endef
$(eval $(call BuildPackage,bbk_cli))

View File

@@ -1,25 +0,0 @@
diff --git a/src/framework/engine.h b/src/framework/engine.h
index 57a48ad..9e1bc36 100644
--- a/src/framework/engine.h
+++ b/src/framework/engine.h
@@ -10,6 +10,7 @@
#include <map>
#include <vector>
#include <string>
+#include <sys/select.h>
#include "logger.h"
diff --git a/src/framework/mk.inc b/src/framework/mk.inc
index 793e211..13275be 100644
--- a/src/framework/mk.inc
+++ b/src/framework/mk.inc
@@ -7,7 +7,7 @@ OS:=$(shell uname)
CXXFLAGS += -O2 -W -Wall -I$(DIRLEVEL)
ifeq ($(OS),Linux)
-CXX = g++
+CXX = $(CROSS_COMPILE)g++
endif
ifeq ($(OS),Darwin)

View File

@@ -18,9 +18,6 @@ PKG_SOURCE_VERSION:=3ab81137cafe25c2ca4bc3a5f322a63646f9ce8d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/bootchart2

View File

@@ -1,52 +0,0 @@
#
# Copyright (C) 2022 iopsys Software Solutions AB
#
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.1.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
PKG_SOURCE_VERSION:=d83c42070e7f10178dc1c2d0ce078e3d6d42d889
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF BulkData Collection
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wall -Werror
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/bulkdata/* $(PKG_BUILD_DIR)/
endef
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/bulkdata
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bulkdata
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,15 +0,0 @@
{
"daemon": {
"input": {
"type": "JSON",
"name": "/etc/bulkdata/bulkdata.json"
},
"output": {
"type": "UBUS",
"name": "bbfdm.bulkdata",
"parent_dm": "Device.",
"object": "BulkData",
"root_obj": "bbfdm"
}
}
}

View File

@@ -1,6 +0,0 @@
config bulkdata 'bulkdata'
option enable '0'
#Log levels: Error=1, Warning=2, Info=3, Debug=4
option log_level '3'

View File

@@ -1,36 +0,0 @@
#!/bin/sh /etc/rc.common
START=60
STOP=10
. /etc/bbfdm/bbfdm_services.sh
USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
BULKDATA_JSON_INPUT="/etc/bulkdata/input.json"
start_service() {
local enable
config_load bulkdata
config_get_bool enable bulkdata enable 1
[ "$enable" -eq "1" ] && {
procd_open_instance "bulkdata"
procd_set_param command "$PROG"
procd_set_param respawn
procd_close_instance "bulkdata"
}
bbfdm_add_service "bbfdm.bulkdata" "${BULKDATA_JSON_INPUT}"
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger bulkdata
}

View File

@@ -1,75 +0,0 @@
#!/bin/sh
. /lib/functions.sh
PROFILE_COUNT=1
get_next_count()
{
local config="$1"
local default_name="${2}"
local count=${3}
local found=0
if [ -z "$count" ]; then
count=1
fi
while [ "${found}" -ne 1 ]; do
uci -q get "${config}"."${default_name}"_${count} >/dev/null
if [ "$?" -eq 0 ]; then
count=$((count + 1))
else
found=1;
fi
done
echo "${default_name}_${count}"
}
translate_profile_id_to_profile_name() {
local section="${1}"
local profile_id="${2}"
local profile_name="${3}"
local curr_profile_id
config_get curr_profile_id "${section}" profile_id
[ -n "${curr_profile_id}" ] || return
[ "${curr_profile_id}" != "${profile_id}" ] && return
uci -q set bulkdata."${section}".profile_name="${profile_name}"
uci -q set bulkdata."${section}".profile_id=""
}
update_profile_sections() {
local section="${1}"
local default="${2}"
local profile_name
config_get profile_id "${section}" profile_id
[ -n "${profile_id}" ] || return
case "${section}" in
"cfg"*)
profile_name="$(get_next_count bulkdata "${default}" ${PROFILE_COUNT})"
uci_rename bulkdata "${section}" "${profile_name}"
;;
esac
PROFILE_COUNT=$((PROFILE_COUNT + 1))
[ -n "$profile_name" ] && section="${profile_name}"
uci -q set bulkdata."${section}".profile_id=""
config_foreach translate_profile_id_to_profile_name profile_parameter "${profile_id}" "${profile_name}"
config_foreach translate_profile_id_to_profile_name profile_http_request_uri_parameter "${profile_id}" "${profile_name}"
}
config_load bulkdata
config_foreach update_profile_sections profile profile
uci commit bulkdata
exit 0

View File

@@ -1,38 +0,0 @@
#
# Copyright (C) 2019 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bulut
PKG_VERSION:=0.2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bulut/bulut-gw-client.git
PKG_SOURCE_VERSION:=227700c44817afa2c392fa08bf4cf70fa6177f01
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/bulut
CATEGORY:=Utilities
DEPENDS:=
TITLE:=bulut
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include
define Package/bulut/description
obuspa keys
endef
define Package/bulut/install
$(CP) $(PKG_BUILD_DIR)/files/* $(1)/
endef
$(eval $(call BuildPackage,bulut))

View File

@@ -1,57 +0,0 @@
#
# Copyright (C) 2021-2023 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=capiagent
PKG_VERSION:=2.1.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=3e671db8f567b19c109fc13b25bc571c4c73a962
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/capiagent.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
#define Package/capiagent/config
# source "$(SOURCE)/Config.in"
#endef
define Package/capiagent
TITLE+= capiagent (daemon implementing Wi-Fi Alliance's CAPI commands)
DEPENDS= +libubox +libuci +libubus +libnl-genl +libeasy +libwifi \
+libjson-c +libblobmsg-json +ubus +libieee1905
endef
define Package/capiagent/description
This package provides agent for the WiFi Alliance's CAPI specification.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
MAKE_PATH:=src
define Package/capiagent/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/lib/wifi/capi
$(CP) $(PKG_BUILD_DIR)/src/capiagent $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/src/scripts/* $(1)/lib/wifi/capi
endef
$(eval $(call BuildPackage,capiagent))

View File

@@ -1,35 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=20
USE_PROCD=1
start_service() {
if [ -e "/etc/config/mapagent" -o -e "/etc/config/mapcontroller" ]; then
config_load mapagent
config_get_bool agent_enabled agent enabled 1
config_load mapcontroller
config_get_bool controller_enabled controller enabled 1
if [ $agent_enabled -eq 1 -o $controller_enabled -eq 1 ]; then
procd_open_instance
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
procd_set_param limits core="unlimited"
#procd_set_param respawn
#procd_set_param stdout 1
#procd_set_param stderr 1
procd_close_instance
fi
fi
}
service_triggers()
{
procd_add_reload_trigger "capiagent"
}
reload_service() {
stop
start
}

View File

@@ -1,19 +1,9 @@
#
# Copyright (C) 2018 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=catv
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/catv

Binary file not shown.

View File

@@ -1,4 +1,7 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2015 inteno.org
#
START=71
USE_PROCD=1

31
crashlog/Makefile Normal file
View File

@@ -0,0 +1,31 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=crashlog
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/crashlog
CATEGORY:=Utilities
TITLE:=Handling kernel crash logs
endef
define Package/crashlog/description
Handling kernel crash logs.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/crashlog/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,crashlog))

Binary file not shown.

View File

@@ -0,0 +1,11 @@
#!/bin/sh /etc/rc.common
START=01
start()
{
if [ -e /proc/sys/kernel/core_pattern ]
then
echo "|/sbin/logcore %e %s" > /proc/sys/kernel/core_pattern
fi
}

View File

@@ -0,0 +1,56 @@
#!/bin/sh /etc/rc.common
START=99
send_log()
{
nr=$(db get hw.board.serialNumber)
hw=$(db get hw.board.hardware)
hwv=$(db get hw.board.hardwareVersion)
bid=$(db get hw.board.boardId)
sw=$(db get hw.board.iopVersion)
server=$(/sbin/uci get system.crashlog.server)
while true
do
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${bid}_${hwv}_${hw}_${sw}_${nr}
if [ $? == 0 ]
then
break;
fi
# wait for another minute then try again
sleep 60
done
}
fill_in_default()
{
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=crashlog
/sbin/uci set system.crashlog.enable=no
/sbin/uci set system.crashlog.server="crash.inteno.se"
/sbin/uci commit
}
boot()
{
# is crashlog enabled ?
enable=$(/sbin/uci get system.crashlog.enable)
case $enable in
0|no|NO|false|FALSE)
exit 0
;;
"")
fill_in_default
exit 0
;;
esac
# is this boot a result from a crash ?
reason=$(cat /etc/boot_reason)
case $reason in
HW|WD)
send_log&
;;
esac
}

61
crashlog/files/sbin/logcore Executable file
View File

@@ -0,0 +1,61 @@
#! /bin/sh
TMP_CORE=/tmp/new_core
# first test if we can contact the log server.
# if not abort directly the core file takes up memory
alive()
{
ping -c1 $server
if [ $? != 0 ]
then
# drain core file from kernel
cat >/dev/null
exit 0
fi
}
fill_in_default()
{
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=corelog
/sbin/uci set system.corelog.enable=no
/sbin/uci set system.corelog.server="crash.inteno.se"
/sbin/uci commit
}
# is corelog enabled ?
enable=$(/sbin/uci get system.corelog.enable)
case $enable in
0|no|NO|false|FALSE)
# drain core file from kernel
cat >/dev/null
exit 0
;;
"")
fill_in_default
exit 0
;;
esac
server=$(/sbin/uci get system.corelog.server)
alive
# dump out the core to disk we need this as scp needs a size before we send data
# and this is the only way to know how much data there is
cat >$TMP_CORE
# in case filesystem/memory is full at least kill the core in the kernel memory should give us some
# more memory to work with. normally this would do nothing.
cat >/dev/null
nr=$(db get hw.board.serialNumber)
hw=$(db get hw.board.hardware)
hwv=$(db get hw.board.hardwareVersion)
bid=$(db get hw.board.boardId)
sw=$(db get hw.board.iopVersion)
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${bid}_${hwv}_${hw}_${sw}_${nr}
rm $TMP_CORE

6
crashlog/files/usr/sbin/logssh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
# we need to have the -y option to dropbear to not halt the scp when
# transfering the log file to a new server for the first time.
# since we already need this also put in the keyfile
ssh -y -i /etc/dropbear/logid $@

42
crashlog/readme Normal file
View File

@@ -0,0 +1,42 @@
Install scp server.
Create a user account on a server and make sure it's possible to login to it
using ssh.
For now the user has to be called "log"
USER is the user name of the account
HOME is the user home directory.
Both should be changed to the correct value in all following example commands.
create HOME/bin
Put scp_upload in HOME/bin
make it executable "chmod a+x HOME/bin/scp_upload"
create home/.ssh (observer the dot .shh)
create an empty file HOME/.ssh/authorized_keys
-------------------------------
Now everyhting is setup for use but we have not added any clients.
What we need is the public key for the clients.
For dropbear "dropbearkey -y -f files/etc/dropbear/logid" will generate the public key.
----------
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@inteno
----------
The public key should be just one line. Add that line to the
HOME/.ssh/authorized_keys file on the scp server. Then add the follwoing as
the first text on the same line. that is insert before the key data.
command="HOME/bin/scp_upload",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
Do not forget to change HOME to the correct value for the server and there
should be one space separating the key data and the above text.
---------------------------------
Now test to make sure that you can upload new files, not download files
and not overwrite files from the client.

53
crashlog/scp_upload Normal file
View File

@@ -0,0 +1,53 @@
#! /bin/bash
# authorized_keys command="/home/boxi/my_scp",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
val=`expr match "$SSH_ORIGINAL_COMMAND" "scp"`
if [ $val != 3 ]
then
echo "only scp is allowed for this rsa key"
exit 1
fi
#strip out "scp" as getopts barf on anything not an option
args=${SSH_ORIGINAL_COMMAND:3}
# we must set args to positional paramters otherwise it's next to impossible
# to get to the rest of the line that is not arguments.
set -- $args
while getopts "rftdvpq" Option
do
case $Option in
r ) echo "recursive not allowed";exit 1;;
f ) echo "reading files not allowed";exit 1;;
t ) ;;
d ) ;;
v ) ;;
p ) ;;
q ) ;;
* ) ;; # Default.
esac
done
shift $(($OPTIND - 1))
file="$*"
dir=$(dirname "$file")
if [ "$dir" != "log" ]
then
echo "only allowed to write to log/"
exit 1
fi
# try to create uniq files
EXTRA=$((0))
while [ -e "${file}_${EXTRA}" ]
do
EXTRA=$((EXTRA +1))
done
logger -t scp_upload "${SSH_ORIGINAL_COMMAND}_${EXTRA}"
exec ${SSH_ORIGINAL_COMMAND}_${EXTRA}

View File

@@ -1,7 +0,0 @@
menu "Configuration"
config DECOLLECTOR_EASYMESH_VERSION
int "Support Easymesh version"
default 4
endmenu

View File

@@ -1,80 +0,0 @@
#
# Copyright (C) 2021-2023 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=4.2.0.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=3e54fa519defa462d08d4107c115905abb929c1a
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/decollector
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi DataElements Collector Proxy
DEPENDS:=+libuci +libubox +ubus +libpthread +libnl-genl \
+libeasy +libwifiutils +libieee1905 +map-plugin
endef
define Package/decollector/description
It implements the WiFi DataElements Agent as defined in the Wi-Fi Alliance's
DataElements specification.
endef
define Package/decollector/config
source "$(SOURCE)/Config.in"
endef
ifneq (,$(findstring ALPHA,$(CONFIG_VERSION_CODE)))
MAKE_FLAGS += DEBUG=1
endif
ifneq (,$(findstring BETA,$(CONFIG_VERSION_CODE)))
MAKE_FLAGS += DEBUG=1
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/decollector/ $(PKG_BUILD_DIR)/
endef
endif
MAKE_PATH:=src
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_DECOLLECTOR_EASYMESH_VERSION)
EXECS := \
$(if $(CONFIG_PACKAGE_decollector),decollector)
MAKE_FLAGS += EXECS="$(EXECS)"
define Package/decollector/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/decollector.init $(1)/etc/init.d/decollector
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/decollector $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,decollector))

View File

@@ -1,30 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=11
USE_PROCD=1
PROG=/usr/sbin/deagent
service_running() {
ubus -t 2 wait_for wifi ieee1905 ieee1905.map
}
start_service() {
procd_open_instance
procd_set_param command "$PROG" "-d" "-t 10"
#procd_set_param stdout 1
#procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger wireless
}

View File

@@ -1,43 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=11
USE_PROCD=1
PROG=/usr/sbin/decollector
service_running() {
ubus -t 2 wait_for ieee1905 ieee1905.map
}
start_service() {
sleep 3
[ -e "/etc/config/mapcontroller" ] && {
local en
config_load mapcontroller
config_get en controller enabled "0"
config_get collect_int controller de_collect_interval
[ -n "$collect_int" -a $collect_int -lt 30 ] && collect_int=""
[ $en -gt 0 ] && {
procd_open_instance
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
#procd_set_param stdout 1
#procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
}
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger mapcontroller
}

View File

@@ -1,11 +0,0 @@
if PACKAGE_dectmngr
menu "Configuration"
config ENABLE_LINE_SETTINGS_EXTENSION
bool "Enable Line Settings List extension "
default y
endmenu
endif

View File

@@ -1,68 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.5.19
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1fd0b11ad34f8f59b40c3a12e0cc07aa212eb87b
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=DECT Manager
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c +gpiod-tools
endef
define Package/$(PKG_NAME)/description
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
endef
endif
TARGET_CFLAGS += \
-Wall \
-Werror \
-I$(STAGING_DIR)/usr/include/libxml2
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
TARGET_CFLAGS += -DENABLE_LINE_SETTINGS_EXTENSION
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/dectmngr
$(CP) ./files/etc/* $(1)/etc/
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,3 +0,0 @@
config dect 'global'
option log_dect_cmbs 'syslog'
option log_level 'realtime,warning,error'

Binary file not shown.

View File

@@ -1,137 +0,0 @@
#!/bin/sh /etc/rc.common
source /lib/functions/uci-defaults.sh
START=70
STOP=12
USE_PROCD=1
PROG=/usr/sbin/dectmngr
LOG_PATH=/var/log/dectmngr
DB_PATH=/etc/dect
DCX81_UART_DT_ALIAS=/proc/device-tree/aliases/dcx81-uart
DECT_GPIO="$(gpiofind DCX81_RSTN | cut -d ' ' -f 2 2>/dev/null)"
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
stop_and_wait_dectmngr() {
dect_pid=$(pidof $PROG)
[ -n "$dect_pid" ] && kill $dect_pid
pidof $PROG > /dev/null 2>&1 && sleep 2 # wait for the process to stop gracefully
while pidof $PROG > /dev/null 2>&1; do
dect_pid=$(pidof $PROG)
[ -n "$dect_pid" ] && kill -9 $dect_pid
sleep 1
done
}
has_dect() {
[ -f "$DCX81_UART_DT_ALIAS" ]
}
get_dcx81_device() {
readonly dcx81_uart_dt_node="/proc/device-tree/$(cat "$DCX81_UART_DT_ALIAS" 2>/dev/null)"
[ -e "$dcx81_uart_dt_node" ] || return 1
for tty_dt_node in /sys/class/tty/*/device/of_node; do
if [ "$tty_dt_node" -ef "$dcx81_uart_dt_node" ]; then
readonly uevent_file="${tty_dt_node%%/device/of_node}/uevent"
local device_name_line
device_name_line="$(grep '^DEVNAME=' "$uevent_file")" || return 1
readonly device="/dev/${device_name_line##DEVNAME=}"
[ -c "$device" ] || return 1
printf "%s" "$device"
return 0
fi
done
return 1
}
start_service() {
local opt_ext=
local rfpi=
local model_id=
local rxtun=
if ! has_dect; then
logger -t "$PROG" "Not starting because no DECT hardware is available."
return 0
fi
local dcx81_uart_device
if ! dcx81_uart_device="$(get_dcx81_device)"; then
logger -t "$PROG" -p daemon.warning "Could not determine DCX81 UART device. Falling back to default ttyH0."
dcx81_uart_device=/dev/ttyH0
fi
[ -n "$DECT_GPIO" ] && echo 1 > /sys/class/gpio/gpio${DECT_GPIO}/value
rfpi=$(db -q get hw.board.dect_rfpi)
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
model_id=$(db -q get hw.board.dect_model_id)
[ -n "$model_id" -a ${#model_id} -eq 8 ] || {
echo "Invalid hw.board.dect_model_id:$model_id. Set to 30.3B.06"
model_id="30.3B.06"
}
opt_ext="$opt_ext -model $model_id"
rxtun=$(db -q get hw.board.dect_rxtun)
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
config_load dect
config_get log_dect_cmbs global log_dect_cmbs syslog
procd_open_instance
# dectmngr takes expects device without /dev
readonly dcx81_uart_device_wo_dev="${dcx81_uart_device##/dev/}"
case "$log_dect_cmbs" in
none)
echo "Starting dectmngr with cmbs logging disabled"
procd_set_param command "$PROG" -comname "$dcx81_uart_device_wo_dev" $opt_ext
rm -f $LOG_PATH/*
;;
file)
echo "Starting dectmngr with cmbs logging enabled to file"
procd_set_param command "$PROG" -comname "$dcx81_uart_device_wo_dev" -log $LOG_PATH/dect-cmbs.log $opt_ext
;;
*)
echo "Starting dectmngr with cmbs logging enabled to syslog"
procd_set_param command "$PROG" -comname "$dcx81_uart_device_wo_dev" -syslog $opt_ext
rm -f $LOG_PATH/*
;;
esac
procd_set_param respawn 6 2 3
procd_set_param term_timeout 20
procd_set_param triggers asterisk
procd_close_instance
}
stop_service() {
has_dect || return 0
[ -n "$DECT_GPIO" ] && echo 0 > /sys/class/gpio/gpio${DECT_GPIO}/value
stop_and_wait_dectmngr
}
reload_service() {
ubus call dect reload
}
service_triggers() {
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
}
boot() {
[ -n "$DECT_GPIO" ] && {
echo ${DECT_GPIO} > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio${DECT_GPIO}/direction
}
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
start
}

View File

@@ -1 +0,0 @@
/etc/dect/LA_DB

53
dectmngr2/Makefile Normal file
View File

@@ -0,0 +1,53 @@
#
# 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.1.0
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ace6a3dcb6aa463cf5a34ad39ac37a5bc7d4ce5e
PKG_NAME:=dectmngr2
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/dectmngr2
CATEGORY:=Utilities
TITLE:=Dectmngr2
URL:=
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus
endef
define Package/dectmngr2/description
Dectmngr2
endef
define Package/dectmngr2/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/dect/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
$(CP) ./files/dect.config $(1)/etc/config/dect
endef
$(eval $(call BuildPackage,dectmngr2))

View File

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

View File

@@ -1,79 +0,0 @@
#
# Copyright (C) 2018 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dslmngr
PKG_VERSION:=1.2.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=43dec92b1c86be7859521da337e7bd1168848b26
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
else
$(info Unexpected CONFIG_TARGET)
endif
export TARGET_PLATFORM
define Package/dslmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=XDSL status and configration utility
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
endef
define Package/dslmngr/description
This package can be used to configure and provide status about
the XDSL subsystem through UBUS.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-I$(STAGING_DIR)/usr/include/xdsl \
-D_GNU_SOURCE
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)"
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/dslmngr/ $(PKG_BUILD_DIR)/
endef
endif
define Build/Compile
+$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
endef
define Package/dslmngr/install
$(CP) ./files/common/* $(1)/
ifeq ($(CONFIG_TARGET_brcmbca),y)
$(CP) ./files/broadcom/* $(1)/
endif
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
endef
$(eval $(call BuildPackage,dslmngr))

View File

@@ -1,313 +0,0 @@
#!/bin/sh
. /lib/functions.sh
# 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 i
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
for i in `seq 0 7`; do
xtmctl operate conn --addq 1.$vpi.$vci $i wrr 1 dt # queue priority 0-7
done
xtmctl operate conn --createnetdev 1.$vpi.$vci $device
xtmctl operate intf --state 1 enable
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 i
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
for i in `seq 0 7`; do
xtmctl operate conn --addq $portid.$priority $i wrr 1 dt -1 -1 3000 # queue priority 0-7
done
echo "xtmctl operate conn --createnetdev $portid.$priority $device"
xtmctl operate conn --createnetdev $portid.$priority $device
xtmctl operate intf --state 1 enable
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
}
xtm_remove_devices() {
remove_atm_devices
remove_ptm_devices
}
xtm_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
}
xdsl_configure() {
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="${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
# 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 0
[ $sesdrop -eq 1 ] && sesdrop="on" || sesdrop="off"
# 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 0
[ $sos -eq 1 ] && sos="on" || sos="off"
config_get_bool phyReXmtUs line phyReXmtUs 0
config_get_bool phyReXmtDs line phyReXmtDs 1
phyReXmt=$(( $((phyReXmtUs<<1)) + phyReXmtDs))
if [ $VDSL -eq 1 -o $GFAST -eq 1 ]; then
echo "xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0 --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt"
xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0 --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt
# G.Fast hardware to VDSL hardware, to set the driver bit kPhyCfg2EnableGfastVdslMMTimeOut0.
# Enable V43 tone for GFAST.
echo "xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400"
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400
else
echo "xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt"
xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt
fi
if [ $GFAST -eq 1 ]; then
# G.Fast hardware to VDSL hardware, to set the driver bit kPhyCfg2EnableGfastVdslMMTimeOut0.
# Enable V43 tone for GFAST.
echo "xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400"
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400
fi
}
xdsl_stop() {
# echo "Stopping DSL"
# stop causes IRQ issues
# xdslctl stop
return 0
}
xdsl_init() {
[ -d /sys/class/net/dsl0/ ] || exit
prioritize_arp
echo "Starting DSL"
xtmctl start
xtmctl operate intf --state 1 enable
}

View File

@@ -1,53 +0,0 @@
# OEM specific parameters
config oem-parameters 'oem'
# option country_code "0000" # 2 bytes hex
# option vendor_id "IO" # 4 bytes string
# option vendor_suffix "0000" # 2 bytes hex
# option sw_version "iopsys" # 16 bytes string
# option serial_nr "00000000" # 32 bytes string
# 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
# VDSL2 profiles
list profile 8a
list profile 8b
list profile 8c
list profile 8d
list profile 12a
list profile 12b
list profile 17a
list profile 30a
option bitswap 1
option sra 1
option us0 1 # VDSL2 only
option sesdrop 0
option sos 0
option phyReXmtUs 0
option phyReXmtDs 1
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

@@ -1,7 +0,0 @@
[ "$STATUS" == "up" -o "$STATUS" == "down" ] || exit 0
. /lib/functions.sh
include /lib/dsl
xtm_remove_devices
xtm_create_devices

View File

@@ -1,7 +0,0 @@
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,41 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/dsl
START=20
USE_PROCD=1
DSLMNGR=$(which dslmngr)
start_service() {
[ -n "$DSLMNGR" ] && {
procd_open_instance
procd_set_param command "$DSLMNGR"
procd_set_param respawn
procd_close_instance
}
xdsl_configure
xtm_create_devices
}
stop_service() {
xtm_remove_devices
xdsl_stop
}
boot() {
xdsl_init
start
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger dsl
}

View File

@@ -1,47 +0,0 @@
#
# Copyright (C) 2019 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-qos
PKG_VERSION:=1.1
PKG_RELEASE:=0
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/easy-qos
SECTION:=net
CATEGORY:=Network
TITLE:=Easy QoS
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha)
endef
define Package/easy-qos/description
This package contains Easy QoS utility
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/easy-qos/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
endef
$(eval $(call BuildPackage,easy-qos))

View File

@@ -1 +0,0 @@
/etc/init.d/easy_qos reload

View File

@@ -1,140 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
log() {
echo "${@}"|logger -t easy_qos.ebtable -p debug
}
exec_log() {
${@}
if [ "${?}" -ne 0 ]; then
log "Failed to create ${@}";
fi
}
get_priority() {
local prio=$(echo $1|tr 'A-Z' 'a-z');
case "${prio}" in
"lowest")
echo 0;;
"low")
echo 1;;
"besteffort")
echo 2;;
"normal")
echo 3;;
"video")
echo 4;;
"medium")
echo 5;;
"high")
echo 6;;
"highest")
echo 7;;
esac
}
validate_rule_section()
{
uci_validate_section easy_qos rule "${1}" \
'priority:string' \
'macaddr:string' \
'proto:string:none' \
'port:list(uinteger)' \
'comment:string:none'
}
# Clear existing rules before applying new rules
clear_existing_rules() {
local rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
while [ -n "${rule}" ]; do
exec_log ebtables -t broute -D BROUTING ${rule}
rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
done
}
create_rule() {
local protocol=$1; shift
local mac=$1; shift
local mark="0x$1"; shift
local forward_port=$1;
local cmd="";
local protocol_number
cmd="-j mark --mark-or ${mark}";
if [ -n "${forward_port}" ]; then
cmd="--ip-destination-port ${forward_port} ${cmd}";
fi
case "${protocol}" in
"tcp")
protocol_number=6;;
"udp")
protocol_number=17;;
"dccp")
protocol_number=33;;
"sctp")
protocol_number=132;;
*)
log "Protocol ${protocol} not supported in ebtables"
return;;
esac
cmd="--ip-proto ${protocol_number} $cmd"
cmd="-p ip $cmd"
cmd="-s ${mac} $cmd"
exec_log ebtables -t broute -A BROUTING ${cmd}
}
manage_rule() {
local cfg="$1"
local priority macaddr proto port comment prio_num protocol
validate_rule_section "${1}" || {
log "Validation of section failed"
return 1;
}
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
prio_num=$(get_priority ${priority})
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
for p in ${port}; do
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
create_rule tcp ${macaddr} ${prio_num} ${p}
create_rule udp ${macaddr} ${prio_num} ${p}
else
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
fi
done
# Create rule for all ports if port is not mentioned in uci
if [ -z "${port}" ]; then
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
create_rule tcp ${macaddr} ${prio_num}
create_rule udp ${macaddr} ${prio_num}
else
create_rule ${protocol} ${macaddr} ${prio_num}
fi
fi
fi
}
reload_service() {
# Do not apply rules if ebtables is not present in system
[ -x /usr/sbin/ebtables ] || return;
clear_existing_rules
config_load easy_qos
config_foreach manage_rule rule
}
start_service() {
reload_service
}
service_triggers() {
procd_add_reload_trigger "easy_qos"
}

View File

@@ -1,186 +0,0 @@
#!/bin/sh /etc/rc.common
. /usr/share/libubox/jshn.sh
START=99
USE_PROCD=1
CLIENT_LIST="/tmp/easy_qos_client.list"
log() {
echo "${@}"|logger -t easy_qos -p debug
}
exec_log() {
${@}
if [ "${?}" -ne 0 ]; then
log "Failed to create ${@}";
fi
}
get_priority() {
local prio=$(echo $1|tr 'A-Z' 'a-z');
case "${prio}" in
"lowest")
echo 0;;
"low")
echo 1;;
"besteffort")
echo 2;;
"normal")
echo 3;;
"video")
echo 4;;
"medium")
echo 5;;
"high")
echo 6;;
"highest")
echo 7;;
esac
}
clean_client_entries() {
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
}
map_client_entries() {
local clients ip mac host
json_load "$(ubus call router.network 'clients')"
json_get_keys keys
for key in ${keys};
do
json_select ${key}
json_get_vars ipaddr macaddr hostname
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
json_select ..
done
json_init
# json_add_array "clients"
IFS=";"
for client in ${clients};
do
macaddr=$(echo ${client} | cut -d" " -f1)
json_add_object "${macaddr//:/_}"
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
json_close_object
done
IFS=' '
echo `json_dump` > ${CLIENT_LIST}
json_cleanup
}
# Find the IP of a corresponding mac from arp table
get_ipaddress() {
local clients ip mac host
json_load "$(cat ${CLIENT_LIST})"
json_get_keys keys
# jshn seems a bit iffy on having : in key, replace by _
json_select "${1//:/_}" 2 > /dev/null
json_get_var ip ip
echo "$ip"
}
validate_rule_section()
{
uci_validate_section easy_qos rule "${1}" \
'priority:string' \
'macaddr:string' \
'proto:string:none' \
'port:list(uinteger)' \
'comment:string:none'
}
# Clear existing rules before applying new rules
clear_existing_rules() {
local rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
while [ -n "${rule}" ]; do
exec_log iptables -t mangle ${rule}
rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
done
}
check_and_create() {
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
# Create rule if not exists
if [ ${?} -ne 0 ]; then
exec_log iptables -t mangle -A PREROUTING ${@}
else
log "Rule exists for ${@}"
fi
}
create_rule() {
local proto=$1; shift
local src_ip=$1; shift
local mark="0x$1/0x$1"; shift
local ports=$1;
local cmd="";
cmd="-j MARK --set-xmark ${mark}";
if [ -n "${ports}" ]; then
cmd="--match multiport --dports ${ports} ${cmd}";
fi
if [ "${proto}" == "icmp" ]; then
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
elif [ "${proto}" == "all" ]; then
cmd="-p all $cmd"
else
cmd="-p ${proto} -m ${proto} $cmd"
fi
cmd="-s ${src_ip} $cmd"
check_and_create ${cmd}
}
manage_rule() {
local cfg="$1"
local priority macaddr proto port comment prio_num ip port_list
validate_rule_section "${1}" || {
log "Validation of section failed"
return 1;
}
prio_num=$(get_priority ${priority})
ip=$(get_ipaddress ${macaddr})
port_list=$(echo ${port}|sed 's/ /,/g')
if [ -n "${ip}" -a -n "${prio_num}" ]; then
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
create_rule tcp ${ip} ${prio_num} ${port_list}
create_rule udp ${ip} ${prio_num} ${port_list}
else
create_rule ${proto} ${ip} ${prio_num} ${port_list}
fi
fi
}
reload_service() {
clear_existing_rules
map_client_entries
config_load easy_qos
config_foreach manage_rule rule
clean_client_entries
}
start_service() {
reload_service
echo "Easy QoS installed">/dev/console;
}
service_triggers() {
procd_add_reload_trigger "easy_qos"
}

View File

@@ -1,8 +0,0 @@
# Add firewall include
uci -q batch <<-EOT
delete firewall.easyqos
set firewall.easyqos=include
set firewall.easyqos.path=/etc/firewall.easyqos
set firewall.easyqos.reload=1
commit firewall
EOT

View File

@@ -1,110 +0,0 @@
# All rights reserved.
# See LICENSE for more information.
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=easy-soc-events
PKG_VERSION:=1.1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
PKG_BUILD_DIR:=$(BUILD_DIR)/easy-soc-events-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
include $(INCLUDE_DIR)/package.mk
-include $(TOPDIR)/.config
ifneq ($(CONFIG_TARGET_brcmbca),)
LINUX_DIR=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.1
LINUX_VERSION := 4.1.52
LINUXINCLUDE=-Iarch/$(LINUX_KARCH)/mach-bcm963xx/include
BCM_BS_PROFILE := $(patsubst "%",%,$(CONFIG_BCM_KERNEL_PROFILE))
FS_DIR := $(BUILD_DIR)/bcmkernel/bcm963xx/targets/$(BCM_BS_PROFILE)/fs
MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)/extra
TARGET_MODULES_DIR:=/$(MODULES_SUBDIR)
endif
define KernelPackage/easy-soc-events/default
SUBMENU:=Other modules
endef
define KernelPackage/easy-soc-events
$(KernelPackage/easy-soc-events/default)
TITLE:=Helper module for netlink event notification
FILES:=$(PKG_BUILD_DIR)/easyevent.ko
AUTOLOAD:=$(call AutoLoad,11,easyevent)
endef
define KernelPackage/easy-soc-events-test
$(KernelPackage/easy-soc-events/default)
TITLE:=Test module for event notification through easyevent
DEPENDS+=+kmod-easy-soc-events
FILES+=$(PKG_BUILD_DIR)/test/testevent.ko
endef
define KernelPackage/easy-soc-events/description
This is a helper module to generate and pass netlink events from
kernel to user applications.
endef
#NOSTDINC_FLAGS :=
ifdef CONFIG_PACKAGE_kmod-easy-soc-events
PKG_MAKE_FLAGS += CONFIG_EASYEVENT=y
endif
LINUXINCLUDE += \
-I$(LINUX_DIR)/include -I$(LINUX_DIR)/include/$(LINUX_UAPI_DIR) \
-Iarch/$(LINUX_KARCH)/include \
-Iarch/$(LINUX_KARCH)/include/generated \
-Iarch/$(LINUX_KARCH)/include/generated/$(LINUX_UAPI_DIR) \
-I$(LINUX_DIR)/include/generated/uapi \
-Iarch/$(LINUX_KARCH)/include/$(LINUX_UAPI_DIR) \
-include ./include/linux/kconfig.h
define Build/Prepare
$(call Build/Prepare/Default)
endef
define Build/Compile
$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) V=1 \
$(PKG_MAKE_FLAGS) \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
LINUXINCLUDE="$(LINUXINCLUDE)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
modules
endef
ifneq ($(CONFIG_TARGET_brcmbca),)
define KernelPackage/easy-soc-events/install-extra
cp $(PKG_BUILD_DIR)/easyevent.ko $(FS_DIR)/lib/modules/$(LINUX_VERSION)/extra
endef
endif
define KernelPackage/easy-soc-events/install
$(call KernelPackage/easy-soc-events/install-extra)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
#$(INSTALL_DIR) $(STAGING_DIR)/usr/include/linux
#$(CP) $(PKG_BUILD_DIR)/easysoc-event.h $(STAGING_DIR)/usr/include/linux/
#$(CP) $(PKG_BUILD_DIR)/easysoc-event.h $(LINUX_DIR)/include/linux/
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(STAGING_DIR)/usr/include/
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(STAGING_DIR)/usr/include/
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(LINUX_DIR)/include/generated/uapi
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(LINUX_DIR)/include/generated/uapi
endef
$(eval $(call KernelPackage,easy-soc-events-test))
$(eval $(call KernelPackage,easy-soc-events))

4
endptmngr/Config.in Executable file
View File

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

66
endptmngr/Makefile Normal file
View File

@@ -0,0 +1,66 @@
#
# 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_VERSION:=fa9ba5d7c942571ae6e44eb7bb5dae2c9b9e8ca4
ifeq ($(CONFIG_ENDPT_OPEN),y)
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
PKG_NAME:=endptmngr-open
else
PKG_SOURCE_URL:=git@private.inteno.se:endptmngr
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_NAME:=endptmngr
endif
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/endptmngr/config
source "$(SOURCE)/Config.in"
endef
define Package/endptmngr
CATEGORY:=Utilities
TITLE:=Brcmslic
URL:=
DEPENDS:= +libubox +ubus +libpicoevent +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen
endef
define Package/endptmngr/description
endptmngr
endef
ifeq ($(CONFIG_ENDPT_OPEN),y)
define Build/Compile
endef
endif
define Package/endptmngr/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/init.d/
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,endptmngr))

View File

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

View File

@@ -1,53 +0,0 @@
#
# Copyright (C) 2020 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=2.1.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
endef
define Package/ethmngr/description
This package can be used to configure and provide status about
the ethernet interfaces and ports through UBUS.
It uses APIs from the libethernet.so library.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
define Build/Compile
endef
endif
define Package/ethmngr/install
$(CP) ./files/* $(1)/
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
endif
endef
$(eval $(call BuildPackage,ethmngr))

View File

@@ -1,28 +0,0 @@
#!/bin/sh /etc/rc.common
START=15
STOP=90
USE_PROCD=1
PROG=/usr/sbin/ethmngr
. /lib/functions.sh
include /lib/ethernet
start_service() {
if [ -f $PROG ]; then
procd_open_instance
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
fi
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger network
}

49
eventlog/Makefile Normal file
View File

@@ -0,0 +1,49 @@
#
# Copyright (C) 2009-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:=eventlog
PKG_VERSION:=0.2.9
PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.balabit.com/downloads/files/eventlog/0.2/
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_MD5SUM:=76e3d7a0b8f335c12099e9b91191fbf1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libeventlog
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A new API to format and send structured log messages.
endef
define Package/eventlog/description
A new API to format and send structured log messages. It supports multiple message
representations (plain, XML attributes and XML tags) and multiple output methods
(local syslogd).
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/eventlog $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/eventlog.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libeventlog/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libeventlog))

View File

@@ -1,7 +1,7 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
@@ -20,9 +20,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE
# support parallel build
#PKG_BUILD_PARALLEL:=1

View File

@@ -1,48 +0,0 @@
#
# Copyright (C) 2021 IOPSYS Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fdtextract
PKG_RELEASE:=1
PKG_VERSION:=1.0
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=fdtextract
DEPENDS:= +libfdt
endef
define Package/$(PKG_NAME)/description
Command to extract sub images from FIT images.
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/fdtextract
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

54
fping/Makefile Normal file
View File

@@ -0,0 +1,54 @@
#
# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fping
PKG_VERSION:=4.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://fping.org/dist/
PKG_HASH:=67eb4152b98ad34f99d2eec4e1098a0bb52caf13c0c89cd147349d08190fe8ce
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=BSD-4-Clause
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/fping
SECTION:=net
CATEGORY:=Network
TITLE:=sends ICMP ECHO_REQUEST packets to network hosts
URL:=http://fping.org/
endef
define Package/fping/description
fping is a ping like program which uses the Internet Control Message Protocol
(ICMP) echo request to determine if a target host is responding. fping
differs from ping in that you can specify any number of targets on the command
line, or specify a file containing the lists of targets to ping. Instead of
sending to one target until it times out or replies, fping will send out a
ping packet and move on to the next target in a round-robin fashion.
endef
CONFIGURE_ARGS+= \
--enable-ipv4 \
--enable-ipv6
TARGET_CFLAGS += -std=gnu99
define Package/fping/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fping $(1)/usr/bin/
endef
$(eval $(call BuildPackage,fping))

View File

@@ -1,42 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=fscryptctl
PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/google/fscryptctl.git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Encryption
TITLE:=Fscryptctl
endef
define Package/$(PKG_NAME)/description
fscryptctl is a low-level tool written in C that handles raw keys and manages policies for Linux filesystem encryption,
specifically the "fscrypt" kernel interface which is supported by the ext4, f2fs, and UBIFS filesystems
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
fscryptctl
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fscryptctl $(1)/usr/bin/fscryptctl
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

3
gigaset-elements/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
git-src

65
gigaset-elements/Makefile Normal file
View File

@@ -0,0 +1,65 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gigaset-elements
PKG_VERSION:=2.4.2
# PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_GIGASET_ELEMENTS_SRC_URL ?= git@public.inteno.se:gigaset-elements.git
PKG_GIGASET_ELEMENTS_VERSION ?= v$(PKG_VERSION)
PKG_SOURCE_URL:=$(PKG_GIGASET_ELEMENTS_SRC_URL)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=aa906b37062b6d7937a9c0f8e7b62b32afe4bdeb
PKG_MAINTAINER:=Magier Marcin, Figlarek Piotr
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
######################################################
define Package/gigaset-elements
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libjson-c +libcurl +libpthread
TITLE:=Gigaset elements
endef
######################################################
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) all
endef
define Package/gigaset-elements/install
$(CP) -r $(PKG_BUILD_DIR)/sysroot_common/* $(1)/
$(CP) -r $(PKG_BUILD_DIR)/sysroot_$(CONFIG_ARCH)/* $(1)/
endef
define Package/gigaset-elements/preinst
#!/bin/sh
mkdir -p $${IPKG_INSTROOT}/usr/gigaset/data/cert
mkdir -p $${IPKG_INSTROOT}/usr/gigaset/data/fw
endef
define Package/gigaset-elements/postrm
#!/bin/sh
rm -rf $${IPKG_INSTROOT}/usr/gigaset/data
rm -rf /usr/share/gigaset
endef
######################################################
$(eval $(call BuildPackage,gigaset-elements))

View File

@@ -1,66 +0,0 @@
# Copyright (c) 2017 Genexis B.V.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=gryphon-led-kernel-module
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define KernelPackage/$(PKG_NAME)
SUBMENU:=LED modules
TITLE:=LED driver for Gryphon
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
DEPENDS:= +(TARGET_brcmbca):bcmkernel
PKG_LICENSE:=GPLv2
PKG_LICENSE_URL:=
endef
define KernelPackage/$(PKG_NAME)/description
This package contains the LED driver for Gryphon devices.
endef
EXTRA_KCONFIG:= CONFIG_RGB_LED=m
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
# support compilation against BCM SDK kernel
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
$(CP) src/* $(PKG_BUILD_DIR)
endef
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="-DKERNEL_MODULE $(BUILDFLAGS) -I$(LINUX_DIR)/include -include generated/autoconf.h $(MODULE_INCLUDE)" \
modules
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
endef
$(eval $(call KernelPackage,$(PKG_NAME)))

View File

@@ -1,26 +0,0 @@
# Copyright (c) 2017 Genexis B.V.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
MODULE_NAME = gryphon-led-kernel-module
obj-m := $(MODULE_NAME).o
GENEXIS_FILES= \
main.o \
sk9822.o \
sk9822_bitbang.o
$(MODULE_NAME)-objs := $(GENEXIS_FILES)

View File

@@ -1,330 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#define DEBUG 1
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/printk.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/version.h>
#include "sk9822.h"
#define DRIVER_NAME "canyon_led"
#define DRIVER_AUTHOR "Genexis B.V."
#define DRIVER_DESC "Canyon LED driver for SK9822"
#define DRIVER_VERSION "1"
/**
* sysfs interfaces
*/
static ssize_t get_led_color(struct device *dev,
struct device_attribute *attr, char *buf)
{
int len;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;
}
return len;
}
/**
* @brief Set complete LED strip to a specific color
* @retval count number of bytes written
* @retval -EMSGSIZE if the message is too big
* @retval -EIO for all other errors (e.g. leds cannot be configured)
*/
static ssize_t set_led_color(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int ret = 0;
size_t buflen = count;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
/* strip newline */
if ((count > 0) && (buf[count-1] == '\n')) {
buflen--;
}
if (buflen != 6) { // RRGGBB\0
return -EMSGSIZE;
}
// Update the LED array here
ret = sk9822_set_color_str(sk9822, buf);
if (ret != 0) {
printk(KERN_ERR "Failed to set led color\n");
return -EIO;
}
// Now push to the HW
ret = sk9822_update(sk9822);
if (ret != 0) {
printk(KERN_ERR "Failed to update led\n");
return -EIO;
}
return count;
}
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
static ssize_t get_led_brightness(struct device *dev,
struct device_attribute *attr, char *buf)
{
int len;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
len = scnprintf(buf, PAGE_SIZE, "%x\n", sk9822->led_brightness);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;
}
return len;
}
/**
* @brief Set LED brightness
* @retval count number of bytes written
* @retval -EINVAL if the message is not a valid hexadecimal number
* @retval -EIO for all other errors (e.g. leds cannot be configured)
*/
static ssize_t set_led_brightness(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int ret = 0;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
unsigned long val = SK9822_DEFAULT_BRIGHTNESS;
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
if (kstrtoul(buf, 16, &val)) {
return -EINVAL;
}
if(val > SK9822_DEFAULT_BRIGHTNESS) {
val = SK9822_DEFAULT_BRIGHTNESS;
}
sk9822->led_brightness = (uint8_t)val;
// Now push to the HW
ret = sk9822_update(sk9822);
if (ret != 0) {
printk(KERN_ERR "Failed to update led\n");
return -EIO;
}
return count;
}
static DEVICE_ATTR(led_brightness, S_IRUGO | S_IWUSR, get_led_brightness, set_led_brightness);
static struct attribute *sk9822_dev_attrs[] = {
&dev_attr_led_color.attr,
&dev_attr_led_brightness.attr,
NULL
};
static struct attribute_group sk9822_dev_attr_group = {
.name = "sk9822",
.attrs = sk9822_dev_attrs,
};
/**
* device prope and removal
*/
static int canyon_led_probe(struct platform_device *pdev)
{
int ret;
struct sk9822_leds *leds;
leds = devm_kzalloc(&pdev->dev, sizeof(*leds), GFP_KERNEL);
if (!leds) {
return -ENOMEM;
}
leds->dev = &pdev->dev;
leds->led_brightness = SK9822_DEFAULT_BRIGHTNESS;
ret = of_property_read_u16(pdev->dev.of_node, "led-count", &leds->led_count);
if (ret < 0) {
dev_warn(&pdev->dev, "Could not read led-count property\n");
leds->led_count = SK9822_DEFAULT_NUM_LEDS;
} else {
printk(KERN_INFO "Got led count: %u\n", leds->led_count);
}
leds->led_colors = devm_kzalloc(&pdev->dev,
(sizeof(cRGB) * leds->led_count), GFP_KERNEL);
if (!leds->led_colors) {
return -ENOMEM;
}
platform_set_drvdata(pdev, leds);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
#else
dev_warn(&pdev->dev, "Kernel version Not supported\n");
exit(1);
#endif
if (IS_ERR(leds->clock_gpio)) {
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
PTR_ERR(leds->clock_gpio));
return PTR_ERR(leds->clock_gpio);
}
gpiod_direction_output(leds->clock_gpio, 1);
if (IS_ERR(leds->clock_gpio)) {
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
PTR_ERR(leds->clock_gpio));
return PTR_ERR(leds->clock_gpio);
} else {
printk(KERN_INFO "Got clock gpio\n");
gpiod_set_value(leds->clock_gpio, 0);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
#else
dev_warn(&pdev->dev, "Kernel version Not supported\n");
exit(1);
#endif
if (IS_ERR(leds->data_gpio)) {
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
PTR_ERR(leds->data_gpio));
return PTR_ERR(leds->data_gpio);
}
gpiod_direction_output(leds->data_gpio, 1);
if (IS_ERR(leds->data_gpio)) {
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
PTR_ERR(leds->data_gpio));
return PTR_ERR(leds->data_gpio);
} else {
printk(KERN_INFO "Got data gpio\n");
gpiod_set_value(leds->data_gpio, 0);
}
printk(KERN_INFO "Attempt to set filefs stuff\n");
ret = sysfs_create_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
if (ret) {
dev_err(&pdev->dev, "sysfs creation failed\n");
return ret;
}
#if 0
printk(KERN_INFO "Flash LEDs to verify they work\n");
sk9822_set_color_str(leds, "00FF00");
sk9822_update(leds);
msleep(200);
sk9822_set_color_str(leds, "000000");
sk9822_update(leds);
#endif
printk(KERN_INFO "canyon led successfully probed\n");
return 0;
}
static int canyon_led_remove(struct platform_device *pdev)
{
struct sk9822_leds *leds;
sysfs_remove_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
leds = platform_get_drvdata(pdev);
if (IS_ERR(leds)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -1;
}
if (leds->clock_gpio) {
gpiod_put(leds->clock_gpio);
}
if (leds->data_gpio) {
gpiod_put(leds->data_gpio);
}
printk(KERN_NOTICE "Bye, bye\n");
return 0;
}
/**
* platform driver metadata
*/
static const struct of_device_id canyon_led_of_ids[] = {
{ .compatible = "canyon,led" },
{ }
};
static struct platform_driver canyon_led = {
.probe = &canyon_led_probe,
.remove = &canyon_led_remove,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = canyon_led_of_ids,
},
};
MODULE_DEVICE_TABLE(of, canyon_led_of_ids);
module_platform_driver(canyon_led);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL");

View File

@@ -1,82 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include "sk9822.h"
#include "sk9822_bitbang.h"
cRGB __hexs_to_rgb(const char *hex)
{
cRGB rgb;
int r, g, b;
sscanf(hex, "%02x%02x%02x", &r, &g, &b);
// This needs sanity checking
rgb.r = r;
rgb.g = g;
rgb.b = b;
return rgb;
}
/**
* @brief update the color over the given device struct to the provided HEX color
*/
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex)
{
int i;
cRGB color = __hexs_to_rgb(hex);
for (i = 0; i < sk9822->led_count; i++) {
sk9822->led_colors[i] = color;
}
return 0;
}
/**
* @brief write device struct to the device
*/
int sk9822_update(struct sk9822_leds *sk9822)
{
uint16_t i;
uint16_t led_count = sk9822->led_count;
// Start Frame
sk9822_bb_write(sk9822, 0x00);
sk9822_bb_write(sk9822, 0x00);
sk9822_bb_write(sk9822, 0x00);
sk9822_bb_write(sk9822, 0x00);
for (i = 0; i < led_count; i++) {
cRGB *p = &sk9822->led_colors[i];
sk9822_bb_write(sk9822, 0xe0+sk9822->led_brightness); // Maximum global brightness
sk9822_bb_write(sk9822, p->b);
sk9822_bb_write(sk9822, p->g);
sk9822_bb_write(sk9822, p->r);
}
// End frame
sk9822_bb_write(sk9822, 0xff);
sk9822_bb_write(sk9822, 0xff);
sk9822_bb_write(sk9822, 0xff);
sk9822_bb_write(sk9822, 0xff);
return 0;
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef SK9822_H_
#define SK9822_H_
#include <linux/types.h>
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
typedef struct {
uint8_t b;
uint8_t g;
uint8_t r;
} cRGB; // BGR (SK9822 Standard)
struct sk9822_leds {
struct device *dev;
struct gpio_desc *clock_gpio;
struct gpio_desc *data_gpio;
cRGB *led_colors;
uint8_t led_brightness;
uint16_t led_count;
};
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex);
int sk9822_update(struct sk9822_leds *sk9822);
#endif /* SK9822_H_ */

View File

@@ -1,48 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include <linux/gpio/consumer.h>
#include <linux/delay.h>
#include <linux/types.h>
#include "sk9822.h"
/**
* @brief Bitbang write operation CLOCK+DATA
*
* Assumed state before call: CLOCK- Low, DATA- High
*/
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c)
{
uint8_t i;
for (i = 0; i < 8 ; i++) {
if (!(c&0x80)) {
gpiod_set_value(sk9822->data_gpio, 0); // set data low
} else {
gpiod_set_value(sk9822->data_gpio, 1); // set data high
}
gpiod_set_value(sk9822->clock_gpio, 1); // set clock high, data sampled here
c <<= 1;
udelay(1); // stretch clock
gpiod_set_value(sk9822->clock_gpio, 0); // set clock low
}
// State after call: SCK Low, Data high
}

View File

@@ -1,28 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef _SK9822_BB_H_
#define _SK9822_BB_H_
#include <linux/types.h>
#include "sk9822.h"
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c);
#endif /* _SK9822_BB_H_ */

View File

@@ -1,15 +0,0 @@
if (PACKAGE_hostmngr)
menu "Configuration"
config HOSTMNGR_HOSTS_HISTORY
bool "Keep history of hosts"
default y
config HOSTMNGR_PLATFORM_HAS_WIFI
bool "Platform has WiFi"
default y if PACKAGE_libwifi
endmenu
endif

View File

@@ -1,75 +0,0 @@
#
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=1.0.7
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=975549e01df338a90e1d1a356d22a2c7f5bf2387
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/hostmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Show and manage hosts in the network
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
+libnetfilter-conntrack \
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api
endef
define Package/hostmngr/config
source "$(SOURCE)/Config.in"
endef
define Package/hostmngr/description
This package provides hostmngr that can detect and show host devices
present in the network.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
-D_GNU_SOURCE
ifeq ($(CONFIG_HOSTMNGR_PLATFORM_HAS_WIFI),y)
TARGET_CFLAGS += -DHAS_WIFI
endif
MAKE_PATH:=src
define Package/hostmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/hostmngr/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
$(INSTALL_DATA) ./files/etc/hostmngr/input.json $(1)/etc/hostmngr/
$(INSTALL_DATA) ./files/lib/hosts/hosts_acl.sh $(1)/lib/hosts/
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/hostmngr/ $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,hostmngr))

View File

@@ -1,9 +0,0 @@
config global 'global'
option enabled '1'
option history '1'
option history_file '/etc/hosts_history.json'
option history_timeout '86400'
config interface
list ifname 'br-lan'

View File

@@ -1,19 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/hosts/hosts_acl.sh
iptables -w -F hosts_forward
ip6tables -w -F hosts_forward
iptables -w -t filter -N hosts_forward
ret=$?
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
ip6tables -w -t filter -N hosts_forward
ret=$?
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
# Load /etc/config/hosts UCI file
config_load hosts
config_foreach process_ac_schedule ac_schedule

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"input": {
"type": "DotSo",
"name": "/etc/hostmngr/libhostmngr.so"
},
"output": {
"type": "UBUS",
"name": "bbfdm.hosts",
"parent_dm": "Device.",
"object": "Hosts",
"root_obj": "bbfdm"
}
}
}

View File

@@ -1,34 +0,0 @@
#!/bin/sh /etc/rc.common
START=97
STOP=20
. /etc/bbfdm/bbfdm_services.sh
. /lib/hosts/hosts_acl.sh
USE_PROCD=1
HOSTS_JSON_INPUT="/etc/hostmngr/input.json"
start_service() {
procd_open_instance
procd_set_param command "/usr/sbin/hostmngr" "--config hosts" "-o" "/tmp/hostmngr.log" "-f"
# procd_set_param respawn
procd_set_param limits core="unlimited"
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance
bbfdm_add_service "bbfdm.hosts" "${HOSTS_JSON_INPUT}"
hosts_acl
}
service_triggers()
{
procd_add_reload_trigger "hosts"
}
reload_service() {
stop
start
}

View File

@@ -1,12 +0,0 @@
#!/bin/sh
if [ -f /etc/firewall.hosts ]; then
uci -q get firewall.hosts || {
uci -q set firewall.hosts=include
uci -q set firewall.hosts.path="/etc/firewall.hosts"
uci -q set firewall.hosts.reload=1
}
fi
exit 0

View File

@@ -1,23 +0,0 @@
#!/bin/sh
uci -q get hosts.global.ageing_timer || exit 0
# Old hosts UCI config is detected; Convert to new format
ageing_timer="$(uci -q get hosts.global.ageing_timer)"
history_timeout=$((ageing_timer*60))
uci -q set hosts.global.enabled=1
uci -q delete hosts.global.ageing_timer
uci -q set hosts.global.history_timeout="$history_timeout"
uci -q rename hosts.global.reboot_persistent=history
uci -q set hosts.global.history_file="/etc/hosts_history.json"
uci -q add hosts interface
for ifname in $(uci -q get hosts.global.ifname); do
uci -q add_list hosts.@interface[-1].ifname="$ifname"
done
uci -q delete hosts.global.ifname
exit 0

View File

@@ -1,230 +0,0 @@
#!/bin/sh
. /lib/functions.sh
day=""
next_days=""
prev_days=""
IP_RULE=""
IP_RULE1=""
get_next_day() {
local weekday="$1"
case "$weekday" in
"Mon"|"Monday") echo "Tuesday"
;;
"Tue"|"Tuesday") echo "Wednesday"
;;
"Wed"|"Wednesday") echo "Thursday"
;;
"Thu"|"Thursday") echo "Friday"
;;
"Fri"|"Friday") echo "Saturday"
;;
"Sat"|"Saturday") echo "Sunday"
;;
"Sun"|"Sunday") echo "Monday"
;;
esac
}
get_previous_day() {
local weekday="$1"
case "$weekday" in
"Mon"|"Monday") echo "Sunday"
;;
"Tue"|"Tuesday") echo "Monday"
;;
"Wed"|"Wednesday") echo "Tuesday"
;;
"Thu"|"Thursday") echo "Wednesday"
;;
"Fri"|"Friday") echo "Thursday"
;;
"Sat"|"Saturday") echo "Friday"
;;
"Sun"|"Sunday") echo "Saturday"
;;
esac
}
ip_rule_west_zone() {
local utc_start_t_h="$1"
local utc_stop_t_h="$2"
local local_start_t_h="$3"
local local_stop_t_h="$4"
local utc_start_time="$5"
local utc_stop_time="$6"
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
if [ -n "$next_days" ]; then
IP_RULE="$IP_RULE --weekdays $next_days"
fi
else
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
IP_RULE1="$IP_RULE"
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop 23:59"
IP_RULE1="$IP_RULE1 -m time --timestart 00:00 --timestop $utc_stop_time"
if [ -n "$next_days" ]; then
IP_RULE1="$IP_RULE1 --weekdays $next_days"
fi
else
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
fi
if [ -n "$day" ]; then
IP_RULE="$IP_RULE --weekdays $day"
fi
fi
}
ip_rule_east_zone() {
local utc_start_t_h="$1"
local utc_stop_t_h="$2"
local local_start_t_h="$3"
local local_stop_t_h="$4"
local utc_start_time="$5"
local utc_stop_time="$6"
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
if [ -n "$day" ]; then
IP_RULE="$IP_RULE --weekdays $day"
fi
else
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
IP_RULE1="$IP_RULE"
IP_RULE="$IP_RULE -m time --timestart 00:00 --timestop $utc_stop_time"
IP_RULE1="$IP_RULE1 -m time --timestart $utc_start_time --timestop 23:59"
if [ -n "$prev_days" ]; then
IP_RULE1="$IP_RULE1 --weekdays $prev_days"
fi
else
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
fi
if [ -n "$day" ]; then
IP_RULE="$IP_RULE --weekdays $day"
fi
fi
}
process_ac_schedule() {
local acs_id="$1"
local is_enabled
local access_control
local start_time=""
local mac=""
handle_day_list() {
local value=$1
val=$(echo $value | cut -c 1-3)
next_day_val=$(get_next_day $val)
prev_day_val=$(get_previous_day $val)
if [ -z $day ]; then
day="$val"
next_days="$next_day_val"
prev_days="$prev_day_val"
else
day="$day,$val"
next_days="$next_days,$next_day_val"
prev_days="$prev_days,$prev_day_val"
fi
}
config_list_foreach "$acs_id" "day" handle_day_list
config_get is_enabled "$acs_id" "enable" 1
config_get access_control "$acs_id" "dm_parent"
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
return
fi
IP_RULE=""
IP_RULE1=""
mac=$(uci -q get hosts.$access_control.macaddr)
access_policy=$(uci -q get hosts.$access_control.access_policy)
config_get start_time "$acs_id" "start_time"
config_get duration "$acs_id" "duration"
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
return
fi
if [ -n "$mac" ]; then
IP_RULE="$IP_RULE -m mac --mac-source $mac"
fi
zone=$(date +%z | cut -c 1)
local_start_time=$start_time
if [ -n "$duration" ]; then
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
hh_s=`expr $hh \* 3600`
mm_s=`expr $mm \* 60`
ss=$(( hh_s + mm_s ))
local_start_hh=$hh
stop_ss=$(( ss + duration ))
hh=$(( stop_ss / 3600 ))
rem_ss=$(( stop_ss % 3600 ))
mm=$(( rem_ss / 60 ))
ss=$(( rem_ss % 60 ))
local_stop_time="$hh:$mm:$ss"
local_stop_hh=$hh
fi
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
utc_stop_time=$(date -u -d @$(date "+%s" -d "$local_stop_time") +%H:%M)
utc_start_hh=$(echo $utc_start_time | awk -F: '{ print $1 }')
utc_stop_hh=$(echo $utc_stop_time | awk -F: '{ print $1 }')
if [ "$zone" == "-" ]; then
ip_rule_west_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
else
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
fi
if [ "$access_policy" == "Deny" ]; then
IP_RULE="$IP_RULE -j DROP"
if [ -n "$IP_RULE1" ]; then
IP_RULE1="$IP_RULE1 -j DROP"
fi
else
IP_RULE="$IP_RULE -j ACCEPT"
if [ -n "$IP_RULE1" ]; then
IP_RULE1="$IP_RULE1 -j ACCEPT"
fi
fi
iptables -w -A hosts_forward ${IP_RULE}
ip6tables -w -A hosts_forward ${IP_RULE}
if [ -n "$IP_RULE1" ]; then
iptables -w -A hosts_forward ${IP_RULE1}
ip6tables -w -A hosts_forward ${IP_RULE1}
fi
day=""
next_days=""
prev_days=""
}
hosts_acl() {
iptables -w -F hosts_forward
ip6tables -w -F hosts_forward
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
if [ -z "$hosts_forward" ]; then
iptables -w -t filter -N hosts_forward
ret=$?
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
ip6tables -w -t filter -N hosts_forward
ret=$?
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
fi
# Load /etc/config/hosts UCI file
config_load hosts
config_foreach process_ac_schedule ac_schedule
}

4
ice-client/Config.in Normal file
View File

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

1046
ice-client/Makefile Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
#!/bin/sh
grep -rq "^ice:" /etc/passwd || {
adduser -D -H -s /bin/false ice
}
uci -q delete passwords.ice
uci -q set passwords.ice=usertype
uci -q set passwords.ice.password="\$WPAKEY"
uci -q add_list passwords.ice._access_r=root
uci -q commit passwords
uci show rpcd | grep username=.*ice.* >/dev/null || {
cat >> /etc/config/rpcd << EOF
config login
option username 'ice'
option password '\$p\$ice'
list _access_r 'none'
list write 'user-user'
list write 'juci-broadcom-dsl'
list write 'juci-broadcom-dsl-admin'
list write 'juci-broadcom-ethernet'
list write 'juci-broadcom-iptv'
list write 'juci-broadcom-vlan'
list write 'juci-broadcom-vlan-admin'
list write 'juci-wireless'
list write 'juci-wireless-admin'
list write 'juci-catv'
list write 'juci-ddns'
list write 'juci-diagnostics'
list write 'juci-dnsmasq-dhcp'
list write 'juci-dropbear'
list write 'juci-ethernet'
list write 'juci-event'
list write 'juci-firewall-fw3'
list write 'juci-iconnect'
list write 'juci-igmpinfo'
list write 'juci-inteno-backup'
list write 'juci-inteno-multiwan'
list write 'juci-inteno-provisioning'
list write 'juci-inteno-qos'
list write 'juci-inteno-voice-client'
list write 'juci-minidlna'
list write 'juci-mod-status'
list write 'juci-mod-system'
list write 'juci-natalie-dect'
list write 'juci-netmode'
list write 'juci-network-netifd'
list write 'juci-owsd'
list write 'juci-printer'
list write 'juci-realtime-graphs'
list write 'juci-samba'
list write 'juci-sfp'
list write 'juci-snmpd'
list write 'juci-sysupgrade'
list write 'juci-uhttpd'
list write 'juci-upnp'
list write 'juci-usb'
list write 'core'
list write 'unauthenticated'
EOF
}
exit 0

46
icgroupd/Makefile Normal file
View File

@@ -0,0 +1,46 @@
#
# Copyright (C) 2016 Inteno Broadband AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=icgroupd
PKG_VERSION:=1.0
PKG_RELEASE:=0
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Inteno Broadband AB
include $(INCLUDE_DIR)/package.mk
define Package/icgroupd
SECTION:=base
CATEGORY:=Base system
TITLE:=Inteno cgroup daemon
DEPENDS:=+uci +busybox
endef
define Package/icgroupd/description
This package contains Intenos cgroup daemon and associated
configuration and startup scripts.
endef
define Build/Compile
true
endef
define Package/icgroupd/install
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
$(INSTALL_CONF) ./files/cgroups.config $(1)/etc/config/cgroups
$(INSTALL_BIN) ./files/cgroups.init $(1)/etc/init.d/cgroups
$(INSTALL_BIN) ./files/cgroupd $(1)/sbin/
endef
$(eval $(call BuildPackage,icgroupd))

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