20#ifndef CLICK_FLOWRULEPARSER_H
21#define CLICK_FLOWRULEPARSER_H
31#include <rte_version.h>
35#include <rte_malloc.h>
36#include <rte_ethdev.h>
39#include <cmdline_parse.h>
49#define PORTID_T_DEFINED
58extern struct rte_port *ports;
63static struct rte_port *get_ports() {
70static struct rte_port *get_port(
const portid_t &port_id) {
73 "DPDK Flow Parser (port %u): Unallocated DPDK ports\n",
81 "DPDK Flow Parser (port %u): Invalid port identifier\n",
87 return &ports[port_id];
96extern cmdline_parse_ctx_t main_ctx[];
102static cmdline_parse_ctx_t *cmdline_get_ctx() {
111struct cmdline *cmdline_new(
112 cmdline_parse_ctx_t *ctx,
133#define FLOWRULEPARSER_ERROR ((int)-1)
134#define FLOWRULEPARSER_SUCCESS ((int) 0)
148 ports = (
struct rte_port *) rte_zmalloc(
"fastclick: ports",
149 sizeof(
struct rte_port) * RTE_MAX_ETHPORTS,
150 RTE_CACHE_LINE_SIZE);
152 rte_exit(EXIT_FAILURE,
"rte_zmalloc(%d struct rte_port) failed\n", RTE_MAX_ETHPORTS);
162struct cmdline *flow_rule_parser_init(
175struct cmdline *flow_rule_parser_alloc(
188char *flow_rule_parser_parse_new_line(
char *line,
int n,
const char **input_cmd);
199int flow_rule_parser_parse(
struct cmdline *cl,
const char *input_cmd,
ErrorHandler *errh);
Error reporting class.
Definition error.hh:90