#include <stdlib.h>
#include "../common.h"
#include "snippet_match_packet_type.h"
void
snippet_init_packet_type(void)
{
init_default_snippet();
}
void
snippet_match_packet_type_create_actions(
__rte_unused uint16_t port_id,
{
if (queue == NULL)
fprintf(stderr, "Failed to allocate memory for queue\n");
}
void
snippet_match_packet_type_create_patterns(
struct rte_flow_item *pattern)
{
if (ptype_spec == NULL)
fprintf(stderr, "Failed to allocate memory for ptype_spec\n");
if (ptype_mask == NULL)
fprintf(stderr, "Failed to allocate memory for ptype_mask\n");
pattern[0].
spec = ptype_spec;
pattern[0].
mask = ptype_mask;
}
static struct rte_flow_pattern_template *
snippet_match_packet_type_create_pattern_template(uint16_t port_id,
struct rte_flow_error *error)
{
.ingress = 1
};
titems[0].
mask = &ptype_mask;
}
static struct rte_flow_actions_template *
snippet_match_packet_type_create_actions_template(uint16_t port_id,
struct rte_flow_error *error)
{
};
memcpy(masks, tactions, sizeof(masks));
tactions, masks, error);
}
struct rte_flow_template_table *
snippet_match_packet_type_create_table(uint16_t port_id,
struct rte_flow_error *error)
{
struct rte_flow_pattern_template *pt;
struct rte_flow_actions_template *at;
.priority = 0,
.ingress = 1,
},
.nb_flows = 1,
};
pt = snippet_match_packet_type_create_pattern_template(port_id, error);
if (pt == NULL) {
printf("Failed to create pattern template: %s (%s)\n",
return NULL;
}
at = snippet_match_packet_type_create_actions_template(port_id, error);
if (at == NULL) {
printf("Failed to create actions template: %s (%s)\n",
return NULL;
}
}