X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnpt66%2Fnpt66_node.c;h=ebe33593700917fea836e0facf9f6bfbd289ed02;hb=bdeee2194;hp=960e4d446dd54b890950a6a35dd624ab7517304d;hpb=054aa8c2f2681e3a4a4af02d9119fb6eaa5dbad6;p=vpp.git diff --git a/src/plugins/npt66/npt66_node.c b/src/plugins/npt66/npt66_node.c index 960e4d446dd..ebe33593700 100644 --- a/src/plugins/npt66/npt66_node.c +++ b/src/plugins/npt66/npt66_node.c @@ -9,6 +9,7 @@ #include #include +#include typedef struct { @@ -197,11 +198,17 @@ npt66_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node, int rv = npt66_translate (ip, binding, dir); if (rv < 0) { - clib_warning ("npt66_translate failed"); + vlib_node_increment_counter (vm, node->node_index, + NPT66_ERROR_TRANSLATION, 1); *next = NPT66_NEXT_DROP; + goto next; } + else if (dir == VLIB_TX) + vlib_node_increment_counter (vm, node->node_index, NPT66_ERROR_TX, 1); + else + vlib_node_increment_counter (vm, node->node_index, NPT66_ERROR_RX, 1); - /*next: */ + next: next += 1; n_left_from -= 1; b += 1; @@ -260,8 +267,8 @@ VLIB_REGISTER_NODE(npt66_input_node) = { .vector_size = sizeof(u32), .format_trace = format_npt66_trace, .type = VLIB_NODE_TYPE_INTERNAL, - // .n_errors = NPT66_N_ERROR, - // .error_counters = npt66_error_counters, + .n_errors = NPT66_N_ERROR, + .error_counters = npt66_error_counters, .n_next_nodes = NPT66_N_NEXT, .next_nodes = { @@ -274,8 +281,8 @@ VLIB_REGISTER_NODE (npt66_output_node) = { .vector_size = sizeof (u32), .format_trace = format_npt66_trace, .type = VLIB_NODE_TYPE_INTERNAL, - // .n_errors = npt66_N_ERROR, - // .error_counters = npt66_error_counters, + .n_errors = NPT66_N_ERROR, + .error_counters = npt66_error_counters, .sibling_of = "npt66-input", };