From d2661a384192d7e86fdd7ccf4a2dde0caf21c045 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Thu, 4 Jan 2024 05:36:14 +0000 Subject: [PATCH] doc: add diagram of oper-state queries. Signed-off-by: Christian Hopps --- doc/developer/mgmtd-dev.rst | 10 +- doc/figures/cli-oper-state.drawio | 377 ++++++++++++++++++++++++++++++ doc/figures/cli-oper-state.svg | 3 + 3 files changed, 388 insertions(+), 2 deletions(-) create mode 100644 doc/figures/cli-oper-state.drawio create mode 100644 doc/figures/cli-oper-state.svg diff --git a/doc/developer/mgmtd-dev.rst b/doc/developer/mgmtd-dev.rst index 9839aa8b6c..fb171c4ae7 100644 --- a/doc/developer/mgmtd-dev.rst +++ b/doc/developer/mgmtd-dev.rst @@ -210,13 +210,19 @@ This section will describe the internal functioning of ``mgmtd``, for now a couple diagrams are included to aide in source code perusal. -The client side of a CLI change +The client side of a CLI configuration change .. figure:: ../figures/cli-change-client.svg :align: center -The server (mgmtd) side of a CLI change +The server (mgmtd) side of a CLI configuration change .. figure:: ../figures/cli-change-mgmtd.svg :align: center + + +The client and server sides of oper-state query + +.. figure:: ../figures/cli-oper-state.svg + :align: center diff --git a/doc/figures/cli-oper-state.drawio b/doc/figures/cli-oper-state.drawio new file mode 100644 index 0000000000..4b86b58f7c --- /dev/null +++ b/doc/figures/cli-oper-state.drawio @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/figures/cli-oper-state.svg b/doc/figures/cli-oper-state.svg new file mode 100644 index 0000000000..bda7d7be8e --- /dev/null +++ b/doc/figures/cli-oper-state.svg @@ -0,0 +1,3 @@ + + +
Frontend CLI (mgmtd)
Frontend CLI (mgmtd)
MGMTD
MGMTD
xpath
xpath
txn
txn
clients (bitmask)
clients (bitmask)
fe_adapter_handle_get_tree
fe_adapter_handle_get_tree
be_adapter_handle_get_tree
mgmt_txn_notify_tree_data_reply
------------------------------------
merge tree data
when all clients respond or timeout
be_adapter_handle_get_tree...
mgmt_txn_send_get_tree_oper
mgmt_txn_send_get_tree_oper
mgmt_be_send_native
mgmt_be_send_native
socket connection
FE adapter -> FE client
MGMT_MSG_CODE_TREE_DATA
struct mgmt_msg_tree_data
socket connection...
txn_get_tree_data_done
fe_adapter_send_tree_data
txn_get_tree_data_done...
session->get_tree_notify
session->get_tree_notify
vty_mgmt_resume_response
vty_mgmt_resume_response
vty_mgmt_get_tree_result_notified
displays result
vty_mgmt_get_tree_result_notified...
clients (bitmask)
clients (bitmask)
mgmt_be_interested_clients
mgmt_be_interested_clients
vty_mgmt_send_get_tree_req
vty_mgmt_send_get_tree_req
socket connection
FE client -> FE adapter
MGMT_MSG_CODE_GET_TREE
struct mgmt_msg_get_tree
socket connection...
mgmt_fe_send_get_tree_req
mgmt_fe_send_get_tree_req
xpath
xpath
fe_adapter_handle_native_msg
fe_adapter_handle_native_msg
"show mgmt get-data-tree WORD$path [json|xml]"
"show mgmt get-data-tree WORD...
EVENT: VTYSH_READ
EVENT: VTYSH_READ
VTYSH
VTYSH
mgmt_create_txn
mgmt_create_txn
mgmt_txn_req_alloc
mgmt_txn_req_alloc
txn_req
MGMTD_TXN_PROC_GETTREE
txn_req...
for each of the clients
in bitmask
for ea...
be_client_send_native_msg
be_client_send_native_msg
be_adapter_handle_native_msg
be_adapter_handle_native_msg
socket connection
BE client -> BE adapter
MGMT_MSG_CODE_TREE_DATA
struct mgmt_msg_tree_data
socket connection...
be_client_send_native_msg
be_client_send_native_msg
Backend Client (ospfd, staticd, ...)
Backend Client (ospfd, staticd, ...)
(1) build oper state tree
struct mgmt_msg_tree_data
(1) build oper state tree...
(2)
(2)
be_client_handle_get_tree
be_client_handle_get_tree
nb_oper_data_iterate
nb_oper_data_iterate
be_client_handle_native_msg
be_client_handle_native_msg
be_client_send_native_msg
be_client_send_native_msg
for each of the
queried BE clients
for ea...
socket connection
BE adapter -> BE client
MGMT_MSG_CODE_GET_TREE
struct mgmt_msg_get_tree
socket connection...
fe_client_handle_native_msg
fe_client_handle_native_msg
socket async
socket async
timer/event async
timer/event async
function sync
function sync
mgmt_fe_adapter.c
mgmt_fe_adapter.c
mgmt_txn.c
mgmt_txn.c
mgmt_be_adapter.c
mgmt_be_adapter.c
z
z
Text is not SVG - cannot display
\ No newline at end of file -- 2.39.5