From 3430b042873f2eac94acd323125eaaa4a5f7f3e9 Mon Sep 17 00:00:00 2001 From: YohanPipereau Date: Thu, 28 Feb 2019 17:21:51 +0100 Subject: Merge IETF and Openconfig to use SCVPP scvpp should eventually be the only interface with VAPI and should not depend on sysrepo. -All sysrepo error codes in scvpp codes have been changed for errno error codes. scvpp might eventually needs its own error codes. -All log messages in scvpp have been removed as error codes are the only way of reporting failures in a library. -Move VAPI symbol definition to SCVPP. In scvpp, unused maccros SC_VPP_VAPI_RECV and SC_REGISTER_RPC_EVT_HANDLER have been removed. Regarding plugins update: -Use Openconfig way to convert interface name to interface index. -Use Openconfig way to enable/disable an interface. -Use Openconfig way of configuring interface IPs but use more arguments like IETF. -Use Openconfig way of adding a new route. -Use Openconfig way of dumping an IP. -Use common interface dump operation for get_name and get_id. -Delete unused create loopback Change-Id: Icc513a064a2528c2b4cbda2b0dd57755a3b08ef9 Signed-off-by: Yohan Pipereau --- src/plugins/sc_plugins.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/plugins/sc_plugins.h') diff --git a/src/plugins/sc_plugins.h b/src/plugins/sc_plugins.h index bdf88d7..f405300 100644 --- a/src/plugins/sc_plugins.h +++ b/src/plugins/sc_plugins.h @@ -20,6 +20,32 @@ #include #include +#define ARG_CHECK(retval, arg) \ + do \ + { \ + if (NULL == (arg)) \ + { \ + SRP_LOG_ERR_MSG(#arg ":NULL pointer passed."); \ + return (retval); \ + } \ + } \ + while (0) + +#define ARG_CHECK2(retval, arg1, arg2) \ + ARG_CHECK(retval, arg1); \ + ARG_CHECK(retval, arg2) + +#define ARG_CHECK3(retval, arg1, arg2, arg3) \ + ARG_CHECK(retval, arg1); \ + ARG_CHECK(retval, arg2); \ + ARG_CHECK(retval, arg3) + +#define ARG_CHECK4(retval, arg1, arg2, arg3, arg4) \ + ARG_CHECK(retval, arg1); \ + ARG_CHECK(retval, arg2); \ + ARG_CHECK(retval, arg3); \ + ARG_CHECK(retval, arg4) + //functions that sysrepo-plugin need int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_ctx); void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_ctx); -- cgit 1.2.3-korg