Lines Matching refs:so
69 struct socket *so = tp->t_socket;
76 n->ti_src = ip_seth(so->so_faddr_ip);
77 n->ti_dst = ip_seth(so->so_laddr_ip);
78 n->ti_sport = port_seth(so->so_faddr_port);
79 n->ti_dport = port_seth(so->so_laddr_port);
135 * ti points into m so the next line is just making
181 tcp_newtcpcb(struct socket *so)
194 tp->t_socket = so;
197 * Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
198 * rtt estimate. Set rttvar so that srtt + 2 * rttvar gives
213 so->so_tcpcb = tp;
244 /* so->so_error = errno; */
258 struct socket *so = tp->t_socket;
278 so->so_tcpcb = NULL;
279 soisfdisconnected(so);
281 if (so == tcp_last_so)
283 socket_close(so->s);
284 sbfree(&so->so_rcv);
285 sbfree(&so->so_snd);
286 sofree(so);
362 tcp_proxy_event( struct socket* so,
366 so->so_state &= ~SS_PROXIFIED;
369 so->s = s;
370 so->so_state &= ~(SS_ISFCONNECTING);
373 so->so_state = SS_NOFDREF;
377 tcp_input(NULL, sizeof(struct ip), so);
382 * server or the gateway - see ctl.h) and if so, rewrites it with the real
413 int tcp_fconnect(struct socket *so)
423 DEBUG_ARG("so = %lx", (long )so);
432 if (slirp_should_drop(so->so_faddr_ip, so->so_faddr_port, IPPROTO_TCP)) {
439 so->so_laddr_ip,
440 so->so_laddr_port,
441 so->so_faddr_ip,
442 so->so_faddr_port,
450 so->so_laddr_ip,
451 so->so_laddr_port,
452 so->so_faddr_ip,
453 so->so_faddr_port,
463 so->so_laddr_ip,
464 so->so_laddr_port,
465 so->so_faddr_ip,
466 so->so_faddr_port,
472 if ((ret=so->s=socket_create_inet(SOCKET_STREAM)) >= 0)
474 int s = so->s;
497 if (slirp_should_net_forward(so->so_faddr_ip, so->so_faddr_port,
506 else if (is_qemu_special_address(so->so_faddr_ip, &faddr)) {
516 sock_port= so->so_faddr_port;/* original dst port */
524 sock_ip = so->so_faddr_ip; /* original dst addr */
525 sock_port= so->so_faddr_port; /* original dst port */
536 (ProxyEventFunc) tcp_proxy_event, so)) {
537 soisfconnecting(so);
538 so->s = -1;
539 so->so_state |= SS_PROXIFIED;
556 so->so_laddr_ip, so->so_laddr_port,
557 so->so_faddr_ip, so->so_laddr_port,
565 * If it's not in progress, it failed, so we just return 0,
568 soisfconnecting(so);
583 * the time it gets to accept(), so... We simply accept
589 struct socket *so;
604 so = inso;
606 if ((so = socreate()) == NULL) {
611 if (tcp_attach(so) < 0) {
612 free(so); /* NOT sofree */
615 so->so_laddr_ip = inso->so_laddr_ip;
616 so->so_laddr_port = inso->so_laddr_port;
619 (void) tcp_mss(sototcpcb(so), 0);
622 tcp_close(sototcpcb(so)); /* This will sofree() as well */
630 so->so_faddr_port = sock_address_get_port(&addr);
634 so->so_faddr_ip = addr_ip;
637 so->so_faddr_ip = alias_addr_ip;
641 socket_close(so->s); /* If we only accept once, close the accept() socket */
642 so->so_state = SS_NOFDREF; /* Don't select it yet, even though we have an FD */
645 so->s = s;
647 so->so_iptos = tcp_tos(so);
648 tp = sototcpcb(so);
654 * (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat)
658 /* soisconnecting(so); */ /* NOFDREF used instead */
673 tcp_attach(struct socket *so)
675 if ((so->so_tcpcb = tcp_newtcpcb(so)) == NULL)
678 insque(so, &tcb);
711 tcp_tos(struct socket *so)
717 if ((tcptos[i].fport && so->so_faddr_port == tcptos[i].fport) ||
718 (tcptos[i].lport && so->so_laddr_port == tcptos[i].lport)) {
719 so->so_emu = tcptos[i].emu;
727 if ((emup->fport && (so->so_faddr_port == emup->fport)) ||
728 (emup->lport && (so->so_laddr_port == emup->lport))) {
729 so->so_emu = emup->emu;
753 * LOWDELAY and so Nagel will kick in. Because of this,
754 * we'll get the first letter, followed by the rest, so
765 tcp_emu(struct socket *so, struct mbuf *m)
774 DEBUG_ARG("so = %lx", (long)so);
777 switch(so->so_emu) {
788 struct sbuf *so_rcv = &so->so_rcv;
798 if (tmpso->so_laddr_ip == so->so_laddr_ip &&
800 tmpso->so_faddr_ip == so->so_faddr_ip &&
832 if ((so = solisten(0, laddr, lport, SS_FACCEPTONCE)) == NULL)
835 n6 = so->so_faddr_port;
840 laddr = so->so_faddr_ip;
864 if ((so = solisten(0, laddr, lport, SS_FACCEPTONCE)) == NULL)
867 n6 = so->so_faddr_port;
872 laddr = so->so_faddr_ip;
896 so->so_emu = 0;
904 (so = solisten(0, so->so_laddr_ip, lport, SS_FACCEPTONCE)) != NULL)
906 so->so_faddr_port) + 1;
919 if ((so = solisten(0, laddr, lport, SS_FACCEPTONCE)) == NULL)
925 (unsigned long) so->so_faddr_ip,
926 so->so_faddr_port, 1);
928 if ((so = solisten(0, laddr, lport, SS_FACCEPTONCE)) == NULL)
934 so->so_faddr_ip, so->so_faddr_port, n1, 1);
936 if ((so = solisten(0, laddr, lport, SS_FACCEPTONCE)) == NULL)
942 (unsigned long)so->so_faddr_ip,
943 so->so_faddr_port, n1, 1);
1052 so->so_laddr_ip,
1075 so->so_emu = 0;
1086 tcp_ctl(struct socket *so)
1088 struct sbuf *sb = &so->so_snd;
1095 DEBUG_ARG("so = %lx", (long )so);
1101 if (ctl_addr_ip && (ctl_addr_ip == -1 || (so->so_laddr_ip != ctl_addr_ip))) {
1107 command = (so->so_faddr_ip & 0xff);
1116 if (ex_ptr->ex_fport == so->so_faddr_port &&
1119 so->s = -1;
1120 so->extra = (void *)ex_ptr->ex_exec;
1131 /* tcp_fconnect(so); */
1142 return(fork_exec(so, ex_ptr->ex_exec, do_pty));
1157 so->so_emu = EMU_CTL;