]> git.proxmox.com Git - mirror_qemu.git/commitdiff
slirp: replace remaining qemu headers dependency
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 17 Jan 2019 11:43:52 +0000 (15:43 +0400)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 7 Feb 2019 13:49:08 +0000 (15:49 +0200)
Except for the migration code which is gated by WITH_QEMU, only
include our own headers, so libslirp can be built standalone.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
28 files changed:
slirp/arp_table.c
slirp/bootp.c
slirp/cksum.c
slirp/dhcpv6.c
slirp/dnssearch.c
slirp/if.c
slirp/ip6.h
slirp/ip6_icmp.c
slirp/ip6_input.c
slirp/ip6_output.c
slirp/ip_icmp.c
slirp/ip_input.c
slirp/ip_output.c
slirp/mbuf.c
slirp/misc.c
slirp/ncsi.c
slirp/ndp_table.c
slirp/sbuf.c
slirp/slirp.c
slirp/socket.c
slirp/tcp_input.c
slirp/tcp_output.c
slirp/tcp_subr.c
slirp/tcp_timer.c
slirp/tftp.c
slirp/udp.c
slirp/udp6.c
slirp/util.h

index bf71b984ad7f69b2bada3c9b98bae8d59487904c..58eafdcfd8f322cbc246b29f708eea3f2630040d 100644 (file)
  * THE SOFTWARE.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
