Imported Upstream version 16.11
[deb_dpdk.git] / lib / librte_net / rte_gre.h
similarity index 62%
rename from lib/librte_vhost/vhost_user/virtio-net-user.h
rename to lib/librte_net/rte_gre.h
index e1b967b..46568ff 100644 (file)
@@ -1,8 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   All rights reserved.
+ *   Copyright 2016 6WIND S.A.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _VIRTIO_NET_USER_H
-#define _VIRTIO_NET_USER_H
+#ifndef _RTE_GRE_H_
+#define _RTE_GRE_H_
 
-#include "vhost-net.h"
-#include "vhost-net-user.h"
+#include <stdint.h>
+#include <rte_byteorder.h>
 
-#define VHOST_USER_PROTOCOL_F_MQ       0
-#define VHOST_USER_PROTOCOL_F_LOG_SHMFD        1
-#define VHOST_USER_PROTOCOL_F_RARP     2
-
-#define VHOST_USER_PROTOCOL_FEATURES   ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
-                                        (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) |\
-                                        (1ULL << VHOST_USER_PROTOCOL_F_RARP))
-
-int user_set_mem_table(int, struct VhostUserMsg *);
-
-void user_set_vring_call(int, struct VhostUserMsg *);
-
-void user_set_vring_kick(int, struct VhostUserMsg *);
-
-void user_set_protocol_features(int vid, uint64_t protocol_features);
-int user_set_log_base(int vid, struct VhostUserMsg *);
-int user_send_rarp(int vid, struct VhostUserMsg *);
-
-int user_get_vring_base(int, struct vhost_vring_state *);
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-int user_set_vring_enable(int vid, struct vhost_vring_state *state);
+/**
+ * GRE Header
+ */
+struct gre_hdr {
+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+       uint16_t res2:4; /**< Reserved */
+       uint16_t s:1;    /**< Sequence Number Present bit */
+       uint16_t k:1;    /**< Key Present bit */
+       uint16_t res1:1; /**< Reserved */
+       uint16_t c:1;    /**< Checksum Present bit */
+       uint16_t ver:3;  /**< Version Number */
+       uint16_t res3:5; /**< Reserved */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+       uint16_t c:1;    /**< Checksum Present bit */
+       uint16_t res1:1; /**< Reserved */
+       uint16_t k:1;    /**< Key Present bit */
+       uint16_t s:1;    /**< Sequence Number Present bit */
+       uint16_t res2:4; /**< Reserved */
+       uint16_t res3:5; /**< Reserved */
+       uint16_t ver:3;  /**< Version Number */
+#endif
+       uint16_t proto;  /**< Protocol Type */
+} __attribute__((__packed__));
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif /* RTE_GRE_H_ */