openvswitch: Userspace tunneling.
[cascardo/ovs.git] / lib / netdev.h
index c6249c4..c5aa17d 100644 (file)
@@ -21,6 +21,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include "openvswitch/types.h"
+#include "packets.h"
 
 #ifdef  __cplusplus
 extern "C" {
@@ -69,6 +70,7 @@ struct in_addr;
 struct in6_addr;
 struct smap;
 struct sset;
+struct ovs_action_push_tnl;
 
 /* Network device statistics.
  *
@@ -162,6 +164,7 @@ const char *netdev_get_type_from_name(const char *);
 int netdev_get_mtu(const struct netdev *, int *mtup);
 int netdev_set_mtu(const struct netdev *, int mtu);
 int netdev_get_ifindex(const struct netdev *);
+int netdev_set_multiq(struct netdev *, unsigned int n_txq, unsigned int n_rxq);
 
 /* Packet reception. */
 int netdev_rxq_open(struct netdev *, struct netdev_rxq **, int id);
@@ -179,9 +182,16 @@ int netdev_send(struct netdev *, int qid, struct dpif_packet **, int cnt,
                 bool may_steal);
 void netdev_send_wait(struct netdev *, int qid);
 
+int netdev_build_header(const struct netdev *, struct ovs_action_push_tnl *data);
+int netdev_push_header(const struct netdev *netdev,
+                       struct dpif_packet **buffers, int cnt,
+                       const struct ovs_action_push_tnl *data);
+int netdev_pop_header(struct netdev *netdev, struct dpif_packet **buffers,
+                      int cnt);
+
 /* Hardware address. */
-int netdev_set_etheraddr(struct netdev *, const uint8_t mac[6]);
-int netdev_get_etheraddr(const struct netdev *, uint8_t mac[6]);
+int netdev_set_etheraddr(struct netdev *, const uint8_t mac[ETH_ADDR_LEN]);
+int netdev_get_etheraddr(const struct netdev *, uint8_t mac[ETH_ADDR_LEN]);
 
 /* PHY interface. */
 bool netdev_get_carrier(const struct netdev *);
@@ -245,13 +255,13 @@ int netdev_add_router(struct netdev *, struct in_addr router);
 int netdev_get_next_hop(const struct netdev *, const struct in_addr *host,
                         struct in_addr *next_hop, char **);
 int netdev_get_status(const struct netdev *, struct smap *);
-int netdev_arp_lookup(const struct netdev *, ovs_be32 ip, uint8_t mac[6]);
+int netdev_arp_lookup(const struct netdev *, ovs_be32 ip,
+                      uint8_t mac[ETH_ADDR_LEN]);
 
 struct netdev *netdev_find_dev_by_in4(const struct in_addr *);
 
 /* Statistics. */
 int netdev_get_stats(const struct netdev *, struct netdev_stats *);
-int netdev_set_stats(struct netdev *, const struct netdev_stats *);
 
 /* Quality of service. */
 struct netdev_qos_capabilities {
@@ -325,6 +335,7 @@ int netdev_dump_queue_stats(const struct netdev *,
                             netdev_dump_queue_stats_cb *, void *aux);
 
 enum { NETDEV_MAX_RX_BATCH = 256 };     /* Maximum number packets in rx_recv() batch. */
+extern struct seq *tnl_conf_seq;
 
 #ifdef  __cplusplus
 }