]> git.proxmox.com Git - qemu.git/blobdiff - slirp/tcp_var.h
qga: Fix compiler warnings (missing format attribute, wrong format strings)
[qemu.git] / slirp / tcp_var.h
index 82380f93658963e166c8f5d632b05272739a8eeb..004193fb6d0073433c93764aa845ba3f2ba45071 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
 #include "tcpip.h"
 #include "tcp_timer.h"
 
-#if SIZEOF_CHAR_P == 4
- typedef struct tcpiphdr *tcpiphdrp_32;
-#else
- typedef u_int32_t tcpiphdrp_32;
-#endif
-
 /*
  * Tcp control block, one per tcp; fields:
  */
 struct tcpcb {
-       tcpiphdrp_32 seg_next;  /* sequencing queue */
-       tcpiphdrp_32 seg_prev;
+       struct tcpiphdr *seg_next;      /* sequencing queue */
+       struct tcpiphdr *seg_prev;
        short   t_state;                /* state of this connection */
        short   t_timer[TCPT_NTIMERS];  /* tcp timers */
        short   t_rxtshift;             /* log(2) of rexmt exp. backoff */
@@ -71,9 +61,7 @@ struct tcpcb {
 #define        TF_RCVD_TSTMP   0x0100          /* a timestamp was received in SYN */
 #define        TF_SACK_PERMIT  0x0200          /* other side said I could SACK */
 
-       /* Make it static  for now */
-/*     struct  tcpiphdr *t_template;   / * skeletal packet for transmit */
-       struct  tcpiphdr t_template;
+       struct  tcpiphdr t_template;    /* static skeletal packet for xmit */
 
        struct  socket *t_socket;               /* back pointer to socket */
 /*
@@ -87,9 +75,9 @@ struct tcpcb {
        tcp_seq snd_wl1;                /* window update seg seq number */
        tcp_seq snd_wl2;                /* window update seg ack number */
        tcp_seq iss;                    /* initial send sequence number */
-       u_int32_t snd_wnd;              /* send window */
+       uint32_t snd_wnd;               /* send window */
 /* receive sequence variables */
-       u_int32_t rcv_wnd;              /* receive window */
+       uint32_t rcv_wnd;               /* receive window */
        tcp_seq rcv_nxt;                /* receive next */
        tcp_seq rcv_up;                 /* receive urgent pointer */
        tcp_seq irs;                    /* initial receive sequence number */
@@ -103,8 +91,8 @@ struct tcpcb {
                                         * used to recognize retransmits
                                         */
 /* congestion control (for slow start, source quench, retransmit after loss) */
-       u_int32_t snd_cwnd;             /* congestion-controlled window */
-       u_int32_t snd_ssthresh;         /* snd_cwnd size threshold for
+       uint32_t snd_cwnd;              /* congestion-controlled window */
+       uint32_t snd_ssthresh;          /* snd_cwnd size threshold for
                                         * for slow start exponential to
                                         * linear switch
                                         */
@@ -118,7 +106,7 @@ struct tcpcb {
        short   t_srtt;                 /* smoothed round-trip time */
        short   t_rttvar;               /* variance in round-trip time */
        u_short t_rttmin;               /* minimum rtt allowed */
-       u_int32_t max_sndwnd;           /* largest window peer has offered */
+       uint32_t max_sndwnd;            /* largest window peer has offered */
 
 /* out-of-band data */
        char    t_oobflags;             /* have some */
@@ -132,8 +120,8 @@ struct tcpcb {
        u_char  rcv_scale;              /* window scaling for recv window */
        u_char  request_r_scale;        /* pending window scaling */
        u_char  requested_s_scale;
-       u_int32_t       ts_recent;              /* timestamp echo data */
-       u_int32_t       ts_recent_age;          /* when last updated */
+       uint32_t        ts_recent;              /* timestamp echo data */
+       uint32_t        ts_recent_age;          /* when last updated */
        tcp_seq last_ack_sent;
 
 };
@@ -170,86 +158,4 @@ struct tcpcb {
 #define        TCP_REXMTVAL(tp) \
        (((tp)->t_srtt >> TCP_RTT_SHIFT) + (tp)->t_rttvar)
 
-/* XXX
- * We want to avoid doing m_pullup on incoming packets but that
- * means avoiding dtom on the tcp reassembly code.  That in turn means
- * keeping an mbuf pointer in the reassembly queue (since we might
- * have a cluster).  As a quick hack, the source & destination
- * port numbers (which are no longer needed once we've located the
- * tcpcb) are overlayed with an mbuf pointer.
- */
-#if SIZEOF_CHAR_P == 4
-typedef struct mbuf *mbufp_32;
-#else
-typedef u_int32_t mbufp_32;
-#endif
-#define REASS_MBUF(ti) (*(mbufp_32 *)&((ti)->ti_t))
-
-#ifdef LOG_ENABLED
-/*
- * TCP statistics.
- * Many of these should be kept per connection,
- * but that's inconvenient at the moment.
- */
-struct tcpstat {
-       u_long  tcps_connattempt;       /* connections initiated */
-       u_long  tcps_accepts;           /* connections accepted */
-       u_long  tcps_connects;          /* connections established */
-       u_long  tcps_drops;             /* connections dropped */
-       u_long  tcps_conndrops;         /* embryonic connections dropped */
-       u_long  tcps_closed;            /* conn. closed (includes drops) */
-       u_long  tcps_segstimed;         /* segs where we tried to get rtt */
-       u_long  tcps_rttupdated;        /* times we succeeded */
-       u_long  tcps_delack;            /* delayed acks sent */
-       u_long  tcps_timeoutdrop;       /* conn. dropped in rxmt timeout */
-       u_long  tcps_rexmttimeo;        /* retransmit timeouts */
-       u_long  tcps_persisttimeo;      /* persist timeouts */
-       u_long  tcps_keeptimeo;         /* keepalive timeouts */
-       u_long  tcps_keepprobe;         /* keepalive probes sent */
-       u_long  tcps_keepdrops;         /* connections dropped in keepalive */
-
-       u_long  tcps_sndtotal;          /* total packets sent */
-       u_long  tcps_sndpack;           /* data packets sent */
-       u_long  tcps_sndbyte;           /* data bytes sent */
-       u_long  tcps_sndrexmitpack;     /* data packets retransmitted */
-       u_long  tcps_sndrexmitbyte;     /* data bytes retransmitted */
-       u_long  tcps_sndacks;           /* ack-only packets sent */
-       u_long  tcps_sndprobe;          /* window probes sent */
-       u_long  tcps_sndurg;            /* packets sent with URG only */
-       u_long  tcps_sndwinup;          /* window update-only packets sent */
-       u_long  tcps_sndctrl;           /* control (SYN|FIN|RST) packets sent */
-
-       u_long  tcps_rcvtotal;          /* total packets received */
-       u_long  tcps_rcvpack;           /* packets received in sequence */
-       u_long  tcps_rcvbyte;           /* bytes received in sequence */
-       u_long  tcps_rcvbadsum;         /* packets received with ccksum errs */
-       u_long  tcps_rcvbadoff;         /* packets received with bad offset */
-/*     u_long  tcps_rcvshort;  */      /* packets received too short */
-       u_long  tcps_rcvduppack;        /* duplicate-only packets received */
-       u_long  tcps_rcvdupbyte;        /* duplicate-only bytes received */
-       u_long  tcps_rcvpartduppack;    /* packets with some duplicate data */
-       u_long  tcps_rcvpartdupbyte;    /* dup. bytes in part-dup. packets */
-       u_long  tcps_rcvoopack;         /* out-of-order packets received */
-       u_long  tcps_rcvoobyte;         /* out-of-order bytes received */
-       u_long  tcps_rcvpackafterwin;   /* packets with data after window */
-       u_long  tcps_rcvbyteafterwin;   /* bytes rcvd after window */
-       u_long  tcps_rcvafterclose;     /* packets rcvd after "close" */
-       u_long  tcps_rcvwinprobe;       /* rcvd window probe packets */
-       u_long  tcps_rcvdupack;         /* rcvd duplicate acks */
-       u_long  tcps_rcvacktoomuch;     /* rcvd acks for unsent data */
-       u_long  tcps_rcvackpack;        /* rcvd ack packets */
-       u_long  tcps_rcvackbyte;        /* bytes acked by rcvd acks */
-       u_long  tcps_rcvwinupd;         /* rcvd window update packets */
-/*     u_long  tcps_pawsdrop;  */      /* segments dropped due to PAWS */
-       u_long  tcps_predack;           /* times hdr predict ok for acks */
-       u_long  tcps_preddat;           /* times hdr predict ok for data pkts */
-       u_long  tcps_socachemiss;       /* tcp_last_so misses */
-       u_long  tcps_didnuttin;         /* Times tcp_output didn't do anything XXX */
-};
-
-extern struct  tcpstat tcpstat;        /* tcp statistics */
-#endif
-
-extern u_int32_t       tcp_now;                /* for RFC 1323 timestamps */
-
 #endif