Commit 0fe6a7f28455cd003b2668e77d5bd1e1cf15309e

Authored by Jan Kiszka
Committed by Anthony Liguori
1 parent 0d62c4cf

slirp: Drop statistic code

As agreed on the mailing list, there is no interest in keeping the
usually disabled slirp statistics in the tree. So this patch removes
them.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c
... ... @@ -1733,8 +1733,6 @@ static const mon_cmd_t info_cmds[] = {
1733 1733 "", "show CPU statistics", },
1734 1734 #endif
1735 1735 #if defined(CONFIG_SLIRP)
1736   - { "slirp", "", do_info_slirp,
1737   - "", "show SLIRP statistics", },
1738 1736 { "usernet", "", do_info_usernet,
1739 1737 "", "show user network stack connection states", },
1740 1738 #endif
... ...
... ... @@ -1112,11 +1112,6 @@ void net_slirp_smb(const char *exported_dir)
1112 1112  
1113 1113 #endif /* !defined(_WIN32) */
1114 1114  
1115   -void do_info_slirp(Monitor *mon)
1116   -{
1117   - slirp_stats();
1118   -}
1119   -
1120 1115 struct GuestFwd {
1121 1116 CharDriverState *hd;
1122 1117 struct in_addr server;
... ...
qemu-monitor.hx
... ... @@ -85,8 +85,6 @@ show the current VM name
85 85 show the current VM UUID
86 86 @item info cpustats
87 87 show CPU statistics
88   -@item info slirp
89   -show SLIRP statistics (if available)
90 88 @item info usernet
91 89 show user network stack connection states
92 90 @item info migrate
... ...
slirp/debug.c
... ... @@ -10,157 +10,3 @@
10 10  
11 11 FILE *dfd = NULL;
12 12 int slirp_debug = 0;
13   -
14   -#ifdef LOG_ENABLED
15   -static void
16   -ipstats(void)
17   -{
18   - lprint(" \r\n");
19   -
20   - lprint("IP stats:\r\n");
21   - lprint(" %6d total packets received (%d were unaligned)\r\n",
22   - ipstat.ips_total, ipstat.ips_unaligned);
23   - lprint(" %6d with incorrect version\r\n", ipstat.ips_badvers);
24   - lprint(" %6d with bad header checksum\r\n", ipstat.ips_badsum);
25   - lprint(" %6d with length too short (len < sizeof(iphdr))\r\n", ipstat.ips_tooshort);
26   - lprint(" %6d with length too small (len < ip->len)\r\n", ipstat.ips_toosmall);
27   - lprint(" %6d with bad header length\r\n", ipstat.ips_badhlen);
28   - lprint(" %6d with bad packet length\r\n", ipstat.ips_badlen);
29   - lprint(" %6d fragments received\r\n", ipstat.ips_fragments);
30   - lprint(" %6d fragments dropped\r\n", ipstat.ips_fragdropped);
31   - lprint(" %6d fragments timed out\r\n", ipstat.ips_fragtimeout);
32   - lprint(" %6d packets reassembled ok\r\n", ipstat.ips_reassembled);
33   - lprint(" %6d outgoing packets fragmented\r\n", ipstat.ips_fragmented);
34   - lprint(" %6d total outgoing fragments\r\n", ipstat.ips_ofragments);
35   - lprint(" %6d with bad protocol field\r\n", ipstat.ips_noproto);
36   - lprint(" %6d total packets delivered\r\n", ipstat.ips_delivered);
37   -}
38   -
39   -static void
40   -tcpstats(void)
41   -{
42   - lprint(" \r\n");
43   -
44   - lprint("TCP stats:\r\n");
45   -
46   - lprint(" %6d packets sent\r\n", tcpstat.tcps_sndtotal);
47   - lprint(" %6d data packets (%d bytes)\r\n",
48   - tcpstat.tcps_sndpack, tcpstat.tcps_sndbyte);
49   - lprint(" %6d data packets retransmitted (%d bytes)\r\n",
50   - tcpstat.tcps_sndrexmitpack, tcpstat.tcps_sndrexmitbyte);
51   - lprint(" %6d ack-only packets (%d delayed)\r\n",
52   - tcpstat.tcps_sndacks, tcpstat.tcps_delack);
53   - lprint(" %6d URG only packets\r\n", tcpstat.tcps_sndurg);
54   - lprint(" %6d window probe packets\r\n", tcpstat.tcps_sndprobe);
55   - lprint(" %6d window update packets\r\n", tcpstat.tcps_sndwinup);
56   - lprint(" %6d control (SYN/FIN/RST) packets\r\n", tcpstat.tcps_sndctrl);
57   - lprint(" %6d times tcp_output did nothing\r\n", tcpstat.tcps_didnuttin);
58   -
59   - lprint(" %6d packets received\r\n", tcpstat.tcps_rcvtotal);
60   - lprint(" %6d acks (for %d bytes)\r\n",
61   - tcpstat.tcps_rcvackpack, tcpstat.tcps_rcvackbyte);
62   - lprint(" %6d duplicate acks\r\n", tcpstat.tcps_rcvdupack);
63   - lprint(" %6d acks for unsent data\r\n", tcpstat.tcps_rcvacktoomuch);
64   - lprint(" %6d packets received in sequence (%d bytes)\r\n",
65   - tcpstat.tcps_rcvpack, tcpstat.tcps_rcvbyte);
66   - lprint(" %6d completely duplicate packets (%d bytes)\r\n",
67   - tcpstat.tcps_rcvduppack, tcpstat.tcps_rcvdupbyte);
68   -
69   - lprint(" %6d packets with some duplicate data (%d bytes duped)\r\n",
70   - tcpstat.tcps_rcvpartduppack, tcpstat.tcps_rcvpartdupbyte);
71   - lprint(" %6d out-of-order packets (%d bytes)\r\n",
72   - tcpstat.tcps_rcvoopack, tcpstat.tcps_rcvoobyte);
73   - lprint(" %6d packets of data after window (%d bytes)\r\n",
74   - tcpstat.tcps_rcvpackafterwin, tcpstat.tcps_rcvbyteafterwin);
75   - lprint(" %6d window probes\r\n", tcpstat.tcps_rcvwinprobe);
76   - lprint(" %6d window update packets\r\n", tcpstat.tcps_rcvwinupd);
77   - lprint(" %6d packets received after close\r\n", tcpstat.tcps_rcvafterclose);
78   - lprint(" %6d discarded for bad checksums\r\n", tcpstat.tcps_rcvbadsum);
79   - lprint(" %6d discarded for bad header offset fields\r\n",
80   - tcpstat.tcps_rcvbadoff);
81   -
82   - lprint(" %6d connection requests\r\n", tcpstat.tcps_connattempt);
83   - lprint(" %6d connection accepts\r\n", tcpstat.tcps_accepts);
84   - lprint(" %6d connections established (including accepts)\r\n", tcpstat.tcps_connects);
85   - lprint(" %6d connections closed (including %d drop)\r\n",
86   - tcpstat.tcps_closed, tcpstat.tcps_drops);
87   - lprint(" %6d embryonic connections dropped\r\n", tcpstat.tcps_conndrops);
88   - lprint(" %6d segments we tried to get rtt (%d succeeded)\r\n",
89   - tcpstat.tcps_segstimed, tcpstat.tcps_rttupdated);
90   - lprint(" %6d retransmit timeouts\r\n", tcpstat.tcps_rexmttimeo);
91   - lprint(" %6d connections dropped by rxmt timeout\r\n",
92   - tcpstat.tcps_timeoutdrop);
93   - lprint(" %6d persist timeouts\r\n", tcpstat.tcps_persisttimeo);
94   - lprint(" %6d keepalive timeouts\r\n", tcpstat.tcps_keeptimeo);
95   - lprint(" %6d keepalive probes sent\r\n", tcpstat.tcps_keepprobe);
96   - lprint(" %6d connections dropped by keepalive\r\n", tcpstat.tcps_keepdrops);
97   - lprint(" %6d correct ACK header predictions\r\n", tcpstat.tcps_predack);
98   - lprint(" %6d correct data packet header predictions\n", tcpstat.tcps_preddat);
99   - lprint(" %6d TCP cache misses\r\n", tcpstat.tcps_socachemiss);
100   -}
101   -
102   -static void
103   -udpstats(void)
104   -{
105   - lprint(" \r\n");
106   -
107   - lprint("UDP stats:\r\n");
108   - lprint(" %6d datagrams received\r\n", udpstat.udps_ipackets);
109   - lprint(" %6d with packets shorter than header\r\n", udpstat.udps_hdrops);
110   - lprint(" %6d with bad checksums\r\n", udpstat.udps_badsum);
111   - lprint(" %6d with data length larger than packet\r\n", udpstat.udps_badlen);
112   - lprint(" %6d UDP socket cache misses\r\n", udpstat.udpps_pcbcachemiss);
113   - lprint(" %6d datagrams sent\r\n", udpstat.udps_opackets);
114   -}
115   -
116   -static void
117   -icmpstats(void)
118   -{
119   - lprint(" \r\n");
120   - lprint("ICMP stats:\r\n");
121   - lprint(" %6d ICMP packets received\r\n", icmpstat.icps_received);
122   - lprint(" %6d were too short\r\n", icmpstat.icps_tooshort);
123   - lprint(" %6d with bad checksums\r\n", icmpstat.icps_checksum);
124   - lprint(" %6d with type not supported\r\n", icmpstat.icps_notsupp);
125   - lprint(" %6d with bad type feilds\r\n", icmpstat.icps_badtype);
126   - lprint(" %6d ICMP packets sent in reply\r\n", icmpstat.icps_reflect);
127   -}
128   -
129   -static void
130   -mbufstats(void)
131   -{
132   - struct mbuf *m;
133   - int i;
134   -
135   - lprint(" \r\n");
136   -
137   - lprint("Mbuf stats:\r\n");
138   -
139   - lprint(" %6d mbufs allocated (%d max)\r\n", mbuf_alloced, mbuf_max);
140   -
141   - i = 0;
142   - for (m = m_freelist.m_next; m != &m_freelist; m = m->m_next)
143   - i++;
144   - lprint(" %6d mbufs on free list\r\n", i);
145   -
146   - i = 0;
147   - for (m = m_usedlist.m_next; m != &m_usedlist; m = m->m_next)
148   - i++;
149   - lprint(" %6d mbufs on used list\r\n", i);
150   - lprint(" %6d mbufs queued as packets\r\n\r\n", if_queued);
151   -}
152   -#endif
153   -
154   -void
155   -slirp_stats(void)
156   -{
157   -#ifdef LOG_ENABLED
158   - ipstats();
159   - tcpstats();
160   - udpstats();
161   - icmpstats();
162   - mbufstats();
163   -#else
164   - lprint("SLIRP statistics code not compiled.\n");
165   -#endif
166   -}
... ...
slirp/icmp_var.h
... ... @@ -34,20 +34,6 @@
34 34 #define _NETINET_ICMP_VAR_H_
35 35  
36 36 /*
37   - * Variables related to this implementation
38   - * of the internet control message protocol.
39   - */
40   -struct icmpstat {
41   -/* statistics related to input messages processed */
42   - u_long icps_received; /* #ICMP packets received */
43   - u_long icps_tooshort; /* packet < ICMP_MINLEN */
44   - u_long icps_checksum; /* bad checksum */
45   - u_long icps_notsupp; /* #ICMP packets not supported */
46   - u_long icps_badtype; /* #with bad type feild */
47   - u_long icps_reflect; /* number of responses */
48   -};
49   -
50   -/*
51 37 * Names for ICMP sysctl objects
52 38 */
53 39 #define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
... ... @@ -60,8 +46,4 @@ struct icmpstat {
60 46 { "stats", CTLTYPE_STRUCT }, \
61 47 }
62 48  
63   -#ifdef LOG_ENABLED
64   -extern struct icmpstat icmpstat;
65   -#endif
66   -
67 49 #endif
... ...
slirp/if.h
... ... @@ -28,24 +28,4 @@ extern struct mbuf *next_m;
28 28  
29 29 #define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm))
30 30  
31   -#ifdef LOG_ENABLED
32   -/* Interface statistics */
33   -struct slirp_ifstats {
34   - u_int out_pkts; /* Output packets */
35   - u_int out_bytes; /* Output bytes */
36   - u_int out_errpkts; /* Output Error Packets */
37   - u_int out_errbytes; /* Output Error Bytes */
38   - u_int in_pkts; /* Input packets */
39   - u_int in_bytes; /* Input bytes */
40   - u_int in_errpkts; /* Input Error Packets */
41   - u_int in_errbytes; /* Input Error Bytes */
42   -
43   - u_int bytes_saved; /* Number of bytes that compression "saved" */
44   - /* ie: number of bytes that didn't need to be sent over the link
45   - * because of compression */
46   -
47   - u_int in_mbad; /* Bad incoming packets */
48   -};
49   -#endif
50   -
51 31 #endif
... ...
slirp/ip.h
... ... @@ -250,43 +250,6 @@ struct ipoption {
250 250 int8_t ipopt_list[MAX_IPOPTLEN]; /* options proper */
251 251 };
252 252  
253   -#ifdef LOG_ENABLED
254   -/*
255   - * Structure attached to inpcb.ip_moptions and
256   - * passed to ip_output when IP multicast options are in use.
257   - */
258   -
259   -struct ipstat {
260   - u_long ips_total; /* total packets received */
261   - u_long ips_badsum; /* checksum bad */
262   - u_long ips_tooshort; /* packet too short */
263   - u_long ips_toosmall; /* not enough data */
264   - u_long ips_badhlen; /* ip header length < data size */
265   - u_long ips_badlen; /* ip length < ip header length */
266   - u_long ips_fragments; /* fragments received */
267   - u_long ips_fragdropped; /* frags dropped (dups, out of space) */
268   - u_long ips_fragtimeout; /* fragments timed out */
269   - u_long ips_forward; /* packets forwarded */
270   - u_long ips_cantforward; /* packets rcvd for unreachable dest */
271   - u_long ips_redirectsent; /* packets forwarded on same net */
272   - u_long ips_noproto; /* unknown or unsupported protocol */
273   - u_long ips_delivered; /* datagrams delivered to upper level*/
274   - u_long ips_localout; /* total ip packets generated here */
275   - u_long ips_odropped; /* lost packets due to nobufs, etc. */
276   - u_long ips_reassembled; /* total packets reassembled ok */
277   - u_long ips_fragmented; /* datagrams successfully fragmented */
278   - u_long ips_ofragments; /* output fragments created */
279   - u_long ips_cantfrag; /* don't fragment flag was set, etc. */
280   - u_long ips_badoptions; /* error in option processing */
281   - u_long ips_noroute; /* packets discarded due to no route */
282   - u_long ips_badvers; /* ip version != 4 */
283   - u_long ips_rawout; /* total raw ip packets generated */
284   - u_long ips_unaligned; /* times the ip packet was not aligned */
285   -};
286   -
287   -extern struct ipstat ipstat;
288   -#endif
289   -
290 253 extern struct ipq ipq; /* ip reass. queue */
291 254 extern u_int16_t ip_id; /* ip packet ctr, for ids */
292 255  
... ...
slirp/ip_icmp.c
... ... @@ -33,10 +33,6 @@
33 33 #include "slirp.h"
34 34 #include "ip_icmp.h"
35 35  
36   -#ifdef LOG_ENABLED
37   -struct icmpstat icmpstat;
38   -#endif
39   -
40 36 /* The message sent when emulating PING */
41 37 /* Be nice and tell them it's just a pseudo-ping packet */
42 38 static const char icmp_ping_msg[] = "This is a pseudo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n";
... ... @@ -78,14 +74,11 @@ icmp_input(struct mbuf *m, int hlen)
78 74 DEBUG_ARG("m = %lx", (long )m);
79 75 DEBUG_ARG("m_len = %d", m->m_len);
80 76  
81   - STAT(icmpstat.icps_received++);
82   -
83 77 /*
84 78 * Locate icmp structure in mbuf, and check
85 79 * that its not corrupted and of at least minimum length.
86 80 */
87 81 if (icmplen < ICMP_MINLEN) { /* min 8 bytes payload */
88   - STAT(icmpstat.icps_tooshort++);
89 82 freeit:
90 83 m_freem(m);
91 84 goto end_error;
... ... @@ -95,7 +88,6 @@ icmp_input(struct mbuf *m, int hlen)
95 88 m->m_data += hlen;
96 89 icp = mtod(m, struct icmp *);
97 90 if (cksum(m, icmplen)) {
98   - STAT(icmpstat.icps_checksum++);
99 91 goto freeit;
100 92 }
101 93 m->m_len += hlen;
... ... @@ -159,12 +151,10 @@ icmp_input(struct mbuf *m, int hlen)
159 151 case ICMP_TSTAMP:
160 152 case ICMP_MASKREQ:
161 153 case ICMP_REDIRECT:
162   - STAT(icmpstat.icps_notsupp++);
163 154 m_freem(m);
164 155 break;
165 156  
166 157 default:
167   - STAT(icmpstat.icps_badtype++);
168 158 m_freem(m);
169 159 } /* swith */
170 160  
... ... @@ -299,8 +289,6 @@ icmp_error(struct mbuf *msrc, u_char type, u_char code, int minsize,
299 289  
300 290 (void ) ip_output((struct socket *)NULL, m);
301 291  
302   - STAT(icmpstat.icps_reflect++);
303   -
304 292 end_error:
305 293 return;
306 294 }
... ... @@ -354,6 +342,4 @@ icmp_reflect(struct mbuf *m)
354 342 }
355 343  
356 344 (void ) ip_output((struct socket *)NULL, m);
357   -
358   - STAT(icmpstat.icps_reflect++);
359 345 }
... ...
slirp/ip_input.c
... ... @@ -42,10 +42,6 @@
42 42 #include <osdep.h>
43 43 #include "ip_icmp.h"
44 44  
45   -#ifdef LOG_ENABLED
46   -struct ipstat ipstat;
47   -#endif
48   -
49 45 struct ipq ipq;
50 46  
51 47 static struct ip *ip_reass(register struct ip *ip,
... ... @@ -82,24 +78,19 @@ ip_input(struct mbuf *m)
82 78 DEBUG_ARG("m = %lx", (long)m);
83 79 DEBUG_ARG("m_len = %d", m->m_len);
84 80  
85   - STAT(ipstat.ips_total++);
86   -
87 81 if (m->m_len < sizeof (struct ip)) {
88   - STAT(ipstat.ips_toosmall++);
89 82 return;
90 83 }
91 84  
92 85 ip = mtod(m, struct ip *);
93 86  
94 87 if (ip->ip_v != IPVERSION) {
95   - STAT(ipstat.ips_badvers++);
96 88 goto bad;
97 89 }
98 90  
99 91 hlen = ip->ip_hl << 2;
100 92 if (hlen<sizeof(struct ip ) || hlen>m->m_len) {/* min header length */
101   - STAT(ipstat.ips_badhlen++); /* or packet too short */
102   - goto bad;
  93 + goto bad; /* or packet too short */
103 94 }
104 95  
105 96 /* keep ip header intact for ICMP reply
... ... @@ -107,7 +98,6 @@ ip_input(struct mbuf *m)
107 98 * if (ip->ip_sum) {
108 99 */
109 100 if(cksum(m,hlen)) {
110   - STAT(ipstat.ips_badsum++);
111 101 goto bad;
112 102 }
113 103  
... ... @@ -116,7 +106,6 @@ ip_input(struct mbuf *m)
116 106 */
117 107 NTOHS(ip->ip_len);
118 108 if (ip->ip_len < hlen) {
119   - STAT(ipstat.ips_badlen++);
120 109 goto bad;
121 110 }
122 111 NTOHS(ip->ip_id);
... ... @@ -129,7 +118,6 @@ ip_input(struct mbuf *m)
129 118 * Drop packet if shorter than we expect.
130 119 */
131 120 if (m->m_len < ip->ip_len) {
132   - STAT(ipstat.ips_tooshort++);
133 121 goto bad;
134 122 }
135 123  
... ... @@ -210,11 +198,9 @@ ip_input(struct mbuf *m)
210 198 * attempt reassembly; if it succeeds, proceed.
211 199 */
212 200 if (ip->ip_tos & 1 || ip->ip_off) {
213   - STAT(ipstat.ips_fragments++);
214 201 ip = ip_reass(ip, fp);
215 202 if (ip == NULL)
216 203 return;
217   - STAT(ipstat.ips_reassembled++);
218 204 m = dtom(ip);
219 205 } else
220 206 if (fp)
... ... @@ -226,7 +212,6 @@ ip_input(struct mbuf *m)
226 212 /*
227 213 * Switch out to protocol's input routine.
228 214 */
229   - STAT(ipstat.ips_delivered++);
230 215 switch (ip->ip_p) {
231 216 case IPPROTO_TCP:
232 217 tcp_input(m, hlen, (struct socket *)NULL);
... ... @@ -238,7 +223,6 @@ ip_input(struct mbuf *m)
238 223 icmp_input(m, hlen);
239 224 break;
240 225 default:
241   - STAT(ipstat.ips_noproto++);
242 226 m_free(m);
243 227 }
244 228 return;
... ... @@ -399,7 +383,6 @@ insert:
399 383 return ip;
400 384  
401 385 dropfrag:
402   - STAT(ipstat.ips_fragdropped++);
403 386 m_freem(m);
404 387 return NULL;
405 388 }
... ... @@ -468,7 +451,6 @@ ip_slowtimo(void)
468 451 struct ipq *fp = container_of(l, struct ipq, ip_link);
469 452 l = l->next;
470 453 if (--fp->ipq_ttl == 0) {
471   - STAT(ipstat.ips_fragtimeout++);
472 454 ip_freef(fp);
473 455 }
474 456 }
... ... @@ -671,7 +653,6 @@ typedef u_int32_t n_time;
671 653 bad:
672 654 icmp_error(m, type, code, 0, 0);
673 655  
674   - STAT(ipstat.ips_badoptions++);
675 656 return (1);
676 657 }
677 658  
... ...
slirp/ip_output.c
... ... @@ -72,7 +72,6 @@ ip_output(struct socket *so, struct mbuf *m0)
72 72 ip->ip_off &= IP_DF;
73 73 ip->ip_id = htons(ip_id++);
74 74 ip->ip_hl = hlen >> 2;
75   - STAT(ipstat.ips_localout++);
76 75  
77 76 /*
78 77 * If small enough for interface, can just send directly.
... ... @@ -93,7 +92,6 @@ ip_output(struct socket *so, struct mbuf *m0)
93 92 */
94 93 if (ip->ip_off & IP_DF) {
95 94 error = -1;
96   - STAT(ipstat.ips_cantfrag++);
97 95 goto bad;
98 96 }
99 97  
... ... @@ -118,7 +116,6 @@ ip_output(struct socket *so, struct mbuf *m0)
118 116 m = m_get();
119 117 if (m == NULL) {
120 118 error = -1;
121   - STAT(ipstat.ips_odropped++);
122 119 goto sendorfree;
123 120 }
124 121 m->m_data += IF_MAXLINKHDR;
... ... @@ -145,7 +142,6 @@ ip_output(struct socket *so, struct mbuf *m0)
145 142 mhip->ip_sum = cksum(m, mhlen);
146 143 *mnext = m;
147 144 mnext = &m->m_nextpkt;
148   - STAT(ipstat.ips_ofragments++);
149 145 }
150 146 /*
151 147 * Update first fragment by trimming what's been copied out
... ... @@ -166,9 +162,6 @@ sendorfree:
166 162 else
167 163 m_freem(m);
168 164 }
169   -
170   - if (error == 0)
171   - STAT(ipstat.ips_fragmented++);
172 165 }
173 166  
174 167 done:
... ...
slirp/libslirp.h
... ... @@ -26,7 +26,6 @@ int slirp_remove_hostfwd(int is_udp, struct in_addr host_addr, int host_port);
26 26 int slirp_add_exec(int do_pty, const void *args, struct in_addr guest_addr,
27 27 int guest_port);
28 28  
29   -void slirp_stats(void);
30 29 void slirp_connection_info(Monitor *mon);
31 30  
32 31 void slirp_socket_recv(struct in_addr guest_addr, int guest_port,
... ...
slirp/mbuf.c
... ... @@ -17,10 +17,9 @@
17 17  
18 18 #include <slirp.h>
19 19  
20   -int mbuf_alloced = 0;
  20 +static int mbuf_alloced;
21 21 struct mbuf m_freelist, m_usedlist;
22 22 #define MBUF_THRESH 30
23   -int mbuf_max = 0;
24 23  
25 24 /*
26 25 * Find a nice value for msize
... ... @@ -57,8 +56,6 @@ m_get(void)
57 56 mbuf_alloced++;
58 57 if (mbuf_alloced > MBUF_THRESH)
59 58 flags = M_DOFREE;
60   - if (mbuf_alloced > mbuf_max)
61   - mbuf_max = mbuf_alloced;
62 59 } else {
63 60 m = m_freelist.m_next;
64 61 remque(m);
... ...
slirp/mbuf.h
... ... @@ -114,19 +114,7 @@ struct mbuf {
114 114 #define M_DOFREE 0x08 /* when m_free is called on the mbuf, free()
115 115 * it rather than putting it on the free list */
116 116  
117   -/*
118   - * Mbuf statistics. XXX
119   - */
120   -
121   -struct mbstat {
122   - int mbs_alloced; /* Number of mbufs allocated */
123   -
124   -};
125   -
126   -extern struct mbstat mbstat;
127   -extern int mbuf_alloced;
128 117 extern struct mbuf m_freelist, m_usedlist;
129   -extern int mbuf_max;
130 118  
131 119 void m_init _P((void));
132 120 struct mbuf * m_get _P((void));
... ...
slirp/slirp.h
... ... @@ -3,15 +3,6 @@
3 3  
4 4 //#define DEBUG 1
5 5  
6   -// Uncomment the following line to enable SLIRP statistics printing in Qemu
7   -//#define LOG_ENABLED
8   -
9   -#ifdef LOG_ENABLED
10   -#define STAT(expr) expr
11   -#else
12   -#define STAT(expr) do { } while(0)
13   -#endif
14   -
15 6 #include "config-host.h"
16 7 #include "slirp_config.h"
17 8  
... ...
slirp/tcp_input.c
... ... @@ -75,8 +75,6 @@ tcp_seq tcp_iss; /* tcp initial send seq # */
75 75 tp->t_flags |= TF_DELACK; \
76 76 (tp)->rcv_nxt += (ti)->ti_len; \
77 77 flags = (ti)->ti_flags & TH_FIN; \
78   - STAT(tcpstat.tcps_rcvpack++); \
79   - STAT(tcpstat.tcps_rcvbyte += (ti)->ti_len); \
80 78 if (so->so_emu) { \
81 79 if (tcp_emu((so),(m))) sbappend((so), (m)); \
82 80 } else \
... ... @@ -94,8 +92,6 @@ tcp_seq tcp_iss; /* tcp initial send seq # */
94 92 tp->t_flags |= TF_DELACK; \
95 93 (tp)->rcv_nxt += (ti)->ti_len; \
96 94 flags = (ti)->ti_flags & TH_FIN; \
97   - STAT(tcpstat.tcps_rcvpack++); \
98   - STAT(tcpstat.tcps_rcvbyte += (ti)->ti_len); \
99 95 if (so->so_emu) { \
100 96 if (tcp_emu((so),(m))) sbappend(so, (m)); \
101 97 } else \
... ... @@ -145,8 +141,6 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
145 141 i = q->ti_seq + q->ti_len - ti->ti_seq;
146 142 if (i > 0) {
147 143 if (i >= ti->ti_len) {
148   - STAT(tcpstat.tcps_rcvduppack++);
149   - STAT(tcpstat.tcps_rcvdupbyte += ti->ti_len);
150 144 m_freem(m);
151 145 /*
152 146 * Try to present any queued data
... ... @@ -162,8 +156,6 @@ tcp_reass(register struct tcpcb *tp, register struct tcpiphdr *ti,
162 156 }
163 157 q = tcpiphdr_next(q);
164 158 }
165   - STAT(tcpstat.tcps_rcvoopack++);
166   - STAT(tcpstat.tcps_rcvoobyte += ti->ti_len);
167 159 ti->ti_mbuf = m;
168 160  
169 161 /*
... ... @@ -263,8 +255,6 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
263 255 goto cont_conn;
264 256 }
265 257  
266   -
267   - STAT(tcpstat.tcps_rcvtotal++);
268 258 /*
269 259 * Get IP and TCP header together in first mbuf.
270 260 * Note: IP leaves IP header in first mbuf.
... ... @@ -295,7 +285,6 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
295 285 ti->ti_len = htons((u_int16_t)tlen);
296 286 len = sizeof(struct ip ) + tlen;
297 287 if(cksum(m, len)) {
298   - STAT(tcpstat.tcps_rcvbadsum++);
299 288 goto drop;
300 289 }
301 290  
... ... @@ -305,7 +294,6 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
305 294 */
306 295 off = ti->ti_off << 2;
307 296 if (off < sizeof (struct tcphdr) || off > tlen) {
308   - STAT(tcpstat.tcps_rcvbadoff++);
309 297 goto drop;
310 298 }
311 299 tlen -= off;
... ... @@ -353,7 +341,6 @@ findso:
353 341 ti->ti_dst, ti->ti_dport);
354 342 if (so)
355 343 tcp_last_so = so;
356   - STAT(tcpstat.tcps_socachemiss++);
357 344 }
358 345  
359 346 /*
... ... @@ -460,13 +447,10 @@ findso:
460 447 /*
461 448 * this is a pure ack for outstanding data.
462 449 */
463   - STAT(tcpstat.tcps_predack++);
464 450 if (tp->t_rtt &&
465 451 SEQ_GT(ti->ti_ack, tp->t_rtseq))
466 452 tcp_xmit_timer(tp, tp->t_rtt);
467 453 acked = ti->ti_ack - tp->snd_una;
468   - STAT(tcpstat.tcps_rcvackpack++);
469   - STAT(tcpstat.tcps_rcvackbyte += acked);
470 454 sbdrop(&so->so_snd, acked);
471 455 tp->snd_una = ti->ti_ack;
472 456 m_freem(m);
... ... @@ -503,10 +487,7 @@ findso:
503 487 * with nothing on the reassembly queue and
504 488 * we have enough buffer space to take it.
505 489 */
506   - STAT(tcpstat.tcps_preddat++);
507 490 tp->rcv_nxt += ti->ti_len;
508   - STAT(tcpstat.tcps_rcvpack++);
509   - STAT(tcpstat.tcps_rcvbyte += ti->ti_len);
510 491 /*
511 492 * Add data to socket buffer.
512 493 */
... ... @@ -658,7 +639,6 @@ findso:
658 639 tp->t_flags |= TF_ACKNOW;
659 640 tp->t_state = TCPS_SYN_RECEIVED;
660 641 tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
661   - STAT(tcpstat.tcps_accepts++);
662 642 goto trimthenstep6;
663 643 } /* case TCPS_LISTEN */
664 644  
... ... @@ -699,7 +679,6 @@ findso:
699 679 tcp_rcvseqinit(tp);
700 680 tp->t_flags |= TF_ACKNOW;
701 681 if (tiflags & TH_ACK && SEQ_GT(tp->snd_una, tp->iss)) {
702   - STAT(tcpstat.tcps_connects++);
703 682 soisfconnected(so);
704 683 tp->t_state = TCPS_ESTABLISHED;
705 684  
... ... @@ -726,8 +705,6 @@ trimthenstep6:
726 705 m_adj(m, -todrop);
727 706 ti->ti_len = tp->rcv_wnd;
728 707 tiflags &= ~TH_FIN;
729   - STAT(tcpstat.tcps_rcvpackafterwin++);
730   - STAT(tcpstat.tcps_rcvbyteafterwin += todrop);
731 708 }
732 709 tp->snd_wl1 = ti->ti_seq - 1;
733 710 tp->rcv_up = ti->ti_seq;
... ... @@ -768,11 +745,6 @@ trimthenstep6:
768 745 */
769 746 tp->t_flags |= TF_ACKNOW;
770 747 todrop = ti->ti_len;
771   - STAT(tcpstat.tcps_rcvduppack++);
772   - STAT(tcpstat.tcps_rcvdupbyte += todrop);
773   - } else {
774   - STAT(tcpstat.tcps_rcvpartduppack++);
775   - STAT(tcpstat.tcps_rcvpartdupbyte += todrop);
776 748 }
777 749 m_adj(m, todrop);
778 750 ti->ti_seq += todrop;
... ... @@ -791,7 +763,6 @@ trimthenstep6:
791 763 if ((so->so_state & SS_NOFDREF) &&
792 764 tp->t_state > TCPS_CLOSE_WAIT && ti->ti_len) {
793 765 tp = tcp_close(tp);
794   - STAT(tcpstat.tcps_rcvafterclose++);
795 766 goto dropwithreset;
796 767 }
797 768  
... ... @@ -801,9 +772,7 @@ trimthenstep6:
801 772 */
802 773 todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
803 774 if (todrop > 0) {
804   - STAT(tcpstat.tcps_rcvpackafterwin++);
805 775 if (todrop >= ti->ti_len) {
806   - STAT(tcpstat.tcps_rcvbyteafterwin += ti->ti_len);
807 776 /*
808 777 * If a new connection request is received
809 778 * while in TIME_WAIT, drop the old connection
... ... @@ -826,11 +795,10 @@ trimthenstep6:
826 795 */
827 796 if (tp->rcv_wnd == 0 && ti->ti_seq == tp->rcv_nxt) {
828 797 tp->t_flags |= TF_ACKNOW;
829   - STAT(tcpstat.tcps_rcvwinprobe++);
830   - } else
  798 + } else {
831 799 goto dropafterack;
832   - } else
833   - STAT(tcpstat.tcps_rcvbyteafterwin += todrop);
  800 + }
  801 + }
