diff --git a/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.c b/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.c index a4e6f68c..3b2c6c9c 100644 --- a/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.c +++ b/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.c @@ -28,7 +28,7 @@ int interfaces_interface_ipv4_address_change_netmask(void* priv, sr_session_ctx_ break; } - return error; + return -1; } void interfaces_interface_ipv4_address_change_netmask_free(void* priv) @@ -60,7 +60,7 @@ int interfaces_interface_ipv4_address_change_prefix_length(void* priv, sr_sessio break; } - return error; + return -1; } void interfaces_interface_ipv4_address_change_prefix_length_free(void* priv) @@ -92,7 +92,7 @@ int interfaces_interface_ipv4_address_change_ip(void* priv, sr_session_ctx_t* se break; } - return error; + return -1; } void interfaces_interface_ipv4_address_change_ip_free(void* priv) diff --git a/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.h b/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.h index d40b23da..a4c807af 100644 --- a/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.h +++ b/src/interfaces/src/plugin/api/interfaces/interface/ipv4/address/change.h @@ -7,9 +7,11 @@ int interfaces_interface_ipv4_address_change_netmask_init(void* priv); int interfaces_interface_ipv4_address_change_netmask(void* priv, sr_session_ctx_t* session, const srpc_change_ctx_t* change_ctx); void interfaces_interface_ipv4_address_change_netmask_free(void* priv); + int interfaces_interface_ipv4_address_change_prefix_length_init(void* priv); int interfaces_interface_ipv4_address_change_prefix_length(void* priv, sr_session_ctx_t* session, const srpc_change_ctx_t* change_ctx); void interfaces_interface_ipv4_address_change_prefix_length_free(void* priv); + int interfaces_interface_ipv4_address_change_ip_init(void* priv); int interfaces_interface_ipv4_address_change_ip(void* priv, sr_session_ctx_t* session, const srpc_change_ctx_t* change_ctx); void interfaces_interface_ipv4_address_change_ip_free(void* priv); diff --git a/src/interfaces/src/plugin/subscription/change.c b/src/interfaces/src/plugin/subscription/change.c index c18c7dfb..01253afd 100644 --- a/src/interfaces/src/plugin/subscription/change.c +++ b/src/interfaces/src/plugin/subscription/change.c @@ -10,6 +10,7 @@ // change API #include "plugin/api/interfaces/change.h" #include "plugin/api/interfaces/interface/change.h" +#include "plugin/api/interfaces/interface/ipv4/address/change.h" #include "plugin/api/interfaces/interface/ipv4/change.h" int interfaces_subscription_change_interfaces_interface(sr_session_ctx_t* session, uint32_t subscription_id, const char* module_name, const char* xpath, sr_event_t event, uint32_t request_id, void* private_data) @@ -58,6 +59,18 @@ int interfaces_subscription_change_interfaces_interface(sr_session_ctx_t* sessio SRPC_SAFE_CALL_ERR_COND(rc, rc < 0, snprintf(change_xpath_buffer, sizeof(change_xpath_buffer), "%s/ipv4/address", xpath), error_out); SRPC_SAFE_CALL_ERR(rc, srpc_iterate_changes(ctx, session, change_xpath_buffer, interfaces_interface_ipv4_change_address, interfaces_change_interface_init, interfaces_change_interface_free), error_out); + // ipv4/address/ip + SRPC_SAFE_CALL_ERR_COND(rc, rc < 0, snprintf(change_xpath_buffer, sizeof(change_xpath_buffer), "%s/ipv4/address/ip", xpath), error_out); + SRPC_SAFE_CALL_ERR(rc, srpc_iterate_changes(ctx, session, change_xpath_buffer, interfaces_interface_ipv4_address_change_ip, interfaces_change_interface_init, interfaces_change_interface_free), error_out); + + // ipv4/address/prefix-length + SRPC_SAFE_CALL_ERR_COND(rc, rc < 0, snprintf(change_xpath_buffer, sizeof(change_xpath_buffer), "%s/ipv4/address/prefix-length", xpath), error_out); + SRPC_SAFE_CALL_ERR(rc, srpc_iterate_changes(ctx, session, change_xpath_buffer, interfaces_interface_ipv4_address_change_prefix_length, interfaces_change_interface_init, interfaces_change_interface_free), error_out); + + // ipv4/address/netmask + SRPC_SAFE_CALL_ERR_COND(rc, rc < 0, snprintf(change_xpath_buffer, sizeof(change_xpath_buffer), "%s/ipv4/address/netmask", xpath), error_out); + SRPC_SAFE_CALL_ERR(rc, srpc_iterate_changes(ctx, session, change_xpath_buffer, interfaces_interface_ipv4_address_change_netmask, interfaces_change_interface_init, interfaces_change_interface_free), error_out); + // ipv4/neighbor SRPC_SAFE_CALL_ERR_COND(rc, rc < 0, snprintf(change_xpath_buffer, sizeof(change_xpath_buffer), "%s/ipv4/neighbor", xpath), error_out); SRPC_SAFE_CALL_ERR(rc, srpc_iterate_changes(ctx, session, change_xpath_buffer, interfaces_interface_ipv4_change_neighbor, interfaces_change_interface_init, interfaces_change_interface_free), error_out);