[3/3] eal/windows: librte_net build on Windows
Checks
Commit Message
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 | 23 +++++++++++++++++++++++
lib/librte_eal/windows/include/netinet/ip.h | 9 +++++++++
lib/meson.build | 2 +-
5 files changed, 35 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
@@ -28,6 +28,7 @@ if is_windows
'malloc_elem.c',
'malloc_heap.c',
'rte_malloc.c',
+ 'rte_random.c',
)
subdir_done()
endif
@@ -137,3 +137,4 @@ EXPORTS
rte_mem_map
rte_mem_page_size
rte_mem_unmap
+ rte_rand
new file mode 100644
@@ -0,0 +1,23 @@
+/* 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
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+* Copyright 2020 Mellanox Technologies, Ltd */
+
+#ifndef _IP_H_
+#define _IP_H_
+
+#define IPVERSION 4
+
+#endif
\ No newline at end of file
@@ -40,7 +40,7 @@ if is_windows
'kvargs',
'eal',
'ring',
- 'mempool', 'pci', 'mbuf',
+ 'mempool', 'pci', 'mbuf', 'net',
] # only supported libraries for windows
endif