summaryrefslogtreecommitdiffstats
path: root/src/plugins/sc_plugins.h
diff options
context:
space:
mode:
authorYohanPipereau <ypiperea@cisco.com>2019-02-28 17:21:51 +0100
committerYohanPipereau <ypiperea@cisco.com>2019-03-05 16:36:48 +0100
commit3430b042873f2eac94acd323125eaaa4a5f7f3e9 (patch)
tree45335d45b94259f53426413bc5333a36dcfb8f07 /src/plugins/sc_plugins.h
parent793682e6fcb9e39891c59c696e5f8e9c18f9d8e7 (diff)
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 <ypiperea@cisco.com>
Diffstat (limited to 'src/plugins/sc_plugins.h')
-rw-r--r--src/plugins/sc_plugins.h26
1 files changed, 26 insertions, 0 deletions
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 <sysrepo/values.h>
#include <sysrepo/plugins.h>
+#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);