summaryrefslogtreecommitdiff
path: root/accel-dp/dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'accel-dp/dev.h')
-rw-r--r--accel-dp/dev.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/accel-dp/dev.h b/accel-dp/dev.h
new file mode 100644
index 0000000..1039a17
--- /dev/null
+++ b/accel-dp/dev.h
@@ -0,0 +1,33 @@
+#ifndef __NET_DEVICE_H
+#define __NET_DEVICE_H
+
+#ifndef IFNAMSIZ
+#define IFNAMSIZ 16
+#endif
+
+struct rte_mbuf;
+
+struct net_device {
+ char name[IFNAMSIZ];
+ int index;
+
+ unsigned char hwaddr[6];
+
+ int refs;
+
+ void (*xmit)(struct rte_mbuf *mbuf, struct net_device *dev);
+ void (*destructor)(struct net_device *dev);
+};
+
+struct net_device *netdev_get_by_index(int id);
+void netdev_put(struct net_device *dev);
+void netdev_free(struct net_device *dev);
+struct net_device *netdev_alloc(const char *name, int priv_size, void (*setup)(struct net_device *dev));
+void netdev_unregister(struct net_device *dev);
+
+static inline void *netdev_priv(struct net_device *dev)
+{
+ return dev + 1;
+}
+
+#endif