const struct cls_field cls_fields[CLS_N_FIELDS + 1] = {
#define CLS_FIELD(WILDCARDS, MEMBER, NAME) \
- { offsetof(flow_t, MEMBER), \
- sizeof ((flow_t *)0)->MEMBER, \
+ { offsetof(struct flow, MEMBER), \
+ sizeof ((struct flow *)0)->MEMBER, \
WILDCARDS, \
#NAME },
CLS_FIELDS
#undef CLS_FIELD
- { sizeof(flow_t), 0, 0, "exact" },
+ { sizeof(struct flow), 0, 0, "exact" },
};
-static uint32_t hash_fields(const flow_t *, int table_idx);
-static bool equal_fields(const flow_t *, const flow_t *, int table_idx);
+static uint32_t hash_fields(const struct flow *, int table_idx);
+static bool equal_fields(const struct flow *, const struct flow *,
+ int table_idx);
static int table_idx_from_wildcards(uint32_t wildcards);
static struct cls_rule *table_insert(struct hmap *, struct cls_rule *);
static struct cls_rule *search_table(const struct hmap *table, int field_idx,
const struct cls_rule *);
static struct cls_rule *search_exact_table(const struct classifier *,
- size_t hash, const flow_t *);
+ size_t hash, const struct flow *);
static bool rules_match_1wild(const struct cls_rule *fixed,
const struct cls_rule *wild, int field_idx);
static bool rules_match_2wild(const struct cls_rule *wild1,
/* Converts the flow in 'flow' into a cls_rule in 'rule', with the given
* 'wildcards' and 'priority'.*/
void
-cls_rule_from_flow(const flow_t *flow, uint32_t wildcards,
+cls_rule_from_flow(const struct flow *flow, uint32_t wildcards,
unsigned int priority, struct cls_rule *rule)
{
rule->flow = *flow;
* rules added more recently take priority over rules added less recently, but
* this is subject to change and should not be depended upon.) */
struct cls_rule *
-classifier_lookup(const struct classifier *cls, const flow_t *flow)
+classifier_lookup(const struct classifier *cls, const struct flow *flow)
{
struct cls_rule *rule = classifier_lookup_exact(cls, flow);
if (!rule) {
}
struct cls_rule *
-classifier_lookup_exact(const struct classifier *cls, const flow_t *flow)
+classifier_lookup_exact(const struct classifier *cls, const struct flow *flow)
{
return (!hmap_is_empty(&cls->exact_table)
? search_exact_table(cls, flow_hash(flow, 0), flow)
}
struct cls_rule *
-classifier_lookup_wild(const struct classifier *cls, const flow_t *flow)
+classifier_lookup_wild(const struct classifier *cls, const struct flow *flow)
{
struct cls_rule *best = NULL;
if (cls->n_rules > hmap_count(&cls->exact_table)) {
struct cls_rule *
classifier_find_rule_exactly(const struct classifier *cls,
- const flow_t *target, uint32_t wildcards,
+ const struct flow *target, uint32_t wildcards,
unsigned int priority)
{
struct cls_bucket *bucket;
* Two rules are considered overlapping if a packet could match both. */
bool
classifier_rule_overlaps(const struct classifier *cls,
- const flow_t *target, uint32_t wildcards,
+ const struct flow *target, uint32_t wildcards,
unsigned int priority)
{
struct cls_rule target_rule;
}
\f
static struct cls_bucket *create_bucket(struct hmap *, size_t hash,
- const flow_t *fixed);
+ const struct flow *fixed);
static struct cls_rule *bucket_insert(struct cls_bucket *, struct cls_rule *);
static inline bool equal_bytes(const void *, const void *, size_t n);
* (CLS_F_IDX_*) are less than 'table_idx'. (If 'table_idx' is
* CLS_F_IDX_EXACT, hashes all the fields in 'flow'). */
static uint32_t
-hash_fields(const flow_t *flow, int table_idx)
+hash_fields(const struct flow *flow, int table_idx)
{
/* I just know I'm going to hell for writing code this way.
*
*
* Returns true if all the compared fields are equal, false otherwise. */
static bool
-equal_fields(const flow_t *a, const flow_t *b, int table_idx)
+equal_fields(const struct flow *a, const struct flow *b, int table_idx)
{
/* XXX The generated code could be better here. */
#define CLS_FIELD(WILDCARDS, MEMBER, NAME) \
/* Creates a bucket and inserts it in 'table' with the given 'hash' and 'fixed'
* values. Returns the new bucket. */
static struct cls_bucket *
-create_bucket(struct hmap *table, size_t hash, const flow_t *fixed)
+create_bucket(struct hmap *table, size_t hash, const struct flow *fixed)
{
struct cls_bucket *bucket = xmalloc(sizeof *bucket);
list_init(&bucket->rules);
* The compared field is the one with wildcard bit or bits 'field_wc', offset
* 'rule_ofs' within cls_rule's "fields" member, and length 'len', in bytes. */
static inline bool ALWAYS_INLINE
-field_matches(const flow_t *a_, const flow_t *b_,
+field_matches(const struct flow *a_, const struct flow *b_,
uint32_t wildcards, uint32_t nw_src_mask, uint32_t nw_dst_mask,
uint32_t field_wc, int ofs, int len)
{
case CLS_F_IDX_##NAME: \
if (!field_matches(&a->flow, &b->flow, \
wildcards, nw_src_mask, nw_dst_mask, \
- WILDCARDS, offsetof(flow_t, MEMBER), \
+ WILDCARDS, offsetof(struct flow, MEMBER), \
sizeof a->flow.MEMBER)) { \
return false; \
} \
static struct cls_rule *
search_exact_table(const struct classifier *cls, size_t hash,
- const flow_t *target)
+ const struct flow *target)
{
struct cls_rule *rule;
* performance (see above). To adjust the ordering, change the order of the
* lines. */
#define CLS_FIELDS \
- /* flow_t all-caps */ \
+ /* struct flow all-caps */ \
/* wildcard bit(s) member name name */ \
/* ----------------- ----------- -------- */ \
CLS_FIELD(OFPFW_IN_PORT, in_port, IN_PORT) \
/* Field information. */
struct cls_field {
- int ofs; /* Offset in flow_t. */
+ int ofs; /* Offset in struct flow. */
int len; /* Length in bytes. */
uint32_t wildcards; /* OFPFW_* bit or bits for this field. */
const char *name; /* Name (for debugging). */
struct cls_bucket {
struct hmap_node hmap_node; /* Within struct classifier 'tables'. */
struct list rules; /* In order from highest to lowest priority. */
- flow_t fixed; /* Values for fixed fields. */
+ struct flow fixed; /* Values for fixed fields. */
};
/* A flow classification rule.
struct list list; /* Within struct cls_bucket 'rules'. */
struct hmap_node hmap; /* Within struct classifier 'exact_table'. */
} node;
- flow_t flow; /* All field values. */
+ struct flow flow; /* All field values. */
struct flow_wildcards wc; /* Wildcards for fields. */
unsigned int priority; /* Larger numbers are higher priorities. */
unsigned int table_idx; /* Index into struct classifier 'tables'. */
};
-void cls_rule_from_flow(const flow_t *, uint32_t wildcards,
+void cls_rule_from_flow(const struct flow *, uint32_t wildcards,
unsigned int priority, struct cls_rule *);
void cls_rule_from_match(const struct ofp_match *, unsigned int priority,
bool tun_id_from_cookie, uint64_t cookie,
struct cls_rule *classifier_insert(struct classifier *, struct cls_rule *);
void classifier_insert_exact(struct classifier *, struct cls_rule *);
void classifier_remove(struct classifier *, struct cls_rule *);
-struct cls_rule *classifier_lookup(const struct classifier *, const flow_t *);
+struct cls_rule *classifier_lookup(const struct classifier *,
+ const struct flow *);
struct cls_rule *classifier_lookup_wild(const struct classifier *,
- const flow_t *);
+ const struct flow *);
struct cls_rule *classifier_lookup_exact(const struct classifier *,
- const flow_t *);
-bool classifier_rule_overlaps(const struct classifier *, const flow_t *,
+ const struct flow *);
+bool classifier_rule_overlaps(const struct classifier *, const struct flow *,
uint32_t wildcards, unsigned int priority);
typedef void cls_cb_func(struct cls_rule *, void *aux);
const struct cls_rule *,
int include, cls_cb_func *, void *aux);
struct cls_rule *classifier_find_rule_exactly(const struct classifier *,
- const flow_t *target,
+ const struct flow *target,
uint32_t wildcards,
unsigned int priority);
for (; cli->received < 50; cli->received++) {
const struct ip_header *ip;
const struct dhcp_header *dhcp;
- flow_t flow;
+ struct flow flow;
int error;
ofpbuf_clear(&b);
struct dp_netdev *dp = get_dp_netdev(dpif);
struct ofpbuf copy;
bool mutates;
- flow_t key;
+ struct flow key;
int error;
if (packet->size < ETH_HEADER_LEN || packet->size > UINT16_MAX) {
}
static void
-parse_vlan(struct ofpbuf *b, flow_t *flow)
+parse_vlan(struct ofpbuf *b, struct flow *flow)
{
struct qtag_prefix {
uint16_t eth_type; /* ETH_TYPE_VLAN */
*/
int
flow_extract(struct ofpbuf *packet, uint32_t tun_id, uint16_t in_port,
- flow_t *flow)
+ struct flow *flow)
{
struct ofpbuf b = *packet;
struct eth_header *eth;
* arguments must have been initialized through a call to flow_extract().
*/
void
-flow_extract_stats(const flow_t *flow, struct ofpbuf *packet,
+flow_extract_stats(const struct flow *flow, struct ofpbuf *packet,
struct odp_flow_stats *stats)
{
memset(stats, '\0', sizeof(*stats));
/* Extract 'flow' with 'wildcards' into the OpenFlow match structure
* 'match'. */
void
-flow_to_match(const flow_t *flow, uint32_t wildcards, bool tun_id_from_cookie,
- struct ofp_match *match)
+flow_to_match(const struct flow *flow, uint32_t wildcards,
+ bool tun_id_from_cookie, struct ofp_match *match)
{
if (!tun_id_from_cookie) {
wildcards &= OFPFW_ALL;
void
flow_from_match(const struct ofp_match *match, bool tun_id_from_cookie,
- uint64_t cookie, flow_t *flow, uint32_t *flow_wildcards)
+ uint64_t cookie, struct flow *flow, uint32_t *flow_wildcards)
{
uint32_t wildcards = ntohl(match->wildcards);
}
char *
-flow_to_string(const flow_t *flow)
+flow_to_string(const struct flow *flow)
{
struct ds ds = DS_EMPTY_INITIALIZER;
flow_format(&ds, flow);
}
void
-flow_format(struct ds *ds, const flow_t *flow)
+flow_format(struct ds *ds, const struct flow *flow)
{
ds_put_format(ds, "tunnel%08"PRIx32":in_port%04"PRIx16
":vlan%"PRIu16":pcp%"PRIu8
}
void
-flow_print(FILE *stream, const flow_t *flow)
+flow_print(FILE *stream, const struct flow *flow)
{
char *s = flow_to_string(flow);
fputs(s, stream);
struct ofp_match;
struct ofpbuf;
-typedef struct flow flow_t;
struct flow {
uint32_t tun_id; /* Encapsulating tunnel ID. */
uint32_t nw_src; /* IP source address. */
BUILD_ASSERT_DECL(sizeof(((struct flow *)0)->nw_tos) == 1);
BUILD_ASSERT_DECL(sizeof(struct flow) == FLOW_SIG_SIZE + FLOW_PAD_SIZE);
-int flow_extract(struct ofpbuf *, uint32_t tun_id, uint16_t in_port, flow_t *);
-void flow_extract_stats(const flow_t *flow, struct ofpbuf *packet,
+int flow_extract(struct ofpbuf *, uint32_t tun_id, uint16_t in_port,
+ struct flow *);
+void flow_extract_stats(const struct flow *flow, struct ofpbuf *packet,
struct odp_flow_stats *stats);
-void flow_to_match(const flow_t *, uint32_t wildcards, bool tun_id_cookie,
+void flow_to_match(const struct flow *, uint32_t wildcards, bool tun_id_cookie,
struct ofp_match *);
void flow_from_match(const struct ofp_match *, bool tun_id_from_cookie,
- uint64_t cookie, flow_t *, uint32_t *wildcards);
-char *flow_to_string(const flow_t *);
-void flow_format(struct ds *, const flow_t *);
-void flow_print(FILE *, const flow_t *);
-static inline int flow_compare(const flow_t *, const flow_t *);
-static inline bool flow_equal(const flow_t *, const flow_t *);
-static inline size_t flow_hash(const flow_t *, uint32_t basis);
+ uint64_t cookie, struct flow *, uint32_t *wildcards);
+char *flow_to_string(const struct flow *);
+void flow_format(struct ds *, const struct flow *);
+void flow_print(FILE *, const struct flow *);
+static inline int flow_compare(const struct flow *, const struct flow *);
+static inline bool flow_equal(const struct flow *, const struct flow *);
+static inline size_t flow_hash(const struct flow *, uint32_t basis);
static inline int
-flow_compare(const flow_t *a, const flow_t *b)
+flow_compare(const struct flow *a, const struct flow *b)
{
return memcmp(a, b, FLOW_SIG_SIZE);
}
static inline bool
-flow_equal(const flow_t *a, const flow_t *b)
+flow_equal(const struct flow *a, const struct flow *b)
{
return !flow_compare(a, b);
}
static inline size_t
-flow_hash(const flow_t *flow, uint32_t basis)
+flow_hash(const struct flow *flow, uint32_t basis)
{
return hash_bytes(flow, FLOW_SIG_SIZE, basis);
}
-/* Information on wildcards for a flow, as a supplement to flow_t. */
+/* Information on wildcards for a flow, as a supplement to struct flow. */
struct flow_wildcards {
uint32_t wildcards; /* enum ofp_flow_wildcards (in host order). */
uint32_t nw_src_mask; /* 1-bit in each significant nw_src bit. */
}
static uint16_t
-lswitch_choose_destination(struct lswitch *sw, const flow_t *flow)
+lswitch_choose_destination(struct lswitch *sw, const struct flow *flow)
{
uint16_t out_port;
size_t pkt_ofs, pkt_len;
struct ofpbuf pkt;
- flow_t flow;
+ struct flow flow;
/* Ignore packets sent via output to OFPP_CONTROLLER. This library never
* uses such an action. You never know what experiments might be going on,
ds_put_char(string, '\n');
if (verbosity > 0) {
- flow_t flow;
+ struct flow flow;
struct ofpbuf packet;
struct ofp_match match;
packet.data = (void *) op->data;
}
struct ofpbuf *
-make_flow_mod(uint16_t command, const flow_t *flow, size_t actions_len)
+make_flow_mod(uint16_t command, const struct flow *flow, size_t actions_len)
{
struct ofp_flow_mod *ofm;
size_t size = sizeof *ofm + actions_len;
}
struct ofpbuf *
-make_add_flow(const flow_t *flow, uint32_t buffer_id,
+make_add_flow(const struct flow *flow, uint32_t buffer_id,
uint16_t idle_timeout, size_t actions_len)
{
struct ofpbuf *out = make_flow_mod(OFPFC_ADD, flow, actions_len);
}
struct ofpbuf *
-make_del_flow(const flow_t *flow)
+make_del_flow(const struct flow *flow)
{
struct ofpbuf *out = make_flow_mod(OFPFC_DELETE_STRICT, flow, 0);
struct ofp_flow_mod *ofm = out->data;
}
struct ofpbuf *
-make_add_simple_flow(const flow_t *flow,
+make_add_simple_flow(const struct flow *flow,
uint32_t buffer_id, uint16_t out_port,
uint16_t idle_timeout)
{
void *put_openflow_xid(size_t openflow_len, uint8_t type, uint32_t xid,
struct ofpbuf *);
void update_openflow_length(struct ofpbuf *);
-struct ofpbuf *make_flow_mod(uint16_t command, const flow_t *,
+struct ofpbuf *make_flow_mod(uint16_t command, const struct flow *,
size_t actions_len);
-struct ofpbuf *make_add_flow(const flow_t *, uint32_t buffer_id,
+struct ofpbuf *make_add_flow(const struct flow *, uint32_t buffer_id,
uint16_t max_idle, size_t actions_len);
-struct ofpbuf *make_del_flow(const flow_t *);
-struct ofpbuf *make_add_simple_flow(const flow_t *,
+struct ofpbuf *make_del_flow(const struct flow *);
+struct ofpbuf *make_add_simple_flow(const struct flow *,
uint32_t buffer_id, uint16_t out_port,
uint16_t max_idle);
struct ofpbuf *make_packet_in(uint32_t buffer_id, uint16_t in_port,
fail_open_recover(struct fail_open *fo)
{
if (fail_open_is_active(fo)) {
- flow_t flow;
+ struct flow flow;
VLOG_WARN("No longer in fail-open mode");
fo->last_disconn_secs = 0;
bool open = disconn_secs >= trigger_duration(fo);
if (open) {
union ofp_action action;
- flow_t flow;
+ struct flow flow;
/* Set up a flow that matches every packet and directs them to
* OFPP_NORMAL. */
};
struct in_band_rule {
- flow_t flow;
+ struct flow flow;
uint32_t wildcards;
unsigned int priority;
};
/* Returns true if 'packet' should be sent to the local port regardless
* of the flow table. */
bool
-in_band_msg_in_hook(struct in_band *in_band, const flow_t *flow,
+in_band_msg_in_hook(struct in_band *in_band, const struct flow *flow,
const struct ofpbuf *packet)
{
if (!in_band) {
/* Returns true if the rule that would match 'flow' with 'actions' is
* allowed to be set up in the datapath. */
bool
-in_band_rule_check(struct in_band *in_band, const flow_t *flow,
+in_band_rule_check(struct in_band *in_band, const struct flow *flow,
const struct odp_actions *actions)
{
if (!in_band) {
void in_band_run(struct in_band *);
void in_band_wait(struct in_band *);
-bool in_band_msg_in_hook(struct in_band *, const flow_t *,
+bool in_band_msg_in_hook(struct in_band *, const struct flow *,
const struct ofpbuf *packet);
-bool in_band_rule_check(struct in_band *, const flow_t *,
+bool in_band_rule_check(struct in_band *, const struct flow *,
const struct odp_actions *);
void in_band_flushed(struct in_band *);
const union odp_action *actions;
struct ofpbuf payload;
size_t n_actions, n_outputs;
+ struct flow flow;
size_t min_size;
- flow_t flow;
size_t i;
/* Get odp_sflow_sample_header. */
static void hton_ofp_phy_port(struct ofp_phy_port *);
static int xlate_actions(const union ofp_action *in, size_t n_in,
- const flow_t *flow, struct ofproto *ofproto,
+ const struct flow *, struct ofproto *,
const struct ofpbuf *packet,
struct odp_actions *out, tag_type *tags,
bool *may_set_up_flow, uint16_t *nf_output_iface);
}
int
-ofproto_send_packet(struct ofproto *p, const flow_t *flow,
+ofproto_send_packet(struct ofproto *p, const struct flow *flow,
const union ofp_action *actions, size_t n_actions,
const struct ofpbuf *packet)
{
}
void
-ofproto_add_flow(struct ofproto *p,
- const flow_t *flow, uint32_t wildcards, unsigned int priority,
+ofproto_add_flow(struct ofproto *p, const struct flow *flow,
+ uint32_t wildcards, unsigned int priority,
const union ofp_action *actions, size_t n_actions,
int idle_timeout)
{
}
void
-ofproto_delete_flow(struct ofproto *ofproto, const flow_t *flow,
+ofproto_delete_flow(struct ofproto *ofproto, const struct flow *flow,
uint32_t wildcards, unsigned int priority)
{
struct rule *rule;
* Takes ownership of 'packet'. */
static void
rule_execute(struct ofproto *ofproto, struct rule *rule,
- struct ofpbuf *packet, const flow_t *flow)
+ struct ofpbuf *packet, const struct flow *flow)
{
const union odp_action *actions;
struct odp_flow_stats stats;
/* Send the packet and credit it to the rule. */
if (packet) {
- flow_t flow;
+ struct flow flow;
flow_extract(packet, 0, in_port, &flow);
rule_execute(p, rule, packet, &flow);
}
static struct rule *
rule_create_subrule(struct ofproto *ofproto, struct rule *rule,
- const flow_t *flow)
+ const struct flow *flow)
{
struct rule *subrule = rule_create(ofproto, rule, NULL, 0,
rule->idle_timeout, rule->hard_timeout,
struct action_xlate_ctx {
/* Input. */
- flow_t flow; /* Flow to which these actions correspond. */
+ struct flow flow; /* Flow to which these actions correspond. */
int recurse; /* Recursion level, via xlate_table_action. */
struct ofproto *ofproto;
const struct ofpbuf *packet; /* The packet corresponding to 'flow', or a
}
static struct rule *
-lookup_valid_rule(struct ofproto *ofproto, const flow_t *flow)
+lookup_valid_rule(struct ofproto *ofproto, const struct flow *flow)
{
struct rule *rule;
rule = rule_from_cls_rule(classifier_lookup(&ofproto->cls, flow));
static int
xlate_actions(const union ofp_action *in, size_t n_in,
- const flow_t *flow, struct ofproto *ofproto,
+ const struct flow *flow, struct ofproto *ofproto,
const struct ofpbuf *packet,
struct odp_actions *out, tag_type *tags, bool *may_set_up_flow,
uint16_t *nf_output_iface)
struct ofp_packet_out *opo;
struct ofpbuf payload, *buffer;
struct odp_actions actions;
+ struct flow flow;
int n_actions;
uint16_t in_port;
- flow_t flow;
int error;
error = reject_slave_controller(ofconn, oh);
int error;
if (ofm->flags & htons(OFPFF_CHECK_OVERLAP)) {
- flow_t flow;
+ struct flow flow;
uint32_t wildcards;
flow_from_match(&ofm->match, p->tun_id_from_cookie, ofm->cookie,
find_flow_strict(struct ofproto *p, const struct ofp_flow_mod *ofm)
{
uint32_t wildcards;
- flow_t flow;
+ struct flow flow;
flow_from_match(&ofm->match, p->tun_id_from_cookie, ofm->cookie,
&flow, &wildcards);
{
struct ofpbuf *packet;
uint16_t in_port;
- flow_t flow;
+ struct flow flow;
int error;
if (ofm->buffer_id == htonl(UINT32_MAX)) {
struct odp_msg *msg = packet->data;
struct rule *rule;
struct ofpbuf payload;
- flow_t flow;
+ struct flow flow;
payload.data = msg + 1;
payload.size = msg->length - sizeof *msg;
for (i = 0; i < n_flows; i++) {
struct odp_flow *f = &flows[i];
struct rule *rule;
- flow_t flow;
+ struct flow flow;
odp_flow_key_to_flow(&f->key, &flow);
static bool
revalidate_rule(struct ofproto *p, struct rule *rule)
{
- const flow_t *flow = &rule->cr.flow;
+ const struct flow *flow = &rule->cr.flow;
COVERAGE_INC(ofproto_revalidate_rule);
if (rule->super) {
}
\f
static bool
-default_normal_ofhook_cb(const flow_t *flow, const struct ofpbuf *packet,
+default_normal_ofhook_cb(const struct flow *flow, const struct ofpbuf *packet,
struct odp_actions *actions, tag_type *tags,
uint16_t *nf_output_iface, void *ofproto_)
{
struct svec;
struct ofexpired {
- flow_t flow;
+ struct flow flow;
uint64_t packet_count; /* Packets from subrules. */
uint64_t byte_count; /* Bytes from subrules. */
long long int used; /* Last-used time (0 if never used). */
void ofproto_get_all_flows(struct ofproto *p, struct ds *);
/* Functions for use by ofproto implementation modules, not by clients. */
-int ofproto_send_packet(struct ofproto *, const flow_t *,
+int ofproto_send_packet(struct ofproto *, const struct flow *,
const union ofp_action *, size_t n_actions,
const struct ofpbuf *);
-void ofproto_add_flow(struct ofproto *, const flow_t *, uint32_t wildcards,
- unsigned int priority,
+void ofproto_add_flow(struct ofproto *, const struct flow *,
+ uint32_t wildcards, unsigned int priority,
const union ofp_action *, size_t n_actions,
int idle_timeout);
-void ofproto_delete_flow(struct ofproto *, const flow_t *, uint32_t wildcards,
- unsigned int priority);
+void ofproto_delete_flow(struct ofproto *, const struct flow *,
+ uint32_t wildcards, unsigned int priority);
void ofproto_flush_flows(struct ofproto *);
/* Hooks for ovs-vswitchd. */
struct ofhooks {
- bool (*normal_cb)(const flow_t *, const struct ofpbuf *packet,
+ bool (*normal_cb)(const struct flow *, const struct ofpbuf *packet,
struct odp_actions *, tag_type *,
uint16_t *nf_output_iface, void *aux);
- void (*account_flow_cb)(const flow_t *, tag_type tags,
+ void (*account_flow_cb)(const struct flow *, tag_type tags,
const union odp_action *, size_t n_actions,
unsigned long long int n_bytes, void *aux);
void (*account_checkpoint_cb)(void *aux);
}
static bool
-match(const struct cls_rule *wild, const flow_t *fixed)
+match(const struct cls_rule *wild, const struct flow *fixed)
{
int f_idx;
}
static struct cls_rule *
-tcls_lookup(const struct tcls *cls, const flow_t *flow, int include)
+tcls_lookup(const struct tcls *cls, const struct flow *flow, int include)
{
size_t i;
static struct cls_rule *
lookup_with_include_bits(const struct classifier *cls,
- const flow_t *flow, int include)
+ const struct flow *flow, int include)
{
switch (include) {
case CLS_INC_WILD:
assert(classifier_count_exact(cls) == tcls_count_exact(tcls));
for (i = 0; i < confidence; i++) {
struct cls_rule *cr0, *cr1;
- flow_t flow;
+ struct flow flow;
unsigned int x;
int include;
const struct cls_field *f;
struct test_rule *rule;
uint32_t wildcards;
- flow_t flow;
+ struct flow flow;
wildcards = 0;
memset(&flow, 0, sizeof flow);
while (fread(&expected_match, sizeof expected_match, 1, flows)) {
struct ofpbuf *packet;
struct ofp_match extracted_match;
- flow_t flow;
+ struct flow flow;
n++;
if (!n_controllers
&& ofproto_get_fail_mode(br->ofproto) == OFPROTO_FAIL_STANDALONE) {
union ofp_action action;
- flow_t flow;
+ struct flow flow;
memset(&action, 0, sizeof action);
action.type = htons(OFPAT_OUTPUT);
}
static bool
-set_dst(struct dst *p, const flow_t *flow,
+set_dst(struct dst *p, const struct flow *flow,
const struct port *in_port, const struct port *out_port,
tag_type *tags)
{
}
static size_t
-compose_dsts(const struct bridge *br, const flow_t *flow, uint16_t vlan,
+compose_dsts(const struct bridge *br, const struct flow *flow, uint16_t vlan,
const struct port *in_port, const struct port *out_port,
struct dst dsts[], tag_type *tags, uint16_t *nf_output_iface)
{
}
static void
-compose_actions(struct bridge *br, const flow_t *flow, uint16_t vlan,
+compose_actions(struct bridge *br, const struct flow *flow, uint16_t vlan,
const struct port *in_port, const struct port *out_port,
tag_type *tags, struct odp_actions *actions,
uint16_t *nf_output_iface)
* 802.1Q header and implicitly tagged ports. A value of 0 indicates that
* the packet is untagged and -1 indicates it has an invalid header and
* should be dropped. */
-static int flow_get_vlan(struct bridge *br, const flow_t *flow,
+static int flow_get_vlan(struct bridge *br, const struct flow *flow,
struct port *in_port, bool have_packet)
{
/* Note that dl_vlan of 0 and of OFP_VLAN_NONE both mean that the packet
* migration. Older Citrix-patched Linux DomU used gratuitous ARP replies to
* indicate this; newer upstream kernels use gratuitous ARP requests. */
static bool
-is_gratuitous_arp(const flow_t *flow)
+is_gratuitous_arp(const struct flow *flow)
{
return (flow->dl_type == htons(ETH_TYPE_ARP)
&& eth_addr_is_broadcast(flow->dl_dst)
}
static void
-update_learning_table(struct bridge *br, const flow_t *flow, int vlan,
+update_learning_table(struct bridge *br, const struct flow *flow, int vlan,
struct port *in_port)
{
enum grat_arp_lock_type lock_type;
* so in one special case.
*/
static bool
-is_admissible(struct bridge *br, const flow_t *flow, bool have_packet,
+is_admissible(struct bridge *br, const struct flow *flow, bool have_packet,
tag_type *tags, int *vlanp, struct port **in_portp)
{
struct iface *in_iface;
* returns true. Otherwise, the actions should only be applied to 'packet', or
* not at all, if 'packet' was NULL. */
static bool
-process_flow(struct bridge *br, const flow_t *flow,
+process_flow(struct bridge *br, const struct flow *flow,
const struct ofpbuf *packet, struct odp_actions *actions,
tag_type *tags, uint16_t *nf_output_iface)
{
}
static bool
-bridge_normal_ofhook_cb(const flow_t *flow, const struct ofpbuf *packet,
+bridge_normal_ofhook_cb(const struct flow *flow, const struct ofpbuf *packet,
struct odp_actions *actions, tag_type *tags,
uint16_t *nf_output_iface, void *br_)
{
}
static void
-bridge_account_flow_ofhook_cb(const flow_t *flow, tag_type tags,
+bridge_account_flow_ofhook_cb(const struct flow *flow, tag_type tags,
const union odp_action *actions,
size_t n_actions, unsigned long long int n_bytes,
void *br_)
union ofp_action actions[2], *a;
uint16_t dp_ifidx;
tag_type tags = 0;
- flow_t flow;
+ struct flow flow;
int retval;
if (e->port == port->port_idx