Lines Matching refs:inp

188 sctp6_notify(struct sctp_inpcb *inp,
223 so = SCTP_INP_SO(inp);
230 (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC,
242 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
260 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
274 struct sctp_inpcb *inp;
337 inp = NULL;
341 &inp, &net, 1, SCTP_DEFAULT_VRFID);
344 (inp != NULL)) {
391 sctp6_notify(inp, stcb, net,
396 if ((stcb == NULL) && (inp != NULL)) {
397 /* reduce inp's ref-count */
398 SCTP_INP_WLOCK(inp);
399 SCTP_INP_DECR_REF(inp);
400 SCTP_INP_WUNLOCK(inp);
418 struct sctp_inpcb *inp;
444 &inp, &net, 1, vrf_id);
445 if (stcb == NULL || inp == NULL || inp->sctp_socket == NULL) {
446 if ((inp != NULL) && (stcb == NULL)) {
448 SCTP_INP_WLOCK(inp);
449 SCTP_INP_DECR_REF(inp);
452 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
463 SCTP_INP_WLOCK(inp);
465 error = cr_canseesocket(req->td->td_ucred, inp->sctp_socket);
467 SCTP_INP_WUNLOCK(inp);
470 cru2x(inp->sctp_socket->so_cred, &xuc);
471 SCTP_INP_WUNLOCK(inp);
486 struct sctp_inpcb *inp;
489 inp = (struct sctp_inpcb *)so->so_pcb;
490 if (inp == NULL) {
491 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
495 flags = inp->sctp_flags;
497 sctp_log_closing(inp, NULL, 17);
500 (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) {
502 sctp_log_closing(inp, NULL, 16);
504 sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT,
517 flags = inp->sctp_flags;
530 struct sctp_inpcb *inp;
533 inp = (struct sctp_inpcb *)so->so_pcb;
534 if (inp != NULL) {
535 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
546 inp = (struct sctp_inpcb *)so->so_pcb;
547 SCTP_INP_WLOCK(inp);
548 inp->sctp_flags |= SCTP_PCB_FLAGS_BOUND_V6; /* I'm v6! */
549 inp6 = (struct in6pcb *)inp;
566 SCTP_INP_WUNLOCK(inp);
573 struct sctp_inpcb *inp;
577 inp = (struct sctp_inpcb *)so->so_pcb;
578 if (inp == NULL) {
579 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
587 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
595 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
601 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
605 inp6 = (struct in6pcb *)inp;
651 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
660 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
694 struct sctp_inpcb *inp;
703 inp = (struct sctp_inpcb *)so->so_pcb;
704 if (inp == NULL) {
710 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
713 inp6 = (struct in6pcb *)inp;
718 if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) &&
728 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EDESTADDRREQ);
739 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
743 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
758 if (inp->control) {
760 SCTP_RELEASE_PKT(inp->control);
761 inp->control = NULL;
763 inp->control = control;
766 if (inp->pkt) {
767 SCTP_BUF_NEXT(inp->pkt_last) = m;
768 inp->pkt_last = m;
770 inp->pkt_last = inp->pkt = m;
785 ret = sctp_output(inp, inp->pkt, addr, inp->control, p, flags);
786 inp->pkt = NULL;
787 inp->control = NULL;
799 struct sctp_inpcb *inp;
812 inp = (struct sctp_inpcb *)so->so_pcb;
813 if (inp == NULL) {
814 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
819 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
826 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
834 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
840 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
844 vrf_id = inp->def_vrf_id;
845 SCTP_ASOC_CREATE_LOCK(inp);
846 SCTP_INP_RLOCK(inp);
847 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
850 SCTP_INP_RUNLOCK(inp);
853 SCTP_ASOC_CREATE_UNLOCK(inp);
857 SCTP_INP_RLOCK(inp);
859 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
860 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
862 SCTP_INP_RUNLOCK(inp);
863 SCTP_ASOC_CREATE_UNLOCK(inp);
864 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EADDRINUSE);
875 SCTP_INP_RUNLOCK(inp);
876 SCTP_ASOC_CREATE_UNLOCK(inp);
877 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
881 SCTP_INP_RUNLOCK(inp);
882 SCTP_ASOC_CREATE_UNLOCK(inp);
883 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
894 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
895 stcb = LIST_FIRST(&inp->sctp_asoc_list);
899 SCTP_INP_RUNLOCK(inp);
901 SCTP_INP_RUNLOCK(inp);
902 SCTP_INP_WLOCK(inp);
903 SCTP_INP_INCR_REF(inp);
904 SCTP_INP_WUNLOCK(inp);
905 stcb = sctp_findassociation_ep_addr(&inp, addr, NULL, NULL, NULL);
907 SCTP_INP_WLOCK(inp);
908 SCTP_INP_DECR_REF(inp);
909 SCTP_INP_WUNLOCK(inp);
915 SCTP_ASOC_CREATE_UNLOCK(inp);
917 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EALREADY);
921 stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id,
922 inp->sctp_ep.pre_open_stream_count,
923 inp->sctp_ep.port, p);
924 SCTP_ASOC_CREATE_UNLOCK(inp);
938 sctp_initialize_auth_params(inp, stcb);
940 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED);
949 struct sctp_inpcb *inp;
964 inp = (struct sctp_inpcb *)so->so_pcb;
965 if (inp == NULL) {
967 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
970 SCTP_INP_RLOCK(inp);
971 sin6->sin6_port = inp->sctp_lport;
972 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
974 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
980 stcb = LIST_FIRST(&inp->sctp_asoc_list);
982 SCTP_INP_RUNLOCK(inp);
984 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
1002 SCTP_INP_RUNLOCK(inp);
1004 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
1007 vrf_id = inp->def_vrf_id;
1008 sctp_ifa = sctp_source_address_selection(inp, stcb, (sctp_route_t *) & net->ro, net, 0, vrf_id);
1021 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
1033 SCTP_INP_RUNLOCK(inp);
1034 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
1038 SCTP_INP_RUNLOCK(inp);
1054 struct sctp_inpcb *inp;
1066 inp = (struct sctp_inpcb *)so->so_pcb;
1067 if ((inp == NULL) ||
1068 ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
1071 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOTCONN);
1074 SCTP_INP_RLOCK(inp);
1075 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1079 SCTP_INP_RUNLOCK(inp);
1082 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
1099 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ENOENT);
1104 SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, error);