Lines Matching refs:sctp

61 sctp_select_port(sctp_t *sctp, in_port_t *requested_port, int *user_specified)  in sctp_select_port()  argument
63 sctp_stack_t *sctps = sctp->sctp_sctps; in sctp_select_port()
64 conn_t *connp = sctp->sctp_connp; in sctp_select_port()
125 sctp_listen(sctp_t *sctp) in sctp_listen() argument
128 sctp_stack_t *sctps = sctp->sctp_sctps; in sctp_listen()
129 conn_t *connp = sctp->sctp_connp; in sctp_listen()
131 RUN_SCTP(sctp); in sctp_listen()
136 if (sctp->sctp_state > SCTPS_BOUND || in sctp_listen()
137 (sctp->sctp_connp->conn_state_flags & CONN_CLOSING)) { in sctp_listen()
138 WAKE_SCTP(sctp); in sctp_listen()
143 if (sctp->sctp_nsaddrs == 0) { in sctp_listen()
150 WAKE_SCTP(sctp); in sctp_listen()
151 if ((ret = sctp_bind(sctp, (struct sockaddr *)&ss, in sctp_listen()
154 RUN_SCTP(sctp) in sctp_listen()
164 sctp->sctp_state = SCTPS_LISTEN; in sctp_listen()
165 (void) random_get_pseudo_bytes(sctp->sctp_secret, SCTP_SECRET_LEN); in sctp_listen()
166 sctp->sctp_last_secret_update = ddi_get_lbolt64(); in sctp_listen()
167 bzero(sctp->sctp_old_secret, SCTP_SECRET_LEN); in sctp_listen()
175 sctp->sctp_listen_cnt == NULL) { in sctp_listen()
207 sctp->sctp_listen_cnt = slc; in sctp_listen()
214 sctp_listen_hash_insert(tf, sctp); in sctp_listen()
216 WAKE_SCTP(sctp); in sctp_listen()
225 sctp_bind(sctp_t *sctp, struct sockaddr *sa, socklen_t len) in sctp_bind() argument
232 conn_t *connp = sctp->sctp_connp; in sctp_bind()
237 ASSERT(sctp != NULL); in sctp_bind()
239 RUN_SCTP(sctp); in sctp_bind()
241 if ((sctp->sctp_state >= SCTPS_BOUND) || in sctp_bind()
242 (sctp->sctp_connp->conn_state_flags & CONN_CLOSING) || in sctp_bind()
290 err = sctp_select_port(sctp, &requested_port, &user_specified); in sctp_bind()
294 if ((err = sctp_bind_add(sctp, sa, 1, B_TRUE, in sctp_bind()
298 err = sctp_bindi(sctp, requested_port, bind_to_req_port_only, in sctp_bind()
301 sctp_free_saddrs(sctp); in sctp_bind()
303 ASSERT(sctp->sctp_state == SCTPS_BOUND); in sctp_bind()
306 WAKE_SCTP(sctp); in sctp_bind()
314 sctp_bindx(sctp_t *sctp, const void *addrs, int addrcnt, int bindop) in sctp_bindx() argument
316 ASSERT(sctp != NULL); in sctp_bindx()
322 return (sctp_bind_add(sctp, addrs, addrcnt, B_FALSE, in sctp_bindx()
323 sctp->sctp_connp->conn_lport)); in sctp_bindx()
325 return (sctp_bind_del(sctp, addrs, addrcnt, B_FALSE)); in sctp_bindx()
335 sctp_bind_add(sctp_t *sctp, const void *addrs, uint32_t addrcnt, in sctp_bind_add() argument
340 sctp_stack_t *sctps = sctp->sctp_sctps; in sctp_bind_add()
341 conn_t *connp = sctp->sctp_connp; in sctp_bind_add()
344 RUN_SCTP(sctp); in sctp_bind_add()
346 if (sctp->sctp_state > SCTPS_ESTABLISHED || in sctp_bind_add()
347 (sctp->sctp_connp->conn_state_flags & CONN_CLOSING)) { in sctp_bind_add()
349 WAKE_SCTP(sctp); in sctp_bind_add()
353 if (sctp->sctp_state > SCTPS_LISTEN) { in sctp_bind_add()
359 !sctp->sctp_understands_asconf || in sctp_bind_add()
360 !sctp->sctp_understands_addip) { in sctp_bind_add()
362 WAKE_SCTP(sctp); in sctp_bind_add()
391 do_listen = !do_asconf && sctp->sctp_state > SCTPS_BOUND && in sctp_bind_add()
394 err = sctp_get_addrlist(sctp, addrs, &addrcnt, &addrlist, in sctp_bind_add()
401 WAKE_SCTP(sctp); in sctp_bind_add()
412 WAKE_SCTP(sctp); in sctp_bind_add()
419 err = sctp_valid_addr_list(sctp, addrlist, addrcnt, llist, in sctp_bind_add()
431 err = sctp_valid_addr_list(sctp, addrs, addrcnt, NULL, 0); in sctp_bind_add()
435 WAKE_SCTP(sctp); in sctp_bind_add()
440 err = sctp_add_ip(sctp, addrs, addrcnt); in sctp_bind_add()
442 sctp_del_saddr_list(sctp, addrs, addrcnt, B_FALSE); in sctp_bind_add()
444 WAKE_SCTP(sctp); in sctp_bind_add()
449 WAKE_SCTP(sctp); in sctp_bind_add()
457 sctp_bind_del(sctp_t *sctp, const void *addrs, uint32_t addrcnt, in sctp_bind_del() argument
464 sctp_stack_t *sctps = sctp->sctp_sctps; in sctp_bind_del()
465 conn_t *connp = sctp->sctp_connp; in sctp_bind_del()
468 RUN_SCTP(sctp); in sctp_bind_del()
470 if (sctp->sctp_state > SCTPS_ESTABLISHED || in sctp_bind_del()
471 (sctp->sctp_connp->conn_state_flags & CONN_CLOSING)) { in sctp_bind_del()
473 WAKE_SCTP(sctp); in sctp_bind_del()
480 if (sctp->sctp_state > SCTPS_LISTEN) { in sctp_bind_del()
482 !sctp->sctp_understands_asconf || in sctp_bind_del()
483 !sctp->sctp_understands_addip) { in sctp_bind_del()
485 WAKE_SCTP(sctp); in sctp_bind_del()
492 if (sctp->sctp_nsaddrs == 1 || addrcnt >= sctp->sctp_nsaddrs) { in sctp_bind_del()
494 WAKE_SCTP(sctp); in sctp_bind_del()
499 sctp->sctp_state > SCTPS_BOUND) { in sctp_bind_del()
504 error = sctp_del_ip(sctp, addrs, addrcnt, ulist, usize); in sctp_bind_del()
509 WAKE_SCTP(sctp); in sctp_bind_del()
520 WAKE_SCTP(sctp); in sctp_bind_del()
540 sctp_bindi(sctp_t *sctp, in_port_t port, boolean_t bind_to_req_port_only, in sctp_bindi() argument
547 sctp_stack_t *sctps = sctp->sctp_sctps; in sctp_bindi()
548 conn_t *connp = sctp->sctp_connp; in sctp_bindi()
593 sctp_bind_hash_remove(sctp); in sctp_bindi()
615 addrcmp = sctp_compare_saddrs(sctp, lsctp); in sctp_bindi()
660 (void *)&sctp->sctp_ipha->ipha_src : in sctp_bindi()
661 (void *)&sctp->sctp_ip6h->ip6_src, in sctp_bindi()
710 sctp->sctp_state = SCTPS_BOUND; in sctp_bindi()
715 sctp_bind_hash_insert(tbf, sctp, 1); in sctp_bindi()