X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=net%2Fopenvswitch%2Fvport.h;h=bdfd82a7c064948dc1dc83acbc85b6534c1bcf9b;hb=527d1529e38b36fd22e65711b653ab773179d9e8;hp=d341ad6f3afe5734f587c1df347fd72dc2ba2c38;hpb=5062ecdb662bf3aed6dc975019c53ffcd3b01d1c;p=cascardo%2Flinux.git diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index d341ad6f3afe..bdfd82a7c064 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -140,7 +140,7 @@ struct vport_ops { int (*set_options)(struct vport *, struct nlattr *); int (*get_options)(const struct vport *, struct sk_buff *); - void (*send)(struct vport *, struct sk_buff *); + netdev_tx_t (*send) (struct sk_buff *skb); struct module *owner; struct list_head list; }; @@ -199,9 +199,25 @@ static inline const char *ovs_vport_name(struct vport *vport) int ovs_vport_ops_register(struct vport_ops *ops); void ovs_vport_ops_unregister(struct vport_ops *ops); -static inline void ovs_vport_send(struct vport *vport, struct sk_buff *skb) +static inline struct rtable *ovs_tunnel_route_lookup(struct net *net, + const struct ip_tunnel_key *key, + u32 mark, + struct flowi4 *fl, + u8 protocol) { - vport->ops->send(vport, skb); + struct rtable *rt; + + memset(fl, 0, sizeof(*fl)); + fl->daddr = key->u.ipv4.dst; + fl->saddr = key->u.ipv4.src; + fl->flowi4_tos = RT_TOS(key->tos); + fl->flowi4_mark = mark; + fl->flowi4_proto = protocol; + + rt = ip_route_output_key(net, fl); + return rt; } +void ovs_vport_send(struct vport *vport, struct sk_buff *skb); + #endif /* vport.h */