• Home
  • Raw
  • Download

Lines Matching refs:event

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);
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()
119 struct sctp_ulpevent *event; in sctp_ulpevent_make_assoc_change() local
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()
224 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_assoc_change()
227 return event; in sctp_ulpevent_make_assoc_change()
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()
315 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_peer_addr_change()
333 return event; in sctp_ulpevent_make_peer_addr_change()
360 struct sctp_ulpevent *event; in sctp_ulpevent_make_remote_error() local
384 event = sctp_skb2event(skb); in sctp_ulpevent_make_remote_error()
385 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); in sctp_ulpevent_make_remote_error()
398 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_remote_error()
401 return event; in sctp_ulpevent_make_remote_error()
415 struct sctp_ulpevent *event; in sctp_ulpevent_make_send_failed() local
435 event = sctp_skb2event(skb); in sctp_ulpevent_make_send_failed()
436 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); in sctp_ulpevent_make_send_failed()
506 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_send_failed()
508 return event; in sctp_ulpevent_make_send_failed()
523 struct sctp_ulpevent *event; in sctp_ulpevent_make_shutdown_event() local
527 event = sctp_ulpevent_new(sizeof(struct sctp_shutdown_event), in sctp_ulpevent_make_shutdown_event()
529 if (!event) in sctp_ulpevent_make_shutdown_event()
532 skb = sctp_event2skb(event); in sctp_ulpevent_make_shutdown_event()
568 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_shutdown_event()
571 return event; in sctp_ulpevent_make_shutdown_event()
585 struct sctp_ulpevent *event; in sctp_ulpevent_make_adaptation_indication() local
589 event = sctp_ulpevent_new(sizeof(struct sctp_adaptation_event), in sctp_ulpevent_make_adaptation_indication()
591 if (!event) in sctp_ulpevent_make_adaptation_indication()
594 skb = sctp_event2skb(event); in sctp_ulpevent_make_adaptation_indication()
601 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_adaptation_indication()
604 return event; in sctp_ulpevent_make_adaptation_indication()
621 struct sctp_ulpevent *event = NULL; in sctp_ulpevent_make_rcvmsg() local
673 event = sctp_skb2event(skb); in sctp_ulpevent_make_rcvmsg()
679 sctp_ulpevent_init(event, 0, skb->len + sizeof(struct sk_buff)); in sctp_ulpevent_make_rcvmsg()
685 event->chunk = chunk; in sctp_ulpevent_make_rcvmsg()
687 sctp_ulpevent_receive_data(event, asoc); in sctp_ulpevent_make_rcvmsg()
689 event->stream = ntohs(chunk->subh.data_hdr->stream); in sctp_ulpevent_make_rcvmsg()
691 event->flags |= SCTP_UNORDERED; in sctp_ulpevent_make_rcvmsg()
692 event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); in sctp_ulpevent_make_rcvmsg()
694 event->tsn = ntohl(chunk->subh.data_hdr->tsn); in sctp_ulpevent_make_rcvmsg()
695 event->msg_flags |= chunk->chunk_hdr->flags; in sctp_ulpevent_make_rcvmsg()
697 return event; in sctp_ulpevent_make_rcvmsg()
718 struct sctp_ulpevent *event; in sctp_ulpevent_make_pdapi() local
722 event = sctp_ulpevent_new(sizeof(struct sctp_pdapi_event), in sctp_ulpevent_make_pdapi()
724 if (!event) in sctp_ulpevent_make_pdapi()
727 skb = sctp_event2skb(event); in sctp_ulpevent_make_pdapi()
759 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_pdapi()
762 return event; in sctp_ulpevent_make_pdapi()
771 struct sctp_ulpevent *event; in sctp_ulpevent_make_authkey() local
775 event = sctp_ulpevent_new(sizeof(struct sctp_authkey_event), in sctp_ulpevent_make_authkey()
777 if (!event) in sctp_ulpevent_make_authkey()
780 skb = sctp_event2skb(event); in sctp_ulpevent_make_authkey()
794 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_authkey()
797 return event; in sctp_ulpevent_make_authkey()
809 struct sctp_ulpevent *event; in sctp_ulpevent_make_sender_dry_event() local
813 event = sctp_ulpevent_new(sizeof(struct sctp_sender_dry_event), in sctp_ulpevent_make_sender_dry_event()
815 if (!event) in sctp_ulpevent_make_sender_dry_event()
818 skb = sctp_event2skb(event); in sctp_ulpevent_make_sender_dry_event()
824 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_sender_dry_event()
827 return event; in sctp_ulpevent_make_sender_dry_event()
835 struct sctp_ulpevent *event; in sctp_ulpevent_make_stream_reset_event() local
840 event = sctp_ulpevent_new(length, MSG_NOTIFICATION, gfp); in sctp_ulpevent_make_stream_reset_event()
841 if (!event) in sctp_ulpevent_make_stream_reset_event()
844 skb = sctp_event2skb(event); in sctp_ulpevent_make_stream_reset_event()
850 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_stream_reset_event()
856 return event; in sctp_ulpevent_make_stream_reset_event()
864 struct sctp_ulpevent *event; in sctp_ulpevent_make_assoc_reset_event() local
867 event = sctp_ulpevent_new(sizeof(struct sctp_assoc_reset_event), in sctp_ulpevent_make_assoc_reset_event()
869 if (!event) in sctp_ulpevent_make_assoc_reset_event()
872 skb = sctp_event2skb(event); in sctp_ulpevent_make_assoc_reset_event()
878 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_assoc_reset_event()
883 return event; in sctp_ulpevent_make_assoc_reset_event()
891 struct sctp_ulpevent *event; in sctp_ulpevent_make_stream_change_event() local
894 event = sctp_ulpevent_new(sizeof(struct sctp_stream_change_event), in sctp_ulpevent_make_stream_change_event()
896 if (!event) in sctp_ulpevent_make_stream_change_event()
899 skb = sctp_event2skb(event); in sctp_ulpevent_make_stream_change_event()
905 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_make_stream_change_event()
910 return event; in sctp_ulpevent_make_stream_change_event()
916 __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event) in sctp_ulpevent_get_notification_type() argument
921 skb = sctp_event2skb(event); in sctp_ulpevent_get_notification_type()
929 void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_sndrcvinfo() argument
934 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_read_sndrcvinfo()
938 sinfo.sinfo_stream = event->stream; in sctp_ulpevent_read_sndrcvinfo()
939 sinfo.sinfo_ssn = event->ssn; in sctp_ulpevent_read_sndrcvinfo()
940 sinfo.sinfo_ppid = event->ppid; in sctp_ulpevent_read_sndrcvinfo()
941 sinfo.sinfo_flags = event->flags; in sctp_ulpevent_read_sndrcvinfo()
942 sinfo.sinfo_tsn = event->tsn; in sctp_ulpevent_read_sndrcvinfo()
943 sinfo.sinfo_cumtsn = event->cumtsn; in sctp_ulpevent_read_sndrcvinfo()
944 sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc); in sctp_ulpevent_read_sndrcvinfo()
946 sinfo.sinfo_context = event->asoc->default_rcv_context; in sctp_ulpevent_read_sndrcvinfo()
957 void sctp_ulpevent_read_rcvinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_rcvinfo() argument
962 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_read_rcvinfo()
966 rinfo.rcv_sid = event->stream; in sctp_ulpevent_read_rcvinfo()
967 rinfo.rcv_ssn = event->ssn; in sctp_ulpevent_read_rcvinfo()
968 rinfo.rcv_ppid = event->ppid; in sctp_ulpevent_read_rcvinfo()
969 rinfo.rcv_flags = event->flags; in sctp_ulpevent_read_rcvinfo()
970 rinfo.rcv_tsn = event->tsn; in sctp_ulpevent_read_rcvinfo()
971 rinfo.rcv_cumtsn = event->cumtsn; in sctp_ulpevent_read_rcvinfo()
972 rinfo.rcv_assoc_id = sctp_assoc2id(event->asoc); in sctp_ulpevent_read_rcvinfo()
973 rinfo.rcv_context = event->asoc->default_rcv_context; in sctp_ulpevent_read_rcvinfo()
982 static void __sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event, in __sctp_ulpevent_read_nxtinfo() argument
989 nxtinfo.nxt_sid = event->stream; in __sctp_ulpevent_read_nxtinfo()
990 nxtinfo.nxt_ppid = event->ppid; in __sctp_ulpevent_read_nxtinfo()
991 nxtinfo.nxt_flags = event->flags; in __sctp_ulpevent_read_nxtinfo()
992 if (sctp_ulpevent_is_notification(event)) in __sctp_ulpevent_read_nxtinfo()
995 nxtinfo.nxt_assoc_id = sctp_assoc2id(event->asoc); in __sctp_ulpevent_read_nxtinfo()
1001 void sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event, in sctp_ulpevent_read_nxtinfo() argument
1020 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event, in sctp_ulpevent_receive_data() argument
1025 skb = sctp_event2skb(event); in sctp_ulpevent_receive_data()
1027 sctp_ulpevent_set_owner(event, asoc); in sctp_ulpevent_receive_data()
1046 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event) in sctp_ulpevent_release_data() argument
1058 skb = sctp_event2skb(event); in sctp_ulpevent_release_data()
1074 sctp_assoc_rwnd_increase(event->asoc, len); in sctp_ulpevent_release_data()
1075 sctp_chunk_put(event->chunk); in sctp_ulpevent_release_data()
1076 sctp_ulpevent_release_owner(event); in sctp_ulpevent_release_data()
1079 static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event) in sctp_ulpevent_release_frag_data() argument
1083 skb = sctp_event2skb(event); in sctp_ulpevent_release_frag_data()
1098 sctp_chunk_put(event->chunk); in sctp_ulpevent_release_frag_data()
1099 sctp_ulpevent_release_owner(event); in sctp_ulpevent_release_frag_data()
1106 void sctp_ulpevent_free(struct sctp_ulpevent *event) in sctp_ulpevent_free() argument
1108 if (sctp_ulpevent_is_notification(event)) in sctp_ulpevent_free()
1109 sctp_ulpevent_release_owner(event); in sctp_ulpevent_free()
1111 sctp_ulpevent_release_data(event); in sctp_ulpevent_free()
1113 kfree_skb(sctp_event2skb(event)); in sctp_ulpevent_free()
1123 struct sctp_ulpevent *event = sctp_skb2event(skb); in sctp_queue_purge_ulpevents() local
1125 if (!sctp_ulpevent_is_notification(event)) in sctp_queue_purge_ulpevents()
1128 sctp_ulpevent_free(event); in sctp_queue_purge_ulpevents()