yumapro
24.10-2
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 | |
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_ex (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 (extended) 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 | init_subsystem_ycontrol (int trace_level, const char *subsys_id) |
@ More... | |
status_t | init_subsystem_ycontrol_ha (int trace_level, const char *subsys_id, const char *server_id, const char *server_addr, uint16 server_port) |
@ 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.
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
|
status_t init_subsystem_ycontrol | ( | int | trace_level, |
const char * | subsys_id | ||
) |
@
Init the subsystem for use within a YControl subsystem
Internal API for YControl use only.
STDIN is input from the client (sent to YP server) STDOUT is output to the client (rcvd from YP server)
THIS FUNCTION WILL SET NON-BLOCKING IO FOR THE SOCKET DO NOT USE FOR yangcli-pro or yp-shell; FOR ycontrol only
trace_level | default trace level to use if no -t CLI entered |
subsys_id | subsystem identifier |
status_t init_subsystem_ycontrol_ha | ( | int | trace_level, |
const char * | subsys_id, | ||
const char * | server_id, | ||
const char * | server_addr, | ||
uint16 | server_port | ||
) |
@
Init the subsystem for use within a YControl subsystem
Internal API for YControl use only.
STDIN is input from the client (sent to YP server) STDOUT is output to the client (rcvd from YP server)
THIS FUNCTION WILL SET NON-BLOCKING IO FOR THE SOCKET DO NOT USE FOR yangcli-pro or yp-shell; FOR ycontrol only
trace_level | default trace level to use if no -t CLI entered |
subsys_id | subsystem identifier |
server_id | the server ID to connect to |
server_addr | the server address to connect to |
server_port | the server port to connect to |
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_ex | ( | 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 (extended)
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 |
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 |