834 802 m_adj(m, -todrop);
835 803 ti->ti_len -= todrop;
836 804 tiflags &= ~(TH_PUSH|TH_FIN);
... ... @@ -854,7 +822,6 @@ trimthenstep6:
854 822 case TCPS_FIN_WAIT_2:
855 823 case TCPS_CLOSE_WAIT:
856 824 tp->t_state = TCPS_CLOSED;
857   - STAT(tcpstat.tcps_drops++);
858 825 tp = tcp_close(tp);
859 826 goto drop;
860 827  
... ... @@ -893,7 +860,6 @@ trimthenstep6:
893 860 if (SEQ_GT(tp->snd_una, ti->ti_ack) ||
894 861 SEQ_GT(ti->ti_ack, tp->snd_max))
895 862 goto dropwithreset;
896   - STAT(tcpstat.tcps_connects++);
897 863 tp->t_state = TCPS_ESTABLISHED;
898 864 /*
899 865 * The sent SYN is ack'ed with our sequence number +1
... ... @@ -944,7 +910,6 @@ trimthenstep6:
944 910  
945 911 if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
946 912 if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
947   - STAT(tcpstat.tcps_rcvdupack++);
948 913 DEBUG_MISC((dfd," dup ack m = %lx so = %lx \n",
949 914 (long )m, (long )so));
950 915 /*
... ... @@ -1012,12 +977,9 @@ trimthenstep6:
1012 977 tp->snd_cwnd = tp->snd_ssthresh;
1013 978 tp->t_dupacks = 0;
1014 979 if (SEQ_GT(ti->ti_ack, tp->snd_max)) {
1015   - STAT(tcpstat.tcps_rcvacktoomuch++);
1016 980 goto dropafterack;
1017 981 }
1018 982 acked = ti->ti_ack - tp->snd_una;
1019   - STAT(tcpstat.tcps_rcvackpack++);
1020   - STAT(tcpstat.tcps_rcvackbyte += acked);
1021 983  
1022 984 /*
1023 985 * If transmit timer is running and timed sequence
... ... @@ -1138,10 +1100,6 @@ step6:
1138 1100 (SEQ_LT(tp->snd_wl1, ti->ti_seq) ||
1139 1101 (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) ||
1140 1102 (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) {
1141   - /* keep track of pure window updates */
1142   - if (ti->ti_len == 0 &&
1143   - tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd)
1144   - STAT(tcpstat.tcps_rcvwinupd++);
1145 1103 tp->snd_wnd = tiwin;
1146 1104 tp->snd_wl1 = ti->ti_seq;
1147 1105 tp->snd_wl2 = ti->ti_ack;
... ... @@ -1425,7 +1383,6 @@ tcp_xmit_timer(register struct tcpcb *tp, int rtt)
1425 1383 DEBUG_ARG("tp = %lx", (long)tp);
1426 1384 DEBUG_ARG("rtt = %d", rtt);
1427 1385  
1428   - STAT(tcpstat.tcps_rttupdated++);
1429 1386 if (tp->t_srtt != 0) {
1430 1387 /*
1431 1388 * srtt is stored as fixed point with 3 bits after the
... ...
slirp/tcp_output.c
... ... @@ -247,8 +247,6 @@ again:
247 247 /*
248 248 * No reason to send a segment, just return.
249 249 */
250   - STAT(tcpstat.tcps_didnuttin++);
251   -
252 250 return (0);
253 251  
254 252 send:
... ... @@ -292,16 +290,6 @@ send:
292 290 * the template for sends on this connection.
293 291 */
294 292 if (len) {
295   - if (tp->t_force && len == 1)
296   - STAT(tcpstat.tcps_sndprobe++);
297   - else if (SEQ_LT(tp->snd_nxt, tp->snd_max)) {
298   - STAT(tcpstat.tcps_sndrexmitpack++);
299   - STAT(tcpstat.tcps_sndrexmitbyte += len);
300   - } else {
301   - STAT(tcpstat.tcps_sndpack++);
302   - STAT(tcpstat.tcps_sndbyte += len);
303   - }
304   -
305 293 m = m_get();
306 294 if (m == NULL) {
307 295 error = 1;
... ... @@ -322,15 +310,6 @@ send:
322 310 if (off + len == so->so_snd.sb_cc)
323 311 flags |= TH_PUSH;
324 312 } else {
325   - if (tp->t_flags & TF_ACKNOW)
326   - STAT(tcpstat.tcps_sndacks++);
327   - else if (flags & (TH_SYN|TH_FIN|TH_RST))
328   - STAT(tcpstat.tcps_sndctrl++);
329   - else if (SEQ_GT(tp->snd_up, tp->snd_una))
330   - STAT(tcpstat.tcps_sndurg++);
331   - else
332   - STAT(tcpstat.tcps_sndwinup++);
333   -
334 313 m = m_get();
335 314 if (m == NULL) {
336 315 error = 1;
... ... @@ -436,7 +415,6 @@ send:
436 415 if (tp->t_rtt == 0) {
437 416 tp->t_rtt = 1;
438 417 tp->t_rtseq = startseq;
439   - STAT(tcpstat.tcps_segstimed++);
440 418 }
441 419 }
442 420  
... ... @@ -481,7 +459,6 @@ send:
481 459 out:
482 460 return (error);
483 461 }
484   - STAT(tcpstat.tcps_sndtotal++);
485 462  
486 463 /*
487 464 * Data sent (as far as we can tell).
... ...
slirp/tcp_subr.c
... ... @@ -222,9 +222,7 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err)
222 222 if (TCPS_HAVERCVDSYN(tp->t_state)) {
223 223 tp->t_state = TCPS_CLOSED;
224 224 (void) tcp_output(tp);
225   - STAT(tcpstat.tcps_drops++);
226   - } else
227   - STAT(tcpstat.tcps_conndrops++);
  225 + }
228 226 return (tcp_close(tp));
229 227 }
230 228  
... ... @@ -261,7 +259,6 @@ tcp_close(struct tcpcb *tp)
261 259 sbfree(&so->so_rcv);
262 260 sbfree(&so->so_snd);
263 261 sofree(so);
264   - STAT(tcpstat.tcps_closed++);
265 262 return ((struct tcpcb *)0);
266 263 }
267 264  
... ... @@ -442,8 +439,6 @@ tcp_connect(struct socket *inso)
442 439  
443 440 tcp_template(tp);
444 441  
445   - STAT(tcpstat.tcps_connattempt++);
446   -
447 442 tp->t_state = TCPS_SYN_SENT;
448 443 tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
449 444 tp->iss = tcp_iss;
... ...
slirp/tcp_timer.c
... ... @@ -32,10 +32,6 @@
32 32  
33 33 #include <slirp.h>
34 34  
35   -#ifdef LOG_ENABLED
36   -struct tcpstat tcpstat; /* tcp statistics */
37   -#endif
38   -
39 35 u_int32_t tcp_now; /* for RFC 1323 timestamps */
40 36  
41 37 static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer);
... ... @@ -58,7 +54,6 @@ tcp_fasttimo(void)
58 54 (tp->t_flags & TF_DELACK)) {
59 55 tp->t_flags &= ~TF_DELACK;
60 56 tp->t_flags |= TF_ACKNOW;
61   - STAT(tcpstat.tcps_delack++);
62 57 (void) tcp_output(tp);
63 58 }
64 59 }
... ... @@ -180,7 +175,6 @@ tcp_timers(register struct tcpcb *tp, int timer)
180 175 * We tried our best, now the connection must die!
181 176 */
182 177 tp->t_rxtshift = TCP_MAXRXTSHIFT;
183   - STAT(tcpstat.tcps_timeoutdrop++);
184 178 tp = tcp_drop(tp, tp->t_softerror);
185 179 /* tp->t_softerror : ETIMEDOUT); */ /* XXX */
186 180 return (tp); /* XXX */
... ... @@ -192,7 +186,6 @@ tcp_timers(register struct tcpcb *tp, int timer)
192 186 */
193 187 tp->t_rxtshift = 6;
194 188 }
195   - STAT(tcpstat.tcps_rexmttimeo++);
196 189 rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
197 190 TCPT_RANGESET(tp->t_rxtcur, rexmt,
198 191 (short)tp->t_rttmin, TCPTV_REXMTMAX); /* XXX */
... ... @@ -254,7 +247,6 @@ tcp_timers(register struct tcpcb *tp, int timer)
254 247 * Force a byte to be output, if possible.
255 248 */
256 249 case TCPT_PERSIST:
257   - STAT(tcpstat.tcps_persisttimeo++);
258 250 tcp_setpersist(tp);
259 251 tp->t_force = 1;
260 252 (void) tcp_output(tp);
... ... @@ -266,7 +258,6 @@ tcp_timers(register struct tcpcb *tp, int timer)
266 258 * or drop connection if idle for too long.
267 259 */
268 260 case TCPT_KEEP:
269   - STAT(tcpstat.tcps_keeptimeo++);
270 261 if (tp->t_state < TCPS_ESTABLISHED)
271 262 goto dropit;
272 263  
... ... @@ -285,7 +276,6 @@ tcp_timers(register struct tcpcb *tp, int timer)
285 276 * by the protocol spec, this requires the
286 277 * correspondent TCP to respond.
287 278 */
288   - STAT(tcpstat.tcps_keepprobe++);
289 279 tcp_respond(tp, &tp->t_template, (struct mbuf *)NULL,
290 280 tp->rcv_nxt, tp->snd_una - 1, 0);
291 281 tp->t_timer[TCPT_KEEP] = TCPTV_KEEPINTVL;
... ... @@ -294,7 +284,6 @@ tcp_timers(register struct tcpcb *tp, int timer)
294 284 break;
295 285  
296 286 dropit:
297   - STAT(tcpstat.tcps_keepdrops++);
298 287 tp = tcp_drop(tp, 0);
299 288 break;
300 289 }
... ...
slirp/tcp_var.h
... ... @@ -158,69 +158,6 @@ struct tcpcb {
158 158 #define TCP_REXMTVAL(tp) \
159 159 (((tp)->t_srtt >> TCP_RTT_SHIFT) + (tp)->t_rttvar)
160 160  
161   -#ifdef LOG_ENABLED
162   -/*
163   - * TCP statistics.
164   - * Many of these should be kept per connection,
165   - * but that's inconvenient at the moment.
166   - */
167   -struct tcpstat {
168   - u_long tcps_connattempt; /* connections initiated */
169   - u_long tcps_accepts; /* connections accepted */
170   - u_long tcps_connects; /* connections established */
171   - u_long tcps_drops; /* connections dropped */
172   - u_long tcps_conndrops; /* embryonic connections dropped */
173   - u_long tcps_closed; /* conn. closed (includes drops) */
174   - u_long tcps_segstimed; /* segs where we tried to get rtt */
175   - u_long tcps_rttupdated; /* times we succeeded */
176   - u_long tcps_delack; /* delayed acks sent */
177   - u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */
178   - u_long tcps_rexmttimeo; /* retransmit timeouts */
179   - u_long tcps_persisttimeo; /* persist timeouts */
180   - u_long tcps_keeptimeo; /* keepalive timeouts */
181   - u_long tcps_keepprobe; /* keepalive probes sent */
182   - u_long tcps_keepdrops; /* connections dropped in keepalive */
183   -
184   - u_long tcps_sndtotal; /* total packets sent */
185   - u_long tcps_sndpack; /* data packets sent */
186   - u_long tcps_sndbyte; /* data bytes sent */
187   - u_long tcps_sndrexmitpack; /* data packets retransmitted */
188   - u_long tcps_sndrexmitbyte; /* data bytes retransmitted */
189   - u_long tcps_sndacks; /* ack-only packets sent */
190   - u_long tcps_sndprobe; /* window probes sent */
191   - u_long tcps_sndurg; /* packets sent with URG only */
192   - u_long tcps_sndwinup; /* window update-only packets sent */
193   - u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */
194   -
195   - u_long tcps_rcvtotal; /* total packets received */
196   - u_long tcps_rcvpack; /* packets received in sequence */
197   - u_long tcps_rcvbyte; /* bytes received in sequence */
198   - u_long tcps_rcvbadsum; /* packets received with ccksum errs */
199   - u_long tcps_rcvbadoff; /* packets received with bad offset */
200   - u_long tcps_rcvduppack; /* duplicate-only packets received */
201   - u_long tcps_rcvdupbyte; /* duplicate-only bytes received */
202   - u_long tcps_rcvpartduppack; /* packets with some duplicate data */
203   - u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
204   - u_long tcps_rcvoopack; /* out-of-order packets received */
205   - u_long tcps_rcvoobyte; /* out-of-order bytes received */
206   - u_long tcps_rcvpackafterwin; /* packets with data after window */
207   - u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */
208   - u_long tcps_rcvafterclose; /* packets rcvd after "close" */
209   - u_long tcps_rcvwinprobe; /* rcvd window probe packets */
210   - u_long tcps_rcvdupack; /* rcvd duplicate acks */
211   - u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */
212   - u_long tcps_rcvackpack; /* rcvd ack packets */
213   - u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */
214   - u_long tcps_rcvwinupd; /* rcvd window update packets */
215   - u_long tcps_predack; /* times hdr predict ok for acks */
216   - u_long tcps_preddat; /* times hdr predict ok for data pkts */
217   - u_long tcps_socachemiss; /* tcp_last_so misses */
218   - u_long tcps_didnuttin; /* Times tcp_output didn't do anything XXX */
219   -};
220   -
221   -extern struct tcpstat tcpstat; /* tcp statistics */
222   -#endif
223   -
224 161 extern u_int32_t tcp_now; /* for RFC 1323 timestamps */
225 162  
226 163 #endif
... ...
slirp/udp.c
... ... @@ -41,10 +41,6 @@
41 41 #include <slirp.h>
42 42 #include "ip_icmp.h"
43 43  
44   -#ifdef LOG_ENABLED
45   -struct udpstat udpstat;
46   -#endif
47   -
48 44 struct socket udb;
49 45  
50 46 static u_int8_t udp_tos(struct socket *so);
... ... @@ -74,8 +70,6 @@ udp_input(register struct mbuf *m, int iphlen)
74 70 DEBUG_ARG("m = %lx", (long)m);
75 71 DEBUG_ARG("iphlen = %d", iphlen);
76 72  
77   - STAT(udpstat.udps_ipackets++);
78   -
79 73 /*
80 74 * Strip IP options, if any; should skip this,
81 75 * make available to user, and use on returned packets,
... ... @@ -101,7 +95,6 @@ udp_input(register struct mbuf *m, int iphlen)
101 95  
102 96 if (ip->ip_len != len) {
103 97 if (len > ip->ip_len) {
104   - STAT(udpstat.udps_badlen++);
105 98 goto bad;
106 99 }
107 100 m_adj(m, len - ip->ip_len);
... ... @@ -123,7 +116,6 @@ udp_input(register struct mbuf *m, int iphlen)
123 116 ((struct ipovly *)ip)->ih_x1 = 0;
124 117 ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
125 118 if(cksum(m, len + sizeof(struct ip))) {
126   - STAT(udpstat.udps_badsum++);
127 119 goto bad;
128 120 }
129 121 }
... ... @@ -165,7 +157,6 @@ udp_input(register struct mbuf *m, int iphlen)
165 157 if (tmp == &udb) {
166 158 so = NULL;
167 159 } else {
168   - STAT(udpstat.udpps_pcbcachemiss++);
169 160 udp_last_so = so;
170 161 }
171 162 }
... ... @@ -279,8 +270,6 @@ int udp_output2(struct socket *so, struct mbuf *m,
279 270 ((struct ip *)ui)->ip_ttl = IPDEFTTL;
280 271 ((struct ip *)ui)->ip_tos = iptos;
281 272  
282   - STAT(udpstat.udps_opackets++);
283   -
284 273 error = ip_output(so, m);
285 274  
286 275 return (error);
... ...
slirp/udp.h
... ... @@ -67,32 +67,12 @@ struct udpiphdr {
67 67 #define ui_ulen ui_u.uh_ulen
68 68 #define ui_sum ui_u.uh_sum
69 69  
70   -#ifdef LOG_ENABLED
71   -struct udpstat {
72   - /* input statistics: */
73   - u_long udps_ipackets; /* total input packets */
74   - u_long udps_hdrops; /* packet shorter than header */
75   - u_long udps_badsum; /* checksum error */
76   - u_long udps_badlen; /* data length larger than packet */
77   - u_long udps_noport; /* no socket on port */
78   - u_long udps_noportbcast; /* of above, arrived as broadcast */
79   - u_long udps_fullsock; /* not delivered, input socket full */
80   - u_long udpps_pcbcachemiss; /* input packets missing pcb cache */
81   - /* output statistics: */
82   - u_long udps_opackets; /* total output packets */
83   -};
84   -#endif
85   -
86 70 /*
87 71 * Names for UDP sysctl objects
88 72 */
89 73 #define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
90 74 #define UDPCTL_MAXID 2
91 75  
92   -#ifdef LOG_ENABLED
93   -extern struct udpstat udpstat;
94   -#endif
95   -
96 76 extern struct socket udb;
97 77 struct mbuf;
98 78  
... ...