#include <stdlib.h>
#include "snippet_match_ipv4.h"
#include "../common.h"
void
{
if (queue == NULL)
fprintf(stderr, "Failed to allocate memory for queue\n");
}
void
snippet_ipv4_flow_create_patterns(
struct rte_flow_item *patterns)
{
if (ip_spec == NULL)
fprintf(stderr, "Failed to allocate memory for ip_spec\n");
if (ip_mask == NULL)
fprintf(stderr, "Failed to allocate memory for ip_mask\n");
ip_spec->
hdr.dst_addr = htonl(DEST_IP);
ip_mask->
hdr.dst_addr = FULL_MASK;
ip_spec->
hdr.src_addr = htonl(SRC_IP);
ip_mask->
hdr.src_addr = EMPTY_MASK;
patterns[1].
spec = ip_spec;
patterns[1].
mask = ip_mask;
}
static struct rte_flow_actions_template *
snippet_ipv4_flow_create_actions_template(uint16_t port_id,
struct rte_flow_error *error)
{
};
memcpy(masks, tactions, sizeof(masks));
tactions, masks, error);
}
static struct rte_flow_pattern_template *
snippet_ipv4_flow_create_pattern_template(uint16_t port_id,
struct rte_flow_error *error)
{
.ingress = 1
};
ip_mask.
hdr.src_addr = EMPTY_MASK;
ip_mask.
hdr.dst_addr = FULL_MASK;
titems[1].
mask = &ip_mask;
}
struct rte_flow_template_table *
snippet_ipv4_flow_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,
.egress = 0,
.transfer = 0,
.reserved = 0,
},
.nb_flows = 1,
};
pt = snippet_ipv4_flow_create_pattern_template(port_id, error);
if (pt == NULL) {
printf("Failed to create pattern template: %s (%s)\n",
return NULL;
}
at = snippet_ipv4_flow_create_actions_template(port_id, error);
if (at == NULL) {
printf("Failed to create actions template: %s (%s)\n",
return NULL;
}
}
const char * rte_strerror(int errnum)
__rte_experimental struct rte_flow_actions_template * rte_flow_actions_template_create(uint16_t port_id, const struct rte_flow_actions_template_attr *template_attr, const struct rte_flow_action actions[], const struct rte_flow_action masks[], struct rte_flow_error *error)
__rte_experimental struct rte_flow_template_table * rte_flow_template_table_create(uint16_t port_id, const struct rte_flow_template_table_attr *table_attr, struct rte_flow_pattern_template *pattern_templates[], uint8_t nb_pattern_templates, struct rte_flow_actions_template *actions_templates[], uint8_t nb_actions_templates, struct rte_flow_error *error)
@ RTE_FLOW_ACTION_TYPE_QUEUE
@ RTE_FLOW_ACTION_TYPE_END
__rte_experimental struct rte_flow_pattern_template * rte_flow_pattern_template_create(uint16_t port_id, const struct rte_flow_pattern_template_attr *template_attr, const struct rte_flow_item pattern[], struct rte_flow_error *error)
@ RTE_FLOW_ITEM_TYPE_IPV4
enum rte_flow_action_type type
enum rte_flow_item_type type
uint32_t relaxed_matching
struct rte_flow_attr flow_attr