@@ -4,4 +4,4 @@ The oai shared library loader is implemented in two source files, located in [co
...
@@ -4,4 +4,4 @@ The oai shared library loader is implemented in two source files, located in [co
1.[load_module_shlib.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.c) contains the loader implementation
1.[load_module_shlib.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.c) contains the loader implementation
1.[load_module_shlib.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.h) is the loader include file containing both private and public data type definitions. It also contain API prototypes.
1.[load_module_shlib.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/load_module_shlib.h) is the loader include file containing both private and public data type definitions. It also contain API prototypes.
@@ -5,13 +5,13 @@ The configuration module objectives are
...
@@ -5,13 +5,13 @@ The configuration module objectives are
As a developer you may need to look at these sections:
As a developer you may need to look at these sections:
*[loading a shared library](loader/devusage/loading)
*[loading a shared library](devusage/loading.md)
*[loader API](loader/devusage/api)
*[loader API](devusage/api.md)
*[loader public structures](loader/devusage/struct)
*[loader public structures](devusage/struct.md)
Loader usage examples can be found in oai sources:
Loader usage examples can be found in oai sources:
* device and transport initialization code: [function `load_lib` in *targets/ARCH/COMMON/__common_lib.c__* ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/targets/ARCH/COMMON/common_lib.c#L91)
* device and transport initialization code: [function `load_lib` in *targets/ARCH/COMMON/__common_lib.c__* ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/targets/ARCH/COMMON/common_lib.c#L91)
* turbo encoder and decoder initialization: [function `load_codinglib`in *openair1/PHY/CODING/__coding_load.c__*](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/CODING/coding_load.c#L113)
* turbo encoder and decoder initialization: [function `load_codinglib`in *openair1/PHY/CODING/__coding_load.c__*](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/openair1/PHY/CODING/coding_load.c#L113)
When loading a shared library the loader looks for a symbol named `< module name > _autoinit` and, if it finds it, calls it. The `autoinit` function is called without any argument and the returned value, if any, is not tested.
When loading a shared library the loader looks for a symbol named `< module name > _autoinit` and, if it finds it, calls it. The `autoinit` function is called without any argument and the returned value, if any, is not tested.
[loader home page](loader)
[loader home page](../loader.md)
[loader developer home page](loader/devusage)
[loader developer home page](../../loader/devusage.md)
@@ -6,5 +6,5 @@ It is defined in include file [ common/util/load_module_shlib.h ](https://gitlab
...
@@ -6,5 +6,5 @@ It is defined in include file [ common/util/load_module_shlib.h ](https://gitlab
| `fname` | symbol name, is passed to the [`dlsym`](http://man7.org/linux/man-pages/man3/dlsym.3.html) system call performed by the loader to get a pointer to the symbol | I |
| `fname` | symbol name, is passed to the [`dlsym`](http://man7.org/linux/man-pages/man3/dlsym.3.html) system call performed by the loader to get a pointer to the symbol | I |
| `fptr` | pointer to the symbol name, set by the loader. `fptr` is defined as a `int (*fptr)(void)` function type | O |
| `fptr` | pointer to the symbol name, set by the loader. `fptr` is defined as a `int (*fptr)(void)` function type | O |
@@ -6,7 +6,7 @@ Shared library full names are built by the loader using the format:
...
@@ -6,7 +6,7 @@ Shared library full names are built by the loader using the format:
1. the <*moduleversion*> and <*path*> optional parameters, are defined at run-time, depending on the configuration.
1. the <*moduleversion*> and <*path*> optional parameters, are defined at run-time, depending on the configuration.
## loader parameters
## loader parameters
The loader is using the [configuration module](config), and defines global and per library parameters. Global parameters must be specified under the **loader** section and library specific parameters under a **loader.<*module name*>** section. Module specific parameters override the global parameters.
The loader is using the [configuration module](../../../config/DOCconfig.md), and defines global and per library parameters. Global parameters must be specified under the **loader** section and library specific parameters under a **loader.<*module name*>** section. Module specific parameters override the global parameters.
### Global loader parameters
### Global loader parameters
| name | type | default | description |
| name | type | default | description |
|:---:|:---:|:---:|:----|
|:---:|:---:|:---:|:----|
...
@@ -47,4 +47,4 @@ With this latest example, nn the softmodem logs, you can check that the right de
...
@@ -47,4 +47,4 @@ With this latest example, nn the softmodem logs, you can check that the right de
@@ -92,7 +92,7 @@ int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmdde
...
@@ -92,7 +92,7 @@ int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmdde
Add a command and the `cmd` list of sub-commands to the telnet server. After a successful call to `add_telnetcmd` function, the telnet server calls the function defined for each sub-commands in the null terminated `cmd` array, when the character string received from the telnet client matches the command and sub-command strings.
Add a command and the `cmd` list of sub-commands to the telnet server. After a successful call to `add_telnetcmd` function, the telnet server calls the function defined for each sub-commands in the null terminated `cmd` array, when the character string received from the telnet client matches the command and sub-command strings.
Also adds the list of variables described in the `var` array to the list of variable which can be set and read.
Also adds the list of variables described in the `var` array to the list of variable which can be set and read.
The function returns -1 if one argument is NULL.
The function returns -1 if one argument is NULL.
The telnet server is dynamically loaded, to use the `add_telnetcmd` function, the shared library loader API should be used to check the availability of the telnet server and retrieve it's address, as shown in [the example at the top of this page](telnetaddcmd#code-example-of-adding-a-command-to-the-telnet-server).
The telnet server is dynamically loaded, to use the `add_telnetcmd` function, the shared library loader API should be used to check the availability of the telnet server and retrieve it's address, as shown in [the example at the top of this page](telnetaddcmd.md#code-example-of-adding-a-command-to-the-telnet-server).
# telnet server public data types
# telnet server public data types
## `telnetshell_vardef_t`structure
## `telnetshell_vardef_t`structure
...
@@ -113,4 +113,4 @@ The telnet server is dynamically loaded, to use the `add_telnetcmd` function, t
...
@@ -113,4 +113,4 @@ The telnet server is dynamically loaded, to use the `add_telnetcmd` function, t
| `helpstr` | `char[TELNET_HELPSTR_SIZE]` | character string to print when the elp`command is received from the telnet client |
| `helpstr` | `char[TELNET_HELPSTR_SIZE]` | character string to print when the elp`command is received from the telnet client |
| `cmdfunc` | `cmdfunc_t` | pointer to the function implementing the `cmdname` sub command. |
| `cmdfunc` | `cmdfunc_t` | pointer to the function implementing the `cmdname` sub command. |
@@ -18,4 +18,4 @@ telnet server source files are located in [common/utils/telnetsrv](https://gitla
...
@@ -18,4 +18,4 @@ telnet server source files are located in [common/utils/telnetsrv](https://gitla
1.`telnetsrv\_\<XXX\>.h`: include file for the implementation of XXX CLI command. Usually included only in the corresponding `.c`file
1.`telnetsrv\_\<XXX\>.h`: include file for the implementation of XXX CLI command. Usually included only in the corresponding `.c`file
1.[telnetsrv_CMakeLists.txt](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/telnetsrv/telnetsrv_CMakeLists.txt): CMakelists file containing the cmake instructions to build the telnet server. this file is included in the [global oai CMakelists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt).
1.[telnetsrv_CMakeLists.txt](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/telnetsrv/telnetsrv_CMakeLists.txt): CMakelists file containing the cmake instructions to build the telnet server. this file is included in the [global oai CMakelists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt).
The log command can be used to get the status of the log parameters and to dynamically modify these parameters. The log command has its own [help](telnethelp#oai-telnet-server-specific-commands-help)
The log command can be used to get the status of the log parameters and to dynamically modify these parameters. The log command has its own [help](telnethelp.md#oai-telnet-server-specific-commands-help)
```bash
```bash
softmodem> softmodem log disable 0-35
softmodem> softmodem log disable 0-35
log level/verbosity comp 0 PHY set to info / medium (disabled)
log level/verbosity comp 0 PHY set to info / medium (disabled)