- (strncmp(xstats[j].name, "rx_", strlen("rx_")) == 0)) {
- if (strncmp(type_end, "_errors", strlen("_errors")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_errors",
- sizeof (dpdkstat_vl.type));
- } else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_dropped",
- sizeof (dpdkstat_vl.type));
- } else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_octets",
- sizeof (dpdkstat_vl.type));
- } else if (strncmp(type_end, "_packets", strlen("_packets")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_packets",
- sizeof (dpdkstat_vl.type));
- } else if (strncmp(type_end, "_placement", strlen("_placement")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_errors",
- sizeof (dpdkstat_vl.type));
- } else if (strncmp(type_end, "_buff", strlen("_buff")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_errors",
- sizeof (dpdkstat_vl.type));
+ (strncmp(counter_name, "rx_", strlen("rx_")) == 0)) {
+ if (strstr(type_end, "bytes") != NULL) {
+ sstrncpy(vl.type, "if_rx_octets", sizeof(vl.type));
+ } else if (strstr(type_end, "error") != NULL) {
+ sstrncpy(vl.type, "if_rx_errors", sizeof(vl.type));
+ } else if (strstr(type_end, "dropped") != NULL) {
+ sstrncpy(vl.type, "if_rx_dropped", sizeof(vl.type));
+ } else if (strstr(type_end, "packets") != NULL) {
+ sstrncpy(vl.type, "if_rx_packets", sizeof(vl.type));
+ } else if (strstr(type_end, "_placement") != NULL) {
+ sstrncpy(vl.type, "if_rx_errors", sizeof(vl.type));
+ } else if (strstr(type_end, "_buff") != NULL) {
+ sstrncpy(vl.type, "if_rx_errors", sizeof(vl.type));