From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0F316A051B;
	Wed, 10 Jun 2020 14:01:44 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 928E51BFAA;
	Wed, 10 Jun 2020 14:01:26 +0200 (CEST)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 5A09F1BFA2
 for <dev@dpdk.org>; Wed, 10 Jun 2020 14:01:25 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 fady@mellanox.com) with SMTP; 10 Jun 2020 15:00:46 +0300
Received: from l-wincomp04-vm.labs.mlnx (l-wincomp04-vm.mtl.labs.mlnx
 [10.237.1.5])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 05AC0iZF006240;
 Wed, 10 Jun 2020 15:00:45 +0300
From: Fady Bader <fady@mellanox.com>
To: dev@dpdk.org
Cc: fady@mellanox.com, thomas@monjalon.net, tbashar@mellanox.com,
 talshn@mellanox.com, yohadt@mellanox.com, dmitry.kozliuk@gmail.com,
 harini.ramakrishnan@microsoft.com, ocardona@microsoft.com,
 anand.rawat@intel.com, ranjit.menon@intel.com, olivier.matz@6wind.com
Date: Wed, 10 Jun 2020 15:00:40 +0300
Message-Id: <20200610120040.17968-4-fady@mellanox.com>
X-Mailer: git-send-email 2.16.1.windows.4
In-Reply-To: <20200610120040.17968-1-fady@mellanox.com>
References: <'20200610112326.18576-1-fady@mellanox.com'>
 <20200610120040.17968-1-fady@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 3/3] eal/windows: librte_net build on Windows
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

librte_net wasn't compiling under Windows.
To solve this, needed exports and files were added for Windows.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_eal/common/meson.build           |  1 +
 lib/librte_eal/rte_eal_exports.def          |  1 +
 lib/librte_eal/windows/include/netinet/in.h | 25 +++++++++++++++++++++++++
 lib/librte_eal/windows/include/netinet/ip.h | 11 +++++++++++
 lib/meson.build                             |  2 +-
 5 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_eal/windows/include/netinet/in.h
 create mode 100644 lib/librte_eal/windows/include/netinet/ip.h

diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
index e1bdaf024..05e40a26b 100644
--- a/lib/librte_eal/common/meson.build
+++ b/lib/librte_eal/common/meson.build
@@ -28,6 +28,7 @@ if is_windows
 		'malloc_elem.c',
 		'malloc_heap.c',
 		'rte_malloc.c',
+		'rte_random.c',
 	)
 	subdir_done()
 endif
diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
index 1cbd00344..c04bfb01b 100644
--- a/lib/librte_eal/rte_eal_exports.def
+++ b/lib/librte_eal/rte_eal_exports.def
@@ -137,3 +137,4 @@ EXPORTS
 	rte_mem_map
 	rte_mem_page_size
 	rte_mem_unmap
+	rte_rand
diff --git a/lib/librte_eal/windows/include/netinet/in.h b/lib/librte_eal/windows/include/netinet/in.h
new file mode 100644
index 000000000..489b587c3
--- /dev/null
+++ b/lib/librte_eal/windows/include/netinet/in.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 Mellanox Technologies, Ltd
+ */
+
+#ifndef _IN_H_
+#define _IN_H_
+
+#define IPPROTO_IP 0
+#define IPPROTO_HOPOPTS 0
+#define	IPPROTO_IPV4 4             /* IPv4 encapsulation */
+#define	IPPROTO_IPIP IPPROTO_IPV4  /* for compatibility */
+#define IPPROTO_TCP 6
+#define IPPROTO_UDP 17
+#define	IPPROTO_IPV6 41	           /* IP6 header */
+#define	IPPROTO_ROUTING 43         /* IP6 routing header */
+#define	IPPROTO_FRAGMENT 44        /* IP6 fragmentation header */
+#define	IPPROTO_GRE 47             /* General Routing Encap. */
+#define	IPPROTO_ESP 50             /* IP6 Encap Sec. Payload */
+#define	IPPROTO_AH 51              /* IP6 Auth Header */
+#define IPPROTO_NONE 59            /* IPv6 no next header */
+#define	IPPROTO_DSTOPTS 60         /* IP6 destination option */
+#define IPPROTO_SCTP 132           /* Stream Control Transmission Protocol */
+
+
+#endif
diff --git a/lib/librte_eal/windows/include/netinet/ip.h b/lib/librte_eal/windows/include/netinet/ip.h
new file mode 100644
index 000000000..cb9c466ba
--- /dev/null
+++ b/lib/librte_eal/windows/include/netinet/ip.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 Mellanox Technologies, Ltd
+ */
+
+#ifndef _IP_H_
+#define _IP_H_
+
+#define	IPVERSION 4
+
+
+#endif
diff --git a/lib/meson.build b/lib/meson.build
index 6d31641ba..22c9ab1fe 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -40,7 +40,7 @@ if is_windows
 		'kvargs',
 		'eal',
 		'ring',
-		'mempool', 'pci', 'mbuf',
+		'mempool', 'pci', 'mbuf', 'net',
 	] # only supported libraries for windows
 endif
 
-- 
2.16.1.windows.4