mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-28 19:32:09 +00:00
lib: add NOTIF message ops (notification, replace, delete, patch)
- needed for supporting backend datastore notifications Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
parent
86fdf0198c
commit
30777991c0
@ -112,6 +112,22 @@ extern struct mgmt_be_client *
|
|||||||
mgmt_be_client_create(const char *name, struct mgmt_be_client_cbs *cbs,
|
mgmt_be_client_create(const char *name, struct mgmt_be_client_cbs *cbs,
|
||||||
uintptr_t user_data, struct event_loop *event_loop);
|
uintptr_t user_data, struct event_loop *event_loop);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mgmt_be_send_ds_delete_notification() - Send a datastore delete notification.
|
||||||
|
*/
|
||||||
|
extern int mgmt_be_send_ds_delete_notification(const char *path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mgmt_be_send_ds_patch_notification() - Send a datastore YANG patch notification.
|
||||||
|
*/
|
||||||
|
extern int mgmt_be_send_ds_patch_notification(const char *path, const struct lyd_node *tree);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mgmt_be_send_ds_replace_notification() - Send a datastore replace notification.
|
||||||
|
*/
|
||||||
|
extern int mgmt_be_send_ds_replace_notification(const char *path, const struct lyd_node *tree);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize library vty (adds debug support).
|
* Initialize library vty (adds debug support).
|
||||||
*
|
*
|
||||||
|
@ -323,22 +323,29 @@ _Static_assert(sizeof(struct mgmt_msg_get_data) ==
|
|||||||
offsetof(struct mgmt_msg_get_data, xpath),
|
offsetof(struct mgmt_msg_get_data, xpath),
|
||||||
"Size mismatch");
|
"Size mismatch");
|
||||||
|
|
||||||
|
|
||||||
|
#define NOTIFY_OP_NOTIFICATION 0
|
||||||
|
#define NOTIFY_OP_DS_REPLACE 1
|
||||||
|
#define NOTIFY_OP_DS_DELETE 2
|
||||||
|
#define NOTIFY_OP_DS_PATCH 3
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct mgmt_msg_notify_data - Message carrying notification data.
|
* struct mgmt_msg_notify_data - Message carrying notification data.
|
||||||
*
|
*
|
||||||
* @result_type: ``LYD_FORMAT`` for format of the @result value.
|
* @result_type: ``LYD_FORMAT`` for format of the @result value.
|
||||||
* @data: The xpath string of the notification followed by the tree data in
|
* @data: The xpath string of the notification followed by the tree data in
|
||||||
* @result_type format.
|
* @result_type format.
|
||||||
|
* @op: notify operation type.
|
||||||
*/
|
*/
|
||||||
struct mgmt_msg_notify_data {
|
struct mgmt_msg_notify_data {
|
||||||
struct mgmt_msg_header;
|
struct mgmt_msg_header;
|
||||||
uint8_t result_type;
|
uint8_t result_type;
|
||||||
uint8_t resv2[7];
|
uint8_t op;
|
||||||
|
uint8_t resv2[6];
|
||||||
|
|
||||||
alignas(8) char data[];
|
alignas(8) char data[];
|
||||||
};
|
};
|
||||||
_Static_assert(sizeof(struct mgmt_msg_notify_data) ==
|
_Static_assert(sizeof(struct mgmt_msg_notify_data) == offsetof(struct mgmt_msg_notify_data, data),
|
||||||
offsetof(struct mgmt_msg_notify_data, data),
|
|
||||||
"Size mismatch");
|
"Size mismatch");
|
||||||
|
|
||||||
#define EDIT_FLAG_IMPLICIT_LOCK 0x01
|
#define EDIT_FLAG_IMPLICIT_LOCK 0x01
|
||||||
|
Loading…
Reference in New Issue
Block a user