+#include <string.h>
+
 void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])
 {
     const uint32_t broadcast_addr =
index 4c9a77eb98f1890d3d0ab13b93bbbd0f1a2508ec..d396849a05ef11a24cd0f7f71ee6e572a2be17a6 100644 (file)
@@ -21,7 +21,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 #if defined(_WIN32)
index 84c858fafb179bc025d334294b9357366e7c2f7c..25bfa67348e5d9074f122b64dc4a4779cdf177e0 100644 (file)
@@ -30,7 +30,6 @@
  * in_cksum.c,v 1.2 1994/08/02 07:48:16 davidg Exp
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 /*
index e27d9a46f845d2713aee1fccc5d103bd972dbfd6..9ffba38e8f48320b4d0e4b87da1c40449304e752 100644 (file)
@@ -20,7 +20,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "dhcpv6.h"
 
index 8fb563321bc443febe4f46c8cb9d6601b548c5db..c459cece8d6bcc81feb1bfe8e72b7bdf1c2d91d7 100644 (file)
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 static const uint8_t RFC3397_OPT_DOMAIN_SEARCH = 119;
index 90b9078687f4e177650cf749b0afcd6cd7fb4033..2ad03b8a79b56f6b2997a76cce053f5c6306302d 100644 (file)
@@ -5,7 +5,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 static void
index 5361bd7449e51fe0cc94d13c3220fec727e0e6a6..1b3364f9605e8ec9c574f99b51b7ed151a2659ec 100644 (file)
@@ -7,6 +7,7 @@
 #define SLIRP_IP6_H
 
 #include <glib.h>
+#include <string.h>
 
 #define ALLNODES_MULTICAST  { .s6_addr = \
                             { 0xff, 0x02, 0x00, 0x00,\
index b3b7e50a311a56f483204a18338febffa21ca408..2a432ebbd486f9785f06ada5193f22d74738d458 100644 (file)
@@ -3,7 +3,6 @@
  * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip6_icmp.h"
 
index ab656a0a9de462d9cffc955298853bc95c583d76..1b8c003c660cb5be0beb06df1309b7ae3a3e6e1d 100644 (file)
@@ -3,7 +3,6 @@
  * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip6_icmp.h"
 
index 52c88ad69117aeb6638623859b4587c470848702..19d1ae77489f0508dd6de1a457102fc22da08d4e 100644 (file)
@@ -3,8 +3,6 @@
  * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "slirp.h"
 
 /* Number of packets queued before we start sending
index 19e247f773eb664ecb5e6a3632195cc232c96f1d..6b6344b77695f0b7d89e9e78a4d4f7bfa9b9de3b 100644 (file)
@@ -30,7 +30,6 @@
  * ip_icmp.c,v 1.7 1995/05/30 08:09:42 rgrimes Exp
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 
index d36062083839004a1d10f6cbede03a7a61e60611..774ce662e60c2be7a62a9f926ff2344328f4fb9e 100644 (file)
@@ -38,7 +38,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 
index db403f04c1efc387f8f2461ca2a086373d119117..f6ec141df59d335c11b8c9bf68c491c0124e8ce1 100644 (file)
@@ -38,7 +38,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 /* Number of packets queued before we start sending
index d8d275e0e7b0a05a246c7791c17b25fcaa5dd2cc..521c02c96739f4b3c333d9767e9a0874f05fea05 100644 (file)
@@ -15,7 +15,6 @@
  * the flags
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 #define MBUF_THRESH 30
index ee77aff337ef62c5ce7cd3335542a9c31f04626d..3c025101010e297970f8fbfd8b4e1ffe0ce55830 100644 (file)
@@ -5,9 +5,7 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
-#include "libslirp.h"
 
 inline void
 insque(void *a, void *b)
index 859438227089ec96af065106472bb410a8bd94fe..327f17543ce0e8c091169d05d84cda6573b55ec2 100644 (file)
@@ -6,7 +6,6 @@
  * This code is licensed under the GPL version 2 or later. See the
  * COPYING file in the top-level directory.
  */
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 #include "ncsi-pkt.h"
index b7b73722f79c76fe5fff15047ad4a2599c1e613d..34ea4fdf1fc968640e12cea51617e83c08ef2562 100644 (file)
@@ -3,8 +3,6 @@
  * Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "slirp.h"
 
 void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr,
index c83e4dd8ed1d9653360aa2871708dbb252b6dfcc..51a9f0cc7d4e5c06ed00fa1cee77aa2e234981ea 100644 (file)
@@ -5,7 +5,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 static void sbappendsb(struct sbuf *sb, struct mbuf *m);
index ec1f606d725aff9f5c52f4c065011b67fd9f817d..730b78255c4a084a088bb9c3517f2478ae09904d 100644 (file)
@@ -21,8 +21,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "slirp.h"
 
 #ifdef WITH_QEMU
index 2e8dc22fb6265720a51b7bc2da30f2186ab0fdd0..dea201f5ce98c1f6310e7530228eb5511543847e 100644 (file)
@@ -5,8 +5,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 #ifdef __sun__
index 7c1fe18fec1ae4f6f3622b69dd9541dc9671e760..864da7d857d4d4d2efb1754506c8ac246a64bc5e 100644 (file)
@@ -38,7 +38,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 
index 6dd1ecf5d9edc66df1cc61210f5ab3b8d35bf34d..2b4335eb34a0f11fe084d7f6abf8be34aa61ceb5 100644 (file)
@@ -38,7 +38,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 static const u_char  tcp_outflags[TCP_NSTATES] = {
index d8846a33b0c7ee5e8d10d434567c4c0b13d69449..879a7dcd29664de60454780c8a067218cf9c9ca5 100644 (file)
@@ -38,7 +38,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 /* patchable/settable parameters for tcp */
index a843e57a2b916ec1e50d10355af86da25862c902..703907eb37ade1526869832b79def568891e25b1 100644 (file)
@@ -30,7 +30,6 @@
  * tcp_timer.c,v 1.2 1994/08/02 07:49:10 davidg Exp
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 
 static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer);
index 5c31886190ff3a9519f5e223d6c0c4e47fe75dee..2d8f9787862c3f25962be08e9e667ea5e7cbaab3 100644 (file)
  * THE SOFTWARE.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
-#include "qemu-common.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 static inline int tftp_session_in_use(struct tftp_session *spt)
 {
index 3915971b506224674f5ba013ab1170a4fb85e9be..ac42be0d8e9bd136c57fe484423754b28a0da958 100644 (file)
@@ -38,7 +38,6 @@
  * terms and conditions of the copyright.
  */
 
-#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 
index fa531e03c4bab0f7f72f5cc0a5ce9138d1177bd3..be5cba1f54dd7502485a55c00a40b6c116a96e3f 100644 (file)
@@ -3,8 +3,6 @@
  * Guillaume Subiron
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "slirp.h"
 #include "udp.h"
 #include "dhcpv6.h"
index ef7580456020e318e41e5118d856cdde5d4e1c12..4963747aefca46926fcb9e845e8c22c62b7ecfc2 100644 (file)
 # define SLIRP_PACKED __attribute__((packed))
 #endif
 
+#ifndef DIV_ROUND_UP
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+#endif
+
+#ifndef container_of
+#define container_of(ptr, type, member) __extension__ ({    \
+    void *__mptr = (void *)(ptr);               \
+    ((type *)(__mptr - offsetof(type, member))); })
+#endif
+
+#if defined(_WIN32) /* CONFIG_IOVEC */
+# if !defined(IOV_MAX) /* XXX: to avoid duplicate with QEMU osdep.h */
+struct iovec {
+    void *iov_base;
+    size_t iov_len;
+};
+# endif
+#else
+#include <sys/uio.h>
+#endif
+
 #define SCALE_MS 1000000
 
 #define ETH_ALEN    6