+ e[0] =
+ vnet_classify_find_entry_inline (t[0], (u8 *) h[0], hash[0], now);
+ if (e[0])
+ {
+ vnet_buffer (b[0])->l2_classify.opaque_index
+ = e[0]->opaque_index;
+ vlib_buffer_advance (b[0], e[0]->advance);
+
+ _next[0] = (e[0]->next_index < n_next_nodes) ?
+ e[0]->next_index : _next[0];
+
+ hits++;
+
+ if (is_ip4)
+ error[0] = (_next[0] == ACL_NEXT_INDEX_DENY) ?
+ (is_output ? IP4_ERROR_OUTACL_SESSION_DENY :
+ IP4_ERROR_INACL_SESSION_DENY) : IP4_ERROR_NONE;
+ else
+ error[0] = (_next[0] == ACL_NEXT_INDEX_DENY) ?
+ (is_output ? IP6_ERROR_OUTACL_SESSION_DENY :
+ IP6_ERROR_INACL_SESSION_DENY) : IP6_ERROR_NONE;
+ b[0]->error = error_node->errors[error[0]];
+
+ if (!is_output)
+ {
+ if (e[0]->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX ||
+ e[0]->action == CLASSIFY_ACTION_SET_IP6_FIB_INDEX)
+ vnet_buffer (b[0])->sw_if_index[VLIB_TX] = e[0]->metadata;
+ else if (e[0]->action == CLASSIFY_ACTION_SET_METADATA)
+ vnet_buffer (b[0])->ip.adj_index[VLIB_TX] =
+ e[0]->metadata;
+ }
+ }
+ else
+ {
+ while (1)
+ {
+ if (PREDICT_TRUE (t[0]->next_table_index != ~0))
+ t[0] = pool_elt_at_index (vcm->tables,
+ t[0]->next_table_index);
+ else
+ {
+ _next[0] = (t[0]->miss_next_index < n_next_nodes) ?
+ t[0]->miss_next_index : _next[0];
+
+ misses++;
+
+ if (is_ip4)
+ error[0] = (_next[0] == ACL_NEXT_INDEX_DENY) ?
+ (is_output ? IP4_ERROR_OUTACL_TABLE_MISS :
+ IP4_ERROR_INACL_TABLE_MISS) : IP4_ERROR_NONE;
+ else
+ error[0] = (_next[0] == ACL_NEXT_INDEX_DENY) ?
+ (is_output ? IP6_ERROR_OUTACL_TABLE_MISS :
+ IP6_ERROR_INACL_TABLE_MISS) : IP6_ERROR_NONE;
+ b[0]->error = error_node->errors[error[0]];
+ break;
+ }
+
+ if (t[0]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
+ h[0] =
+ (void *) vlib_buffer_get_current (b[0]) +
+ t[0]->current_data_offset;
+ else
+ h[0] = b[0]->data;
+
+ /* advance the match pointer so the matching happens on IP header */
+ if (is_output)
+ h[0] += vnet_buffer (b[0])->l2_classify.pad.l2_len;
+
+ hash[0] =
+ vnet_classify_hash_packet_inline (t[0], (u8 *) h[0]);
+ e[0] =
+ vnet_classify_find_entry_inline (t[0], (u8 *) h[0],
+ hash[0], now);
+ if (e[0])
+ {
+ vnet_buffer (b[0])->l2_classify.opaque_index
+ = e[0]->opaque_index;
+ vlib_buffer_advance (b[0], e[0]->advance);
+ _next[0] = (e[0]->next_index < n_next_nodes) ?
+ e[0]->next_index : _next[0];
+ hits++;
+ chain_hits++;
+
+ if (is_ip4)
+ error[0] = (_next[0] == ACL_NEXT_INDEX_DENY) ?
+ (is_output ? IP4_ERROR_OUTACL_SESSION_DENY :
+ IP4_ERROR_INACL_SESSION_DENY) : IP4_ERROR_NONE;
+ else
+ error[0] = (_next[0] == ACL_NEXT_INDEX_DENY) ?
+ (is_output ? IP6_ERROR_OUTACL_SESSION_DENY :
+ IP6_ERROR_INACL_SESSION_DENY) : IP6_ERROR_NONE;
+ b[0]->error = error_node->errors[error[0]];
+
+ if (!is_output)
+ {
+ if (e[0]->action ==
+ CLASSIFY_ACTION_SET_IP4_FIB_INDEX
+ || e[0]->action ==
+ CLASSIFY_ACTION_SET_IP6_FIB_INDEX)
+ vnet_buffer (b[0])->sw_if_index[VLIB_TX] =
+ e[0]->metadata;
+ else if (e[0]->action ==
+ CLASSIFY_ACTION_SET_METADATA)
+ vnet_buffer (b[0])->ip.adj_index[VLIB_TX] =
+ e[0]->metadata;
+ }
+ break;
+ }
+ }
+ }