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
803 changed files with 21407 additions and 46623 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,10 +0,0 @@
if PACKAGE_bbfdmd
config BBF_VENDOR_PREFIX
string "Vendor Prefix"
default "X_IOWRT_EU_"
config BBF_OBFUSCATION_KEY
string "Obfuscation key"
default "371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04"
endif

View File

@@ -1,217 +0,0 @@
#
# Copyright (C) 2023 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.16.6.2
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=aa480554461c82e6f6f44ee6c23108d3e44fce21
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
RSTRIP:=true
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include bbfdm.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 +libcurl
ABI_VERSION:=1.0
endef
define Package/libbbfdm-ubus
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF datamodel ubus library, provides API to expose datamodel over ubus
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
endef
define Package/bbfdmd
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend to expose core tree
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libopenssl +libbbfdm-ubus +bbf_configmngr
endef
define Package/dm-service
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend to expose micro-service tree
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr
endef
define Package/bbf_configmngr
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:= BBF Config Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
endef
define Package/bbfdmd/config
source "$(SOURCE)/Config_bbfdmd.in"
endef
# Below config is a hack to force-recompile dependent micro-services
define Package/libbbfdm-api/config
if PACKAGE_bbfdmd
config BBF_LIBBBFDM_VERSION
string "Internal config variable to force recompile"
default "v${PKG_VERSION}"
endif
endef
define Package/libbbfdm-api/description
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
endef
define Package/libbbfdm-ubus/description
Library contains the APIs to expose data model over ubus
endef
define Package/bbfdmd/description
Daemon to expose Datamodel core tree
endef
define Package/dm-service/description
Daemon to expose Datamodel micro-service tree
endef
define Package/bbf_configmngr/description
Daemon for handling bbf reload services via ubus bbf.config
endef
ifeq ($(USE_LOCAL),1)
define Build/Prepare
$(CP) ~/git/bbfdm/* $(PKG_BUILD_DIR)/
endef
endif
CMAKE_OPTIONS += \
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760 \
-DCMAKE_BUILD_TYPE:String="Debug" \
define Package/libbbfdm-api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/libbbfdm-api.so $(1)/lib/
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/libbbfdm-api-v2.so $(1)/lib/
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.secure $(1)/usr/libexec/rpcd/bbf.secure
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_api $(1)/usr/share/bbfdm/scripts/
$(INSTALL_DIR) $(1)/etc/bbfdm/certificates
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
endef
define Package/libbbfdm-ubus/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-ubus/libbbfdm-ubus.so $(1)/lib/
endef
define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
$(INSTALL_CONF) ./files/etc/config/schedules $(1)/etc/config/schedules
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/bbfdmd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/ruleng.bbfdm $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/ruleng
$(INSTALL_BIN) ./files/etc/ruleng/bbfdm.json $(1)/etc/ruleng
endef
define Package/dm-service/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/bbfdm.services $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dm-service/dm-service $(1)/usr/sbin/
$(BBFDM_REGISTER_SERVICES) -v ${CONFIG_BBF_VENDOR_PREFIX} ./bbfdm_service.json $(1) core
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfdm/libcore.so $(1) core
endef
define Package/bbf_configmngr/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/bbfdm/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/bbf_configd $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/bbf_configd
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
$(INSTALL_DATA) ./files/etc/bbfdm/critical_services.json $(1)/etc/bbfdm/
endef
define Package/bbfdmd/prerm
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api/legacy
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api/version-2
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-ubus
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/*.h $(1)/usr/include/libbbfdm-api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/*.h $(1)/usr/include/libbbfdm-api/legacy/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/*.h $(1)/usr/include/libbbfdm-api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/*.h $(1)/usr/include/libbbfdm-api/version-2/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-ubus/bbfdm-ubus.h $(1)/usr/include/libbbfdm-ubus/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/include/*.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/libbbfdm-api.so $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/libbbfdm-api-v2.so $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-ubus/libbbfdm-ubus.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,bbf_configmngr))
$(eval $(call BuildPackage,libbbfdm-api))
$(eval $(call BuildPackage,libbbfdm-ubus))
$(eval $(call BuildPackage,bbfdmd))
$(eval $(call BuildPackage,dm-service))

View File

@@ -1,38 +0,0 @@
# BBFDM configuration options and utilities
bbfdm provides few compile time configuration options and compile time help utility called [bbfdm.mk](./bbfdm.mk), this document aimed to explain the available usages and best practices.
## Compilation options
| Configuration option | Description | Default Value |
| ----------------------- | ------------- | ----------- |
| CONFIG_BBF_VENDOR_LIST | List of vendor extension directories | iopsys |
| CONFIG_BBF_VENDOR_PREFIX | Prefix for Vendor extension datamodel objects/parameters | X_IOPSYS_EU_ |
| CONFIG_BBF_MAX_OBJECT_INSTANCES | Maximum number of instances per object | 255 |
| BBF_OBFUSCATION_KEY | Hash used to encode/decode in `bbf.secure` object | 371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04 |
#### BBF_OBFUSCATION_KEY
`bbfdm` provides an ubus object called `bbf.secure` to allow encoding/decoding the values, `bbf.secure` currently support following methods internally to encode/decode
- Encode/Decode using a predefined SHA512 Hash key
- Encode/Decode using a private/public RSA key pair
The `BBF_OBFUSCATION_KEY` compile time configuration option used to defined the SHA512 HASH, if this option is undefined, then it usages a default value as mention in the above table.
User must override this parameter with their own hash value, to generate a hash user can run below command and copy the hash value to this option.
ex: User wants to use 'Sup3rS3cur3Passw0rd' as passkey, then can get the SHA512 sum with
```bash
$ echo -n "Sup3rS3cur3Passw0rd" | sha512sum
371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04 -
```
> Note: Additionally, user can install RSA private key in '/etc/bbfdm/certificates/private_key.pem' path, if private key is present `bbf.secure` shall use rsa private certificate for encrypt/decrypt function. In case of key not present in the pre-defined path, hash will be used for the same.
## Helper utility (bbfdm.mk)
bbfdm provides a helper utility [bbfdm.mk](./bbfdm.mk) to install datamodel plugins in bbfdm core or in microservice directory.

View File

@@ -1,92 +0,0 @@
#
# Copyright (C) 2023 IOPSYS
#
BBFDM_BASE_DM_PATH=/usr/share/bbfdm
BBFDM_INPUT_PATH=/etc/bbfdm/micro_services
BBFDM_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PKG_CONFIG_DEPENDS += CONFIG_BBF_LIBBBFDM_VERSION
#BBFDM_VERSION:=$(shell grep -oP '(?<=^PKG_VERSION:=).*' ${BBFDM_DIR}/Makefile)
#BBFDM_TOOLS:=$(BUILD_DIR)/bbfdm-$(BBFDM_VERSION)/tools
# Utility to install the plugin in bbfdm core path with priority.
# Its now possible to overwrite/remove core datamodel with plugin, so, if some
# datamodel objects/parameters are present in more than one plugin, order in
# which they loaded into memory becomes crucial, this Utility help to configure
# a priority order in which they gets loaded in memory.
#
# ARGS:
# $1 => Plugin artifact
# $2 => package install directory
# $3 => Priority of the installed plugin (Optional)
#
# Note:
# - Last loaded plugin gets the highest priority
#
# Example:
# BBFDM_INSTALL_CORE_PLUGIN ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)
#
# Example to install plugin with priority:
# BBFDM_INSTALL_CORE_PLUGIN ./files/etc/bbfdm/json/CWMPManagementServer.json $(1) 01
#
BBFDM_INSTALL_CORE_PLUGIN:=$(BBFDM_DIR)/tools/bbfdm.sh -p
# Utility to install the micro-service datamodel
# Use Case:
# user wants to run a datamodel micro-service, it required to install the
# DotSO/JSON plugin into a bbf shared directory, this utility helps in
# installing the DotSO/JSON plugin in bbfdm shared directory, and auto-generate
# input file for the micro-service
#
# ARGS:
# $1 => DotSo or Json plugin with complete path
# $2 => package install directory
# $3 => service name
#
# Note:
# - There could be only one main plugin file, so its bind to PKG_NAME
# - Micro-service input.json will be auto generated with this call
#
# Example:
# BBFDM_INSTALL_MS_DM $(PKG_BUILD_DIR)/libcwmp.so $(1) $(PKG_NAME)
#
BBFDM_INSTALL_MS_DM:=$(BBFDM_DIR)/tools/bbfdm.sh -m
# Utility to install a plugins in datamodel micro-service
#
# ARGS:
# $1 => DotSo or Json plugin with complete path
# $2 => package install directory
# $3 => service name
#
# Note:
# - Use the service_name/PKG_NAME of the service in which this has to run
#
# Example:
# BBFDM_INSTALL_MS_PLUGIN $(PKG_BUILD_DIR)/libxmpp.so $(1) icwmp
#
BBFDM_INSTALL_MS_PLUGIN:=$(BBFDM_DIR)/tools/bbfdm.sh -m -p
# Utility to install the helper scripts in default bbfdm script path
#
# Use Case:
# User want to install some script for running diagnostics
#
# ARGS:
# $1 => Script with complete path
# $2 => package install directory
#
# Note:
# - Use with -d option to install script in bbf.diag directory
#
# Example:
# BBFDM_INSTALL_SCRIPT $(PKG_BUILD_DIR)/download $(1)
# BBFDM_INSTALL_SCRIPT -d $(PKG_BUILD_DIR)/ipping $(1)
#
BBFDM_INSTALL_SCRIPT:=$(BBFDM_DIR)/tools/bbfdm.sh -s
BBFDM_REGISTER_SERVICES:=$(BBFDM_DIR)/tools/bbfdm.sh -t

View File

@@ -1,54 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "core",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "LANConfigSecurity"
},
{
"parent_dm": "Device.",
"object": "Schedules"
},
{
"parent_dm": "Device.",
"object": "Security",
"proto": "cwmp"
},
{
"parent_dm": "Device.",
"object": "PacketCaptureDiagnostics"
},
{
"parent_dm": "Device.",
"object": "SelfTestDiagnostics"
},
{
"parent_dm": "Device.",
"object": "Syslog"
},
{
"parent_dm": "Device.",
"object": "{BBF_VENDOR_PREFIX}OpenVPN",
"proto": "usp"
},
{
"parent_dm": "Device.",
"object": "RootDataModelVersion"
},
{
"parent_dm": "Device.",
"object": "Reboot()"
},
{
"parent_dm": "Device.",
"object": "FactoryReset()"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,23 +0,0 @@
{
"usp": [
"firewall",
"network",
"dhcp",
"time",
"wireless",
"ieee1905",
"mapcontroller",
"mosquitto",
"nginx",
"netmode"
],
"cwmp": [
"firewall",
"network",
"dhcp",
"mapcontroller",
"wireless",
"time",
"netmode"
]
}

View File

@@ -1,12 +0,0 @@
config bbfdmd 'bbfdmd'
option enable '1'
option debug '0'
option loglevel '3'
config micro_services 'micro_services'
option enable '1'
option enable_core '0'
config reload_handler 'reload_handler'
option log_level '1'

View File

@@ -1,2 +0,0 @@
config global 'global'
option enable '1'

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,41 +0,0 @@
#!/bin/sh /etc/rc.common
START=80
STOP=07
USE_PROCD=1
PROG=/usr/sbin/bbf_configd
log() {
echo "${@}"|logger -t bbf.config -p info
}
create_needed_directories()
{
mkdir -p /tmp/bbfdm/.cwmp
mkdir -p /tmp/bbfdm/.usp
mkdir -p /tmp/bbfdm/.bbfdm
}
start_service()
{
local log_level
create_needed_directories
config_load bbfdm
config_get log_level "reload_handler" log_level 2
procd_open_instance "bbf_configd"
procd_set_param command ${PROG}
procd_append_param command -l "${log_level}"
procd_set_param respawn
procd_close_instance "bbf_configd"
}
service_triggers() {
for config_file in /etc/config/*; do
config_name=$(basename "$config_file")
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh
done
}

View File

@@ -1,114 +0,0 @@
#!/bin/sh /etc/rc.common
START=60
STOP=05
USE_PROCD=1
PROG=/usr/sbin/dm-service
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/services"
. /usr/share/libubox/jshn.sh
log() {
echo "${@}"|logger -t bbfdmd.services -p info
}
validate_bbfdm_micro_service_section()
{
uci_validate_section bbfdm micro_services "micro_services" \
'enable:bool:true' \
'enable_core:bool:false'
}
_add_microservice()
{
local name path loglevel
local enable enable_core unified_daemon
# Check enable from micro-service
path="${1}"
enable_core="${2}"
name="$(basename ${path})"
name="${name//.json}"
json_load_file "${path}"
json_select daemon
json_get_var enable enable 1
if [ "${enable}" -eq "0" ]; then
log "datamodel micro-service ${name} not enabled"
return 0
fi
json_get_var unified_daemon unified_daemon 0
if [ "${unified_daemon}" -eq "1" ]; then
return 0
fi
json_select config
json_get_var loglevel loglevel 4
procd_open_instance "${name}"
procd_set_param command ${PROG}
procd_append_param command -m "${name}"
procd_append_param command -l "${loglevel}"
if [ "${enable_core}" -eq "1" ]; then
procd_set_param limits core="unlimited"
procd_set_param stdout 1
procd_set_param stderr 1
fi
procd_set_param respawn
procd_close_instance "${name}"
}
configure_bbfdm_micro_services()
{
local enable enable_core
config_load bbfdm
validate_bbfdm_micro_service_section || {
log "Validation of micro_service section failed"
return 1;
}
[ "${enable}" -eq "0" ] && return 0
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
FILES="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/*.json)"
for file in $FILES;
do
[ -e "$file" ] || continue
_add_microservice $file "${enable_core}"
done
fi
}
_start_single_service()
{
local service file
service="${1}"
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
file="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/${service}.json)"
[ -e "$file" ] || return
_add_microservice $file "0"
fi
}
start_service()
{
if [ -n "${1}" ]; then
_start_single_service "${1}"
else
configure_bbfdm_micro_services
fi
}

View File

@@ -1,56 +0,0 @@
#!/bin/sh /etc/rc.common
START=97
STOP=06
USE_PROCD=1
PROG=/usr/sbin/bbfdmd
. /usr/share/libubox/jshn.sh
log() {
echo "${@}"|logger -t bbfdmd.init -p info
}
validate_bbfdm_bbfdmd_section()
{
uci_validate_section bbfdm bbfdmd "bbfdmd" \
'enable:bool:true' \
'debug:bool:false' \
'loglevel:uinteger:4'
}
configure_bbfdmd()
{
local enable debug
local jlog jrefresh jtimeout jlevel
config_load bbfdm
validate_bbfdm_bbfdmd_section || {
log "Validation of bbfdmd section failed"
return 1;
}
[ "${enable}" -eq 0 ] && return 0
procd_set_param command ${PROG}
procd_append_param command -l "${loglevel}"
if [ "${debug}" -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
fi
}
start_service()
{
procd_open_instance "bbfdm"
configure_bbfdmd
procd_set_param respawn
procd_close_instance "bbfdm"
}
service_triggers()
{
procd_add_reload_trigger "bbfdm"
}

View File

@@ -1,66 +0,0 @@
{
"hosts_refresh": {
"if" : [
{
"event": "host"
}
],
"then" : [
{
"object": "bbfdm.hostmngr",
"method":"refresh_references_db",
"args" : {},
"timeout": 1
}
]
},
"dhcp_refresh": {
"if_operator": "OR",
"if" : [
{
"event": "host"
},
{
"event": "wifi.dataelements.Associated"
}
],
"then" : [
{
"object": "bbfdm.dhcpmngr",
"method":"refresh_references_db",
"args" : {},
"timeout": 1
}
]
},
"ieee1905_refresh_add": {
"if" : [
{
"event": "ieee1905.neighbor.add"
}
],
"then" : [
{
"object": "bbfdm.ieee1905",
"method":"refresh_references_db",
"args" : {},
"timeout": 1
}
]
},
"ieee1905_refresh_del": {
"if" : [
{
"event": "ieee1905.neighbor.del"
}
],
"then" : [
{
"object": "bbfdm.ieee1905",
"method":"refresh_references_db",
"args" : {},
"timeout": 1
}
]
}
}

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# rename bbfdmd enabled option to enable
val="$(uci -q get bbfdm.bbfdmd.enabled)"
if [ -n "${val}" ]; then
uci -q set bbfdm.bbfdmd.enabled=""
uci -q set bbfdm.bbfdmd.enable="${val}"
fi
exit 0

View File

@@ -1,58 +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}"
}
parse_bbfdm_sysctl_conf_file
exit 0

View File

@@ -1,2 +0,0 @@
uci -q set ruleng.bbfdm=rule
uci -q set ruleng.bbfdm.recipe='/etc/ruleng/bbfdm.json'

View File

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

View File

@@ -1,203 +0,0 @@
#!/bin/bash
BBFDM_BASE_DM_PATH="usr/share/bbfdm"
BBFDM_INPUT_PATH="etc/bbfdm/micro_services"
INPUT_FILE="0"
MICRO_SERVICE=0
SCRIPT=0
DIAG=0
PLUGIN=0
DEST=""
VENDOR_EXTN=""
TOOLS="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
SRC=""
EXTRA_DATA=""
while getopts ":mpsdtv:" opt; do
case ${opt} in
m)
MICRO_SERVICE=1
;;
p)
PLUGIN=1
;;
s)
SCRIPT=1
;;
d)
DIAG=1
;;
t)
INPUT_FILE=1
;;
v)
VENDOR_EXTN=${OPTARG}
;;
?)
echo "Invalid option: ${OPTARG}"
exit 1
;;
esac
done
shift $((OPTIND-1))
SRC="${1}"
shift
DEST="${1}"
shift
DATA="${1}"
shift
EXTRA_DATA="${1}"
install_bin() {
if ! install -m0755 ${1} ${2}; then
echo "Failed to install bin ${1} => ${2}"
exit 1
fi
}
install_dir() {
if ! install -d -m0755 ${1}; then
echo "Failed to create directory ${1}"
exit 1
fi
}
install_data() {
if ! install -m0644 ${1} ${2}; then
echo "Failed to install ${1} => ${2}"
exit 1
fi
}
# Installing datamodel
bbfdm_install_dm()
{
local src dest minfile
src="$1"
dest="$2"
minfile=""
if [ -z ${src} ] || [ -z "${dest}" ] || [ -z "${TOOLS}" ]; then
echo "Invalid input option for install dm $@"
exit 1
fi
if [ ! -f "${src}" ]; then
echo "File $src does not exists..."
exit 1
fi
if [ "${src##*.}" = "json" ]; then
echo "Compacting BBFDM JSON file"
minfile=$(mktemp)
jq -c 'del(..|.description?)' ${src} > ${minfile}
if [ -n "${VENDOR_EXTN}" ]; then
sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${minfile}
fi
src=${minfile}
if dpkg -s python3-jsonschema >/dev/null 2>&1; then
echo "Verifying bbfdm Datamodel JSON file"
if ! ${TOOLS}/validate_plugins.py ${src}; then
echo "Validation of the plugin failed ${src}"
exit 1
fi
else
echo "## Install python3-jsonschema to verify datamodel plugins"
fi
fi
install_bin ${src} ${dest}
if [ -f "${minfile}" ]; then
rm ${minfile}
fi
}
if [ -z "$SRC" ] || [ -z "${DEST}" ] ; then
echo "# BBFDM Null value in src[${SRC}], dest[${DEST}]"
exit 1
fi
if [ "${SCRIPT}" -eq "1" ]; then
if [ "${DIAG}" -eq "1" ]; then
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/scripts/bbf_diag
install_bin ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/scripts/bbf_diag/
else
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/scripts
install_bin ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/scripts/
fi
exit 0
fi
if [ "${INPUT_FILE}" -eq "1" ]; then
tempfile=""
if [ ! -f "${SRC}" ]; then
echo "# Datamodel Input file ${SRC} not available"
exit 1
fi
if ! cat ${SRC} |jq >/dev/null 2>&1; then
echo "# Invalid datamodel json input file"
exit 1
fi
service_name="$(cat ${SRC}|jq -r '.daemon.service_name')"
if [ -z "${service_name}" ]; then
echo "# service_name not defined in service json ...."
exit 1
fi
tempfile=$(mktemp)
cp ${SRC} ${tempfile}
if [ -n "${VENDOR_EXTN}" ]; then
sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${tempfile}
fi
install_dir ${DEST}/etc/bbfdm/services
install_data ${tempfile} ${DEST}/etc/bbfdm/services/${service_name}.json
if [ -f "${tempfile}" ]; then
rm ${tempfile}
fi
exit 0
fi
if [ "${MICRO_SERVICE}" -eq "1" ]; then
if [ -z "${DATA}" ]; then
echo "# service_name[${DATA}] not provided"
exit 1
fi
if [ "${PLUGIN}" -ne "1" ]; then
extn="$(basename ${SRC})"
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}.${extn##*.}
else
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}/$(printf "%02d" ${EXTRA_DATA})$(basename ${SRC})
fi
else
if [ "${PLUGIN}" -eq "1" ]; then
echo "# WARNING: BBFDM_INSTALL_CORE_PLUGIN macro will be deprecated soon. Please use BBFDM_INSTALL_MS_PLUGIN macro instead, specifying 'core' as micro-service name #"
priority="${DATA:-0}"
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/core
if [ "${priority}" -gt "0" ]; then
# install with priority if defined
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/core/${priority}_$(basename ${SRC})
elif [ "${priority}" -eq "0" ]; then
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/core/$(basename ${SRC})
else
echo "# Priority should be an unsigned integer"
exit 1
fi
fi
fi

View File

@@ -1,333 +0,0 @@
#!/usr/bin/python3
# Copyright (C) 2024 iopsys Software Solutions AB
# Author: Amin Ben Romdhane <amin.benromdhane@iopsys.eu>
import sys
import json
from jsonschema import validate
JSON_PLUGIN_VERSION = 0
obj_schema = {
"definitions": {
"type_t": {
"type": "string",
"enum": [
"object"
]
},
"map_type_t": {
"type": "string",
"enum": [
"uci",
"ubus"
]
},
"protocols_t": {
"type": "string",
"enum": [
"none",
"cwmp",
"usp"
]
}
},
"type" : "object",
"properties" : {
"type" : {"$ref": "#/definitions/type_t"},
"version" : {"type": "string"},
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
"uniqueKeys" : {"type" : "array"},
"access" : {"type" : "boolean"},
"array" : {"type" : "boolean"},
"mapping" : {"type" : "object", "properties" : {
"type" : {"$ref": "#/definitions/map_type_t"},
"uci" : {"type" : "object", "properties" : {
"file" : {"type": "string"},
"section" : {"type": "object", "properties" : {
"type" : {"type": "string"}
}
},
"dmmapfile" : {"type": "string"}
}
},
"ubus" : {"type" : "object", "properties" : {
"object" : {"type": "string"},
"method" : {"type": "string"},
"args" : {"type": "object"},
"key" : {"type": "string"}
}
}
}
}
},
"required": [
"type",
"protocols",
"array",
"access"
]
}
obj_schema_v1 = {
"definitions": {
"type_t": {
"type": "string",
"enum": [
"object"
]
},
"map_type_t": {
"type": "string",
"enum": [
"uci",
"ubus"
]
},
"protocols_t": {
"type": "string",
"enum": [
"cwmp",
"usp",
"none"
]
}
},
"type" : "object",
"properties" : {
"type" : {"$ref": "#/definitions/type_t"},
"version" : {"type": "string"},
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
"uniqueKeys" : {"type" : "array"},
"access" : {"type" : "boolean"},
"array" : {"type" : "boolean"},
"mapping" : {"type" : "array", "items" : {
"type" : "object", "properties" : {
"type" : {"$ref": "#/definitions/map_type_t"},
"uci" : {"type" : "object", "properties" : {
"file" : {"type": "string"},
"section" : {"type": "object", "properties" : {
"type" : {"type": "string"}
}
},
"dmmapfile" : {"type": "string"}
}
},
"ubus" : {"type" : "object", "properties" : {
"object" : {"type": "string"},
"method" : {"type": "string"},
"args" : {"type": "object"},
"key" : {"type": "string"}
}
}
}
}
}
},
"required": [
"type",
"protocols",
"array",
"access"
]
}
param_schema = {
"definitions": {
"type_t": {
"type": "string",
"enum": [
"string",
"unsignedInt",
"unsignedLong",
"int",
"long",
"boolean",
"dateTime",
"hexBinary",
"base64",
"decimal"
]
},
"map_type_t": {
"type": "string",
"enum": [
"uci",
"ubus",
"procfs",
"sysfs",
"json",
"uci_sec"
]
},
"protocols_t": {
"type": "string",
"enum": [
"cwmp",
"usp",
"none"
]
}
},
"type" : "object",
"properties" : {
"type" : {"$ref": "#/definitions/type_t"},
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
"read" : {"type" : "boolean"},
"write" : {"type" : "boolean"},
"mapping" : {"type" : "array", "items" : {"type": "object", "properties" : {
"type" : {"$ref": "#/definitions/map_type_t"},
"uci" : {"type" : "object", "properties" : {
"file" : {"type": "string"},
"section" : {"type": "object", "properties" : {
"type" : {"type": "string"},
"index" : {"type": "string"}
}
},
"option" : {"type": "object", "properties" : {
"name" : {"type": "string"} }
}
}
},
"ubus" : {"type" : "object", "properties" : {
"object" : {"type": "string"},
"method" : {"type": "string"},
"args" : {"type": "object"},
"key" : {"type": "string"}
}
},
"procfs" : {"type" : "object", "properties" : {
"file" : {"type": "string"}
}
},
"sysfs" : {"type" : "object", "properties" : {
"file" : {"type": "string"}
}
}
}
}
}
},
"required": [
"type",
"protocols",
"read",
"write"
]
}
event_schema = {
"definitions": {
"type_t": {
"type": "string",
"enum": [
"event"
]
},
"protocols_t": {
"type": "string",
"enum": [
"none",
"usp"
]
}
},
"type" : "object",
"properties" : {
"type" : {"$ref": "#/definitions/type_t"},
"version" : {"type": "string"},
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}}
},
"required": [
"type",
"protocols"
]
}
command_schema = {
"definitions": {
"type_t": {
"type": "string",
"enum": [
"command"
]
},
"protocols_t": {
"type": "string",
"enum": [
"none",
"usp"
]
}
},
"type" : "object",
"properties" : {
"type" : {"$ref": "#/definitions/type_t"},
"async" : {"type" : "boolean"},
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
"input" : {"type" : "object"},
"output" : {"type" : "object"}
},
"required": [
"type",
"async",
"protocols"
]
}
def print_validate_json_usage():
print("Usage: " + sys.argv[0] + " <dm json file>")
print("Examples:")
print(" - " + sys.argv[0] + " datamodel.json")
print(" ==> Validate the json file")
print("")
exit(1)
def parse_value( key , value ):
if key.endswith('.') and not key.startswith('Device.'):
print(key + " is not a valid path")
exit(1)
if key.endswith('.') and (JSON_PLUGIN_VERSION == 1 or JSON_PLUGIN_VERSION == 2):
__schema = obj_schema_v1
elif key.endswith('.'):
__schema = obj_schema
elif key.endswith('!'):
__schema = event_schema
elif key.endswith('()'):
__schema = command_schema
else:
__schema = param_schema
validate(instance = value, schema = __schema)
for k, v in value.items():
if k != "list" and k != "mapping" and k != "input" and k != "output" and isinstance(v, dict):
parse_value(k, v)
### main ###
if len(sys.argv) < 2:
print_validate_json_usage()
json_file = open(sys.argv[1], "r", encoding='utf-8')
try:
json_data = json.loads(json_file.read())
except ValueError:
print(sys.argv[1] + " file has a wrong JSON format!!!!!")
exit(1)
for __key, __value in json_data.items():
if __key == "json_plugin_version":
if not isinstance(__value, int) or __value not in [0, 1, 2]:
raise ValueError("Invalid value for json_plugin_version")
JSON_PLUGIN_VERSION = __value
continue
parse_value(__key , __value)
print("JSON File is Valid")

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

@@ -1,45 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2025 IOPSYS Software Solutions AB
include $(TOPDIR)/rules.mk
PKG_NAME:=blkpg-part
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=5a4ec5f53ed904b37fba03f3797fbe2af3077f8d
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/gportay/blkpg-part.git
PKG_MIRROR_HASH:=skip
PKG_MAINTAINER:=Andreas Gnau <andreas.gnau@iopsys.eu>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
MAKE_INSTALL_FLAGS += PREFIX=/usr
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Disc
TITLE:=User space partition table and disk geometry handling utility
URL:=https://www.portay.io/blkpg-part/
endef
define Package/$(PKG_NAME)/description
blkpg-part creates temporary partitions that are not part of the GPT/MBR.
It makes a partition block device from any consecutive blocks that are
not partitioned. It creates, resizes and deletes partitions on the fly
without writing back the changes to the partition table.
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blkpg-part $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

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,17 +0,0 @@
if PACKAGE_bridgemngr
config BRIDGEMNGR_BRIDGE_VLAN
bool "Use bridge-vlan backend"
help
Set this option to use bridge-vlan as backend for VLAN objects.
config BRIDGEMNGR_BRIDGE_VENDOR_EXT
bool "Use bridge BBF vendor extensions"
default y
help
Set this option to use bridge BBF vendor extensions.
config BRIDGEMNGR_BRIDGE_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endif

View File

@@ -1,75 +0,0 @@
#
# Copyright (C) 2020-2024 iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bridgemngr
PKG_VERSION:=1.0.18.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
PKG_SOURCE_VERSION:=71ed529be038392071b0399bcfe9d46e89d3cb46
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/bridgemngr
CATEGORY:=Utilities
TITLE:=Bridge Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/bridgemngr/description
Package to add Device.Bridging. data model support.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
MAKE_PATH:=src
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
endif
define Package/bridgemngr/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME) 10
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME) 11
endif
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/bridging $(1)/etc/config/
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) ~/git/bridgemngr/* $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,bridgemngr))

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "bridgemngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "Bridging"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,31 +0,0 @@
{
"json_plugin_version": 2,
"Device.Bridging.Bridge.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": true,
"array": true,
"{BBF_VENDOR_PREFIX}VLANFiltering": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"description": "Enable or disable VLAN Filtering on this bridge.",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "vlan_filtering"
}
]
}
}
}

View File

@@ -1,33 +0,0 @@
#L2 filter UCI file
config chain 'qos_output'
option target 'qos_output'
option table 'nat'
option chain 'OUTPUT'
option policy 'RETURN'
config chain 'dscp2pbits'
option target 'dscp2pbits'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
config chain 'qos'
option target 'qos'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
config chain 'prevlanxlate'
option target 'prevlanxlate'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
option append 'false'
config chain 'mcsnooping'
option target 'mcsnooping'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
option append 'false'

View File

@@ -1,93 +0,0 @@
#!/bin/sh /etc/rc.common
# Start after bdmf shell, wanconf, and switch-script but before the network-script
START=20
STOP=10
USE_PROCD=1
. /lib/functions.sh
handle_ebtables_chain() {
local sid="$1"
local table
local chain
local target
local policy
local append
local enabled
local ret
config_get table "$sid" table filter
config_get chain "$sid" chain
config_get policy "$sid" policy RETURN
config_get target "$sid" target
config_get_bool append "$sid" append 1
config_get_bool enabled "$sid" enabled 1
[ "$enabled" = "0" ] && return
[ -z "${chain}" -o -z "${target}" ] && return
if [ "$append" != "0" ]; then
append="-A"
else
append="-I"
fi
ebtables --concurrent -t "$table" -N "$target" -P "$policy" 2> /dev/null
ret=$?
if [ $ret -eq 0 ]; then
ebtables --concurrent -t "$table" ${append} "$chain" -j "$target"
else
ebtables --concurrent -t "$table" -D "$chain" -j "$target"
ebtables --concurrent -t "$table" ${append} "$chain" -j "$target"
fi
}
handle_ebtables_rule() {
local sid="$1"
local table
local chain
local target
local match
local value
local enabled
local ret
config_get table "$sid" table filter
config_get chain "$sid" chain
config_get match "$sid" match
config_get value "$sid" value
config_get target "$sid" target RETURN
config_get_bool append "$sid" append 1
config_get_bool enabled "$sid" enabled 1
[ "$enabled" = "0" ] && return
[ -z "${chain}" -o -z "${target}" ] && return
if [ "$append" != "0" ]; then
append="-A"
else
append="-I"
fi
ebtables --concurrent -t "$table" -D "$chain" ${match} -j "$target" ${value} 2> /dev/null
ebtables --concurrent -t "$table" ${append} "$chain" ${match} -j "$target" ${value}
}
start_service() {
config_load bridging
config_foreach handle_ebtables_chain chain
config_foreach handle_ebtables_rule rule
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger bridging
}

View File

@@ -1,61 +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.20
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
PKG_SOURCE_VERSION:=a5e57962938ca143ede65d92be90b6e9fce66e15
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 $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/bulkdata
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF BulkData Collection
DEPENDS:=+ubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
DEPENDS+=+libbbfdm-api +libbbfdm-ubus
endef
define Package/bulkdata/description
BulkData daemon for TR069 with bbfdm backend.
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/bulkdata/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
$(INSTALL_DATA) ./files/etc/config/bulkdata $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,bulkdata))

View File

@@ -1,17 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "bulkdata",
"unified_daemon": true,
"proto": "cwmp",
"services": [
{
"parent_dm": "Device.",
"object": "BulkData"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,6 +0,0 @@
config bulkdata 'bulkdata'
option enable '0'
#Log levels: As per syslog 0-7, default 6=>LOG_INFO
option loglevel '3'

View File

@@ -1,41 +0,0 @@
#!/bin/sh /etc/rc.common
START=60
STOP=10
USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
validate_global_section() {
uci_validate_section bulkdata bulkdata bulkdata \
'enable:bool:1' \
'loglevel:uinteger:3'
}
start_service() {
local enable loglevel
validate_global_section
procd_open_instance "bulkdata"
procd_set_param command "$PROG"
procd_append_param command -l ${loglevel}
procd_set_param respawn
procd_close_instance "bulkdata"
}
reload_service() {
ret=$(ubus call service list '{"name":"bulkdatad"}' | jsonfilter -qe '@.bulkdatad.instances.bulkdata.running')
if [ "$ret" != "true" ]; then
stop
start
else
ubus send bulkdata.reload
fi
return 0
}
service_triggers() {
procd_add_reload_trigger bulkdata
}

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.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=136cab3a9f1eec0132db9fa3f7bb1c8748ce1449
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 +libwifiutils
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

View File

@@ -1,52 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cmph
PKG_VERSION:=2.0.2
PKG_RELEASE:=1
PKG_SOURCE:=cmph-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/cmph/
PKG_MD5SUM:=51ec5329b47774d251a96eaaafdb409e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_FIXUP:=autoreconf
PKG_LICENSE:=LGPLv2
PKG_LICENSE_FILES:=LGPL-2
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=libs
CATEGORY:=Libraries
TITLE:=C Minimal Perfect Hashing library
URL:=https://sourceforge.net/projects/cmph/
endef
define Package/$(PKG_NAME)/description
C Minimal Perfect Hashing (CMPH) library allows the creation of minimal perfect hash functions for large data sets.
endef
define Build/Configure
$(call Build/Configure/Default)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/cmph.h $(1)/usr/include/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/cmph_time.h $(1)/usr/include/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/cmph_types.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/.libs/libcmph.a $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/src/.libs/libcmph.so* $(1)/usr/lib/
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/.libs/libcmph.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

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,64 +0,0 @@
#
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=csmngr
PKG_VERSION:=1.0.2
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5e50fe388fff29b08d895c1c580152cccfa290ad
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/csmngr.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
PKG_CONFIG_DEPENDS := \
CONFIG_PACKAGE_libwifiutils \
CONFIG_PACKAGE_libwifi
PKG_BUILD_DEPENDS := libwifi
include $(INCLUDE_DIR)/package.mk
MAKE_PATH:=src
define Package/csmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi channel selection manager
DEPENDS:=+libwifiutils +libwifi +libuci +libubox +ubus +libnl-genl
endef
define Package/csmngr/description
WiFi Auto Channel Selection manager.
endef
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/csmngr/ $(PKG_BUILD_DIR)/
endef
endif
define Package/csmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/csmngr $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,csmngr))

View File

@@ -1,21 +0,0 @@
#!/bin/sh /etc/rc.common
START=95
STOP=10
USE_PROCD=1
PROG=/usr/sbin/csmngr
start_service() {
procd_open_instance
procd_set_param command ${PROG}
# procd_set_param stderr 1 #for debugging only
# procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}

View File

@@ -1,16 +0,0 @@
if PACKAGE_ddnsmngr
choice
prompt "Select backend for dynamic DNS management"
default DDNSMNGR_BACKEND_DDNSSCRIPT
depends on PACKAGE_ddnsmngr
help
Select which package to use for dynamic DNS support
config DDNSMNGR_BACKEND_DDNSSCRIPT
bool "Use ddns_script"
config DDNSMNGR_BACKEND_INADYN
bool "Use inadyn"
endchoice
endif

View File

@@ -1,79 +0,0 @@
#
# Copyright (C) 2024 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ddnsmngr
PKG_VERSION:=1.0.12
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ddnsmngr.git
PKG_SOURCE_VERSION:=44af9a7b3fec3929f8554af9633a5b8068189b48
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
PKG_CONFIG_DEPENDS:=CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT CONFIG_DDNSMNGR_BACKEND_INADYN
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Dynamic DNS manager
DEPENDS:=+DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
MENU:=1
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
MAKE_PATH:=src
define Package/$(PKG_NAME)/description
Manage dynamic DNS updation and provides Device.DynamicDNS. datamodel object based on TR181-2.16
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/ddnsmngr/* $(PKG_BUILD_DIR)/
endef
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/ddnsmngr/ddns
$(INSTALL_DIR) $(1)/etc/ddnsmngr/servers
$(INSTALL_DIR) $(1)/usr/lib/ddnsmngr
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(INSTALL_DATA) ./files/etc/config/ddnsmngr $(1)/etc/config/ddnsmngr
$(INSTALL_BIN) ./files/etc/uci-defaults/01-ddns-config-migrate $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/init.d/ddnsmngr $(1)/etc/init.d/ddnsmngr
ifeq ($(CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT),y)
$(INSTALL_BIN) ./files/usr/lib/ddns_script/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/lib/ddnsmngr/ddnsmngr_updater.sh $(1)/usr/lib/ddnsmngr/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/ddns-script/server/* $(1)/etc/ddnsmngr/servers
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
endif
ifeq ($(CONFIG_DDNSMNGR_BACKEND_INADYN),y)
$(INSTALL_BIN) ./files/usr/lib/inadyn/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/inadyn/server/* $(1)/etc/ddnsmngr/servers
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/inadyn/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
endif
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libddnsmngr.so $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "ddnsmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DynamicDNS"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,23 +0,0 @@
config ddnsmngr 'global'
option configfile '/var/run/ddnsmngr/ddnsmngr.json'
option ddns_dateformat '%F %R'
option ddns_rundir '/var/run/ddnsmngr'
option ddns_logdir '/var/log/ddnsmngr'
option ddns_loglines '250'
option upd_privateip '0'
option use_curl '1'
config server 'ddns_server_1'
option enabled '1'
option service 'dynu.com'
option name 'dynu.com'
config server 'ddns_server_2'
option enabled '1'
option service 'dyndns.org'
option name 'dyndns.org'
config server 'ddns_server_3'
option enabled '1'
option service 'zoneedit.com'
option name 'zoneedit.com'

View File

@@ -1,26 +0,0 @@
#!/bin/sh /etc/rc.common
START=80
STOP=10
USE_PROCD=1
. /usr/lib/ddnsmngr/ddnsmngr_service.sh
start_service() {
start_ddnsmngr_service
}
stop_service() {
stop_ddnsmngr_service
}
reload_service() {
stop
sleep 1
start
}
service_triggers() {
procd_add_reload_trigger ddnsmngr
add_ddnsmngr_triggers
}

View File

@@ -1,170 +0,0 @@
#!/bin/sh
. /lib/functions.sh
cl_id=1
srv_id=1
function get_ddns_config_option() {
local val
val="$(uci -q get ddns.${1}.${2})"
if [ -z "${val}" ] && [ -n "${3}" ]; then
val="${3}"
fi
echo "${val}"
}
function config_supported_service() {
if ! uci -q get ddnsmngr.global >/dev/null 2>&1; then
uci -q set ddnsmngr.global="ddnsmngr"
fi
servers=""
for i in $(find /etc/ddnsmngr/servers/ -name '*.json' | cut -d'/' -f 5 | sed "s/.json//")
do
if [ -z "${servers}" ]; then
servers="${i}"
else
servers="${servers},${i}"
fi
done
uci -q set ddnsmngr.global.supported_services="${servers}"
}
function migrate_service_section() {
client_sec=""
enabled="$(get_ddns_config_option ${1} enabled "0")"
service_name="$(get_ddns_config_option ${1} service_name)"
interface="$(get_ddns_config_option ${1} interface)"
ip_network="$(get_ddns_config_option ${1} ip_network)"
username="$(get_ddns_config_option ${1} username)"
password="$(get_ddns_config_option ${1} password)"
lookup_host="$(get_ddns_config_option ${1} lookup_host)"
use_ipv6="$(get_ddns_config_option ${1} use_ipv6 "0")"
force_ipversion="$(get_ddns_config_option ${1} force_ipversion "0")"
use_https="$(get_ddns_config_option ${1} use_https "0")"
force_dnstcp="$(get_ddns_config_option ${1} force_dnstcp "0")"
if [ -z "${service_name}" ]; then
uci -q delete ddns."${1}"
return 0
fi
# check server file is present in device
if [ ! -f "/etc/ddnsmngr/servers/${service_name}.json" ]; then
uci -q delete ddns."${1}"
return 0
fi
# Check if client section is already added for this service
clients=$(uci -q show ddnsmngr | grep "=client")
client_count=$(echo "${clients}" | wc -l)
tmp=0
while [ $tmp -lt $client_count ]
do
mngr_serv="$(uci -q get ddnsmngr.@client[$tmp].service_name)"
mngr_intf="$(uci -q get ddnsmngr.@client[$tmp].interface)"
mngr_netw="$(uci -q get ddnsmngr.@client[$tmp].ip_network)"
mngr_user="$(uci -q get ddnsmngr.@client[$tmp].username)"
mngr_ipv6="$(uci -q get ddnsmngr.@client[$tmp].use_ipv6)"
mngr_forceip="$(uci -q get ddnsmngr.@client[$tmp].force_ipversion)"
mngr_https="$(uci -q get ddnsmngr.@client[$tmp].use_https)"
mngr_dnstcp="$(uci -q get ddnsmngr.@client[$tmp].force_dnstcp)"
[ -z "${mngr_ipv6}" ] && mngr_ipv6="0"
[ -z "${mngr_forceip}" ] && mngr_forceip="0"
[ -z "${mngr_https}" ] && mngr_https="0"
[ -z "${mngr_dnstcp}" ] && mngr_dnstcp="0"
if [ "${mngr_serv}" == "${service_name}" ] && [ "${mngr_intf}" == "${interface}" ] && \
[ "${mngr_netw}" == "${ip_network}" ] && [ "${mngr_user}" == "${username}" ] && \
[ "${mngr_ipv6}" == "${use_ipv6}" ] && [ "${mngr_forceip}" == "${force_ipversion}" ] && \
[ "${mngr_https}" == "${use_https}" ] && [ "${mngr_dnstcp}" == "${force_dnstcp}" ]; then
break
fi
tmp=$(( tmp + 1 ))
done
if [ $tmp -ne $client_count ]; then
i=0
for client in $clients; do
if [ $i -eq $tmp ]; then
client_sec="$(echo $client | cut -d'=' -f 1 | cut -d'.' -f 2)"
break
fi
i=$(( i + 1 ))
done
if [ $enabled -eq 1 ]; then
uci -q set ddnsmngr."${client_sec}".enabled="1"
fi
else
client_sec=ddns_mig_client_"${cl_id}"
uci -q set ddnsmngr."${client_sec}"="client"
uci -q set ddnsmngr."${client_sec}".enabled="${enabled}"
uci -q set ddnsmngr."${client_sec}".service_name="${service_name}"
uci -q set ddnsmngr."${client_sec}".interface="${interface}"
uci -q set ddnsmngr."${client_sec}".ip_network="${ip_network}"
uci -q set ddnsmngr."${client_sec}".username="${username}"
uci -q set ddnsmngr."${client_sec}".password="${password}"
uci -q set ddnsmngr."${client_sec}".use_ipv6="${use_ipv6}"
uci -q set ddnsmngr."${client_sec}".force_ipversion="${force_ipversion}"
uci -q set ddnsmngr."${client_sec}".use_https="${use_https}"
uci -q set ddnsmngr."${client_sec}".force_dnstcp="${force_dnstcp}"
cl_id=$(( cl_id + 1 ))
# add server section if not added
servers=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'")
if [ -z "${servers}" ]; then
server_sec=ddns_mig_server_"${srv_id}"
uci -q set ddnsmngr."${server_sec}"="server"
uci -q set ddnsmngr."${server_sec}".enabled="1"
uci -q set ddnsmngr."${server_sec}".service="${service_name}"
uci -q set ddnsmngr."${server_sec}".name="${service_name}"
srv_id=$(( srv_id + 1 ))
fi
fi
# if lookup_host is set then add host section
if [ -n "${lookup_host}" ] && [ -n "${client_sec}" ]; then
# check number of hosts present for this client
host_count=$(uci -q show ddnsmngr | grep "dm_parent=\'${client_sec}\'" | wc -l)
host_ix=$(( host_count + 1 ))
host_sec="${client_sec}"_host_"${host_ix}"
uci -q set ddnsmngr."${host_sec}"="host"
uci -q set ddnsmngr."${host_sec}".enabled="${enabled}"
uci -q set ddnsmngr."${host_sec}".lookup_host="${lookup_host}"
uci -q set ddnsmngr."${host_sec}".dm_parent="${client_sec}"
fi
uci -q delete ddns."${1}"
}
function migrate_ddns_config() {
if [ ! -f "/etc/config/ddnsmngr" ]; then
# Create ddnsmngr config file
touch /etc/config/ddnsmngr
fi
config_supported_service
config_load ddns
config_foreach migrate_service_section service
uci -q commit ddns
uci -q commit ddnsmngr
}
migrate_ddns_config

View File

@@ -1,169 +0,0 @@
#! /bin/sh
RUNDIR="/var/run/ddnsmngr"
LOGDIR="/var/log/ddnsmngr"
PROG="/usr/lib/ddnsmngr/ddnsmngr_updater.sh"
CONFIGFILE="/var/run/ddnsmngr/ddnsmngr.json"
CLIENT_INTFS=""
. /usr/share/libubox/jshn.sh
log() {
echo "$*"|logger -t ddnsmngr.init -p debug
}
validate_host_section() {
uci_validate_section ddnsmngr host "${1}" \
'enabled:bool:0' \
'lookup_host:string' \
'dm_parent:string'
}
validate_client_section() {
uci_validate_section ddnsmngr client "${1}" \
'enabled:bool:0' \
'service_name:string' \
'interface:string' \
'ip_network:string' \
'username:string' \
'password:string' \
'use_https:bool:0' \
'force_dnstcp:bool:0' \
'use_ipv6:bool:0' \
'force_ipversion:bool:0'
}
add_object() {
local enabled lookup_host dm_parent use_ipv6 force_ipversion proc_info_file
local service_name interface ip_network username password use_https force_dnstcp
validate_host_section "${1}" || {
log "Validation of host section failed"
return 0
}
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
return 0
fi
validate_client_section "${dm_parent}" || {
log "Validation of client section failed"
return 0
}
if [ "${enabled}" -ne 1 ]; then
return 0
fi
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
if [ -z "${service_name}" ]; then
return 0
fi
service_section=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
if [ -z "${service_section}" ]; then
return 0
fi
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
if [ "${service_enabled}" -ne 1 ]; then
return 0
fi
json_add_object
json_add_string "interface" "${interface}"
json_add_string "service_name" "${service_name}"
json_add_string "username" "${username}"
json_add_string "password" "${password}"
json_add_string "lookup_host" "${lookup_host}"
json_add_string "ip_network" "${ip_network}"
json_add_string "proc_info_file" "${1}"
json_add_string "use_ipv6" "${use_ipv6}"
json_add_string "force_ipversion" "${force_ipversion}"
json_add_string "use_https" "${use_https}"
json_add_string "force_dnstcp" "${force_dnstcp}"
json_close_object
if [ -z "${interface}" ]; then
if [ "${use_ipv6}" -eq 0 ]; then
interface="wan"
else
interface="wan6"
fi
fi
for intf in $CLIENT_INTFS; do
if [ "${intf}" == "${interface}" ]; then
return 0
fi
done
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
}
start_ddnsmngr_service() {
run_dir=$(uci -q get ddnsmngr.global.ddns_rundir)
log_dir=$(uci -q get ddnsmngr.global.ddns_logdir)
if [ -n "${run_dir}" ]; then
RUNDIR="${run_dir}"
fi
if [ -n "${log_dir}" ]; then
LOGDIR="${log_dir}"
fi
mkdir -p "${RUNDIR}"
mkdir -p "${LOGDIR}"
conf_file=$(uci -q get ddnsmngr.global.configfile)
if [ -n "${conf_file}" ]; then
CONFIGFILE="${conf_file}"
fi
touch "${CONFIGFILE}"
if [ ! -f "${CONFIGFILE}" ]; then
log "Can not create ${CONFIGFILE}, exit"
exit 0
fi
json_init
json_add_array "services"
config_load ddnsmngr
config_foreach add_object host
json_close_array
json_dump > "${CONFIGFILE}"
procd_open_instance ddnsmngr
procd_set_param command "$PROG"
procd_append_param command -c "${CONFIGFILE}"
procd_append_param command -- start
procd_close_instance
}
stop_ddnsmngr_service() {
conf_file=$(uci -q get ddnsmngr.global.configfile)
if [ -n "${conf_file}" ]; then
CONFIGFILE="${conf_file}"
fi
if [ ! -f "${CONFIGFILE}" ]; then
log "${CONFIGFILE} not found, can't stop services if running any"
fi
"$PROG" -c "${CONFIGFILE}" -- stop
return 0
}
add_ddnsmngr_triggers() {
procd_open_trigger
for intf in $CLIENT_INTFS; do
# No need to handle other ifevents like ifupdate etc
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
procd_add_interface_trigger "interface.*.down" $intf /etc/init.d/ddnsmngr restart
done
procd_close_trigger
}

View File

@@ -1,311 +0,0 @@
#!/bin/sh
PROG="/usr/sbin/inadyn"
CONFIGPATH="/tmp/inadyn_config"
PIDPATH="/etc/inadyn_pid"
CLIENT_INTFS=""
CONFIG_FILES=""
SERVER_PATH="/etc/ddnsmngr/servers"
FORMAT="custom [SECTION] {\n\tusername\t= [USER]\n\tpassword\t= [PWD]\n\tddns-server\t= [SERV]\n\tddns-path\t= [URI]\n\tssl\t\t= [SSL]\n\thostname\t= [NAME]\n\tcheckip-command\t= [CMD]\n\tddns-response\t= [RESPONSES]\n}"
. /usr/share/libubox/jshn.sh
log() {
echo "$*"|logger -t ddnsmngr.init -p debug
}
get_service_data() {
local provider="$1"
shift
local dir="$1"
shift
local ipv6="$1"
shift
local name data url answer script
[ $# -ne 2 ] && {
return 1
}
[ -f "${dir}/${provider}.json" ] || {
eval "$1=\"\""
eval "$2=\"\""
return 1
}
json_load_file "${dir}/${provider}.json"
json_get_var name "name"
if [ "$ipv6" -eq "1" ]; then
json_select "ipv6"
else
json_select "ipv4"
fi
json_get_var data "url"
json_get_var answer "answer"
json_select ".."
json_cleanup
response=""
if [ -n "${answer}" ]; then
answer=$(echo "${answer}" | sed 's/|/ /g')
for ans in $answer; do
if [ -z "${response}" ]; then
response="${ans}"
else
response="${response}, ${ans}"
fi
done
response="{ ${response} }"
fi
eval "$1=\"$data\""
eval "$2=\"$response\""
return 0
}
generate_inadyn_config() {
json_load "${1}"
json_get_var service_name service_name
json_get_var use_ipv6 use_ipv6
json_get_var interface interface
json_get_var username username
json_get_var password password
json_get_var host lookup_host
json_get_var conf_file config_file
json_get_var conf_dir config_dir
json_get_var server_address server_address
json_cleanup
if [ -z "${service_name}" ] || [ -z "${host}" ]; then
return 1
fi
if [ -z "${conf_file}" ]; then
return 1
fi
if [ -z "${conf_dir}" ]; then
return 1
fi
# First look into custom path to load the url otherwise default path
get_service_data "${service_name}" "${SERVER_PATH}" "${use_ipv6}" server_url server_answer
if [ -z "${server_url}" ]; then
return 1
fi
# Need to pick proto, server address and request uri separately from the url
# format http://[server_address]/[update_Request_uri]
proto=$(echo $server_url | cut -d':' -f 1)
serv=$(echo $server_url | cut -d'/' -f 3 | cut -d'@' -f 2)
uri=${server_url#*$serv}
if [ -z $proto ] || [ -z $serv ] || [ -z $uri ]; then
return 1
fi
path=$(echo "$uri" | sed 's/&/\\&/g')
update_uri=$(echo $path | sed -e "s#\[DOMAIN\]#%h#g" -e "s#\[PASSWORD\]#%p#g" \
-e "s#\[USERNAME\]#%u#g" -e "s#\[IP\]#%i#g")
if [ -z "${interface}" ]; then
if [ "${use_ipv6}" -eq 0 ]; then
interface="wan"
else
interface="wan6"
fi
fi
# now get the physical interface name
intf=$(ifstatus "${interface}" | jsonfilter -e '@.device')
if [ -z "${intf}" ]; then
return 1
fi
# command to get ip of the interface
if [ "${use_ipv6}" -eq 0 ]; then
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv4-address\\\\\"][0].address'\""
else
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv6-address\\\\\"][0].address'\""
fi
if [ "${proto}" = "http" ]; then
ssl="false"
else
ssl="true"
fi
inadyn_ver=$(inadyn -v)
user_agent="inadyn/${inadyn_ver}"
config_file="${conf_dir}/${conf_file}"
touch "${config_file}"
echo "iface = ${intf}" > "${config_file}"
echo "period = 600" >> "${config_file}"
echo "user-agent = ${user_agent}" >> "${config_file}"
if [ "${use_ipv6}" -eq 1 ]; then
echo "allow-ipv6 = true" >> "${config_file}"
fi
if [ -z "${password}" ]; then
FORMAT=$(echo "${FORMAT}" | sed 's/\\tpassword\\t= \[PWD\]\\n//g')
fi
if [ -z "${server_answer}" ]; then
FORMAT=$(echo "${FORMAT}" | sed 's/\\tddns-response\\t= \[RESPONSES\]\\n//g')
fi
config=$(echo $FORMAT | sed -e "s#\[SECTION\]#$conf_file#g" -e "s#\[PWD\]#$password#g" \
-e "s#\[USER\]#$username#g" -e "s#\[SERV\]#$serv#g" \
-e "s#\[URI\]#\"$update_uri\"#g" -e "s#\[SSL\]#$ssl#g" \
-e "s#\[NAME\]#$host#g" -e "s#\[CMD\]#$get_ip#g" \
-e "s#\[RESPONSES\]#$server_answer#g")
echo -e "\n\n${config}" >> "${config_file}"
return 0
}
validate_host_section() {
uci_validate_section ddnsmngr host "${1}" \
'enabled:bool:0' \
'lookup_host:string' \
'dm_parent:string'
}
validate_client_section() {
uci_validate_section ddnsmngr client "${1}" \
'enabled:bool:0' \
'service_name:string' \
'interface:string' \
'ip_network:string' \
'username:string' \
'password:string' \
'use_https:bool:0' \
'force_dnstcp:bool:0' \
'use_ipv6:bool:0' \
'force_ipversion:bool:0'
}
add_object() {
local enabled lookup_host dm_parent use_ipv6 force_ipversion
local service_name interface ip_network username password use_https force_dnstcp
validate_host_section "${1}" || {
log "Validation of host section failed"
return
}
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
return
fi
validate_client_section "${dm_parent}" || {
log "Validation of client section failed"
return
}
if [ "${enabled}" -ne 1 ]; then
return
fi
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
if [ -z "${service_name}" ]; then
return
fi
service_section=$(uci show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
if [ -z "${service_section}" ]; then
return
fi
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
if [ "${service_enabled}" -ne 1 ]; then
return
fi
json_init
json_add_string "interface" "${interface}"
json_add_string "service_name" "${service_name}"
json_add_string "username" "${username}"
json_add_string "password" "${password}"
json_add_string "lookup_host" "${lookup_host}"
json_add_string "ip_network" "${ip_network}"
json_add_string "use_ipv6" "${use_ipv6}"
json_add_string "force_ipversion" "${force_ipversion}"
json_add_string "use_https" "${use_https}"
json_add_string "force_dnstcp" "${force_dnstcp}"
json_add_string "config_file" "${1}"
json_add_string "config_dir" "${CONFIGPATH}"
json_str=$(json_dump)
json_cleanup
generate_inadyn_config "${json_str}"
if [ "$?" -ne 0 ]; then
return
fi
CONFIG_FILES="${CONFIG_FILES} ${1}"
if [ -z "${interface}" ]; then
if [ "${use_ipv6}" -eq 0 ]; then
interface="wan"
else
interface="wan6"
fi
fi
for intf in $CLIENT_INTFS; do
if [ "${intf}" == "${interface}" ]; then
return
fi
done
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
}
start_ddnsmngr_service() {
rm -rf $CONFIGPATH
mkdir $CONFIGPATH
mkdir -p $PIDPATH
config_load ddnsmngr
config_foreach add_object host
i=1
for conf in $CONFIG_FILES; do
instance="ddnsmngr_${i}"
i=$(( i + 1 ))
procd_open_instance $instance
procd_set_param command "$PROG"
procd_append_param command -f "${CONFIGPATH}/${conf}"
procd_append_param command -l debug
procd_append_param command -P "${PIDPATH}/${conf}"
procd_append_param command -n -C
procd_close_instance
done
}
stop_ddnsmngr_service() {
rm -rf $CONFIGPATH
return 0
}
add_ddnsmngr_triggers() {
procd_open_trigger
for intf in $CLIENT_INTFS; do
# No need to handle other ifevents like ifupdate etc
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
done
procd_close_trigger
}

View File

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

View File

@@ -1,81 +0,0 @@
#
# Copyright (C) 2021-2024 IOPSYS Software Solutions AB
# Copyright (C) 2025 Genexis AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=6.2.1.8
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b7e294d7c610adfd80cf40a0628c189695dc5156
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@genexis.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 +ieee1905-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,71 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.7.10
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1f851980a6ba616df54f79930225f8bcd563b711
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 +voicemngr
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/dspg
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/dectmngr
ifeq ($(CONFIG_TARGET_airoha),)
$(CP) ./firmware/common/* $(1)/etc/dspg/
endif
$(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,6 +0,0 @@
config dect 'global'
option log_dect_cmbs 'syslog'
option log_level 'realtime,warning,error'
config dect 'base'
option enable '1'

View File

@@ -1,193 +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
get_extension_shift() {
local dect_exts
get_dect_extension() {
local ext=$1
local type
config_get type $ext type
[ "$type" == "dect" ] && echo $ext
}
config_load "asterisk"
dect_exts=$(config_foreach get_dect_extension "extension" |sort |head -n1)
echo "${dect_exts#extension}"
}
# 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" "$(basename $device)"
return 0
fi
done
return 1
}
check_dcx81_firmware() {
local dcx81_uart=$1
local fw_link="/lib/firmware/dcx81_firmware"
local fw_file
[ -L "$fw_link" ] || return
fw_file=$(readlink -f $fw_link)
[ -f "$fw_file" ] || return
# the symbolic link is not needed
rm -f $fw_link
eval $(/sbin/cmbs_tcx -comname "$dcx81_uart" -fw_version |grep DCX81_FW_Version)
[ -n "$DCX81_FW_Version" ] || return
if echo $(basename $fw_file) | grep -qi "$DCX81_FW_Version" ; then
logger -t "$PROG" "DCX81 running expected $DCX81_FW_Version"
return;
fi
logger -t "$PROG" "DCX81 firmware upgrading to $fw_file"
/sbin/cmbs_tcx -comname "$dcx81_uart" -fwu "$fw_file" 2>&1 >/dev/null &
echo -n "Updrading DCX81 firmware.." >/dev/console
local wait_time=0
while pidof cmbs_tcx >/dev/null && [ "$wait_time" -lt "200" ] ; do
sleep 5
wait_time=$(($wait_time + 5))
echo -n "." >/dev/console
done
if pidof cmbs_tcx >/dev/null ; then
killall -9 cmbs_tcx
logger -t "$PROG" "DCX81 firmware upgrade timeout"
else
logger -t "$PROG" "DCX81 firmware upgrade done"
fi
}
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="ttyH0"
fi
check_dcx81_firmware $dcx81_uart_device
opt_ext="-extensionShift $(get_extension_shift)"
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
config_get pcm_slot_start global pcm_slot_start
config_get pcm_fsync global pcm_fsync
[ -n "$pcm_fsync" ] && opt_ext="$opt_ext -sync $pcm_fsync"
[ -n "$pcm_slot_start" ] && opt_ext="$opt_ext -slotsShift $pcm_slot_start"
procd_open_instance
case "$log_dect_cmbs" in
none)
echo "Starting dectmngr with cmbs logging disabled"
procd_set_param command "$PROG" -comname "$dcx81_uart_device" $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" -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" -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
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() {
[ ! -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,59 +0,0 @@
#
# Copyright (C) 2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dhcpmngr
PKG_VERSION:=1.0.6
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
PKG_SOURCE_VERSION:=986f66608959f4f589009d580b046e250d8c620d
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 ../bbfdm/bbfdm.mk
MAKE_PATH:=src
define Package/dhcpmngr
SECTION:=net
CATEGORY:=Network
TITLE:=Package to add Device.DHCPv4 and v6 data model support.
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS+=+DNSMNGR_DNS_SD:umdns
DEPENDS+=+DNSMNGR_BACKEND_DNSMASQ:dnsmasq
DEPENDS+=+DNSMNGR_BACKEND_UNBOUND:odhcpd
endef
define Package/dhcpmngr/description
Package to add Device.DHCPv4. and Device.DHCPv6. data model support.
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/dhcpmngr/* $(PKG_BUILD_DIR)/
endef
endif
define Package/dhcpmngr/install
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_lease_start_time.user $(1)/etc/udhcpc.user.d/udhcpc_lease_start_time.user
ifeq ($(CONFIG_DNSMNGR_BACKEND_UNBOUND),y)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/etc/uci-defaults/unbound.odhcpd.uci_default $(1)/etc/uci-defaults/16-set-unbound-as-odhcpd-leasetrigger
endif
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdhcpmngr.so $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,dhcpmngr))

View File

@@ -1,20 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "dhcpmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DHCPv4"
},
{
"parent_dm": "Device.",
"object": "DHCPv6"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,17 +0,0 @@
#!/bin/sh
# update odhcpd uci to use unbound's script as leasetrigger
uci -q get dhcp.odhcpd >/dev/null 2>&1 && {
maindhcp="$(uci -q get dhcp.odhcpd.maindhcp)"
# if odhcpd is the main dhcp
[ "$maindhcp" = "1" ] || [ "$maindhcp" = "true" ] || [ "$maindhcp" = "on" ] && {
# if unbound daemon and unbound script file is present
[ -e /usr/lib/unbound/odhcpd.sh ] && [ -e /usr/sbin/unbound ] && {
# then set unbound script as leasetrigger in dhcp UCI
uci -q set dhcp.odhcpd.leasetrigger='/usr/lib/unbound/odhcpd.sh'
}
}
}
exit 0

View File

@@ -1,14 +0,0 @@
#!/bin/sh
leasestarttime="$(awk -F'.' '{print $1}' /proc/uptime 2> /dev/null)"
target_file=/tmp/dhcp_client_info
target_str="$INTERFACE $lease $leasestarttime"
# if this interface is present in file, then replace it
if grep -q "$INTERFACE" "$target_file" 2> /dev/null; then
# replace the whole line if pattern matches
sed -i "/${INTERFACE}/c\\${target_str}" "$target_file"
else
# interface info was not present, append it to the file
echo "$target_str" >> "$target_file"
fi

View File

@@ -1,30 +0,0 @@
if PACKAGE_dnsmngr
menu "Configuration"
config DNSMNGR_DNS_SD
bool "Include Device.DNS.SD. TR-181 support"
default y
help
Set this option to include support for TR-181 DNS.SD. object.
choice
prompt "Select backend for DNS management"
default DNSMNGR_BACKEND_DNSMASQ
depends on PACKAGE_dnsmngr
help
Select which backend daemon to use for DNS
config DNSMNGR_BACKEND_DNSMASQ
bool "Use dnsmasq for dns and dhcp"
help
Enable this option to use dnsmasq + odhcpd for dns and dhcp.
config DNSMNGR_BACKEND_UNBOUND
bool "Use unbound with odhcpd-full for dns and dhcp"
help
Enable this option to use unbound + odhcpd for dns and dhcp.
endchoice
endmenu
endif

View File

@@ -1,79 +0,0 @@
#
# Copyright (C) 2022-2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmngr
PKG_VERSION:=1.0.18
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
PKG_SOURCE_VERSION:=80fa147e6f1f0d9c1a62a62a693ff3adaef45363
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 ../bbfdm/bbfdm.mk
MAKE_PATH:=src
define Package/dnsmngr
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +odhcpd
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS+=+DNSMNGR_DNS_SD:umdns
DEPENDS+=+DNSMNGR_BACKEND_DNSMASQ:dnsmasq
DEPENDS+=+DNSMNGR_BACKEND_UNBOUND:unbound-daemon +DNSMNGR_BACKEND_UNBOUND:unbound-control
TITLE:=Package to configure DNS backend and TR-181 support
endef
define Package/dnsmngr/description
Package to configure DNS backend and TR-181 support.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
define Build/Compile
$(call Build/Compile/Default,all)
endef
else
define Build/Compile
$(call Build/Compile/Default,dns)
endef
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/dnsmngr/* $(PKG_BUILD_DIR)/
endef
endif
ifeq ($(CONFIG_DNSMNGR_BACKEND_DNSMASQ),y)
TARGET_CFLAGS += -DDNSMASQ_BACKEND
endif
define Package/dnsmngr/install
$(INSTALL_DIR) $(1)/etc/umdns
$(INSTALL_DIR) $(1)/etc/umdns/tmp
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dnsmngr $(1)/lib/upgrade/keep.d/dnsmngr
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1) $(PKG_NAME)
$(BBFDM_INSTALL_SCRIPT) -d $(PKG_BUILD_DIR)/scripts/nslookup $(1)
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libdns_sd.so $(1) $(PKG_NAME) 10
endif
endef
$(eval $(call BuildPackage,dnsmngr))

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "dnsmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DNS"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1 +0,0 @@
/etc/umdns/*

View File

@@ -1,90 +0,0 @@
#
# Copyright (C) 2018-2024 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.10
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
PKG_SOURCE_VERSION:=8fb4093b4d26b3cb06603e110d424005e33cf5d6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
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
include ../bbfdm/bbfdm.mk
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
else ifneq ($(CONFIG_TARGET_airoha),)
TARGET_PLATFORM=AIROHA
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
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +TARGET_airoha:br2684ctl
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=.* ./dslmngr/ $(PKG_BUILD_DIR)/
endef
endif
define Build/Compile
+$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
endef
define Package/dslmngr/install
$(INSTALL_DIR) $(1)/etc/dsl
$(CP) ./files/common/* $(1)/
ifeq ($(CONFIG_TARGET_brcmbca),y)
$(CP) ./files/broadcom/* $(1)/
else ifneq ($(CONFIG_TARGET_airoha),)
$(CP) ./files/airoha/* $(1)/
endif
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfdsl.so $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,dslmngr))

View File

@@ -1,28 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "dslmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DSL"
},
{
"parent_dm": "Device.",
"object": "FAST"
},
{
"parent_dm": "Device.",
"object": "ATM"
},
{
"parent_dm": "Device.",
"object": "PTM"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,26 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
STOP=99
USE_PROCD=1
start_service() {
readonly need_xdsl="$(jsonfilter -i /etc/board.json -e @.dsl)"
[ -f /etc/board.json ] || return 0
if [ "$need_xdsl" != "" ]; then
procd_open_instance xdsl_wan
procd_set_param command /sbin/xdsl_wan
procd_set_param respawn
procd_close_instance
fi
}
boot() {
: # boot-up is handled from 'hsm' application
}
service_triggers()
{
procd_add_reload_trigger "dsl"
}

View File

@@ -1,28 +0,0 @@
#!/bin/sh
. /lib/functions.sh
xtm_remove_devices() {
:
}
xtm_create_devices() {
:
}
xdsl_configure() {
# Support bridged WAN interface
ebtables --concurrent -t broute -D BROUTING -p 0xbeed -j DROP 2> /dev/null
ebtables --concurrent -t broute -I BROUTING -p 0xbeed -j DROP
}
xdsl_stop() {
return 0
}
xdsl_init() {
readonly need_xdsl="$(jsonfilter -i /etc/board.json -e @.dsl)"
[ "$need_xdsl" = "" ] && exit 0
echo "Starting DSL"
}

View File

@@ -1,270 +0,0 @@
#!/bin/sh
source "/lib/functions.sh"
source "/lib/functions/network.sh"
source "/lib/functions/system.sh"
PREVLINK=""
LINK=""
LINKSPEED=""
PREVWANMODE=""
WANMODE=""
CONFIGURED=0
CINDEX=0
WANPORT="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
delete_atm_device() {
/userfs/bin/blapi_cmd xdsl atm_delete_interface $CINDEX
CINDEX=$((CINDEX+1))
}
delete_atm_devices() {
CINDEX=0
config_load dsl
config_foreach delete_atm_device atm-device
}
configure_atm_device() {
local vpi vci encapsulation qos_class pcr mbs scr
local encap qos ethmac
config_get vpi $1 vpi "8"
config_get vci $1 vci "35"
config_get encapsulation $1 encapsulation "llc"
config_get qos_class $1 qos_class "ubr"
config_get pcr $1 pcr "0"
config_get mbs $1 mbs "0"
config_get scr $1 scr "0"
case $encapsulation in # llc, vcmux
vcmux)
encap="1483 Bridged IP VC-Mux"
;;
*)
encap="1483 Bridged IP LLC"
;;
esac
ethmac="$(echo -n "$(macaddr_add 02:AA:BB:01:23:40 $((CINDEX+2)))" | sed 's#:##g')"
/userfs/bin/blapi_cmd xdsl create_device $CINDEX ATM "" "$ethmac"
/userfs/bin/blapi_cmd xdsl atm_create_interface $CINDEX ATM "$qos_class" "$encap" "$vpi" "$vci" "$pcr" "$scr" "$mbs" 0
CINDEX=$((CINDEX+1))
}
create_atm_devices() {
delete_atm_devices
CINDEX=0
config_foreach configure_atm_device atm-device
}
configure_line() {
local mode profile bitswap sra us0 sesdrop sos roc ginp gvector mod prof
local adsl1_flag=0 issue2_flag=0 Glite_flag=0 adsl2_flag=0 adsl2p_flag=0 vdsl2_flag=0
local pro_8a_flag=0 pro_8b_flag=0 pro_8c_flag=0 pro_8d_flag=0 pro_12a_flag=0 pro_12b_flag=0 pro_17a_flag=0 pro_30a_flag=0 pro_35b_flag=0
config_get mode $1 mode "vdsl2"
config_get profile $1 profile "35b"
config_get bitswap $1 bitswap "1"
config_get sra $1 sra "1"
config_get us0 $1 us0 "1"
config_get sos $1 sos "0"
config_get roc $1 roc "0"
config_get ginp $1 ginp "1"
config_get gvector $1 gvector "1"
for mod in $mode; do
[ "$mod" = "gdmt" ] && adsl1_flag=1
[ "$mod" = "glite" ] && Glite_flag=1
[ "$mod" = "t1413" ] && issue2_flag=1
[ "$mod" = "adsl2" ] && adsl2_flag=1
[ "$mod" = "adsl2p" ] && adsl2p_flag=1
[ "$mod" = "vdsl2" ] && vdsl2_flag=1
done
for prof in $profile; do
[ "$prof" = "8a" ] && pro_8a_flag=1
[ "$prof" = "8b" ] && pro_8b_flag=1
[ "$prof" = "8c" ] && pro_8c_flag=1
[ "$prof" = "8d" ] && pro_8d_flag=1
[ "$prof" = "12a" ] && pro_12a_flag=1
[ "$prof" = "12b" ] && pro_12b_flag=1
[ "$prof" = "17a" ] && pro_17a_flag=1
[ "$prof" = "30a" ] && pro_30a_flag=1
[ "$prof" = "35b" ] && pro_35b_flag=1
done
/userfs/bin/blapi_cmd xdsl set_adsl_profile "$pro_8a_flag" "$pro_8b_flag" "$pro_8c_flag" "$pro_8d_flag" "$pro_12a_flag" "$pro_12b_flag" "$pro_17a_flag" "$pro_30a_flag" "$pro_35b_flag"
/userfs/bin/blapi_cmd xdsl set_adsl_mode "$adsl1_flag" "$issue2_flag" "$Glite_flag" "$adsl2_flag" "$adsl2p_flag" "$vdsl2_flag"
/userfs/bin/blapi_cmd xdsl set_adsl_gvector "$((!gvector))"
/userfs/bin/blapi_cmd xdsl set_adsl_ginp "$((!ginp))"
/userfs/bin/blapi_cmd xdsl set_adsl_sos_roc "$((!sos))" "$((!roc))"
/userfs/bin/blapi_cmd xdsl set_adsl_us0 "$((!us0))"
/userfs/bin/blapi_cmd xdsl set_adsl_sra "$((!sra))"
/userfs/bin/blapi_cmd xdsl set_adsl_bitswap "$((!bitswap))"
CONFIGURED=1
}
configure_lines() {
config_load dsl
config_foreach configure_line dsl-line
}
call_wan_hotplug() {
# initializations
local updown="$1"
local ethwan="$2"
# ethernet hotlugs expect LINK and PORT environment variables set
env -i LINK="$updown" PORT="$ethwan" /sbin/hotplug-call ethernet
}
if [ "$WANPORT" = "ae_wan" -a -f /proc/device-tree/ae_wan/wan-dsl ]; then
/etc/init.d/br2684ctl stop
else
/etc/init.d/br2684ctl start
fi
# Wait for nas0 interface to come up.
while [ "$(devstatus "$WANPORT" | jsonfilter -e @.up)" != "true" ]; do
sleep 1
done
while [ true ]; do
LINK="$(awk '/ADSL link status:/{print $4}' /proc/tc3162/adsl_stats)"
[ \( "$LINK" = "down" -o "$LINK" = "up" \) ] && break
sleep 1
done
sleep 2
/userfs/bin/blapi_cmd xdsl set_adsl_sysvid "26 00 47 4E 58 53 00 00" # GNXS vendor id
/userfs/bin/blapi_cmd xdsl set_adsl_version "$(ubus call fwbank dump | jsonfilter -e "@.bank[@.active=true].swver" | cut -f1 -d'_' | cut -f1 -d'-' | hexdump -e '11/1 "%02x " "\n"' | head -n1)"
/userfs/bin/blapi_cmd xdsl set_power_up_down 1
/userfs/bin/blapi_cmd xdsl set_power_up_down 0
sleep 1
while [ true ]; do
LINK="$(awk '/ADSL link status:/{print $4}' /proc/tc3162/adsl_stats)"
if [ "$LINK" != "$PREVLINK" -a \( "$LINK" = "down" -o "$LINK" = "up" \) ]; then
if [ "$LINK" = "down" ]; then
if [ ! -s /tmp/qos/wan_link_shape_rate ]; then
rm -rf /tmp/qos/wan_link_shape_rate
rm -rf /tmp/qos/wan_link_speed
/usr/sbin/qos-uplink-bandwidth
fi
[ "$CONFIGURED" -eq 0 ] && configure_lines # Needs to be done once the slave SoC is in down state and we've not been able to auto-sync.
if [ -n "$WANMODE" ]; then
if [ "$WANMODE" = "PTM" ]; then
/userfs/bin/blapi_cmd xdsl ptm_do_reset_sequence 0 1
else
delete_atm_devices
fi
fi
call_wan_hotplug "down" "$WANPORT"
else
CONFIGURED=1
WANMODE="$(awk '/TPSTC type:/{print $4}' /proc/tc3162/adsl_stats)"
if [ "$WANMODE" != "$PREVWANMODE" ]; then
OLDWANPORT="$WANPORT"
network_defer_device "$OLDWANPORT"
if [ -f /proc/device-tree/ae_wan/wan-dsl ]; then
WANPORT="ae_wan"
else
WANPORT="nas10"
fi
if [ "$WANMODE" = "PTM" ]; then
/etc/init.d/br2684ctl stop
delete_atm_devices
/userfs/bin/blapi_cmd system set_wan_mode 1
/userfs/bin/blapi_cmd xdsl reload_ko 2
/userfs/bin/blapi_cmd xdsl ptm_do_reset_sequence 1 2
# Set extended TPID for PTM packet flow
sys memwl 1FB50000 81001839
# VLAN TPID - VLAN
sys memwl 1FB50F18 8100
ifconfig ${WANPORT} mtu 1500
else
/userfs/bin/blapi_cmd system set_wan_mode 0
/userfs/bin/blapi_cmd xdsl reload_ko 1
/etc/init.d/br2684ctl start
# Set extended TPID for ATM packet flow
sys memwl 1FB50000 884C1839
# VLAN TPID - MPOA
sys memwl 1FB50F18 884C
ifconfig ${WANPORT} mtu 1982
ifconfig ${WANPORT} down up
OLDWANPORT="$WANPORT"
ATMINDEX="$(cat /sys/class/atm/TSARM*/atmindex | tail -n1 2> /dev/null)"
WANPORT="nas$((ATMINDEX))"
fi
if [ "$OLDWANPORT" != "$WANPORT" ]; then
call_wan_hotplug "down" "$OLDWANPORT"
FILES="$(grep "$OLDWANPORT" /etc/config/* | cut -f1 -d: | uniq | cut -f4 -d/ | xargs)"
for FILE in $FILES; do
sed -i -e "s#${OLDWANPORT}#${WANPORT}#g" "/etc/config/${FILE}"
"/etc/init.d/${FILE}" restart
done
else
/etc/init.d/network restart
fi
ifconfig ${OLDWANPORT} down up
fi
if [ "$WANMODE" = "PTM" ]; then
: # ToDo
else
create_atm_devices
fi
call_wan_hotplug "up" "$WANPORT"
PREVWANMODE="$WANMODE"
if [ ! -s /tmp/qos/wan_link_shape_rate ]; then
LINKSPEED="$(awk '/far-end interleaved channel bit rate/{print $6}' /proc/tc3162/adsl_stats)"
LINKSPEED=$((LINKSPEED))
if [ "$LINKSPEED" -eq 0 ]; then
LINKSPEED="$(awk '/far-end fast channel bit rate/{print $6}' /proc/tc3162/adsl_stats)"
LINKSPEED=$((LINKSPEED))
fi
if [ "$LINKSPEED" -ne 0 ]; then
mkdir -p /tmp/qos
touch /tmp/qos/wan_link_shape_rate
/userfs/bin/qosrule discpline Rate uplink-bandwidth ${LINKSPEED}
hw_nat -! > /dev/null 2>&1
else
rm -rf /tmp/qos/wan_link_speed
/usr/sbin/qos-uplink-bandwidth
fi
fi
fi
# Toggle link state
network_defer_device "$WANPORT"
network_ready_device "$WANPORT"
# We are only interested in the transtion from init -> up/down and up/down -> down/up and vice versa.
# Since we poll the status via in-band signaling packets might get lost and the /procfs file is empty.
# This state we don't want to handle as it will toggle the link and do a re-setup which is totally unnecessary and unwanted.
PREVLINK="$LINK"
fi
sleep 5
done

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 --concurrent -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
ebtables --concurrent -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,54 +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
list profile 35b
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,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))

