Lines Matching defs:so
262 struct socket *so,
272 for (entry = so->so_filt; entry; entry = entry->sfe_next_onfilter)
295 entry->sfe_socket = so;
296 entry->sfe_next_onsocket = so->so_filt;
297 so->so_filt = entry;
308 socket_unlock(so, 0);
311 error = entry->sfe_filter->sf_filter.sf_attach(&entry->sfe_cookie, so);
315 socket_lock(so, 0);
373 struct socket *so)
375 struct protosw *proto = so->so_proto;
399 sflt_attach_locked(so, filter, 0);
421 struct socket *so)
427 while ((entry = so->so_filt) != NULL) {
429 so->so_filt = entry->sfe_next_onsocket;
437 // entry could be freed when we drop the lock, so we make copies on
452 sfe_filter->sf_filter.sf_detach(sfe_cookie, so);
466 struct socket *so,
471 if (so->so_filt == NULL) return;
477 for (entry = so->so_filt; entry; entry = entry->sfe_next_onsocket) {
489 socket_unlock(so, 0);
494 sf_notify(entry->sfe_cookie, so, event, param);
504 socket_lock(so, 0);
510 struct socket *so,
514 sflt_notify_internal(so, event, param, 0);
519 struct socket *so,
523 sflt_notify_internal(so, event, NULL, handle);
528 struct socket *so,
532 if (so->so_filt == NULL) return 0;
539 for (entry = so->so_filt; entry && error == 0;
549 socket_unlock(so, 0);
555 sf_ioctl(entry->sfe_cookie, so, cmd, data);
565 socket_lock(so, 0);
573 struct socket *so,
576 if (so->so_filt == NULL) return 0;
583 for (entry = so->so_filt; entry && error == 0;
593 socket_unlock(so, 0);
599 sf_bind(entry->sfe_cookie, so, nam);
609 socket_lock(so, 0);
617 struct socket *so)
619 if (so->so_filt == NULL) return 0;
626 for (entry = so->so_filt; entry && error == 0;
636 socket_unlock(so, 0);
642 sf_listen(entry->sfe_cookie, so);
652 socket_lock(so, 0);
661 struct socket *so,
665 if (so->so_filt == NULL) return 0;
672 for (entry = so->so_filt; entry && error == 0;
682 socket_unlock(so, 0);
688 sf_accept(entry->sfe_cookie, head, so, local, remote);
698 socket_lock(so, 0);
706 struct socket *so,
709 if (so->so_filt == NULL) return 0;
716 for (entry = so->so_filt; entry && error == 0;
726 socket_unlock(so, 0);
732 sf_getsockname(entry->sfe_cookie, so, local);
742 socket_lock(so, 0);
750 struct socket *so,
753 if (so->so_filt == NULL) return 0;
760 for (entry = so->so_filt; entry && error == 0;
770 socket_unlock(so, 0);
776 sf_getpeername(entry->sfe_cookie, so, remote);
786 socket_lock(so, 0);
794 struct socket *so,
797 if (so->so_filt == NULL) return 0;
804 for (entry = so->so_filt; entry && error == 0;
814 socket_unlock(so, 0);
820 sf_connect_in(entry->sfe_cookie, so, remote);
830 socket_lock(so, 0);
838 struct socket *so,
841 if (so->so_filt == NULL) return 0;
848 for (entry = so->so_filt; entry && error == 0;
858 socket_unlock(so, 0);
864 sf_connect_out(entry->sfe_cookie, so, nam);
874 socket_lock(so, 0);
882 struct socket *so,
885 if (so->so_filt == NULL) return 0;
892 for (entry = so->so_filt; entry && error == 0;
902 socket_unlock(so, 0);
908 sf_setoption(entry->sfe_cookie, so, sopt);
918 socket_lock(so, 0);
926 struct socket *so,
929 if (so->so_filt == NULL) return 0;
936 for (entry = so->so_filt; entry && error == 0;
946 socket_unlock(so, 0);
952 sf_getoption(entry->sfe_cookie, so, sopt);
962 socket_lock(so, 0);
970 struct socket *so,
976 if (so->so_filt == NULL) return 0;
984 for (entry = so->so_filt; entry && error == 0;
994 if (so->so_send_filt_thread == NULL) {
996 so->so_send_filt_thread = current_thread();
998 socket_unlock(so, 0);
1004 sf_data_out(entry->sfe_cookie, so, to, data, control, flags);
1014 socket_lock(so, 0);
1015 if (setsendthread) so->so_send_filt_thread = NULL;
1023 struct socket *so,
1029 if (so->so_filt == NULL) return 0;
1037 for (entry = so->so_filt; entry && (error == 0);
1048 socket_unlock(so, 0);
1053 entry->sfe_cookie, so, from, data, control, flags);
1063 socket_lock(so, 0);
1112 struct socket *so;
1127 struct socket *so;
1152 * so any unused portion would have been taken care of.
1199 solist->so = (_so); \
1205 so = inp->inp_socket;
1206 if (so == NULL || so->so_state & SS_DEFUNCT ||
1207 so->so_state & SS_NOFDREF ||
1208 !INP_CHECK_SOCKAF(so, domain) ||
1209 !INP_CHECK_SOCKTYPE(so, type))
1215 SOLIST_ADD(so);
1221 so = inp->inp_socket;
1222 if (so == NULL || so->so_state & SS_DEFUNCT ||
1223 so->so_state & SS_NOFDREF ||
1224 !INP_CHECK_SOCKAF(so, domain) ||
1225 !INP_CHECK_SOCKTYPE(so, type))
1231 SOLIST_ADD(so);
1241 so = solisthead->so;
1242 sflt_initsock(so);
1244 if (so->so_state & SS_ISCONNECTING)
1245 sflt_notify_after_register(so, sock_evt_connecting,
1247 else if (so->so_state & SS_ISCONNECTED)
1248 sflt_notify_after_register(so, sock_evt_connected,
1250 else if ((so->so_state &
1253 sflt_notify_after_register(so, sock_evt_disconnecting,
1255 else if ((so->so_state &
1258 sflt_notify_after_register(so, sock_evt_disconnected,
1260 else if (so->so_state & SS_CANTSENDMORE)
1261 sflt_notify_after_register(so, sock_evt_cantsendmore,
1263 else if (so->so_state & SS_CANTRCVMORE)
1264 sflt_notify_after_register(so, sock_evt_cantrecvmore,
1267 sock_release(so);
1319 socket_t so,
1326 if (so == NULL || data == NULL) return EINVAL;
1332 socket_lock(so, 1);
1335 if (sbappendaddr(&so->so_rcv, (struct sockaddr*)(uintptr_t)from, data,
1337 sorwakeup(so);
1342 if (sbappendcontrol(&so->so_rcv, data, control, NULL))
1343 sorwakeup(so);
1352 if (sbappendrecord(&so->so_rcv, (struct mbuf*)data))
1353 sorwakeup(so);
1357 if (sbappend(&so->so_rcv, data))
1358 sorwakeup(so);
1360 socket_unlock(so, 1);
1366 socket_t so,
1374 return sosend(so, (struct sockaddr*)(uintptr_t)to, NULL,