Lines Matching refs:event

51 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
53 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event);
69 SCTP_STATIC void sctp_ulpevent_init(struct sctp_ulpevent *event, int msg_flags) in sctp_ulpevent_init() argument
71 memset(event, 0, sizeof(struct sctp_ulpevent)); in sctp_ulpevent_init()
72 event->msg_flags = msg_flags; in sctp_ulpevent_init()
79 struct sctp_ulpevent *event; in sctp_ulpevent_new() local
86 event = sctp_skb2event(skb); in sctp_ulpevent_new()
87 sctp_ulpevent_init(event, msg_flags); in sctp_ulpevent_new()
89 return event; in sctp_ulpevent_new()
96 int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event) in sctp_ulpevent_is_notification() argument
98 return MSG_NOTIFICATION == (event->msg_flags & MSG_NOTIFICATION); in sctp_ulpevent_is_notification()
104 static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event, in sctp_ulpevent_set_owner() argument
113 skb = sctp_event2skb(event); in sctp_ulpevent_set_owner()
115 event->asoc = (struct sctp_association *)asoc; in sctp_ulpevent_set_owner()
120 static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event) in sctp_ulpevent_release_owner() argument
122 sctp_association_put(event->asoc); in sctp_ulpevent_release_owner()
141 struct sctp_ulpevent *event; in sctp_ulpevent_make_assoc_change() local
145 event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), in sctp_ulpevent_make_assoc_change()
147 if (!event) in sctp_ulpevent_make_assoc_change()
149 skb = sctp_event2skb(event); in sctp_ulpevent_make_assoc_change()
220 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_assoc_change()
223 return event; in sctp_ulpevent_make_assoc_change()
242 struct sctp_ulpevent *event; in sctp_ulpevent_make_peer_addr_change() local
246 event = sctp_ulpevent_new(sizeof(struct sctp_paddr_change), in sctp_ulpevent_make_peer_addr_change()
248 if (!event) in sctp_ulpevent_make_peer_addr_change()
251 skb = sctp_event2skb(event); in sctp_ulpevent_make_peer_addr_change()
312 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_peer_addr_change()
330 return event; in sctp_ulpevent_make_peer_addr_change()
355 struct sctp_ulpevent *event; in sctp_ulpevent_make_remote_error() local
381 event = sctp_skb2event(skb); in sctp_ulpevent_make_remote_error()
382 sctp_ulpevent_init(event, MSG_NOTIFICATION); in sctp_ulpevent_make_remote_error()
435 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_remote_error()
438 return event; in sctp_ulpevent_make_remote_error()
453 struct sctp_ulpevent *event; in sctp_ulpevent_make_send_failed() local
473 event = sctp_skb2event(skb); in sctp_ulpevent_make_send_failed()
474 sctp_ulpevent_init(event, MSG_NOTIFICATION); in sctp_ulpevent_make_send_failed()
545 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_send_failed()
547 return event; in sctp_ulpevent_make_send_failed()
562 struct sctp_ulpevent *event; in sctp_ulpevent_make_shutdown_event() local
566 event = sctp_ulpevent_new(sizeof(struct sctp_shutdown_event), in sctp_ulpevent_make_shutdown_event()
568 if (!event) in sctp_ulpevent_make_shutdown_event()
571 skb = sctp_event2skb(event); in sctp_ulpevent_make_shutdown_event()
608 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_shutdown_event()
611 return event; in sctp_ulpevent_make_shutdown_event()
625 struct sctp_ulpevent *event; in sctp_ulpevent_make_adaption_indication() local
629 event = sctp_ulpevent_new(sizeof(struct sctp_adaption_event), in sctp_ulpevent_make_adaption_indication()
631 if (!event) in sctp_ulpevent_make_adaption_indication()
634 skb = sctp_event2skb(event); in sctp_ulpevent_make_adaption_indication()
642 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_adaption_indication()
645 return event; in sctp_ulpevent_make_adaption_indication()
662 struct sctp_ulpevent *event = NULL; in sctp_ulpevent_make_rcvmsg() local
690 event = sctp_skb2event(skb); in sctp_ulpevent_make_rcvmsg()
693 sctp_ulpevent_init(event, 0); in sctp_ulpevent_make_rcvmsg()
695 sctp_ulpevent_receive_data(event, asoc); in sctp_ulpevent_make_rcvmsg()
697 event->stream = ntohs(chunk->subh.data_hdr->stream); in sctp_ulpevent_make_rcvmsg()
698 event->ssn = ntohs(chunk->subh.data_hdr->ssn); in sctp_ulpevent_make_rcvmsg()
699 event->ppid = chunk->subh.data_hdr->ppid; in sctp_ulpevent_make_rcvmsg()
701 event->flags |= MSG_UNORDERED; in sctp_ulpevent_make_rcvmsg()
702 event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); in sctp_ulpevent_make_rcvmsg()
704 event->tsn = ntohl(chunk->subh.data_hdr->tsn); in sctp_ulpevent_make_rcvmsg()
705 event->msg_flags |= chunk->chunk_hdr->flags; in sctp_ulpevent_make_rcvmsg()
706 event->iif = sctp_chunk_iif(chunk); in sctp_ulpevent_make_rcvmsg()
709 return event; in sctp_ulpevent_make_rcvmsg()
723 struct sctp_ulpevent *event; in sctp_ulpevent_make_pdapi() local
727 event = sctp_ulpevent_new(sizeof(struct sctp_pdapi_event), in sctp_ulpevent_make_pdapi()
729 if (!event) in sctp_ulpevent_make_pdapi()
732 skb = sctp_event2skb(event); in sctp_ulpevent_make_pdapi()
763 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_pdapi()
766 return event; in sctp_ulpevent_make_pdapi()
774 __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event) in sctp_ulpevent_get_notification_type() argument
779 skb = sctp_event2skb((struct sctp_ulpevent *)event); in sctp_ulpevent_get_notification_type()
785 void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_sndrcvinfo() argument
790 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_read_sndrcvinfo()
801 sinfo.sinfo_stream = event->stream; in sctp_ulpevent_read_sndrcvinfo()
809 sinfo.sinfo_ssn = event->ssn; in sctp_ulpevent_read_sndrcvinfo()
818 sinfo.sinfo_ppid = event->ppid; in sctp_ulpevent_read_sndrcvinfo()
829 sinfo.sinfo_flags = event->flags; in sctp_ulpevent_read_sndrcvinfo()
835 sinfo.sinfo_tsn = event->tsn; in sctp_ulpevent_read_sndrcvinfo()
843 sinfo.sinfo_cumtsn = event->cumtsn; in sctp_ulpevent_read_sndrcvinfo()
851 sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc); in sctp_ulpevent_read_sndrcvinfo()
864 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event, in sctp_ulpevent_receive_data() argument
869 skb = sctp_event2skb(event); in sctp_ulpevent_receive_data()
871 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_receive_data()
891 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event) in sctp_ulpevent_release_data() argument
902 skb = sctp_event2skb(event); in sctp_ulpevent_release_data()
903 sctp_assoc_rwnd_increase(event->asoc, skb_headlen(skb)); in sctp_ulpevent_release_data()
918 sctp_ulpevent_release_owner(event); in sctp_ulpevent_release_data()
926 void sctp_ulpevent_free(struct sctp_ulpevent *event) in sctp_ulpevent_free() argument
928 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_free()
929 sctp_ulpevent_release_owner(event); in sctp_ulpevent_free()
931 sctp_ulpevent_release_data(event); in sctp_ulpevent_free()
933 kfree_skb(sctp_event2skb(event)); in sctp_ulpevent_free()