• Home
  • Raw
  • Download

Lines Matching refs:chunk

67 static void *sctp_addto_param(struct sctp_chunk *chunk, int len,
73 struct sctp_chunk *chunk = skb_shinfo(skb)->destructor_arg; in sctp_control_release_owner() local
75 if (chunk->shkey) { in sctp_control_release_owner()
76 struct sctp_shared_key *shkey = chunk->shkey; in sctp_control_release_owner()
77 struct sctp_association *asoc = chunk->asoc; in sctp_control_release_owner()
93 sctp_auth_shkey_release(chunk->shkey); in sctp_control_release_owner()
97 static void sctp_control_set_owner_w(struct sctp_chunk *chunk) in sctp_control_set_owner_w() argument
99 struct sctp_association *asoc = chunk->asoc; in sctp_control_set_owner_w()
100 struct sk_buff *skb = chunk->skb; in sctp_control_set_owner_w()
109 if (chunk->auth) { in sctp_control_set_owner_w()
110 chunk->shkey = asoc->shkey; in sctp_control_set_owner_w()
111 sctp_auth_shkey_hold(chunk->shkey); in sctp_control_set_owner_w()
114 skb_shinfo(skb)->destructor_arg = chunk; in sctp_control_set_owner_w()
119 int sctp_chunk_iif(const struct sctp_chunk *chunk) in sctp_chunk_iif() argument
121 struct sk_buff *skb = chunk->skb; in sctp_chunk_iif()
143 int sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, in sctp_init_cause() argument
154 if (skb_tailroom(chunk->skb) < len) in sctp_init_cause()
157 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(err), &err); in sctp_init_cause()
380 const struct sctp_chunk *chunk, in sctp_make_init_ack() argument
411 cookie = sctp_pack_cookie(asoc->ep, asoc, chunk, &cookie_len, in sctp_make_init_ack()
485 if (chunk->transport) in sctp_make_init_ack()
488 &chunk->transport->ipaddr); in sctp_make_init_ack()
568 const struct sctp_chunk *chunk) in sctp_make_cookie_echo() argument
594 if (chunk) in sctp_make_cookie_echo()
595 retval->transport = chunk->transport; in sctp_make_cookie_echo()
620 const struct sctp_chunk *chunk) in sctp_make_cookie_ack() argument
635 if (retval && chunk && chunk->transport) in sctp_make_cookie_ack()
638 &chunk->transport->ipaddr); in sctp_make_cookie_ack()
668 const struct sctp_chunk *chunk) in sctp_make_cwr() argument
693 if (chunk) in sctp_make_cwr()
694 retval->transport = chunk->transport; in sctp_make_cwr()
855 const struct sctp_chunk *chunk) in sctp_make_shutdown() argument
872 if (chunk) in sctp_make_shutdown()
873 retval->transport = chunk->transport; in sctp_make_shutdown()
879 const struct sctp_chunk *chunk) in sctp_make_shutdown_ack() argument
895 if (retval && chunk) in sctp_make_shutdown_ack()
896 retval->transport = chunk->transport; in sctp_make_shutdown_ack()
903 const struct sctp_chunk *chunk) in sctp_make_shutdown_complete() argument
926 if (retval && chunk) in sctp_make_shutdown_complete()
927 retval->transport = chunk->transport; in sctp_make_shutdown_complete()
936 const struct sctp_chunk *chunk, in sctp_make_abort() argument
946 if (chunk && chunk->chunk_hdr && in sctp_make_abort()
947 chunk->chunk_hdr->type == SCTP_CID_INIT) in sctp_make_abort()
965 if (retval && chunk) in sctp_make_abort()
966 retval->transport = chunk->transport; in sctp_make_abort()
974 const struct sctp_chunk *chunk, in sctp_make_abort_no_data() argument
980 retval = sctp_make_abort(asoc, chunk, in sctp_make_abort_no_data()
1000 if (chunk) in sctp_make_abort_no_data()
1001 retval->transport = chunk->transport; in sctp_make_abort_no_data()
1052 static void *sctp_addto_param(struct sctp_chunk *chunk, int len, in sctp_addto_param() argument
1055 int chunklen = ntohs(chunk->chunk_hdr->length); in sctp_addto_param()
1058 target = skb_put(chunk->skb, len); in sctp_addto_param()
1066 chunk->chunk_hdr->length = htons(chunklen + len); in sctp_addto_param()
1067 chunk->chunk_end = skb_tail_pointer(chunk->skb); in sctp_addto_param()
1075 const struct sctp_chunk *chunk, in sctp_make_abort_violation() argument
1082 retval = sctp_make_abort(asoc, chunk, sizeof(struct sctp_errhdr) + in sctp_make_abort_violation()
1090 phdr.type = htons(chunk->chunk_hdr->type); in sctp_make_abort_violation()
1091 phdr.length = chunk->chunk_hdr->length; in sctp_make_abort_violation()
1101 const struct sctp_chunk *chunk, in sctp_make_violation_paramlen() argument
1109 retval = sctp_make_abort(asoc, chunk, payload_len); in sctp_make_violation_paramlen()
1124 const struct sctp_chunk *chunk) in sctp_make_violation_max_retrans() argument
1130 retval = sctp_make_abort(asoc, chunk, payload_len); in sctp_make_violation_max_retrans()
1142 const struct sctp_chunk *chunk) in sctp_make_new_encap_port() argument
1147 retval = sctp_make_abort(asoc, chunk, in sctp_make_new_encap_port()
1153 nep.cur_port = SCTP_INPUT_CB(chunk->skb)->encap_port; in sctp_make_new_encap_port()
1154 nep.new_port = chunk->transport->encap_port; in sctp_make_new_encap_port()
1195 const struct sctp_chunk *chunk, in sctp_make_heartbeat_ack() argument
1217 if (chunk) in sctp_make_heartbeat_ack()
1218 retval->transport = chunk->transport; in sctp_make_heartbeat_ack()
1255 const struct sctp_chunk *chunk, in sctp_make_op_error_space() argument
1274 if (chunk) in sctp_make_op_error_space()
1275 retval->transport = chunk->transport; in sctp_make_op_error_space()
1290 const struct sctp_chunk *chunk) in sctp_make_op_error_limited() argument
1302 return sctp_make_op_error_space(asoc, chunk, size); in sctp_make_op_error_limited()
1307 const struct sctp_chunk *chunk, in sctp_make_op_error() argument
1313 retval = sctp_make_op_error_space(asoc, chunk, paylen + reserve_tail); in sctp_make_op_error()
1398 SCTP_DBG_OBJCNT_INC(chunk); in sctp_chunkify()
1406 void sctp_init_addrs(struct sctp_chunk *chunk, union sctp_addr *src, in sctp_init_addrs() argument
1409 memcpy(&chunk->source, src, sizeof(union sctp_addr)); in sctp_init_addrs()
1410 memcpy(&chunk->dest, dest, sizeof(union sctp_addr)); in sctp_init_addrs()
1414 const union sctp_addr *sctp_source(const struct sctp_chunk *chunk) in sctp_source() argument
1417 if (chunk->transport) { in sctp_source()
1418 return &chunk->transport->ipaddr; in sctp_source()
1421 return &chunk->source; in sctp_source()
1488 struct sctp_chunk *chunk; in sctp_make_control() local
1490 chunk = _sctp_make_chunk(asoc, type, flags, paylen, gfp); in sctp_make_control()
1491 if (chunk) in sctp_make_control()
1492 sctp_control_set_owner_w(chunk); in sctp_make_control()
1494 return chunk; in sctp_make_control()
1498 static void sctp_chunk_destroy(struct sctp_chunk *chunk) in sctp_chunk_destroy() argument
1500 BUG_ON(!list_empty(&chunk->list)); in sctp_chunk_destroy()
1501 list_del_init(&chunk->transmitted_list); in sctp_chunk_destroy()
1503 consume_skb(chunk->skb); in sctp_chunk_destroy()
1504 consume_skb(chunk->auth_chunk); in sctp_chunk_destroy()
1506 SCTP_DBG_OBJCNT_DEC(chunk); in sctp_chunk_destroy()
1507 kmem_cache_free(sctp_chunk_cachep, chunk); in sctp_chunk_destroy()
1511 void sctp_chunk_free(struct sctp_chunk *chunk) in sctp_chunk_free() argument
1514 if (chunk->msg) in sctp_chunk_free()
1515 sctp_datamsg_put(chunk->msg); in sctp_chunk_free()
1517 sctp_chunk_put(chunk); in sctp_chunk_free()
1536 void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data) in sctp_addto_chunk() argument
1538 int chunklen = ntohs(chunk->chunk_hdr->length); in sctp_addto_chunk()
1542 skb_put_zero(chunk->skb, padlen); in sctp_addto_chunk()
1543 target = skb_put_data(chunk->skb, data, len); in sctp_addto_chunk()
1546 chunk->chunk_hdr->length = htons(chunklen + padlen + len); in sctp_addto_chunk()
1547 chunk->chunk_end = skb_tail_pointer(chunk->skb); in sctp_addto_chunk()
1556 int sctp_user_addto_chunk(struct sctp_chunk *chunk, int len, in sctp_user_addto_chunk() argument
1562 target = skb_put(chunk->skb, len); in sctp_user_addto_chunk()
1569 chunk->chunk_hdr->length = in sctp_user_addto_chunk()
1570 htons(ntohs(chunk->chunk_hdr->length) + len); in sctp_user_addto_chunk()
1571 chunk->chunk_end = skb_tail_pointer(chunk->skb); in sctp_user_addto_chunk()
1579 void sctp_chunk_assign_ssn(struct sctp_chunk *chunk) in sctp_chunk_assign_ssn() argument
1586 if (chunk->has_ssn) in sctp_chunk_assign_ssn()
1590 sid = ntohs(chunk->subh.data_hdr->stream); in sctp_chunk_assign_ssn()
1591 stream = &chunk->asoc->stream; in sctp_chunk_assign_ssn()
1596 msg = chunk->msg; in sctp_chunk_assign_ssn()
1615 void sctp_chunk_assign_tsn(struct sctp_chunk *chunk) in sctp_chunk_assign_tsn() argument
1617 if (!chunk->has_tsn) { in sctp_chunk_assign_tsn()
1621 chunk->subh.data_hdr->tsn = in sctp_chunk_assign_tsn()
1622 htonl(sctp_association_get_next_tsn(chunk->asoc)); in sctp_chunk_assign_tsn()
1623 chunk->has_tsn = 1; in sctp_chunk_assign_tsn()
1629 struct sctp_chunk *chunk, in sctp_make_temp_asoc() argument
1637 scope = sctp_scope(sctp_source(chunk)); in sctp_make_temp_asoc()
1642 skb = chunk->skb; in sctp_make_temp_asoc()
1743 struct sctp_chunk *chunk, gfp_t gfp, in sctp_unpack_cookie() argument
1749 struct sk_buff *skb = chunk->skb; in sctp_unpack_cookie()
1762 bodysize = ntohs(chunk->chunk_hdr->length) - headersize; in sctp_unpack_cookie()
1769 len = ntohs(chunk->chunk_hdr->length); in sctp_unpack_cookie()
1778 cookie = chunk->subh.cookie_hdr; in sctp_unpack_cookie()
1812 if (ntohl(chunk->sctp_hdr->vtag) != bear_cookie->my_vtag) { in sctp_unpack_cookie()
1817 if (chunk->sctp_hdr->source != bear_cookie->peer_addr.v4.sin_port || in sctp_unpack_cookie()
1818 ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) { in sctp_unpack_cookie()
1848 *errp = sctp_make_op_error(asoc, chunk, in sctp_unpack_cookie()
1860 scope = sctp_scope(sctp_source(chunk)); in sctp_unpack_cookie()
1868 retval->peer.port = ntohs(chunk->sctp_hdr->source); in sctp_unpack_cookie()
1881 sctp_add_bind_addr(&retval->base.bind_addr, &chunk->dest, in sctp_unpack_cookie()
1882 sizeof(chunk->dest), SCTP_ADDR_SRC, in sctp_unpack_cookie()
1925 struct sctp_chunk *chunk, in sctp_process_missing_param() argument
1937 *errp = sctp_make_op_error_space(asoc, chunk, len); in sctp_process_missing_param()
1953 struct sctp_chunk *chunk, in sctp_process_inv_mandatory() argument
1959 *errp = sctp_make_op_error_space(asoc, chunk, 0); in sctp_process_inv_mandatory()
1970 const struct sctp_chunk *chunk, in sctp_process_inv_paramlength() argument
1980 *errp = sctp_make_violation_paramlen(asoc, chunk, param); in sctp_process_inv_paramlength()
1991 struct sctp_chunk *chunk, in sctp_process_hn_param() argument
2004 *errp = sctp_make_op_error(asoc, chunk, SCTP_ERROR_DNS_FAILED, in sctp_process_hn_param()
2112 struct sctp_chunk *chunk, in sctp_process_unk_param() argument
2131 *errp = sctp_make_op_error_limited(asoc, chunk); in sctp_process_unk_param()
2167 struct sctp_chunk *chunk, in sctp_verify_param() argument
2204 chunk, err_chunk); in sctp_verify_param()
2211 sctp_process_hn_param(asoc, param, chunk, err_chunk); in sctp_verify_param()
2232 chunk, err_chunk); in sctp_verify_param()
2248 chunk, err_chunk); in sctp_verify_param()
2273 sctp_process_inv_paramlength(asoc, param.p, chunk, in sctp_verify_param()
2283 retval = sctp_process_unk_param(asoc, param, chunk, err_chunk); in sctp_verify_param()
2293 struct sctp_chunk *chunk, struct sctp_chunk **errp) in sctp_verify_init() argument
2307 return sctp_process_inv_mandatory(asoc, chunk, errp); in sctp_verify_init()
2321 if (param.v != (void *)chunk->chunk_end) in sctp_verify_init()
2322 return sctp_process_inv_paramlength(asoc, param.p, chunk, errp); in sctp_verify_init()
2329 chunk, errp); in sctp_verify_init()
2334 chunk, errp); in sctp_verify_init()
2355 int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk, in sctp_process_init() argument
2376 asoc->encap_port = SCTP_INPUT_CB(chunk->skb)->encap_port; in sctp_process_init()
2380 if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr)) in sctp_process_init()
2390 chunk->sctp_hdr->source, 0)) in sctp_process_init()
2392 if (sctp_cmp_addr_exact(sctp_source(chunk), &addr)) in sctp_process_init()
3011 static void sctp_add_asconf_response(struct sctp_chunk *chunk, __be32 crr_id, in sctp_add_asconf_response() argument
3037 sctp_addto_chunk(chunk, sizeof(ack_param), &ack_param); in sctp_add_asconf_response()
3045 sctp_addto_chunk(chunk, err_param_len, &err_param); in sctp_add_asconf_response()
3049 sctp_addto_chunk(chunk, asconf_param_len, asconf_param); in sctp_add_asconf_response()
3197 struct sctp_chunk *chunk, bool addr_param_needed, in sctp_verify_asconf() argument
3204 addip = (struct sctp_addip_chunk *)chunk->chunk_hdr; in sctp_verify_asconf()
3256 if (param.v != chunk->chunk_end) in sctp_verify_asconf()
3872 struct sctp_chunk *chunk, in sctp_verify_reconf() argument
3880 hdr = (struct sctp_reconf_chunk *)chunk->chunk_hdr; in sctp_verify_reconf()