If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:dev debug.lua

From BoxMatrix


BoxMatrix >> Webinterface >> dev_debug.lua @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

UI-Structure UI-Modules HTML-Files XML-Files Lua-Scripts Javascript Browser SSI-Files SSI-Directives HTML-Text Event-Text Help-Pages CSS-Files Graphics Research

Lua-Script

Goto:   Functions  -  Dependencies   -   Model-Matrix   -   SMW-Browser

Details

dev_debug.lua is the REST-API Developers Debugging Module.

This is no typical module. Unlike all other modules it is not loaded by rest_config.lua but directly by api.lua.
It provides a bunch of endpoints which are directly hooked up to the URL to function router espresso.lua.

Some of the endpoints use unusual pathes:

GET /api/v0/boxinfo                             # get juis_boxinfo.json

GET /api/v0/eventlog                            # get the complete eventlog
GET /api/v0/eventlog/groups                     # get the eventlog groups
GET /api/v0/eventlog/groups/<string>            # get the filtered eventlog

ANY /api/lua_debug                              # return the passed box object
ANY /api/lua_debug/<string>                     # log and return the passed string
ANY /api/crash                                  # cause a crash on Lua stack

POST /api/set_config                            # direct box.set_config
POST /api/query                                 # direct box.query
POST /api/querycount                            # direct box.querycount
POST /api/multiquery                            # direct box.multiquery
POST /api/NULL                                  # get an empty body, used for performance tests

Included from landevice.lua:

GET /api/v0/landevice                           # get the whole landvice ui-module and its values
GET /api/v0/landevice/landevice                 # get the whole landvice list
GET /api/v0/landevice/landevice/<string>        # get a specific landevice from landevice list
GET /api/v0/landevice/landevice/<string>/iplist # get the whole iplist from a specific landevice
GET /api/v0/landevice/landevice/<string>/iplist/<string>  # get a specific iplist entry 

REST-API:

Functions

The function names of scripts often help to understand function blocks (and show gaps in the docs). fw 7530-7.51-102799 functions:

$ grep -e '^function' -e '^local function' /usr/rest_api/dev_debug.lua

# Helper function to send a data table to the client.
local function send_data(data)

# Helper function to send an error object with HTTP status code 400.
local function send_error(code, message)

# Send juis_boxinfo.json to the client.
# GET /api/v0/boxinfo
local function get_juisboxinfos()

# Load libluaevent.so
local function load_luaevent()

# Load libluaevent.so optionally
local function assert_luaevent()

# Get the eventlog groups
# GET /api/v0/eventlog/groups
local function get_eventlog_groups()

# Get the complete eventlog
# GET /api/v0/eventlog
local function get_eventlog()

# Get the filtered eventlog
# GET /api/v0/eventlog/groups/<string>
local function get_eventlog_specific(params)

# Handling of direct box.set_config.
# POST /api/set_config
local function set_config()

# Handling of direct box.query.
# POST /api/query
local function query()

# Handling of direct box.querycount.
# POST /api/querycount
local function querycount()

# Handling of direct box.multiquery.
# POST /api/multiquery
local function multiquery()

# Helper function for sorting lists of objects. Used by table.sort
local function object_sort_cmp(a, b)

# Get a list of filter parameters from a given list.
local function filter_f_params(list)

# Filters a list of objects by a given field name and value combination.
local function filter_list_by_param(list, name, value)

# Filters a list of objects.
local function filter_list(list)

# Slice a list for pagination.
local function paginate(list)

# Send an empty body to the client. Used for performance tests.
# POST /api/NULL
local function send_null()

# Send the box object back to the client.
# ANY /api/lua_debug
local function resend_box_obj()

# Cause an crash on Lua stack
# ANY /api/crash
local function crash()

# Prints the test string in capiterm and sends it back via REST. Useful for testing.
# ANY /api/lua_debug/<string>
local function log_test_string(params)

# Add some endpoints to the overview (boxinfo, eventlog)
function dev_debug.add_overview(modules)

# Add endpoints by their path and callback to the router
# GET /api/v0/boxinfo
# GET /api/v0/eventlog
# GET /api/v0/eventlog/groups
# GET /api/v0/eventlog/groups/<string>
# GET /api/v0/landevice                      (from landevice.lua)
# GET /api/v0/landevice/landevice
# GET /api/v0/landevice/landevice/<string>
# GET /api/v0/landevice/landevice/<string>/iplist
# GET /api/v0/landevice/landevice/<string>/iplist/<string>
# ALL /api/lua_debug
# ALL /api/lua_debug/<string>
# ALL /api/crash
# POST /api/set_config
# POST /api/query
# POST /api/querycount
# POST /api/multiquery
# POST /api/NULL
function dev_debug.register_endpoints() 

