![]() |
yumapro
24.10-11
YumaPro SDK
|
Subsystem core functions are used to launch the subsystem and perform IO operations. More...
Macros | |
#define | SUBSYS_BUFFLEN 32000 |
max length of an <ncx-connect> message | |
#define | SUBSYS_TRACE1(cb, fmt, ...) |
SUBSYS_TRACE Level 1 log debug trace macro. | |
#define | SUBSYS_TRACE2(cb, fmt, ...) |
SUBSYS_TRACE Level 2 log debug trace macro. | |
#define | SUBSYS_TRACE3(cb, fmt, ...) |
SUBSYS_TRACE Level 3 log debug trace macro. | |
#define | XML_START_MSG |
copied from ncx/xml_util.h to avoid inluding that file and all the files it includes | |
#define | run_subsystem_ex run_subsystem_full |
Run the subsystem : entry point (extended) More... | |
Typedefs | |
typedef status_t(* | subsys_stdout_fn_t) (const char *buff, size_t bufflen) |
STDOUT FUNCTION TEMPLATE subsys_stdout_fn_t. More... | |
typedef ssize_t(* | subsys_stdin_fn_t) (char *buff, size_t bufflen) |
STDIN FUNCTION TEMPLATE subsys_stdin_fn_t. More... | |
Enumerations | |
enum | proto_id_t { PROTO_ID_NONE , PROTO_ID_NETCONF , PROTO_ID_YANGAPI , PROTO_ID_CLI , PROTO_ID_WEBUI , PROTO_ID_YCONTROL , PROTO_ID_RESTCONF } |
the type of protocol starting the subsystem More... | |
Functions | |
int | run_subsystem (proto_id_t protocol_id, int trace_level, int argc, char **argv) |
Run the subsystem : entry point. More... | |
int | run_subsystem_full (proto_id_t protocol_id, int trace_level, int argc, char **argv, char **envp, subsys_stdin_fn_t stdin_fn, subsys_stdout_fn_t stdout_fn, int32 stdin_len) |
Run the subsystem : entry point (full) More... | |
status_t | connect_subsystem_ycontrol (int *retfd) |
Connect the subsystem for YControl. More... | |
status_t | connect_subsystem_srid (const char *server_root, int *retfd) |
Connect the subsystem for YControl using a server root. More... | |
status_t | check_subsystem_io (void) |
Check if any input ready to transfer. More... | |
void | cleanup_subsystem_ycontrol (status_t res) |
Cleanup the subsystem variables. More... | |
Subsystem core functions are used to launch the subsystem and perform IO operations.
It contains the entry points for the library.
#define run_subsystem_ex run_subsystem_full |
Run the subsystem : entry point (extended)
REMOVED: USE run_subsystem_full instead
STDIN is input from the SSH client (sent to YP server)
STDOUT is output to the SSH client (rcvd from YP server)
protocol_id | default protocol to use if no -p CLI entered |
trace_level | default trace level to use if no -t CLI entered |
argc | argument count passed to program |
argv | argument list passed to program |
envp | environment list passed to program |
stdin_fn | function to call for reading a buffer from STDIN NULL to use internal default function |
stdout_fn | function to call for writing a buffer to STDOUT NULL to use internal default function |
stdin_len | content length if limited or known in advance -1 if content_length not known or used |
typedef ssize_t(* subsys_stdin_fn_t) (char *buff, size_t bufflen) |
STDIN FUNCTION TEMPLATE subsys_stdin_fn_t.
buff | buffer to read from STDIN |
bufflen | max number of bytes to read |
typedef status_t(* subsys_stdout_fn_t) (const char *buff, size_t bufflen) |
STDOUT FUNCTION TEMPLATE subsys_stdout_fn_t.
buff | buffer to write to STDOUT |
bufflen | number of bytes to write |
enum proto_id_t |
status_t check_subsystem_io | ( | void | ) |
Check if any input ready to transfer.
void cleanup_subsystem_ycontrol | ( | status_t | res | ) |
Cleanup the subsystem variables.
res | final status for trace message |
status_t connect_subsystem_srid | ( | const char * | server_root, |
int * | retfd | ||
) |
Connect the subsystem for YControl using a server root.
server_root |
| |
[out] | retfd | address of return file descriptor number
|
status_t connect_subsystem_ycontrol | ( | int * | retfd | ) |
Connect the subsystem for YControl.
[out] | retfd | address of return file descriptor number
|
int run_subsystem | ( | proto_id_t | protocol_id, |
int | trace_level, | ||
int | argc, | ||
char ** | argv | ||
) |
Run the subsystem : entry point.
STDIN is input from the SSH client (sent to YP server)
STDOUT is output to the SSH client (rcvd from YP server)
protocol_id | default protocol to use if no -p CLI entered |
trace_level | default trace level to use if no -t CLI entered |
argc | argument count passed to program |
argv | argument list passed to program |
int run_subsystem_full | ( | proto_id_t | protocol_id, |
int | trace_level, | ||
int | argc, | ||
char ** | argv, | ||
char ** | envp, | ||
subsys_stdin_fn_t | stdin_fn, | ||
subsys_stdout_fn_t | stdout_fn, | ||
int32 | stdin_len | ||
) |
Run the subsystem : entry point (full)
Appears to be a duplicate of run_subsystem_ex. STDIN is input from the SSH client (sent to YP server)
STDOUT is output to the SSH client (rcvd from YP server)
protocol_id | default protocol to use if no -p CLI entered |
trace_level | default trace level to use if no -t CLI entered |
argc | argument count passed to program |
argv | argument list passed to program |
envp | environment list passed to program |
stdin_fn | function to call for reading a buffer from STDIN NULL to use internal default function |
stdout_fn | function to call for writing a buffer to STDOUT NULL to use internal default function |
stdin_len | content length if limited or known in advance -1 if content_length not known or used |