return retval;
}
+void
+flow_fill_match(struct ofp_match *to, const struct flow *from,
+ uint32_t wildcards)
+{
+ to->wildcards = htonl(wildcards);
+ to->in_port = from->in_port;
+ to->dl_vlan = from->dl_vlan;
+ memcpy(to->dl_src, from->dl_src, ETH_ADDR_LEN);
+ memcpy(to->dl_dst, from->dl_dst, ETH_ADDR_LEN);
+ to->dl_type = from->dl_type;
+ to->nw_src = from->nw_src;
+ to->nw_dst = from->nw_dst;
+ to->nw_proto = from->nw_proto;
+ to->tp_src = from->tp_src;
+ to->tp_dst = from->tp_dst;
+ to->pad = 0;
+}
+
void
flow_print(FILE *stream, const struct flow *flow)
{
#include "hash.h"
#include "util.h"
+struct ofp_match;
struct ofpbuf;
/* Identification data for a flow.
BUILD_ASSERT_DECL(sizeof(struct flow) == 32);
int flow_extract(struct ofpbuf *, uint16_t in_port, struct flow *);
+void flow_fill_match(struct ofp_match *, const struct flow *,
+ uint32_t wildcards);
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 *);
nfe->header.vendor = htonl(NX_VENDOR_ID);
nfe->header.subtype = htonl(NXT_FLOW_END);
- flow_fill_match(&nfe->match, &flow->key);
+ flow_fill_match(&nfe->match, &flow->key.flow, flow->key.wildcards);
nfe->priority = htons(flow->priority);
nfe->reason = reason;
-/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford
+/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford
* Junior University
*
* We are making the OpenFlow specification and associated documentation
to->nw_dst_mask = make_nw_mask(to->wildcards >> OFPFW_NW_DST_SHIFT);
}
-void
-flow_fill_match(struct ofp_match* to, const struct sw_flow_key* from)
-{
- to->wildcards = htonl(from->wildcards);
- to->in_port = from->flow.in_port;
- to->dl_vlan = from->flow.dl_vlan;
- memcpy(to->dl_src, from->flow.dl_src, ETH_ADDR_LEN);
- memcpy(to->dl_dst, from->flow.dl_dst, ETH_ADDR_LEN);
- to->dl_type = from->flow.dl_type;
- to->nw_src = from->flow.nw_src;
- to->nw_dst = from->flow.nw_dst;
- to->nw_proto = from->flow.nw_proto;
- to->tp_src = from->flow.tp_src;
- to->tp_dst = from->flow.tp_dst;
- to->pad = 0;
-}
-
/* Allocates and returns a new flow with room for 'actions_len' actions.
* Returns the new flow or a null pointer on failure. */
struct sw_flow *
-/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford
+/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford
* Junior University
*
* We are making the OpenFlow specification and associated documentation
void flow_replace_acts(struct sw_flow *, const struct ofp_action_header *,
size_t);
void flow_extract_match(struct sw_flow_key* to, const struct ofp_match* from);
-void flow_fill_match(struct ofp_match* to, const struct sw_flow_key* from);
void print_flow(const struct sw_flow_key *);
bool flow_timeout(struct sw_flow *flow);