diff options
author | YohanPipereau <ypiperea@cisco.com> | 2019-02-28 17:21:51 +0100 |
---|---|---|
committer | YohanPipereau <ypiperea@cisco.com> | 2019-03-05 16:36:48 +0100 |
commit | 3430b042873f2eac94acd323125eaaa4a5f7f3e9 (patch) | |
tree | 45335d45b94259f53426413bc5333a36dcfb8f07 /src/plugins/sc_plugins.c | |
parent | 793682e6fcb9e39891c59c696e5f8e9c18f9d8e7 (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.c')
-rw-r--r-- | src/plugins/sc_plugins.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/plugins/sc_plugins.c b/src/plugins/sc_plugins.c index e0db8ed..093939c 100644 --- a/src/plugins/sc_plugins.c +++ b/src/plugins/sc_plugins.c @@ -12,25 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include <vapi/vapi.h> -#include <vapi/vpe.api.vapi.h> -#include <vapi/interface.api.vapi.h> -#include <vapi/l2.api.vapi.h> -#include <vapi/ip.api.vapi.h> -#include <vapi/tapv2.api.vapi.h> -#include <vapi/ipsec.api.vapi.h> -#include <vapi/vxlan.api.vapi.h> -#include <vnet/interface.h> -#include <vnet/mpls/mpls_types.h> - -// Use VAPI macros to define symbols -DEFINE_VAPI_MSG_IDS_VPE_API_JSON; -DEFINE_VAPI_MSG_IDS_INTERFACE_API_JSON; -DEFINE_VAPI_MSG_IDS_L2_API_JSON; -DEFINE_VAPI_MSG_IDS_IP_API_JSON; -DEFINE_VAPI_MSG_IDS_TAPV2_API_JSON; -DEFINE_VAPI_MSG_IDS_IPSEC_API_JSON; -DEFINE_VAPI_MSG_IDS_VXLAN_API_JSON; #include "sc_plugins.h" #include "sc_model.h" @@ -41,13 +22,12 @@ DEFINE_VAPI_MSG_IDS_VXLAN_API_JSON; int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_ctx) { - SC_INVOKE_BEGIN; plugin_main_t plugin_main; int rc; rc = sc_connect_vpp(); if (0 != rc) { - SC_LOG_ERR("vpp connect error , with return %d.", rc); + SRP_LOG_ERR("vpp connect error , with return %d.", rc); return SR_ERR_INTERNAL; } @@ -61,22 +41,18 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_ctx) /* set subscription as our private context */ *private_ctx = plugin_main.subscription; - SC_INVOKE_END; return SR_ERR_OK; } void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_ctx) { - SC_INVOKE_BEGIN; - /* subscription was set as our private context */ if (private_ctx != NULL) sr_unsubscribe(session, private_ctx); - SC_LOG_DBG_MSG("unload plugin ok."); + SRP_LOG_DBG_MSG("unload plugin ok."); sc_disconnect_vpp(); - SC_LOG_DBG_MSG("plugin disconnect vpp ok."); - SC_INVOKE_END; + SRP_LOG_DBG_MSG("plugin disconnect vpp ok."); } |