Dependencies

Daily updated index of all dependencies of this script. Last update: 2024-04-26 08:50 GMT.
A * in the Mod column marks info from Supportdata-Probes, which will always stay incomplete.
If an Object includes itself then this is a file with the same name but another Path and the dependencies are merged.

Relation Typ Object Mod Firmware Info Origin
Requires lib libluaevent.so 35 7.39 - 7.90 Lua-Library for event handling AVM
Requires lua avmluamessages.lua 34 7.39 - 7.61 REST-API Debug Message Printer AVM
Requires lua landevice.lua 35 7.39 - 7.90 REST-API wrapper for the landevice ui-module AVM
Requires lua response.lua 35 7.39 - 7.90 REST-API Response API AVM
Requires lua rest_api_const.lua 35 7.39 - 7.90 REST-API Const Tables AVM
Required by lua api.lua 50 7.39 - 7.90 REST-API Lua-Land root for scgi_server AVM
Required by lua plugin_common.lua 13 7.90 TODO AVM
Includes js box.js 35 7.39 - 7.90 TODO AVM
8 dependencies for this script

Model-Matrix

Daily updated index of the presence, path and size of this script for each model. Last update: 2024-04-26 06:23 GMT.
Showing all models using this script. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom) label in the Model column shows which CPU is meant for models with multiple Linux instances.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.

Model Firmware Path Size/Bytes
FRITZ!Box 4040 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 4050 7.57 /usr/rest_api 9.5k
FRITZ!Box 4060 7.39 - 7.57 /usr/rest_api 9.5k
FRITZ!Box 5530 Fiber (main) 7.39 - 7.70 /usr/rest_api 9.0k - 9.5k
FRITZ!Box 5590 Fiber (arm) 7.39 - 7.90 /usr/rest_api 9.0k - 9.5k
FRITZ!Box 5590 Fiber (prx) 7.70 - 7.90 /usr/rest_api 9.0k - 9.1k
FRITZ!Box 5690 Pro (arm) 7.59 - 7.60 /usr/rest_api 9.5k
FRITZ!Box 6490 Cable (arm) 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6490 Cable (atom) 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6590 Cable (arm) 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6590 Cable (atom) 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6591 Cable (arm) 7.39 - 7.90 /usr/rest_api 9.5k - 9.9k
FRITZ!Box 6591 Cable (atom) 7.39 - 7.90 /usr/rest_api 9.5k - 9.9k
FRITZ!Box 6660 Cable (arm) 7.39 - 7.90 /usr/rest_api 9.5k - 9.9k
FRITZ!Box 6660 Cable (atom) 7.39 - 7.90 /usr/rest_api 9.5k - 9.9k
FRITZ!Box 6670 Cable (arm) 7.61 /usr/rest_api 9.5k
FRITZ!Box 6670 Cable (atom) 7.61 /usr/rest_api 9.5k
FRITZ!Box 6690 Cable (arm) 7.39 - 7.90 /usr/rest_api 9.5k - 9.9k
FRITZ!Box 6690 Cable (atom) 7.39 - 7.90 /usr/rest_api 9.5k - 9.9k
FRITZ!Box 6820 LTE v1 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6820 LTE v2 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6820 LTE v3 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6850 LTE 7.39 - 7.90 /usr/rest_api 9.1k - 9.5k
FRITZ!Box 6850 5G 7.39 - 7.90 /usr/rest_api 9.1k - 9.5k
FRITZ!Box 6890 LTE v1 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 6890 LTE v2 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 7490 (main) 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 7510 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 7520 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 7520 v2 (arm) 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 7530 7.39 - 7.51 /usr/rest_api 9.5k
FRITZ!Box 7530 AX 7.39 - 7.90 /usr/rest_api 9.0k - 9.9k
FRITZ!Box 7590 7.39 - 7.90 /usr/rest_api 9.1k - 10.7k
FRITZ!Box 7590 AX 7.39 - 7.90 /usr/rest_api 9.0k - 10.7k
FRITZ!Box 7690 7.59 /usr/rest_api 9.5k
35 models use this script

SMW-Browser

Information is currently being retrieved from the backend.
 

Synonyms

Showing 1 related property.

d