X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fpackets.h;h=e6b330380b519d47888fb168b9e0218f26ea0407;hb=7685b7a9e5b3f6db6832e52e111000ff36d3acb4;hp=ce089bcf33e7100f6e4f9fd8c804bab4f821ae27;hpb=c56fac1b678101b189e16f0462556c992feeffdc;p=sliver-openvswitch.git diff --git a/lib/packets.h b/lib/packets.h index ce089bcf3..e6b330380 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -36,11 +36,17 @@ struct pkt_metadata { struct flow_tnl tunnel; /* Encapsulating tunnel parameters. */ uint32_t skb_priority; /* Packet priority for QoS. */ uint32_t pkt_mark; /* Packet mark. */ - odp_port_t in_port; /* Input port. */ + union flow_in_port in_port; /* Input port. */ }; #define PKT_METADATA_INITIALIZER(PORT) \ - (struct pkt_metadata){ { 0, 0, 0, 0, 0, 0}, 0, 0, (PORT) } + (struct pkt_metadata){ { 0, 0, 0, 0, 0, 0}, 0, 0, {(PORT)} } + +void pkt_metadata_init(struct pkt_metadata *md, const struct flow_tnl *tnl, + const uint32_t skb_priority, + const uint32_t pkt_mark, + const union flow_in_port *in_port); +void pkt_metadata_from_flow(struct pkt_metadata *md, const struct flow *flow); bool dpid_from_string(const char *s, uint64_t *dpidp); @@ -154,8 +160,6 @@ void compose_rarp(struct ofpbuf *, const uint8_t eth_src[ETH_ADDR_LEN]); void eth_push_vlan(struct ofpbuf *, ovs_be16 tpid, ovs_be16 tci); void eth_pop_vlan(struct ofpbuf *); -void set_ethertype(struct ofpbuf *packet, ovs_be16 eth_type); - const char *eth_from_hex(const char *hex, struct ofpbuf **packetp); void eth_format_masked(const uint8_t eth[ETH_ADDR_LEN], const uint8_t mask[ETH_ADDR_LEN], struct ds *s);