X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_net%2Frte_gre.h;fp=lib%2Flibrte_vhost%2Fvhost_user%2Fvirtio-net-user.h;h=46568ff57421498adabb314d183b421882eeee13;hb=3d9b72106bd664b1267533e7278ff817f942e3c6;hp=e1b967b828005f49bff21ab14852989a94254d4d;hpb=a83862b166241910d0474f801cb2e6afa4c6875b;p=deb_dpdk.git diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.h b/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 e1b967b8..46568ff5 100644 --- a/lib/librte_vhost/vhost_user/virtio-net-user.h +++ b/lib/librte_net/rte_gre.h @@ -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 @@ -31,32 +30,42 @@ * 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 +#include -#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_ */