]> git.proxmox.com Git - qemu.git/blobdiff - slirp/socket.h
Merge remote-tracking branch 'kraxel/seabios-a810e4e' into staging
[qemu.git] / slirp / socket.h
index d241a48ca2ebe9b673a11dd1953a91a12dba0be2..857b0da311b12caba5753b3fcc7155ace1c58172 100644 (file)
@@ -5,8 +5,6 @@
  * terms and conditions of the copyright.
  */
 
-/* MINE */
-
 #ifndef _SLIRP_SOCKET_H_
 #define _SLIRP_SOCKET_H_
 
@@ -22,6 +20,8 @@ struct socket {
 
   int s;                           /* The actual socket */
 
+  Slirp *slirp;                           /* managing slirp instance */
+
                        /* XXX union these with not-yet-used sbuf params */
   struct mbuf *so_m;              /* Pointer to the original SYN packet,
                                    * for non-blocking connect()'s, and
@@ -31,11 +31,11 @@ struct socket {
   int so_urgc;
   struct in_addr so_faddr;        /* foreign host table entry */
   struct in_addr so_laddr;        /* local host table entry */
-  u_int16_t so_fport;             /* foreign port */
-  u_int16_t so_lport;             /* local port */
+  uint16_t so_fport;              /* foreign port */
+  uint16_t so_lport;              /* local port */
 
-  u_int8_t     so_iptos;       /* Type of service */
-  u_int8_t     so_emu;         /* Is the socket emulated? */
+  uint8_t      so_iptos;       /* Type of service */
+  uint8_t      so_emu;         /* Is the socket emulated? */
 
   u_char       so_type;                /* Type of socket, UDP or TCP */
   int  so_state;               /* internal state flags SS_*, below */
@@ -64,7 +64,6 @@ struct socket {
 #define SS_ISFCONNECTED                0x004   /* Socket is connected to peer */
 #define SS_FCANTRCVMORE                0x008   /* Socket can't receive more from peer (for half-closes) */
 #define SS_FCANTSENDMORE       0x010   /* Socket can't send more to peer (for half-closes) */
-/* #define SS_ISFDISCONNECTED  0x020*/ /* Socket has disconnected from peer, in 2MSL state */
 #define SS_FWDRAIN             0x040   /* We received a FIN, drain data and set SS_FCANTSENDMORE */
 
 #define SS_CTL                 0x080
@@ -75,22 +74,20 @@ struct socket {
 #define SS_HOSTFWD             0x1000  /* Socket describes host->guest forwarding */
 #define SS_INCOMING            0x2000  /* Connection was initiated by a host on the internet */
 
-extern struct socket tcb;
-
-struct socket * solookup _P((struct socket *, struct in_addr, u_int, struct in_addr, u_int));
-struct socket * socreate _P((void));
-void sofree _P((struct socket *));
-int soread _P((struct socket *));
-void sorecvoob _P((struct socket *));
-int sosendoob _P((struct socket *));
-int sowrite _P((struct socket *));
-void sorecvfrom _P((struct socket *));
-int sosendto _P((struct socket *, struct mbuf *));
-struct socket * tcp_listen _P((u_int32_t, u_int, u_int32_t, u_int, int));
-void soisfconnecting _P((register struct socket *));
-void soisfconnected _P((register struct socket *));
-void soisfdisconnected _P((struct socket *));
-void sofwdrain _P((struct socket *));
+struct socket * solookup(struct socket *, struct in_addr, u_int, struct in_addr, u_int);
+struct socket * socreate(Slirp *);
+void sofree(struct socket *);
+int soread(struct socket *);
+void sorecvoob(struct socket *);
+int sosendoob(struct socket *);
+int sowrite(struct socket *);
+void sorecvfrom(struct socket *);
+int sosendto(struct socket *, struct mbuf *);
+struct socket * tcp_listen(Slirp *, uint32_t, u_int, uint32_t, u_int,
+                               int);
+void soisfconnecting(register struct socket *);
+void soisfconnected(register struct socket *);
+void sofwdrain(struct socket *);
 struct iovec; /* For win32 */
 size_t sopreprbuf(struct socket *so, struct iovec *iov, int *np);
 int soreadbuf(struct socket *so, const char *buf, int size);