X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fflow.h;h=603c4aceb1b65e30f989ca3740143da1923440dc;hb=b8dcf5e9c554e2c5fc35a68a086d304fc0cea59a;hp=35415057c52f18482d7c2f1012051e6574aa968d;hpb=a14bc59fb8f27db193d74662dc9c5cb8237177ef;p=sliver-openvswitch.git diff --git a/lib/flow.h b/lib/flow.h index 35415057c..603c4aceb 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,14 @@ #ifndef FLOW_H #define FLOW_H 1 +#include #include #include #include #include +#include "openflow/nicira-ext.h" #include "openflow/openflow.h" #include "hash.h" -#include "openflow/openflow.h" #include "openvswitch/datapath-protocol.h" #include "util.h" @@ -32,11 +33,13 @@ struct ofpbuf; typedef struct odp_flow_key flow_t; -int flow_extract(struct ofpbuf *, 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, flow_t *); +void flow_extract_stats(const flow_t *flow, struct ofpbuf *packet, struct odp_flow_stats *stats); -void flow_to_match(const flow_t *, uint32_t wildcards, struct ofp_match *); -void flow_from_match(flow_t *, uint32_t *wildcards, const struct ofp_match *); +void flow_to_match(const flow_t *, 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 *); @@ -93,7 +96,7 @@ flow_nw_bits_to_mask(uint32_t wildcards, int shift) static inline void flow_wildcards_init(struct flow_wildcards *wc, uint32_t wildcards) { - wc->wildcards = wildcards & OFPFW_ALL; + wc->wildcards = wildcards & OVSFW_ALL; wc->nw_src_mask = flow_nw_bits_to_mask(wc->wildcards, OFPFW_NW_SRC_SHIFT); wc->nw_dst_mask = flow_nw_bits_to_mask(wc->wildcards, OFPFW_NW_DST_SHIFT); }