From dc394f0d636f973260fffe7d4cdf94951ae9c198 Mon Sep 17 00:00:00 2001 From: "drenfong.wang" Date: Fri, 23 Aug 2019 23:48:31 +0800 Subject: fix vapi change problem and fix package name Change-Id: I1c7de9dfe78d2b92adabf69ef716652b3bb4db92 Signed-off-by: drenfong.wang (cherry picked from commit 55de4df2fc5231334fd022cb1aa4508cd5ec770b) --- src/cmake/Packager.cmake | 4 ++-- src/plugins/ietf/ietf_interface.cpp | 16 ++++++++-------- src/plugins/openconfig/openconfig_interfaces.cpp | 8 ++++---- src/plugins/vpp-oper/interface.cpp | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/cmake/Packager.cmake b/src/cmake/Packager.cmake index b22d5dc..92b2ba1 100644 --- a/src/cmake/Packager.cmake +++ b/src/cmake/Packager.cmake @@ -66,8 +66,8 @@ macro(make_packages) set(deb_ver "${tag}") set(rpm_ver "${tag}") else() - set(deb_ver "${tag}-${commit_num}-${commit_name}-release") - set(rpm_ver "${tag}-${commit_num}-${commit_name}-release") + set(deb_ver "${tag}-${commit_num}-${commit_name}") + set(rpm_ver "${tag}-${commit_num}-${commit_name}") endif() get_cmake_property(components COMPONENTS) diff --git a/src/plugins/ietf/ietf_interface.cpp b/src/plugins/ietf/ietf_interface.cpp index 74fc594..0fedbf9 100644 --- a/src/plugins/ietf/ietf_interface.cpp +++ b/src/plugins/ietf/ietf_interface.cpp @@ -407,25 +407,25 @@ ietf_interface_state_cb(const char *xpath, sr_val_t **values, for (auto &it : *dump) { interface = it.get_payload(); - SRP_LOG_DBG("State of interface %s", interface.interface_name); + SRP_LOG_DBG("State of interface %s", interface.interface_name.buf); /* it needs if-mib YANG feature to work ! * admin-state: state as required by configuration */ sr_val_build_xpath(&val[cnt], "%s[name='%s']/admin-status", xpath, - interface.interface_name); + interface.interface_name.buf); sr_val_set_str_data(&val[cnt], SR_ENUM_T, - interface.admin_up_down ? "up" : "down"); + interface.flags? "up" : "down"); cnt++; /* oper-state: effective state. can differ from admin-state */ sr_val_build_xpath(&val[cnt], "%s[name='%s']/oper-status", xpath, - interface.interface_name); + interface.interface_name.buf); sr_val_set_str_data(&val[cnt], SR_ENUM_T, - interface.link_up_down ? "up" : "down"); + interface.link_duplex ? "up" : "down"); cnt++; sr_val_build_xpath(&val[cnt], "%s[name='%s']/phys-address", xpath, - interface.interface_name); + interface.interface_name.buf); sr_val_build_str_data(&val[cnt], SR_STRING_T, "%02x:%02x:%02x:%02x:%02x:%02x", interface.l2_address[0], interface.l2_address[1], @@ -434,13 +434,13 @@ ietf_interface_state_cb(const char *xpath, sr_val_t **values, cnt++; sr_val_build_xpath(&val[cnt], "%s[name='%s']/if-index", xpath, - interface.interface_name); + interface.interface_name.buf); val[cnt].type = SR_INT32_T; val[cnt].data.int32_val = interface.sw_if_index; cnt++; sr_val_build_xpath(&val[cnt], "%s[name='%s']/speed", xpath, - interface.interface_name); + interface.interface_name.buf); val[cnt].type = SR_UINT64_T; val[cnt].data.uint64_val = interface.link_speed; cnt++; diff --git a/src/plugins/openconfig/openconfig_interfaces.cpp b/src/plugins/openconfig/openconfig_interfaces.cpp index 40de71c..2f09a2a 100644 --- a/src/plugins/openconfig/openconfig_interfaces.cpp +++ b/src/plugins/openconfig/openconfig_interfaces.cpp @@ -235,7 +235,7 @@ oc_interfaces_state_cb(const char *xpath, sr_val_t **values, size_t *values_cnt, reply = dump->begin()->get_payload(); sr_val_build_xpath(&vals[cnt], "%s/name", xpath_root); - sr_val_set_str_data(&vals[cnt], SR_STRING_T, (char *)reply.interface_name); + sr_val_set_str_data(&vals[cnt], SR_STRING_T, (char *)reply.interface_name.buf); cnt++; //TODO revisit types after V3PO has been implemented @@ -250,7 +250,7 @@ oc_interfaces_state_cb(const char *xpath, sr_val_t **values, size_t *values_cnt, sr_val_build_xpath(&vals[cnt], "%s/enabled", xpath_root); vals[cnt].type = SR_BOOL_T; - vals[cnt].data.bool_val = reply.admin_up_down; + vals[cnt].data.bool_val = reply.flags; cnt++; sr_val_build_xpath(&vals[cnt], "%s/ifindex", xpath_root); @@ -260,12 +260,12 @@ oc_interfaces_state_cb(const char *xpath, sr_val_t **values, size_t *values_cnt, sr_val_build_xpath(&vals[cnt], "%s/admin-status", xpath_root); sr_val_set_str_data(&vals[cnt], SR_ENUM_T, - reply.admin_up_down ? "UP" : "DOWN"); + reply.flags ? "UP" : "DOWN"); cnt++; sr_val_build_xpath(&vals[cnt], "%s/oper-status", xpath_root); sr_val_set_str_data(&vals[cnt], SR_ENUM_T, - reply.link_up_down ? "UP" : "DOWN"); + reply.link_duplex ? "UP" : "DOWN"); cnt++; *values = vals; diff --git a/src/plugins/vpp-oper/interface.cpp b/src/plugins/vpp-oper/interface.cpp index 054ec6c..263f56e 100644 --- a/src/plugins/vpp-oper/interface.cpp +++ b/src/plugins/vpp-oper/interface.cpp @@ -22,7 +22,7 @@ interface_dump::issue(connection& con) payload.name_filter_valid = 0; } else { payload.name_filter_valid = 1; - strcpy((char*)payload.name_filter, m_name.c_str()); + strcpy((char*)payload.name_filter.buf, m_name.c_str()); } VAPI_CALL(m_dump->execute()); -- cgit 1.2.3-korg