diff options
| author | Christian Hopps <chopps@labn.net> | 2023-05-20 04:25:47 -0400 | 
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-05-30 02:10:20 -0400 | 
| commit | 0327be91d1c8186c1b04e06d6a45bcbe0af7a92f (patch) | |
| tree | ee16a0672fc7b7fbc9ad930e04396a8c92f4312c /mgmtd/mgmt_be_adapter.h | |
| parent | 52a50ca1d799096e04a4497974a925ee71166cf9 (diff) | |
mgmtd: cleanup BE xpath subscription and matching code
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'mgmtd/mgmt_be_adapter.h')
| -rw-r--r-- | mgmtd/mgmt_be_adapter.h | 35 | 
1 files changed, 22 insertions, 13 deletions
diff --git a/mgmtd/mgmt_be_adapter.h b/mgmtd/mgmt_be_adapter.h index e2a41ef874..910ae34b34 100644 --- a/mgmtd/mgmt_be_adapter.h +++ b/mgmtd/mgmt_be_adapter.h @@ -69,17 +69,20 @@ struct mgmt_be_client_adapter {  DECLARE_LIST(mgmt_be_adapters, struct mgmt_be_client_adapter, list_linkage); -union mgmt_be_xpath_subscr_info { -	uint8_t subscribed; -	struct { -		uint8_t validate_config : 1; -		uint8_t notify_config : 1; -		uint8_t own_oper_data : 1; -	}; -}; +/* + * MGMT_SUBSCR_xxx - flags for subscription types for xpaths registrations + * + * MGMT_SUBSCR_VALIDATE_CFG :: the client should be asked to validate config + * MGMT_SUBSCR_NOTIFY_CFG :: the client should be notified of config changes + * MGMT_SUBSCR_OPER_OWN :: the client owns the given oeprational state + */ +#define MGMT_SUBSCR_VALIDATE_CFG	0x1 +#define MGMT_SUBSCR_NOTIFY_CFG	0x2 +#define MGMT_SUBSCR_OPER_OWN	0x4 +#define MGMT_SUBSCR_ALL	       	0x7  struct mgmt_be_client_subscr_info { -	union mgmt_be_xpath_subscr_info xpath_subscr[MGMTD_BE_CLIENT_ID_MAX]; +	uint xpath_subscr[MGMTD_BE_CLIENT_ID_MAX];  };  /* Initialise backend adapter module. */ @@ -194,11 +197,17 @@ extern void mgmt_be_adapter_status_write(struct vty *vty);   */  extern void mgmt_be_xpath_register_write(struct vty *vty); -/* - * Maps a YANG dtata Xpath to one or more - * backend clients that should be contacted for various purposes. +/** + * Lookup the clients which are subscribed to a given `xpath` + * and the way they are subscribed. + * + * Args: + *     xpath - the xpath to check for subscription information. + *     subscr_info - An array of uint indexed by client id + *                   each eleemnt holds the subscription info + *                   for that client.   */ -extern int mgmt_be_get_subscr_info_for_xpath( +extern void mgmt_be_get_subscr_info_for_xpath(  	const char *xpath, struct mgmt_be_client_subscr_info *subscr_info);  /*  | 
