From 14243005c70d47fadc918031b24747e6c417d7f5 Mon Sep 17 00:00:00 2001 From: Pavol Hanzel Date: Tue, 4 Dec 2018 15:35:38 +0100 Subject: Binary-api wrappers: IP and interfaces Change-Id: I3b27dae29498346bf9baccd650d5260b0bfc6491 Signed-off-by: Pavol Hanzel --- src/scvpp/src/sc_vpp_operation.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/scvpp') diff --git a/src/scvpp/src/sc_vpp_operation.h b/src/scvpp/src/sc_vpp_operation.h index 497b704..7c914f0 100644 --- a/src/scvpp/src/sc_vpp_operation.h +++ b/src/scvpp/src/sc_vpp_operation.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018 HUACHENTEL and/or its affiliates. + * Copyright (c) 2018 PANTHEON.tech * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -60,6 +61,32 @@ DEFINE_VAPI_MSG_IDS_VPE_API_JSON; #define SC_INVOKE_END SC_LOG_DBG("inovke %s end,with return OK.",SC_THIS_FUNC); #define SC_INVOKE_ENDX(...) SC_LOG_DBG("inovke %s end,with %s.",SC_THIS_FUNC, ##__VA_ARGS__) +#define ARG_CHECK(retval, arg) \ + do \ + { \ + if (NULL == (arg)) \ + { \ + ERROR(#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) + /** * when use tihs must fist DEFINE_VAPI_MSG_IDS_VXLAN_API_JSON */ -- cgit