VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/tcp_subr.c@ 28480

Last change on this file since 28480 was 28480, checked in by vboxsync, 15 years ago

NAT: nuke dead code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.1 KB
Line 
1/* $Id: tcp_subr.c 28480 2010-04-19 16:25:07Z vboxsync $ */
2/** @file
3 * NAT - TCP support.
4 */
5
6/*
7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22/*
23 * This code is based on:
24 *
25 * Copyright (c) 1982, 1986, 1988, 1990, 1993
26 * The Regents of the University of California. All rights reserved.
27 *
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
30 * are met:
31 * 1. Redistributions of source code must retain the above copyright
32 * notice, this list of conditions and the following disclaimer.
33 * 2. Redistributions in binary form must reproduce the above copyright
34 * notice, this list of conditions and the following disclaimer in the
35 * documentation and/or other materials provided with the distribution.
36 * 3. All advertising materials mentioning features or use of this software
37 * must display the following acknowledgement:
38 * This product includes software developed by the University of
39 * California, Berkeley and its contributors.
40 * 4. Neither the name of the University nor the names of its contributors
41 * may be used to endorse or promote products derived from this software
42 * without specific prior written permission.
43 *
44 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 *
56 * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93
57 * tcp_subr.c,v 1.5 1994/10/08 22:39:58 phk Exp
58 */
59
60/*
61 * Changes and additions relating to SLiRP
62 * Copyright (c) 1995 Danny Gasparovski.
63 *
64 * Please read the file COPYRIGHT for the
65 * terms and conditions of the copyright.
66 */
67
68#define WANT_SYS_IOCTL_H
69#include <slirp.h>
70
71
72/*
73 * Tcp initialization
74 */
75void
76tcp_init(PNATState pData)
77{
78 tcp_iss = 1; /* wrong */
79 tcb.so_next = tcb.so_prev = &tcb;
80 tcp_last_so = &tcb;
81 tcp_reass_maxqlen = 48;
82 tcp_reass_maxseg = 256;
83}
84
85/*
86 * Create template to be used to send tcp packets on a connection.
87 * Call after host entry created, fills
88 * in a skeletal tcp/ip header, minimizing the amount of work
89 * necessary when the connection is used.
90 */
91/* struct tcpiphdr * */
92void
93tcp_template(struct tcpcb *tp)
94{
95 struct socket *so = tp->t_socket;
96 register struct tcpiphdr *n = &tp->t_template;
97
98 memset(n->ti_x1, 0, 9);
99 n->ti_pr = IPPROTO_TCP;
100 n->ti_len = RT_H2N_U16(sizeof (struct tcpiphdr) - sizeof (struct ip));
101 n->ti_src = so->so_faddr;
102 n->ti_dst = so->so_laddr;
103 n->ti_sport = so->so_fport;
104 n->ti_dport = so->so_lport;
105
106 n->ti_seq = 0;
107 n->ti_ack = 0;
108 n->ti_x2 = 0;
109 n->ti_off = 5;
110 n->ti_flags = 0;
111 n->ti_win = 0;
112 n->ti_sum = 0;
113 n->ti_urp = 0;
114}
115
116/*
117 * Send a single message to the TCP at address specified by
118 * the given TCP/IP header. If m == 0, then we make a copy
119 * of the tcpiphdr at ti and send directly to the addressed host.
120 * This is used to force keep alive messages out using the TCP
121 * template for a connection tp->t_template. If flags are given
122 * then we send a message back to the TCP which originated the
123 * segment ti, and discard the mbuf containing it and any other
124 * attached mbufs.
125 *
126 * In any case the ack and sequence number of the transmitted
127 * segment are as specified by the parameters.
128 */
129void
130tcp_respond(PNATState pData, struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags)
131{
132 register int tlen;
133 int win = 0;
134
135 DEBUG_CALL("tcp_respond");
136 DEBUG_ARG("tp = %lx", (long)tp);
137 DEBUG_ARG("ti = %lx", (long)ti);
138 DEBUG_ARG("m = %lx", (long)m);
139 DEBUG_ARG("ack = %u", ack);
140 DEBUG_ARG("seq = %u", seq);
141 DEBUG_ARG("flags = %x", flags);
142
143 if (tp)
144 win = sbspace(&tp->t_socket->so_rcv);
145 if (m == 0)
146 {
147#ifndef VBOX_WITH_SLIRP_BSD_MBUF
148 if ((m = m_get(pData)) == NULL)
149#else
150 if ((m = m_gethdr(pData, M_DONTWAIT, MT_HEADER)) == NULL)
151#endif
152 return;
153#ifdef TCP_COMPAT_42
154 tlen = 1;
155#else
156 tlen = 0;
157#endif
158 m->m_data += if_maxlinkhdr;
159#ifdef VBOX_WITH_SLIRP_BSD_MBUF
160 m->m_pkthdr.header = mtod(m, void *);
161#endif
162 *mtod(m, struct tcpiphdr *) = *ti;
163 ti = mtod(m, struct tcpiphdr *);
164 flags = TH_ACK;
165 }
166 else
167 {
168 /*
169 * ti points into m so the next line is just making
170 * the mbuf point to ti
171 */
172 m->m_data = (caddr_t)ti;
173
174 m->m_len = sizeof (struct tcpiphdr);
175 tlen = 0;
176#define xchg(a,b,type) { type t; t = a; a = b; b = t; }
177 xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_int32_t);
178 xchg(ti->ti_dport, ti->ti_sport, u_int16_t);
179#undef xchg
180 }
181 ti->ti_len = RT_H2N_U16((u_short)(sizeof (struct tcphdr) + tlen));
182 tlen += sizeof (struct tcpiphdr);
183 m->m_len = tlen;
184
185 memset(ti->ti_x1, 0, 9);
186 ti->ti_seq = RT_H2N_U32(seq);
187 ti->ti_ack = RT_H2N_U32(ack);
188 ti->ti_x2 = 0;
189 ti->ti_off = sizeof (struct tcphdr) >> 2;
190 ti->ti_flags = flags;
191 if (tp)
192 ti->ti_win = RT_H2N_U16((u_int16_t) (win >> tp->rcv_scale));
193 else
194 ti->ti_win = RT_H2N_U16((u_int16_t)win);
195 ti->ti_urp = 0;
196 ti->ti_sum = 0;
197 ti->ti_sum = cksum(m, tlen);
198 ((struct ip *)ti)->ip_len = tlen;
199
200 if(flags & TH_RST)
201 ((struct ip *)ti)->ip_ttl = MAXTTL;
202 else
203 ((struct ip *)ti)->ip_ttl = ip_defttl;
204
205 (void) ip_output(pData, (struct socket *)0, m);
206}
207
208/*
209 * Create a new TCP control block, making an
210 * empty reassembly queue and hooking it to the argument
211 * protocol control block.
212 */
213struct tcpcb *
214tcp_newtcpcb(PNATState pData, struct socket *so)
215{
216 register struct tcpcb *tp;
217
218 tp = (struct tcpcb *)RTMemAllocZ(sizeof(*tp));
219 if (tp == NULL)
220 return ((struct tcpcb *)0);
221
222 tp->t_maxseg = tcp_mssdflt;
223
224 tp->t_flags = tcp_do_rfc1323 ? (TF_REQ_SCALE|TF_REQ_TSTMP) : 0;
225 tp->t_socket = so;
226
227 /*
228 * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
229 * rtt estimate. Set rttvar so that srtt + 2 * rttvar gives
230 * reasonable initial retransmit time.
231 */
232 tp->t_srtt = TCPTV_SRTTBASE;
233 tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << 2;
234 tp->t_rttmin = TCPTV_MIN;
235
236 TCPT_RANGESET(tp->t_rxtcur,
237 ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
238 TCPTV_MIN, TCPTV_REXMTMAX);
239
240 tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
241 tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
242 tp->t_state = TCPS_CLOSED;
243
244 so->so_tcpcb = tp;
245
246 return (tp);
247}
248
249/*
250 * Drop a TCP connection, reporting
251 * the specified error. If connection is synchronized,
252 * then send a RST to peer.
253 */
254struct tcpcb *tcp_drop(PNATState pData, struct tcpcb *tp, int err)
255{
256/* tcp_drop(tp, errno)
257 register struct tcpcb *tp;
258 int errno;
259{
260*/
261 DEBUG_CALL("tcp_drop");
262 DEBUG_ARG("tp = %lx", (long)tp);
263 DEBUG_ARG("errno = %d", errno);
264
265 if (TCPS_HAVERCVDSYN(tp->t_state))
266 {
267 tp->t_state = TCPS_CLOSED;
268 (void) tcp_output(pData, tp);
269 tcpstat.tcps_drops++;
270 }
271 else
272 tcpstat.tcps_conndrops++;
273#if 0
274 if (errno == ETIMEDOUT && tp->t_softerror)
275 errno = tp->t_softerror;
276
277 so->so_error = errno;
278#endif
279 return (tcp_close(pData, tp));
280}
281
282/*
283 * Close a TCP control block:
284 * discard all space held by the tcp
285 * discard internet protocol block
286 * wake up any sleepers
287 */
288struct tcpcb *
289tcp_close(PNATState pData, register struct tcpcb *tp)
290{
291 struct socket *so = tp->t_socket;
292 struct socket *so_next, *so_prev;
293
294 struct tseg_qent *te = NULL;
295 DEBUG_CALL("tcp_close");
296 DEBUG_ARG("tp = %lx", (long )tp);
297 so_next = so_prev = NULL;
298 /*XXX: freeing the reassembly queue */
299 while (!LIST_EMPTY(&tp->t_segq))
300 {
301 te = LIST_FIRST(&tp->t_segq);
302 LIST_REMOVE(te, tqe_q);
303 m_freem(pData, te->tqe_m);
304 RTMemFree(te);
305 tcp_reass_qsize--;
306 }
307 RTMemFree(tp);
308 so->so_tcpcb = 0;
309 soisfdisconnected(so);
310 /* clobber input socket cache if we're closing the cached connection */
311 if (so == tcp_last_so)
312 tcp_last_so = &tcb;
313 closesocket(so->s);
314 /* (vvl) opening listening socket we do not reserve sbufs for it */
315 if ((so->so_state & SS_FACCEPTCONN) == 0)
316 {
317 sbfree(&so->so_rcv);
318 sbfree(&so->so_snd);
319 }
320 sofree(pData, so);
321 SOCKET_UNLOCK(so);
322 tcpstat.tcps_closed++;
323 return ((struct tcpcb *)0);
324}
325
326void
327tcp_drain()
328{
329 /* XXX */
330}
331
332/*
333 * When a source quench is received, close congestion window
334 * to one segment. We will gradually open it again as we proceed.
335 */
336
337#if 0
338
339void
340tcp_quench(i, int errno)
341{
342 struct tcpcb *tp = intotcpcb(inp);
343
344 if (tp)
345 tp->snd_cwnd = tp->t_maxseg;
346}
347
348#endif
349
350/*
351 * TCP protocol interface to socket abstraction.
352 */
353
354/*
355 * User issued close, and wish to trail through shutdown states:
356 * if never received SYN, just forget it. If got a SYN from peer,
357 * but haven't sent FIN, then go to FIN_WAIT_1 state to send peer a FIN.
358 * If already got a FIN from peer, then almost done; go to LAST_ACK
359 * state. In all other cases, have already sent FIN to peer (e.g.
360 * after PRU_SHUTDOWN), and just have to play tedious game waiting
361 * for peer to send FIN or not respond to keep-alives, etc.
362 * We can let the user exit from the close as soon as the FIN is acked.
363 */
364void
365tcp_sockclosed(PNATState pData, struct tcpcb *tp)
366{
367 DEBUG_CALL("tcp_sockclosed");
368 DEBUG_ARG("tp = %lx", (long)tp);
369
370 switch (tp->t_state)
371 {
372 case TCPS_CLOSED:
373 case TCPS_LISTEN:
374 case TCPS_SYN_SENT:
375 tp->t_state = TCPS_CLOSED;
376 tp = tcp_close(pData, tp);
377 break;
378
379 case TCPS_SYN_RECEIVED:
380 case TCPS_ESTABLISHED:
381 tp->t_state = TCPS_FIN_WAIT_1;
382 break;
383
384 case TCPS_CLOSE_WAIT:
385 tp->t_state = TCPS_LAST_ACK;
386 break;
387 }
388/* soisfdisconnecting(tp->t_socket); */
389 if ( tp
390 && tp->t_state >= TCPS_FIN_WAIT_2)
391 soisfdisconnected(tp->t_socket);
392 /*
393 * (vasily) there're situations when the FIN or FIN,ACK are lost (Windows host)
394 * and retransmitting keeps VBox busy on sending closing sequences *very* frequent,
395 * easting a lot of CPU. To avoid this we don't sent on sockets marked as closed
396 * (see slirp.c for details about setting so_close member).
397 */
398 if ( tp
399 && tp->t_socket
400 && !tp->t_socket->so_close)
401 tcp_output(pData, tp);
402}
403
404/*
405 * Connect to a host on the Internet
406 * Called by tcp_input
407 * Only do a connect, the tcp fields will be set in tcp_input
408 * return 0 if there's a result of the connect,
409 * else return -1 means we're still connecting
410 * The return value is almost always -1 since the socket is
411 * nonblocking. Connect returns after the SYN is sent, and does
412 * not wait for ACK+SYN.
413 */
414int tcp_fconnect(PNATState pData, struct socket *so)
415{
416 int ret = 0;
417
418 DEBUG_CALL("tcp_fconnect");
419 DEBUG_ARG("so = %lx", (long )so);
420
421 if ((ret = so->s = socket(AF_INET, SOCK_STREAM, 0)) >= 0)
422 {
423 int opt, s = so->s;
424 struct sockaddr_in addr;
425
426 fd_nonblock(s);
427 opt = 1;
428 setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt));
429 opt = 1;
430 setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(opt));
431
432 addr.sin_family = AF_INET;
433 if ((so->so_faddr.s_addr & RT_H2N_U32(pData->netmask)) == pData->special_addr.s_addr)
434 {
435 /* It's an alias */
436 switch(RT_N2H_U32(so->so_faddr.s_addr) & ~pData->netmask)
437 {
438 case CTL_DNS:
439 case CTL_ALIAS:
440 default:
441 addr.sin_addr = loopback_addr;
442 break;
443 }
444 }
445 else
446 addr.sin_addr = so->so_faddr;
447 addr.sin_port = so->so_fport;
448
449 DEBUG_MISC((dfd, " connect()ing, addr.sin_port=%d, "
450 "addr.sin_addr.s_addr=%.16s\n",
451 RT_N2H_U16(addr.sin_port), inet_ntoa(addr.sin_addr)));
452 /* We don't care what port we get */
453 ret = connect(s,(struct sockaddr *)&addr,sizeof (addr));
454
455 /*
456 * If it's not in progress, it failed, so we just return 0,
457 * without clearing SS_NOFDREF
458 */
459 soisfconnecting(so);
460 }
461
462 return(ret);
463}
464
465/*
466 * Accept the socket and connect to the local-host
467 *
468 * We have a problem. The correct thing to do would be
469 * to first connect to the local-host, and only if the
470 * connection is accepted, then do an accept() here.
471 * But, a) we need to know who's trying to connect
472 * to the socket to be able to SYN the local-host, and
473 * b) we are already connected to the foreign host by
474 * the time it gets to accept(), so... We simply accept
475 * here and SYN the local-host.
476 */
477void
478tcp_connect(PNATState pData, struct socket *inso)
479{
480 struct socket *so;
481 struct sockaddr_in addr;
482 socklen_t addrlen = sizeof(struct sockaddr_in);
483 struct tcpcb *tp;
484 int s, opt;
485 int status;
486 socklen_t optlen;
487 static int cVerbose = 1;
488
489 DEBUG_CALL("tcp_connect");
490 DEBUG_ARG("inso = %lx", (long)inso);
491
492 /*
493 * If it's an SS_ACCEPTONCE socket, no need to socreate()
494 * another socket, just use the accept() socket.
495 */
496 if (inso->so_state & SS_FACCEPTONCE)
497 {
498 /* FACCEPTONCE already have a tcpcb */
499 so = inso;
500 }
501 else
502 {
503 if ((so = socreate()) == NULL)
504 {
505 /* If it failed, get rid of the pending connection */
506 closesocket(accept(inso->s,(struct sockaddr *)&addr,&addrlen));
507 return;
508 }
509 if (tcp_attach(pData, so) < 0)
510 {
511 RTMemFree(so); /* NOT sofree */
512 return;
513 }
514 so->so_laddr = inso->so_laddr;
515 so->so_lport = inso->so_lport;
516 so->so_la = inso->so_la;
517 }
518
519 (void) tcp_mss(pData, sototcpcb(so), 0);
520
521 fd_nonblock(inso->s);
522 if ((s = accept(inso->s,(struct sockaddr *)&addr,&addrlen)) < 0)
523 {
524 tcp_close(pData, sototcpcb(so)); /* This will sofree() as well */
525 return;
526 }
527 fd_nonblock(s);
528 opt = 1;
529 setsockopt(s, SOL_SOCKET, SO_REUSEADDR,(char *)&opt, sizeof(int));
530 opt = 1;
531 setsockopt(s, SOL_SOCKET, SO_OOBINLINE,(char *)&opt, sizeof(int));
532#if 0
533 opt = 1;
534 setsockopt(s, IPPROTO_TCP, TCP_NODELAY,(char *)&opt, sizeof(int));
535#endif
536
537 optlen = sizeof(int);
538 status = getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, &optlen);
539 if (status < 0)
540 {
541 LogRel(("NAT: Error(%d) while getting RCV capacity\n", errno));
542 goto no_sockopt;
543 }
544 if (cVerbose > 0)
545 LogRel(("NAT: old socket rcv size: %dKB\n", opt / 1024));
546 /* @todo (r-vvl) make it configurable (via extra data) */
547 opt = pData->socket_rcv;
548 status = setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&opt, sizeof(int));
549 if (status < 0)
550 {
551 LogRel(("NAT: Error(%d) while setting RCV capacity to (%d)\n", errno, opt));
552 goto no_sockopt;
553 }
554 optlen = sizeof(int);
555 status = getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&opt, &optlen);
556 if (status < 0)
557 {
558 LogRel(("NAT: Error(%d) while getting SND capacity\n", errno));
559 goto no_sockopt;
560 }
561 if (cVerbose > 0)
562 LogRel(("NAT: old socket snd size: %dKB\n", opt / 1024));
563 opt = pData->socket_rcv;
564 status = setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&opt, sizeof(int));
565 if (status < 0)
566 {
567 LogRel(("NAT: Error(%d) while setting SND capacity to (%d)\n", errno, opt));
568 goto no_sockopt;
569 }
570 if (cVerbose > 0)
571 cVerbose--;
572
573 no_sockopt:
574 so->so_fport = addr.sin_port;
575 so->so_faddr = addr.sin_addr;
576 /* Translate connections from localhost to the real hostname */
577 if (so->so_faddr.s_addr == 0 || so->so_faddr.s_addr == loopback_addr.s_addr)
578 so->so_faddr = alias_addr;
579
580 /* Close the accept() socket, set right state */
581 if (inso->so_state & SS_FACCEPTONCE)
582 {
583 closesocket(so->s); /* If we only accept once, close the accept() socket */
584 so->so_state = SS_NOFDREF; /* Don't select it yet, even though we have an FD */
585 /* if it's not FACCEPTONCE, it's already NOFDREF */
586 }
587 so->s = s;
588
589 so->so_iptos = tcp_tos(so);
590 tp = sototcpcb(so);
591
592 tcp_template(tp);
593
594 /* Compute window scaling to request. */
595/* while (tp->request_r_scale < TCP_MAX_WINSHIFT
596 * && (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
597 * tp->request_r_scale++;
598 */
599
600/* soisconnecting(so); */ /* NOFDREF used instead */
601 tcpstat.tcps_connattempt++;
602
603 tp->t_state = TCPS_SYN_SENT;
604 tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
605 tp->iss = tcp_iss;
606 tcp_iss += TCP_ISSINCR/2;
607 tcp_sendseqinit(tp);
608 tcp_output(pData, tp);
609}
610
611/*
612 * Attach a TCPCB to a socket.
613 */
614int
615tcp_attach(PNATState pData, struct socket *so)
616{
617 if ((so->so_tcpcb = tcp_newtcpcb(pData, so)) == NULL)
618 return -1;
619
620 SOCKET_LOCK_CREATE(so);
621 QSOCKET_LOCK(tcb);
622 insque(pData, so, &tcb);
623 NSOCK_INC();
624 QSOCKET_UNLOCK(tcb);
625 return 0;
626}
627
628/*
629 * Set the socket's type of service field
630 */
631static const struct tos_t tcptos[] =
632{
633 {0, 20, IPTOS_THROUGHPUT, 0}, /* ftp data */
634 {21, 21, IPTOS_LOWDELAY, EMU_FTP}, /* ftp control */
635 {0, 23, IPTOS_LOWDELAY, 0}, /* telnet */
636 {0, 80, IPTOS_THROUGHPUT, 0}, /* WWW */
637 {0, 513, IPTOS_LOWDELAY, EMU_RLOGIN|EMU_NOCONNECT}, /* rlogin */
638 {0, 514, IPTOS_LOWDELAY, EMU_RSH|EMU_NOCONNECT}, /* shell */
639 {0, 544, IPTOS_LOWDELAY, EMU_KSH}, /* kshell */
640 {0, 543, IPTOS_LOWDELAY, 0}, /* klogin */
641 {0, 6667, IPTOS_THROUGHPUT, EMU_IRC}, /* IRC */
642 {0, 6668, IPTOS_THROUGHPUT, EMU_IRC}, /* IRC undernet */
643 {0, 7070, IPTOS_LOWDELAY, EMU_REALAUDIO }, /* RealAudio control */
644 {0, 113, IPTOS_LOWDELAY, EMU_IDENT }, /* identd protocol */
645 {0, 0, 0, 0}
646};
647
648/*
649 * Return TOS according to the above table
650 */
651u_int8_t
652tcp_tos(struct socket *so)
653{
654 return 0;
655}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette