diff options
author | 2018-12-04 15:35:38 +0100 | |
---|---|---|
committer | 2018-12-18 02:10:52 +0000 | |
commit | 14243005c70d47fadc918031b24747e6c417d7f5 (patch) | |
tree | 439e81d2fd859050a08e0dd325fb7cd2c028763e /src/scvpp | |
parent | 53b1826e015b153b1ebc0953f852105ab5f4a402 (diff) |
Binary-api wrappers: IP and interfaces
Change-Id: I3b27dae29498346bf9baccd650d5260b0bfc6491
Signed-off-by: Pavol Hanzel <pavol.hanzel@pantheon.tech>
Diffstat (limited to 'src/scvpp')
-rw-r--r-- | src/scvpp/src/sc_vpp_operation.h | 27 |
1 files changed, 27 insertions, 0 deletions
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 */ |