File: patch9350

package info (click to toggle)
lwip 2.1.3%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,060 kB
  • sloc: ansic: 90,089; perl: 81; sh: 28; makefile: 18
file content (73 lines) | stat: -rw-r--r-- 2,234 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From a41c1fcc62e01780a96f96a9b4af813ef8f9ec74 Mon Sep 17 00:00:00 2001
From: Simon Goldschmidt <goldsimon@gmx.de>
Date: Fri, 26 Oct 2018 19:33:47 +0200
Subject: patch #9350: Sockets API: use OS's sys/socket.h instead of lwip/sock

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
---
 src/include/lwip/inet.h    |  7 +++++++
 src/include/lwip/opt.h     | 11 +++++++++++
 src/include/lwip/sockets.h |  6 ++++++
 3 files changed, 24 insertions(+)

--- a/src/include/lwip/inet.h
+++ b/src/include/lwip/inet.h
@@ -41,6 +41,11 @@
 #define LWIP_HDR_INET_H
 
 #include "lwip/opt.h"
+
+#if LWIP_SOCKET_EXTERNAL_HEADERS
+#include LWIP_SOCKET_EXTERNAL_HEADER_INET_H
+#else /* LWIP_SOCKET_EXTERNAL_HEADERS */
+
 #include "lwip/def.h"
 #include "lwip/ip_addr.h"
 #include "lwip/ip6_addr.h"
@@ -166,4 +171,6 @@
 }
 #endif
 
+#endif /* LWIP_SOCKET_EXTERNAL_HEADERS */
+
 #endif /* LWIP_HDR_INET_H */
--- a/src/include/lwip/opt.h
+++ b/src/include/lwip/opt.h
@@ -1978,6 +1978,17 @@
 #endif
 
 /**
+ * LWIP_SOCKET_EXTERNAL_HEADERS==1: Use external headers instead of sockets.h
+ * and inet.h. In this case, user must provide its own headers by setting the
+ * values for LWIP_SOCKET_EXTERNAL_HEADER_SOCKETS_H and
+ * LWIP_SOCKET_EXTERNAL_HEADER_INET_H to appropriate include file names and the
+ * whole content of the default sockets.h and inet.h is skipped.
+ */
+#if !defined LWIP_SOCKET_EXTERNAL_HEADERS || defined __DOXYGEN__
+#define LWIP_SOCKET_EXTERNAL_HEADERS    0
+#endif
+
+/**
  * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
  * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
  * in seconds. (does not require sockets.c, and will affect tcp.c)
--- a/src/include/lwip/sockets.h
+++ b/src/include/lwip/sockets.h
@@ -41,6 +41,10 @@
 
 #include "lwip/opt.h"
 
+#if LWIP_SOCKET_EXTERNAL_HEADERS
+#include LWIP_SOCKET_EXTERNAL_HEADER_SOCKETS_H
+#else /* LWIP_SOCKET_EXTERNAL_HEADERS */
+
 #if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
 
 #include "lwip/ip_addr.h"
@@ -685,4 +689,6 @@
 
 #endif /* LWIP_SOCKET */
 
+#endif /* LWIP_SOCKET_EXTERNAL_HEADERS */
+
 #endif /* LWIP_HDR_SOCKETS_H */