X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fodp-util.h;h=2712cb007583513579621e93dffd6705c2a77c63;hb=0a37839c03307cc4cc726d27a7348c05d469c5eb;hp=0c10cfa27aeb0c3a282a6cea6305d40ad8191b38;hpb=661cbcd54f0030e9f2c9b27b652b987ae5e8aa18;p=sliver-openvswitch.git diff --git a/lib/odp-util.h b/lib/odp-util.h index 0c10cfa27..2712cb007 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -23,6 +23,7 @@ #include #include #include "hash.h" +#include "hmap.h" #include "openflow/openflow.h" #include "util.h" @@ -42,6 +43,16 @@ void format_odp_actions(struct ds *, const struct nlattr *odp_actions, int odp_actions_from_string(const char *, const struct simap *port_names, struct ofpbuf *odp_actions); +/* A map from odp port number to its name. */ +struct odp_portno_names { + struct hmap_node hmap_node; /* A node in a port number to name hmap. */ + odp_port_t port_no; /* Port number in the datapath. */ + char *name; /* Name associated with the above 'port_no'. */ +}; + +void odp_portno_names_set(struct hmap *portno_names, odp_port_t port_no, + char *port_name); +void odp_portno_names_destroy(struct hmap *portno_names); /* The maximum number of bytes that odp_flow_key_from_flow() appends to a * buffer. This is the upper bound on the length of a nlattr-formatted flow * key that ovs-vswitchd fully understands. @@ -94,7 +105,8 @@ enum odp_key_fitness odp_tun_key_from_attr(const struct nlattr *, void odp_flow_format(const struct nlattr *key, size_t key_len, const struct nlattr *mask, size_t mask_len, - struct ds *); + const struct hmap *portno_names, struct ds *, + bool verbose); void odp_flow_key_format(const struct nlattr *, size_t, struct ds *); int odp_flow_from_string(const char *s, const struct simap *port_names, @@ -122,13 +134,16 @@ enum odp_key_fitness { }; enum odp_key_fitness odp_flow_key_to_flow(const struct nlattr *, size_t, struct flow *); +enum odp_key_fitness odp_flow_key_to_mask(const struct nlattr *key, size_t len, + struct flow *mask, + const struct flow *flow); const char *odp_key_fitness_to_string(enum odp_key_fitness); void commit_odp_tunnel_action(const struct flow *, struct flow *base, struct ofpbuf *odp_actions); void commit_odp_actions(const struct flow *, struct flow *base, - struct ofpbuf *odp_actions, - struct flow_wildcards *wc); + struct ofpbuf *odp_actions, struct flow_wildcards *wc, + int *mpls_depth_delta); /* ofproto-dpif interface. * @@ -181,7 +196,7 @@ size_t odp_put_userspace_action(uint32_t pid, struct ofpbuf *odp_actions); void odp_put_tunnel_action(const struct flow_tnl *tunnel, struct ofpbuf *odp_actions); -void odp_put_skb_mark_action(const uint32_t skb_mark, +void odp_put_pkt_mark_action(const uint32_t pkt_mark, struct ofpbuf *odp_actions); /* Reasons why a subfacet might not be fast-pathable. */