Lines Matching full:event
10 * These functions manipulate an sctp event. The struct ulpevent is used
31 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
33 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event);
34 static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);
37 /* Initialize an ULP event from an given skb. */
38 static void sctp_ulpevent_init(struct sctp_ulpevent *event, in sctp_ulpevent_init() argument
42 memset(event, 0, sizeof(struct sctp_ulpevent)); in sctp_ulpevent_init()
43 event->msg_flags = msg_flags; in sctp_ulpevent_init()
44 event->rmem_len = len; in sctp_ulpevent_init()
51 struct sctp_ulpevent *event; in sctp_ulpevent_new() local
58 event = sctp_skb2event(skb); in sctp_ulpevent_new()
59 sctp_ulpevent_init(event, msg_flags, skb->truesize); in sctp_ulpevent_new()
61 return event; in sctp_ulpevent_new()
68 int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event) in sctp_ulpevent_is_notification() argument
70 return MSG_NOTIFICATION == (event->msg_flags & MSG_NOTIFICATION); in sctp_ulpevent_is_notification()
76 static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event, in sctp_ulpevent_set_owner() argument
79 struct sctp_chunk *chunk = event->chunk; in sctp_ulpevent_set_owner()
86 skb = sctp_event2skb(event); in sctp_ulpevent_set_owner()
87 event->asoc = (struct sctp_association *)asoc; in sctp_ulpevent_set_owner()
88 atomic_add(event->rmem_len, &event->asoc->rmem_alloc); in sctp_ulpevent_set_owner()
95 static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event) in sctp_ulpevent_release_owner() argument
97 struct sctp_association *asoc = event->asoc; in sctp_ulpevent_release_owner()
99 atomic_sub(event->rmem_len, &asoc->rmem_alloc); in sctp_ulpevent_release_owner()
103 /* Create and initialize an SCTP_ASSOC_CHANGE event.
119 struct sctp_ulpevent *event; in sctp_ulpevent_make_assoc_change() local
136 /* Embed the event fields inside the cloned skb. */ in sctp_ulpevent_make_assoc_change()
137 event = sctp_skb2event(skb); in sctp_ulpevent_make_assoc_change()
138 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); in sctp_ulpevent_make_assoc_change()
148 event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), in sctp_ulpevent_make_assoc_change()
150 if (!event) in sctp_ulpevent_make_assoc_change()
153 skb = sctp_event2skb(event); in sctp_ulpevent_make_assoc_change()
170 * event that happened to the association. in sctp_ulpevent_make_assoc_change()
224 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_assoc_change()
227 return event; in sctp_ulpevent_make_assoc_change()
233 /* Create and initialize an SCTP_PEER_ADDR_CHANGE event.
239 * an interface details event is sent.
246 struct sctp_ulpevent *event; in sctp_ulpevent_make_peer_addr_change() local
250 event = sctp_ulpevent_new(sizeof(struct sctp_paddr_change), in sctp_ulpevent_make_peer_addr_change()
252 if (!event) in sctp_ulpevent_make_peer_addr_change()
255 skb = sctp_event2skb(event); in sctp_ulpevent_make_peer_addr_change()
291 * event that happened to the address. in sctp_ulpevent_make_peer_addr_change()
315 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_peer_addr_change()
333 return event; in sctp_ulpevent_make_peer_addr_change()
344 struct sctp_ulpevent *event; in sctp_ulpevent_notify_peer_addr_change() local
352 event = sctp_ulpevent_make_peer_addr_change(asoc, &addr, 0, state, in sctp_ulpevent_notify_peer_addr_change()
354 if (event) in sctp_ulpevent_notify_peer_addr_change()
355 asoc->stream.si->enqueue_event(&asoc->ulpq, event); in sctp_ulpevent_notify_peer_addr_change()
369 * included in a SCTP_REMOTE_ERROR event. Please refer to the SCTP
379 struct sctp_ulpevent *event; in sctp_ulpevent_make_remote_error() local
402 /* Embed the event fields inside the cloned skb. */ in sctp_ulpevent_make_remote_error()
403 event = sctp_skb2event(skb); in sctp_ulpevent_make_remote_error()
404 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); in sctp_ulpevent_make_remote_error()
417 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_remote_error()
420 return event; in sctp_ulpevent_make_remote_error()
434 struct sctp_ulpevent *event; in sctp_ulpevent_make_send_failed() local
453 /* Embed the event fields inside the cloned skb. */ in sctp_ulpevent_make_send_failed()
454 event = sctp_skb2event(skb); in sctp_ulpevent_make_send_failed()
455 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); in sctp_ulpevent_make_send_failed()
525 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_send_failed()
527 return event; in sctp_ulpevent_make_send_failed()
538 struct sctp_ulpevent *event; in sctp_ulpevent_make_send_failed_event() local
550 event = sctp_skb2event(skb); in sctp_ulpevent_make_send_failed_event()
551 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); in sctp_ulpevent_make_send_failed_event()
566 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_send_failed_event()
569 return event; in sctp_ulpevent_make_send_failed_event()
581 struct sctp_ulpevent *event; in sctp_ulpevent_make_shutdown_event() local
585 event = sctp_ulpevent_new(sizeof(struct sctp_shutdown_event), in sctp_ulpevent_make_shutdown_event()
587 if (!event) in sctp_ulpevent_make_shutdown_event()
590 skb = sctp_event2skb(event); in sctp_ulpevent_make_shutdown_event()
626 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_shutdown_event()
629 return event; in sctp_ulpevent_make_shutdown_event()
643 struct sctp_ulpevent *event; in sctp_ulpevent_make_adaptation_indication() local
647 event = sctp_ulpevent_new(sizeof(struct sctp_adaptation_event), in sctp_ulpevent_make_adaptation_indication()
649 if (!event) in sctp_ulpevent_make_adaptation_indication()
652 skb = sctp_event2skb(event); in sctp_ulpevent_make_adaptation_indication()
659 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_adaptation_indication()
662 return event; in sctp_ulpevent_make_adaptation_indication()
679 struct sctp_ulpevent *event = NULL; in sctp_ulpevent_make_rcvmsg() local
730 /* Embed the event fields inside the cloned skb. */ in sctp_ulpevent_make_rcvmsg()
731 event = sctp_skb2event(skb); in sctp_ulpevent_make_rcvmsg()
733 /* Initialize event with flags 0 and correct length in sctp_ulpevent_make_rcvmsg()
737 sctp_ulpevent_init(event, 0, skb->len + sizeof(struct sk_buff)); in sctp_ulpevent_make_rcvmsg()
743 event->chunk = chunk; in sctp_ulpevent_make_rcvmsg()
745 sctp_ulpevent_receive_data(event, asoc); in sctp_ulpevent_make_rcvmsg()
747 event->stream = ntohs(chunk->subh.data_hdr->stream); in sctp_ulpevent_make_rcvmsg()
749 event->flags |= SCTP_UNORDERED; in sctp_ulpevent_make_rcvmsg()
750 event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); in sctp_ulpevent_make_rcvmsg()
752 event->tsn = ntohl(chunk->subh.data_hdr->tsn); in sctp_ulpevent_make_rcvmsg()
753 event->msg_flags |= chunk->chunk_hdr->flags; in sctp_ulpevent_make_rcvmsg()
755 return event; in sctp_ulpevent_make_rcvmsg()
763 /* Create a partial delivery related event.
776 struct sctp_ulpevent *event; in sctp_ulpevent_make_pdapi() local
780 event = sctp_ulpevent_new(sizeof(struct sctp_pdapi_event), in sctp_ulpevent_make_pdapi()
782 if (!event) in sctp_ulpevent_make_pdapi()
785 skb = sctp_event2skb(event); in sctp_ulpevent_make_pdapi()
817 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_pdapi()
820 return event; in sctp_ulpevent_make_pdapi()
829 struct sctp_ulpevent *event; in sctp_ulpevent_make_authkey() local
833 event = sctp_ulpevent_new(sizeof(struct sctp_authkey_event), in sctp_ulpevent_make_authkey()
835 if (!event) in sctp_ulpevent_make_authkey()
838 skb = sctp_event2skb(event); in sctp_ulpevent_make_authkey()
852 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_authkey()
855 return event; in sctp_ulpevent_make_authkey()
867 struct sctp_ulpevent *event; in sctp_ulpevent_make_sender_dry_event() local
871 event = sctp_ulpevent_new(sizeof(struct sctp_sender_dry_event), in sctp_ulpevent_make_sender_dry_event()
873 if (!event) in sctp_ulpevent_make_sender_dry_event()
876 skb = sctp_event2skb(event); in sctp_ulpevent_make_sender_dry_event()
882 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_sender_dry_event()
885 return event; in sctp_ulpevent_make_sender_dry_event()
893 struct sctp_ulpevent *event; in sctp_ulpevent_make_stream_reset_event() local
898 event = sctp_ulpevent_new(length, MSG_NOTIFICATION, gfp); in sctp_ulpevent_make_stream_reset_event()
899 if (!event) in sctp_ulpevent_make_stream_reset_event()
902 skb = sctp_event2skb(event); in sctp_ulpevent_make_stream_reset_event()
908 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_stream_reset_event()
914 return event; in sctp_ulpevent_make_stream_reset_event()
922 struct sctp_ulpevent *event; in sctp_ulpevent_make_assoc_reset_event() local
925 event = sctp_ulpevent_new(sizeof(struct sctp_assoc_reset_event), in sctp_ulpevent_make_assoc_reset_event()
927 if (!event) in sctp_ulpevent_make_assoc_reset_event()
930 skb = sctp_event2skb(event); in sctp_ulpevent_make_assoc_reset_event()
936 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_assoc_reset_event()
941 return event; in sctp_ulpevent_make_assoc_reset_event()
949 struct sctp_ulpevent *event; in sctp_ulpevent_make_stream_change_event() local
952 event = sctp_ulpevent_new(sizeof(struct sctp_stream_change_event), in sctp_ulpevent_make_stream_change_event()
954 if (!event) in sctp_ulpevent_make_stream_change_event()
957 skb = sctp_event2skb(event); in sctp_ulpevent_make_stream_change_event()
963 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_stream_change_event()
968 return event; in sctp_ulpevent_make_stream_change_event()
972 * event.
974 __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event) in sctp_ulpevent_get_notification_type() argument
979 skb = sctp_event2skb(event); in sctp_ulpevent_get_notification_type()
987 void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_sndrcvinfo() argument
992 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_read_sndrcvinfo()
996 sinfo.sinfo_stream = event->stream; in sctp_ulpevent_read_sndrcvinfo()
997 sinfo.sinfo_ssn = event->ssn; in sctp_ulpevent_read_sndrcvinfo()
998 sinfo.sinfo_ppid = event->ppid; in sctp_ulpevent_read_sndrcvinfo()
999 sinfo.sinfo_flags = event->flags; in sctp_ulpevent_read_sndrcvinfo()
1000 sinfo.sinfo_tsn = event->tsn; in sctp_ulpevent_read_sndrcvinfo()
1001 sinfo.sinfo_cumtsn = event->cumtsn; in sctp_ulpevent_read_sndrcvinfo()
1002 sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc); in sctp_ulpevent_read_sndrcvinfo()
1004 sinfo.sinfo_context = event->asoc->default_rcv_context; in sctp_ulpevent_read_sndrcvinfo()
1015 void sctp_ulpevent_read_rcvinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_rcvinfo() argument
1020 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_read_rcvinfo()
1024 rinfo.rcv_sid = event->stream; in sctp_ulpevent_read_rcvinfo()
1025 rinfo.rcv_ssn = event->ssn; in sctp_ulpevent_read_rcvinfo()
1026 rinfo.rcv_ppid = event->ppid; in sctp_ulpevent_read_rcvinfo()
1027 rinfo.rcv_flags = event->flags; in sctp_ulpevent_read_rcvinfo()
1028 rinfo.rcv_tsn = event->tsn; in sctp_ulpevent_read_rcvinfo()
1029 rinfo.rcv_cumtsn = event->cumtsn; in sctp_ulpevent_read_rcvinfo()
1030 rinfo.rcv_assoc_id = sctp_assoc2id(event->asoc); in sctp_ulpevent_read_rcvinfo()
1031 rinfo.rcv_context = event->asoc->default_rcv_context; in sctp_ulpevent_read_rcvinfo()
1040 static void __sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event, in __sctp_ulpevent_read_nxtinfo() argument
1047 nxtinfo.nxt_sid = event->stream; in __sctp_ulpevent_read_nxtinfo()
1048 nxtinfo.nxt_ppid = event->ppid; in __sctp_ulpevent_read_nxtinfo()
1049 nxtinfo.nxt_flags = event->flags; in __sctp_ulpevent_read_nxtinfo()
1050 if (sctp_ulpevent_is_notification(event)) in __sctp_ulpevent_read_nxtinfo()
1053 nxtinfo.nxt_assoc_id = sctp_assoc2id(event->asoc); in __sctp_ulpevent_read_nxtinfo()
1059 void sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_nxtinfo() argument
1078 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event, in sctp_ulpevent_receive_data() argument
1083 skb = sctp_event2skb(event); in sctp_ulpevent_receive_data()
1085 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_receive_data()
1091 /* Note: Not clearing the entire event struct as this is just a in sctp_ulpevent_receive_data()
1092 * fragment of the real event. However, we still need to do rwnd in sctp_ulpevent_receive_data()
1104 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event) in sctp_ulpevent_release_data() argument
1116 skb = sctp_event2skb(event); in sctp_ulpevent_release_data()
1132 sctp_assoc_rwnd_increase(event->asoc, len); in sctp_ulpevent_release_data()
1133 sctp_chunk_put(event->chunk); in sctp_ulpevent_release_data()
1134 sctp_ulpevent_release_owner(event); in sctp_ulpevent_release_data()
1137 static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event) in sctp_ulpevent_release_frag_data() argument
1141 skb = sctp_event2skb(event); in sctp_ulpevent_release_frag_data()
1156 sctp_chunk_put(event->chunk); in sctp_ulpevent_release_frag_data()
1157 sctp_ulpevent_release_owner(event); in sctp_ulpevent_release_frag_data()
1161 * to the owner, updating the rwnd in case of a DATA event and freeing the
1164 void sctp_ulpevent_free(struct sctp_ulpevent *event) in sctp_ulpevent_free() argument
1166 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_free()
1167 sctp_ulpevent_release_owner(event); in sctp_ulpevent_free()
1169 sctp_ulpevent_release_data(event); in sctp_ulpevent_free()
1171 kfree_skb(sctp_event2skb(event)); in sctp_ulpevent_free()
1181 struct sctp_ulpevent *event = sctp_skb2event(skb); in sctp_queue_purge_ulpevents() local
1183 if (!sctp_ulpevent_is_notification(event)) in sctp_queue_purge_ulpevents()
1186 sctp_ulpevent_free(event); in sctp_queue_purge_ulpevents()