diff options
| author | Christian Hopps <chopps@labn.net> | 2024-01-15 07:03:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-15 07:03:34 -0500 |
| commit | f2bb6874268b271e49ca2acdc5dba5efd2b0b697 (patch) | |
| tree | f44cc26dec9896b45d2a3c4139b1ea30fd2f3e75 /lib/mgmt_msg_native.h | |
| parent | bd9174f424bd33e75895160aa1f4a63dae795460 (diff) | |
| parent | 2764344bcbd37c5ea69231d6e51ba9cd58edbb44 (diff) | |
Merge pull request #15154 from idryzhov/mgmt-get-data
mgmtd get-data request expansion
Diffstat (limited to 'lib/mgmt_msg_native.h')
| -rw-r--r-- | lib/mgmt_msg_native.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/mgmt_msg_native.h b/lib/mgmt_msg_native.h index 3f6283025c..069cb9b150 100644 --- a/lib/mgmt_msg_native.h +++ b/lib/mgmt_msg_native.h @@ -142,6 +142,7 @@ DECLARE_MTYPE(MSG_NATIVE_MSG); DECLARE_MTYPE(MSG_NATIVE_ERROR); DECLARE_MTYPE(MSG_NATIVE_GET_TREE); DECLARE_MTYPE(MSG_NATIVE_TREE_DATA); +DECLARE_MTYPE(MSG_NATIVE_GET_DATA); /* * Native message codes @@ -149,6 +150,7 @@ DECLARE_MTYPE(MSG_NATIVE_TREE_DATA); #define MGMT_MSG_CODE_ERROR 0 #define MGMT_MSG_CODE_GET_TREE 1 #define MGMT_MSG_CODE_TREE_DATA 2 +#define MGMT_MSG_CODE_GET_DATA 3 /** * struct mgmt_msg_header - Header common to all native messages. @@ -193,7 +195,7 @@ _Static_assert(sizeof(struct mgmt_msg_error) == "Size mismatch"); /** - * struct mgmt_msg_get_tree - Message carrying xpath query request. + * struct mgmt_msg_get_tree - backend oper data request. * * @result_type: ``LYD_FORMAT`` for the returned result. * @xpath: the query for the data to return. @@ -231,6 +233,30 @@ _Static_assert(sizeof(struct mgmt_msg_tree_data) == offsetof(struct mgmt_msg_tree_data, result), "Size mismatch"); +/* Flags for get-data request */ +#define GET_DATA_FLAG_STATE 0x01 /* get only "config false" data */ +#define GET_DATA_FLAG_CONFIG 0x02 /* get only "config true" data */ +#define GET_DATA_FLAG_EXACT 0x04 /* get exact data node instead of the full tree */ + +/** + * struct mgmt_msg_get_data - frontend get-data request. + * + * @result_type: ``LYD_FORMAT`` for the returned result. + * @flags: combination of ``GET_DATA_FLAG_*`` flags. + * @xpath: the query for the data to return. + */ +struct mgmt_msg_get_data { + struct mgmt_msg_header; + uint8_t result_type; + uint8_t flags; + uint8_t resv2[6]; + + alignas(8) char xpath[]; +}; +_Static_assert(sizeof(struct mgmt_msg_get_data) == + offsetof(struct mgmt_msg_get_data, xpath), + "Size mismatch"); + #define MGMT_MSG_VALIDATE_NUL_TERM(msgp, len) \ ((len) >= sizeof(*msg) + 1 && ((char *)msgp)[(len)-1] == 0) |
