diff options
author | Ethan Jackson <ethan@nicira.com> | 2012-01-04 16:40:13 -0800 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2012-01-10 14:30:15 -0800 |
commit | 5d6c3af0fbff6c67f36c34f6e4c885f54de1bfe3 (patch) | |
tree | 8ac4ee5ca06cca57684f8a71c5638e7d3f4192de /lib/flow.c | |
parent | c97664b30f65d3a087076cb33242ffe2cc52a814 (diff) |
flow: Create new flow_metadata structure for packet_in messages.
This will ease the implementation of future patches.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/flow.c')
-rw-r--r-- | lib/flow.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -507,6 +507,19 @@ flow_zero_wildcards(struct flow *flow, const struct flow_wildcards *wildcards) flow->skb_priority = 0; } +/* Initializes 'fmd' with the metadata found in 'flow'. */ +void +flow_get_metadata(const struct flow *flow, struct flow_metadata *fmd) +{ + fmd->tun_id = flow->tun_id; + fmd->tun_id_mask = htonll(UINT64_MAX); + + memcpy(fmd->regs, flow->regs, sizeof fmd->regs); + memset(fmd->reg_masks, 0xff, sizeof fmd->reg_masks); + + fmd->in_port = flow->in_port; +} + char * flow_to_string(const struct flow *flow) { |