View File

@@ -1,257 +0,0 @@
#
# Copyright (C) 2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ebtables-extensions
PKG_VERSION:=2.0.5
PKG_LICENSE:=GPL-2.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ebtables-extensions.git
PKG_SOURCE_VERSION:=7357622d806833d93d317164dc6673fbf5fd1629
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ebt-vlantranslation
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables VLAN translation
FILES:=$(PKG_BUILD_DIR)/src/ebt_vlantranslation.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_vlantranslation)
KCONFIG:=
endef
define KernelPackage/ebt-dscp2pbit
SUBMENU:=Other modules
TITLE:=Kernel module for DSCP-to-Pbit mapping
DEPENDS+=+kmod-ebtables
FILES:=$(PKG_BUILD_DIR)/src/ebt_dscp2pbit.ko
AUTOLOAD:=$(call AutoLoad,30,ebt_dscp2pbit)
KCONFIG:=
endef
define KernelPackage/ebt-dhcp
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables DHCP snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_dhcp.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_dhcp)
KCONFIG:=
endef
define KernelPackage/ebt-dhcpv6
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables DHCPv6 snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_dhcpv6.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_dhcpv6)
KCONFIG:=
endef
define KernelPackage/ebt-ra
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables NDP/RA snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_ra.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_ra)
KCONFIG:=
endef
define KernelPackage/ebt-dns
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables DNS manipulation
FILES:=$(PKG_BUILD_DIR)/src/ebt_dns.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_dns)
KCONFIG:=
endef
define KernelPackage/ebt-pppoe_disc
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables PPPoE manipulation
FILES:=$(PKG_BUILD_DIR)/src/ebt_pppoe_disc.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_pppoe_disc)
KCONFIG:=
endef
define KernelPackage/ebt-l2pt
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables L2CP tunneling
FILES:=$(PKG_BUILD_DIR)/src/ebt_l2pt.ko
DEPENDS+=@TARGET_airoha +kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_l2pt)
KCONFIG:=
endef
define KernelPackage/ebt-xtarp
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables extended ARP matching
FILES:=$(PKG_BUILD_DIR)/src/ebt_xtarp.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_xtarp)
KCONFIG:=
endef
define KernelPackage/ebt-xtip
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables extended IPv4 matching
FILES:=$(PKG_BUILD_DIR)/src/ebt_xtip.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_xtip)
KCONFIG:=
endef
define KernelPackage/ebt-xtip6
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables extended IPv6 matching
FILES:=$(PKG_BUILD_DIR)/src/ebt_xtip6.ko
DEPENDS+=+kmod-ebtables
AUTOLOAD:=$(call AutoLoad,30,ebt_xtip6)
KCONFIG:=
endef
define KernelPackage/ebt-igmpsnooping
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables IGMP snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_igmpsnooping.ko
DEPENDS+=+kmod-ebtables
# AUTOLOAD:=$(call AutoLoad,30,ebt_igmpsnooping) - Will be loaded on demand
KCONFIG:=
endef
define KernelPackage/ebt-mldsnooping
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables MLD snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_mldsnooping.ko
DEPENDS+=+kmod-ebtables
# AUTOLOAD:=$(call AutoLoad,30,ebt_mldsnooping) - Will be loaded on demand
KCONFIG:=
endef
define KernelPackage/ebt-dhcp/description
Kernel module to enable DHCP snooping for ebtables
endef
define KernelPackage/ebt-dhcpv6/description
Kernel module to enable DHCPv6 snooping for ebtables
endef
define KernelPackage/ebt-ra/description
Kernel module to enable NDP/RA snooping for ebtables
endef
define KernelPackage/ebt-dns/description
Kernel module to enable DNS manipulation for ebtables
endef
define KernelPackage/ebt-pppoe_disc/description
Kernel module to enable PPPoE manipulation for ebtables
endef
define KernelPackage/ebt-l2pt/description
Kernel module to enable L2CP tunneling for ebtables
endef
define KernelPackage/ebt-xtarp/description
Kernel module to enable extended ARP matching for ebtables
endef
define KernelPackage/ebt-xtip/description
Kernel module to enable extended IPv4 matching for ebtables
endef
define KernelPackage/ebt-xtip6/description
Kernel module to enable extended IPv6 matching for ebtables
endef
define KernelPackage/ebt-vlantranslation/description
Kernel module to enable VLAN translation for ebtables
endef
define KernelPackage/ebt-dscp2pbit/description
Kernel module to enable DSCP-to-Pbit mapping for ebtables
endef
define KernelPackage/ebt-igmpsnooping/description
Kernel module to enable IGMP snooping for ebtables
endef
define KernelPackage/ebt-mldsnooping/description
Kernel module to enable MLD snooping for ebtables
endef
-include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
define Build/Prepare
ifeq ($(LOCAL_DEV),1)
$(CP) -rf ./ebtables-extensions/* $(PKG_BUILD_DIR)/
else
$(Build/Prepare/Default)
endif
$(CP) $(PKG_BUILD_DIR)/src/ebt_vlantranslation.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dscp2pbit.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dhcp.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dhcpv6.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_ra.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dns.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_pppoe_disc.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
ifeq ($(CONFIG_TARGET_airoha),y)
$(CP) $(PKG_BUILD_DIR)/src/ebt_l2pt.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
endif
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtarp.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip6.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_igmpsnooping.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_mldsnooping.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_vlantranslation.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dscp2pbit.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dhcp.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dhcpv6.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_ra.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_dns.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_pppoe_disc.h $(1)/include/uapi/linux/netfilter_bridge/
ifeq ($(CONFIG_TARGET_airoha),y)
$(CP) $(PKG_BUILD_DIR)/src/ebt_l2pt.h $(1)/include/uapi/linux/netfilter_bridge/
endif
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtarp.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip6.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_igmpsnooping.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_mldsnooping.h $(1)/include/uapi/linux/netfilter_bridge/
endef
ifeq ($(CONFIG_TARGET_airoha),y)
KERNEL_MAKE_FLAGS += PLATFORM="ECONET"
endif
define Build/Compile
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src" modules
endef
$(eval $(call KernelPackage,ebt-vlantranslation))
$(eval $(call KernelPackage,ebt-dscp2pbit))
$(eval $(call KernelPackage,ebt-dhcp))
$(eval $(call KernelPackage,ebt-dhcpv6))
$(eval $(call KernelPackage,ebt-ra))
$(eval $(call KernelPackage,ebt-dns))
$(eval $(call KernelPackage,ebt-pppoe_disc))
$(eval $(call KernelPackage,ebt-l2pt))
$(eval $(call KernelPackage,ebt-xtarp))
$(eval $(call KernelPackage,ebt-xtip))
$(eval $(call KernelPackage,ebt-xtip6))
$(eval $(call KernelPackage,ebt-igmpsnooping))
$(eval $(call KernelPackage,ebt-mldsnooping))

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,17 +0,0 @@
if (PACKAGE_ethmngr)
menu "Configurations"
config ETHMNGR_MACVLAN_EXTENSION
bool "Enable datamodel MACVLAN vendor extension"
default y
config ETHMNGR_EXPOSE_ETHERNET_OBJECT
bool "Expose ethernet ubus object to fetch and clear interface stats"
default y
config ETHMNGR_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endmenu
endif

View File

@@ -1,78 +0,0 @@
#
# Copyright (C) 2020-2024 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=3.0.8
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
PKG_SOURCE_VERSION:=c73e5b15718ca40b2740bbe6151dfbb2bcca16df
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +libblobmsg-json +libjson-c +libc +libubus
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
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(CONFIG_ETHMNGR_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_ETHMNGR_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/ethmngr/* $(PKG_BUILD_DIR)/
endef
endif
ifeq ($(CONFIG_ETHMNGR_MACVLAN_EXTENSION),y)
TARGET_CFLAGS += -DETHMNGR_MACVLAN_EXTENSION
endif
ifeq ($(CONFIG_ETHMNGR_EXPOSE_ETHERNET_OBJECT),y)
TARGET_CFLAGS += -DETHMNGR_EXPOSE_ETHERNET_OBJECT
endif
define Package/ethmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,ethmngr))

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "ethmngr",
"unified_daemon": true,
"services": [
{
"parent_dm": "Device.",
"object": "Ethernet"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,17 +0,0 @@
#!/bin/sh /etc/rc.common
START=80
STOP=90
USE_PROCD=1
PROG=/usr/sbin/ethmngr
start_service() {
if [ -f $PROG ]; then
procd_open_instance "ethmngr"
procd_set_param command ${PROG}
procd_append_param command -l 3
procd_set_param respawn
procd_close_instance "ethmngr"
fi
}

View File

@@ -1,23 +0,0 @@
{
"ethport_update": {
"if" : [
{
"event": "network.device",
"match": {
"wireless": false
}
}
],
"then" : [
{
"cli": "/sbin/hotplug-call ethernet",
"envs": {
"PORT": "&network.device->ifname",
"LINK": "&network.device->link"
},
"timeout": 1
}
]
}
}

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