diff mbox series

[v3,1/4] cmdline: remove POSIX dependency

Message ID 20210313222217.18271-2-dmitry.kozliuk@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series net: replace Windows networking shim | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dmitry Kozlyuk March 13, 2021, 10:22 p.m. UTC
Use <rte_ip.h> for IP-related defines instead of POSIX headers.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
Depends-on: series-15513 ("eal/windows: do not expose POSIX symbols")

 examples/cmdline/commands.c                  | 1 -
 examples/cmdline/parse_obj_list.c            | 2 --
 lib/librte_cmdline/cmdline.c                 | 1 -
 lib/librte_cmdline/cmdline_parse.c           | 2 --
 lib/librte_cmdline/cmdline_parse_etheraddr.c | 6 ------
 lib/librte_cmdline/cmdline_parse_ipaddr.c    | 6 ------
 lib/librte_cmdline/cmdline_parse_ipaddr.h    | 2 +-
 lib/librte_net/rte_ip.h                      | 3 +++
 8 files changed, 4 insertions(+), 19 deletions(-)

Comments

Tyler Retzlaff March 17, 2021, 5:22 p.m. UTC | #1
On Sun, Mar 14, 2021 at 01:22:13AM +0300, Dmitry Kozlyuk wrote:
> Use <rte_ip.h> for IP-related defines instead of POSIX headers.
> 
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
diff mbox series

Patch

diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
index f43eacfbad..2c62d04fb0 100644
--- a/examples/cmdline/commands.c
+++ b/examples/cmdline/commands.c
@@ -10,7 +10,6 @@ 
 #include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <netinet/in.h>
 #ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
 #endif
diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index b04adbea58..959bcd1452 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -6,11 +6,9 @@ 
 
 #include <stdio.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <ctype.h>
 #include <string.h>
-#include <netinet/in.h>
 
 #include <cmdline_parse.h>
 #include <cmdline_parse_ipaddr.h>
diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c
index 49770869bb..a176d15130 100644
--- a/lib/librte_cmdline/cmdline.c
+++ b/lib/librte_cmdline/cmdline.c
@@ -12,7 +12,6 @@ 
 #include <inttypes.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <netinet/in.h>
 
 #include <rte_string_fns.h>
 
diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c
index fe366841cd..f5cc934782 100644
--- a/lib/librte_cmdline/cmdline_parse.c
+++ b/lib/librte_cmdline/cmdline_parse.c
@@ -11,8 +11,6 @@ 
 #include <inttypes.h>
 #include <ctype.h>
 
-#include <netinet/in.h>
-
 #include <rte_string_fns.h>
 
 #include "cmdline_private.h"
diff --git a/lib/librte_cmdline/cmdline_parse_etheraddr.c b/lib/librte_cmdline/cmdline_parse_etheraddr.c
index 5cb10de321..433b828a72 100644
--- a/lib/librte_cmdline/cmdline_parse_etheraddr.c
+++ b/lib/librte_cmdline/cmdline_parse_etheraddr.c
@@ -5,13 +5,7 @@ 
  */
 
 #include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
-#include <sys/types.h>
 
 #include <rte_string_fns.h>
 #include <rte_ether.h>
diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c
index f8dbdf204c..5e278c963f 100644
--- a/lib/librte_cmdline/cmdline_parse_ipaddr.c
+++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c
@@ -6,14 +6,8 @@ 
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
 #include <errno.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
 
 #include <rte_string_fns.h>
 
diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.h b/lib/librte_cmdline/cmdline_parse_ipaddr.h
index 0ba81647bc..0118c31d44 100644
--- a/lib/librte_cmdline/cmdline_parse_ipaddr.h
+++ b/lib/librte_cmdline/cmdline_parse_ipaddr.h
@@ -8,7 +8,7 @@ 
 #define _PARSE_IPADDR_H_
 
 #include <cmdline_parse.h>
-#include <netinet/in.h>
+#include <rte_ip.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 212ff2c4fd..2cf7b0bd28 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -16,7 +16,10 @@ 
  */
 
 #include <stdint.h>
+
+#include <sys/socket.h>
 #include <sys/types.h>
+#include <arpa/inet.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>