From 460fec67ee3807bb2eb189587ffe803a48f317e5 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 24 Jun 2009 14:42:31 +0200 Subject: slirp: Factor out internal state structure The essence of this patch is to stuff (almost) all global variables of the slirp stack into the structure Slirp. In this step, we still keep the structure as global variable, directly accessible by the whole stack. Changes to the external interface of slirp will be applied in the following patches. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- slirp/udp.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'slirp/udp.h') diff --git a/slirp/udp.h b/slirp/udp.h index 3eed14a677..cc814a3f48 100644 --- a/slirp/udp.h +++ b/slirp/udp.h @@ -36,8 +36,6 @@ #define UDP_TTL 0x60 #define UDP_UDPDATALEN 16192 -extern struct socket *udp_last_so; - /* * Udp protocol header. * Per RFC 768, September, 1981. @@ -73,15 +71,15 @@ struct udpiphdr { #define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ #define UDPCTL_MAXID 2 -extern struct socket udb; struct mbuf; -void udp_init _P((void)); +void udp_init _P((Slirp *)); void udp_input _P((register struct mbuf *, int)); int udp_output _P((struct socket *, struct mbuf *, struct sockaddr_in *)); int udp_attach _P((struct socket *)); void udp_detach _P((struct socket *)); -struct socket * udp_listen _P((u_int32_t, u_int, u_int32_t, u_int, int)); +struct socket * udp_listen _P((Slirp *, u_int32_t, u_int, u_int32_t, u_int, + int)); int udp_output2(struct socket *so, struct mbuf *m, struct sockaddr_in *saddr, struct sockaddr_in *daddr, int iptos); -- cgit v1.2.1