1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39#include <linux/slab.h>
40#include <linux/types.h>
41#include <linux/skbuff.h>
42#include <net/sctp/structs.h>
43#include <net/sctp/sctp.h>
44#include <net/sctp/sm.h>
45
46static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
47 struct sctp_association *asoc);
48static void sctp_ulpevent_release_data(struct sctp_ulpevent *event);
49static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);
50
51
52
53static void sctp_ulpevent_init(struct sctp_ulpevent *event,
54 int msg_flags,
55 unsigned int len)
56{
57 memset(event, 0, sizeof(struct sctp_ulpevent));
58 event->msg_flags = msg_flags;
59 event->rmem_len = len;
60}
61
62
63static struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags,
64 gfp_t gfp)
65{
66 struct sctp_ulpevent *event;
67 struct sk_buff *skb;
68
69 skb = alloc_skb(size, gfp);
70 if (!skb)
71 goto fail;
72
73 event = sctp_skb2event(skb);
74 sctp_ulpevent_init(event, msg_flags, skb->truesize);
75
76 return event;
77
78fail:
79 return NULL;
80}
81
82
83int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event)
84{
85 return MSG_NOTIFICATION == (event->msg_flags & MSG_NOTIFICATION);
86}
87
88
89
90
91static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event,
92 const struct sctp_association *asoc)
93{
94 struct sk_buff *skb;
95
96
97
98
99 sctp_association_hold((struct sctp_association *)asoc);
100 skb = sctp_event2skb(event);
101 event->asoc = (struct sctp_association *)asoc;
102 atomic_add(event->rmem_len, &event->asoc->rmem_alloc);
103 sctp_skb_set_owner_r(skb, asoc->base.sk);
104}
105
106
107static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event)
108{
109 struct sctp_association *asoc = event->asoc;
110
111 atomic_sub(event->rmem_len, &asoc->rmem_alloc);
112 sctp_association_put(asoc);
113}
114
115
116
117
118
119
120
121
122
123
124
125
126struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
127 const struct sctp_association *asoc,
128 __u16 flags, __u16 state, __u16 error, __u16 outbound,
129 __u16 inbound, struct sctp_chunk *chunk, gfp_t gfp)
130{
131 struct sctp_ulpevent *event;
132 struct sctp_assoc_change *sac;
133 struct sk_buff *skb;
134
135
136
137
138 if (chunk) {
139
140
141
142 skb = skb_copy_expand(chunk->skb,
143 sizeof(struct sctp_assoc_change), 0, gfp);
144
145 if (!skb)
146 goto fail;
147
148
149 event = sctp_skb2event(skb);
150 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize);
151
152
153 sac = (struct sctp_assoc_change *)
154 skb_push(skb, sizeof(struct sctp_assoc_change));
155
156
157 skb_trim(skb, sizeof(struct sctp_assoc_change) +
158 ntohs(chunk->chunk_hdr->length) -
159 sizeof(sctp_chunkhdr_t));
160 } else {
161 event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change),
162 MSG_NOTIFICATION, gfp);
163 if (!event)
164 goto fail;
165
166 skb = sctp_event2skb(event);
167 sac = (struct sctp_assoc_change *) skb_put(skb,
168 sizeof(struct sctp_assoc_change));
169 }
170
171
172
173
174
175
176
177 sac->sac_type = SCTP_ASSOC_CHANGE;
178
179
180
181
182
183
184
185
186 sac->sac_state = state;
187
188
189
190
191
192
193
194 sac->sac_flags = 0;
195
196
197
198
199
200
201
202
203 sac->sac_length = skb->len;
204
205
206
207
208
209
210
211
212
213
214
215 sac->sac_error = error;
216
217
218
219
220
221
222
223
224
225
226 sac->sac_outbound_streams = outbound;
227 sac->sac_inbound_streams = inbound;
228
229
230
231
232
233
234
235
236
237
238 sctp_ulpevent_set_owner(event, asoc);
239 sac->sac_assoc_id = sctp_assoc2id(asoc);
240
241 return event;
242
243fail:
244 return NULL;
245}
246
247
248
249
250
251
252
253
254
255struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
256 const struct sctp_association *asoc,
257 const struct sockaddr_storage *aaddr,
258 int flags, int state, int error, gfp_t gfp)
259{
260 struct sctp_ulpevent *event;
261 struct sctp_paddr_change *spc;
262 struct sk_buff *skb;
263
264 event = sctp_ulpevent_new(sizeof(struct sctp_paddr_change),
265 MSG_NOTIFICATION, gfp);
266 if (!event)
267 goto fail;
268
269 skb = sctp_event2skb(event);
270 spc = (struct sctp_paddr_change *)
271 skb_put(skb, sizeof(struct sctp_paddr_change));
272
273
274
275
276
277
278
279
280 spc->spc_type = SCTP_PEER_ADDR_CHANGE;
281
282
283
284
285
286
287
288
289
290 spc->spc_length = sizeof(struct sctp_paddr_change);
291
292
293
294
295
296
297
298 spc->spc_flags = 0;
299
300
301
302
303
304
305
306
307
308 spc->spc_state = state;
309
310
311
312
313
314
315
316
317
318
319 spc->spc_error = error;
320
321
322
323
324
325
326
327
328
329
330 sctp_ulpevent_set_owner(event, asoc);
331 spc->spc_assoc_id = sctp_assoc2id(asoc);
332
333
334
335
336
337
338
339
340
341 memcpy(&spc->spc_aaddr, aaddr, sizeof(struct sockaddr_storage));
342
343
344 sctp_get_pf_specific(asoc->base.sk->sk_family)->addr_to_user(
345 sctp_sk(asoc->base.sk),
346 (union sctp_addr *)&spc->spc_aaddr);
347
348 return event;
349
350fail:
351 return NULL;
352}
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369struct sctp_ulpevent *
370sctp_ulpevent_make_remote_error(const struct sctp_association *asoc,
371 struct sctp_chunk *chunk, __u16 flags,
372 gfp_t gfp)
373{
374 struct sctp_ulpevent *event;
375 struct sctp_remote_error *sre;
376 struct sk_buff *skb;
377 sctp_errhdr_t *ch;
378 __be16 cause;
379 int elen;
380
381 ch = (sctp_errhdr_t *)(chunk->skb->data);
382 cause = ch->cause;
383 elen = WORD_ROUND(ntohs(ch->length)) - sizeof(sctp_errhdr_t);
384
385
386 skb_pull(chunk->skb, sizeof(sctp_errhdr_t));
387
388
389
390
391 skb = skb_copy_expand(chunk->skb, sizeof(*sre), 0, gfp);
392
393
394 skb_pull(chunk->skb, elen);
395 if (!skb)
396 goto fail;
397
398
399 event = sctp_skb2event(skb);
400 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize);
401
402 sre = (struct sctp_remote_error *) skb_push(skb, sizeof(*sre));
403
404
405 skb_trim(skb, sizeof(*sre) + elen);
406
407
408 memset(sre, 0, sizeof(*sre));
409 sre->sre_type = SCTP_REMOTE_ERROR;
410 sre->sre_flags = 0;
411 sre->sre_length = skb->len;
412 sre->sre_error = cause;
413 sctp_ulpevent_set_owner(event, asoc);
414 sre->sre_assoc_id = sctp_assoc2id(asoc);
415
416 return event;
417fail:
418 return NULL;
419}
420
421
422
423
424
425
426struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
427 const struct sctp_association *asoc, struct sctp_chunk *chunk,
428 __u16 flags, __u32 error, gfp_t gfp)
429{
430 struct sctp_ulpevent *event;
431 struct sctp_send_failed *ssf;
432 struct sk_buff *skb;
433
434
435 int len = ntohs(chunk->chunk_hdr->length);
436
437
438 skb = skb_copy_expand(chunk->skb,
439 sizeof(struct sctp_send_failed),
440 0,
441 gfp);
442 if (!skb)
443 goto fail;
444
445
446 skb_pull(skb, sizeof(struct sctp_data_chunk));
447 len -= sizeof(struct sctp_data_chunk);
448
449
450 event = sctp_skb2event(skb);
451 sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize);
452
453 ssf = (struct sctp_send_failed *)
454 skb_push(skb, sizeof(struct sctp_send_failed));
455
456
457
458
459
460
461
462 ssf->ssf_type = SCTP_SEND_FAILED;
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477 ssf->ssf_flags = flags;
478
479
480
481
482
483
484
485
486 ssf->ssf_length = sizeof(struct sctp_send_failed) + len;
487 skb_trim(skb, ssf->ssf_length);
488
489
490
491
492
493
494
495
496
497 ssf->ssf_error = error;
498
499
500
501
502
503
504
505
506 memcpy(&ssf->ssf_info, &chunk->sinfo, sizeof(struct sctp_sndrcvinfo));
507
508
509
510
511 ssf->ssf_info.sinfo_flags = chunk->chunk_hdr->flags;
512
513
514
515
516
517
518
519
520
521
522 sctp_ulpevent_set_owner(event, asoc);
523 ssf->ssf_assoc_id = sctp_assoc2id(asoc);
524 return event;
525
526fail:
527 return NULL;
528}
529
530
531
532
533
534
535struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
536 const struct sctp_association *asoc,
537 __u16 flags, gfp_t gfp)
538{
539 struct sctp_ulpevent *event;
540 struct sctp_shutdown_event *sse;
541 struct sk_buff *skb;
542
543 event = sctp_ulpevent_new(sizeof(struct sctp_shutdown_event),
544 MSG_NOTIFICATION, gfp);
545 if (!event)
546 goto fail;
547
548 skb = sctp_event2skb(event);
549 sse = (struct sctp_shutdown_event *)
550 skb_put(skb, sizeof(struct sctp_shutdown_event));
551
552
553
554
555
556
557
558 sse->sse_type = SCTP_SHUTDOWN_EVENT;
559
560
561
562
563
564
565
566 sse->sse_flags = 0;
567
568
569
570
571
572
573
574
575 sse->sse_length = sizeof(struct sctp_shutdown_event);
576
577
578
579
580
581
582
583
584
585 sctp_ulpevent_set_owner(event, asoc);
586 sse->sse_assoc_id = sctp_assoc2id(asoc);
587
588 return event;
589
590fail:
591 return NULL;
592}
593
594
595
596
597
598
599struct sctp_ulpevent *sctp_ulpevent_make_adaptation_indication(
600 const struct sctp_association *asoc, gfp_t gfp)
601{
602 struct sctp_ulpevent *event;
603 struct sctp_adaptation_event *sai;
604 struct sk_buff *skb;
605
606 event = sctp_ulpevent_new(sizeof(struct sctp_adaptation_event),
607 MSG_NOTIFICATION, gfp);
608 if (!event)
609 goto fail;
610
611 skb = sctp_event2skb(event);
612 sai = (struct sctp_adaptation_event *)
613 skb_put(skb, sizeof(struct sctp_adaptation_event));
614
615 sai->sai_type = SCTP_ADAPTATION_INDICATION;
616 sai->sai_flags = 0;
617 sai->sai_length = sizeof(struct sctp_adaptation_event);
618 sai->sai_adaptation_ind = asoc->peer.adaptation_ind;
619 sctp_ulpevent_set_owner(event, asoc);
620 sai->sai_assoc_id = sctp_assoc2id(asoc);
621
622 return event;
623
624fail:
625 return NULL;
626}
627
628
629
630
631
632
633
634
635struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
636 struct sctp_chunk *chunk,
637 gfp_t gfp)
638{
639 struct sctp_ulpevent *event = NULL;
640 struct sk_buff *skb;
641 size_t padding, len;
642 int rx_count;
643
644
645
646
647
648
649 if (asoc->ep->rcvbuf_policy)
650 rx_count = atomic_read(&asoc->rmem_alloc);
651 else
652 rx_count = atomic_read(&asoc->base.sk->sk_rmem_alloc);
653
654 if (rx_count >= asoc->base.sk->sk_rcvbuf) {
655
656 if ((asoc->base.sk->sk_userlocks & SOCK_RCVBUF_LOCK) ||
657 (!sk_rmem_schedule(asoc->base.sk, chunk->skb,
658 chunk->skb->truesize)))
659 goto fail;
660 }
661
662
663 skb = skb_clone(chunk->skb, gfp);
664 if (!skb)
665 goto fail;
666
667
668
669
670 if (sctp_tsnmap_mark(&asoc->peer.tsn_map,
671 ntohl(chunk->subh.data_hdr->tsn),
672 chunk->transport))
673 goto fail_mark;
674
675
676
677
678
679
680
681
682
683
684
685
686
687 len = ntohs(chunk->chunk_hdr->length);
688 padding = WORD_ROUND(len) - len;
689
690
691 skb_trim(skb, chunk->chunk_end - padding - skb->data);
692
693
694 event = sctp_skb2event(skb);
695
696
697
698
699
700 sctp_ulpevent_init(event, 0, skb->len + sizeof(struct sk_buff));
701
702 sctp_ulpevent_receive_data(event, asoc);
703
704 event->stream = ntohs(chunk->subh.data_hdr->stream);
705 event->ssn = ntohs(chunk->subh.data_hdr->ssn);
706 event->ppid = chunk->subh.data_hdr->ppid;
707 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) {
708 event->flags |= SCTP_UNORDERED;
709 event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
710 }
711 event->tsn = ntohl(chunk->subh.data_hdr->tsn);
712 event->msg_flags |= chunk->chunk_hdr->flags;
713 event->iif = sctp_chunk_iif(chunk);
714
715 return event;
716
717fail_mark:
718 kfree_skb(skb);
719fail:
720 return NULL;
721}
722
723
724
725
726
727
728
729
730
731struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
732 const struct sctp_association *asoc, __u32 indication,
733 gfp_t gfp)
734{
735 struct sctp_ulpevent *event;
736 struct sctp_pdapi_event *pd;
737 struct sk_buff *skb;
738
739 event = sctp_ulpevent_new(sizeof(struct sctp_pdapi_event),
740 MSG_NOTIFICATION, gfp);
741 if (!event)
742 goto fail;
743
744 skb = sctp_event2skb(event);
745 pd = (struct sctp_pdapi_event *)
746 skb_put(skb, sizeof(struct sctp_pdapi_event));
747
748
749
750
751
752
753
754 pd->pdapi_type = SCTP_PARTIAL_DELIVERY_EVENT;
755 pd->pdapi_flags = 0;
756
757
758
759
760
761
762
763 pd->pdapi_length = sizeof(struct sctp_pdapi_event);
764
765
766
767
768
769 pd->pdapi_indication = indication;
770
771
772
773
774
775 sctp_ulpevent_set_owner(event, asoc);
776 pd->pdapi_assoc_id = sctp_assoc2id(asoc);
777
778 return event;
779fail:
780 return NULL;
781}
782
783struct sctp_ulpevent *sctp_ulpevent_make_authkey(
784 const struct sctp_association *asoc, __u16 key_id,
785 __u32 indication, gfp_t gfp)
786{
787 struct sctp_ulpevent *event;
788 struct sctp_authkey_event *ak;
789 struct sk_buff *skb;
790
791 event = sctp_ulpevent_new(sizeof(struct sctp_authkey_event),
792 MSG_NOTIFICATION, gfp);
793 if (!event)
794 goto fail;
795
796 skb = sctp_event2skb(event);
797 ak = (struct sctp_authkey_event *)
798 skb_put(skb, sizeof(struct sctp_authkey_event));
799
800 ak->auth_type = SCTP_AUTHENTICATION_EVENT;
801 ak->auth_flags = 0;
802 ak->auth_length = sizeof(struct sctp_authkey_event);
803
804 ak->auth_keynumber = key_id;
805 ak->auth_altkeynumber = 0;
806 ak->auth_indication = indication;
807
808
809
810
811 sctp_ulpevent_set_owner(event, asoc);
812 ak->auth_assoc_id = sctp_assoc2id(asoc);
813
814 return event;
815fail:
816 return NULL;
817}
818
819
820
821
822
823struct sctp_ulpevent *sctp_ulpevent_make_sender_dry_event(
824 const struct sctp_association *asoc, gfp_t gfp)
825{
826 struct sctp_ulpevent *event;
827 struct sctp_sender_dry_event *sdry;
828 struct sk_buff *skb;
829
830 event = sctp_ulpevent_new(sizeof(struct sctp_sender_dry_event),
831 MSG_NOTIFICATION, gfp);
832 if (!event)
833 return NULL;
834
835 skb = sctp_event2skb(event);
836 sdry = (struct sctp_sender_dry_event *)
837 skb_put(skb, sizeof(struct sctp_sender_dry_event));
838
839 sdry->sender_dry_type = SCTP_SENDER_DRY_EVENT;
840 sdry->sender_dry_flags = 0;
841 sdry->sender_dry_length = sizeof(struct sctp_sender_dry_event);
842 sctp_ulpevent_set_owner(event, asoc);
843 sdry->sender_dry_assoc_id = sctp_assoc2id(asoc);
844
845 return event;
846}
847
848
849
850
851__u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event)
852{
853 union sctp_notification *notification;
854 struct sk_buff *skb;
855
856 skb = sctp_event2skb(event);
857 notification = (union sctp_notification *) skb->data;
858 return notification->sn_header.sn_type;
859}
860
861
862
863
864void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
865 struct msghdr *msghdr)
866{
867 struct sctp_sndrcvinfo sinfo;
868
869 if (sctp_ulpevent_is_notification(event))
870 return;
871
872 memset(&sinfo, 0, sizeof(sinfo));
873 sinfo.sinfo_stream = event->stream;
874 sinfo.sinfo_ssn = event->ssn;
875 sinfo.sinfo_ppid = event->ppid;
876 sinfo.sinfo_flags = event->flags;
877 sinfo.sinfo_tsn = event->tsn;
878 sinfo.sinfo_cumtsn = event->cumtsn;
879 sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc);
880
881 sinfo.sinfo_context = event->asoc->default_rcv_context;
882
883 sinfo.sinfo_timetolive = 0;
884
885 put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV,
886 sizeof(sinfo), &sinfo);
887}
888
889
890
891
892void sctp_ulpevent_read_rcvinfo(const struct sctp_ulpevent *event,
893 struct msghdr *msghdr)
894{
895 struct sctp_rcvinfo rinfo;
896
897 if (sctp_ulpevent_is_notification(event))
898 return;
899
900 memset(&rinfo, 0, sizeof(struct sctp_rcvinfo));
901 rinfo.rcv_sid = event->stream;
902 rinfo.rcv_ssn = event->ssn;
903 rinfo.rcv_ppid = event->ppid;
904 rinfo.rcv_flags = event->flags;
905 rinfo.rcv_tsn = event->tsn;
906 rinfo.rcv_cumtsn = event->cumtsn;
907 rinfo.rcv_assoc_id = sctp_assoc2id(event->asoc);
908 rinfo.rcv_context = event->asoc->default_rcv_context;
909
910 put_cmsg(msghdr, IPPROTO_SCTP, SCTP_RCVINFO,
911 sizeof(rinfo), &rinfo);
912}
913
914
915
916
917static void __sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event,
918 struct msghdr *msghdr,
919 const struct sk_buff *skb)
920{
921 struct sctp_nxtinfo nxtinfo;
922
923 memset(&nxtinfo, 0, sizeof(nxtinfo));
924 nxtinfo.nxt_sid = event->stream;
925 nxtinfo.nxt_ppid = event->ppid;
926 nxtinfo.nxt_flags = event->flags;
927 if (sctp_ulpevent_is_notification(event))
928 nxtinfo.nxt_flags |= SCTP_NOTIFICATION;
929 nxtinfo.nxt_length = skb->len;
930 nxtinfo.nxt_assoc_id = sctp_assoc2id(event->asoc);
931
932 put_cmsg(msghdr, IPPROTO_SCTP, SCTP_NXTINFO,
933 sizeof(nxtinfo), &nxtinfo);
934}
935
936void sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event,
937 struct msghdr *msghdr,
938 struct sock *sk)
939{
940 struct sk_buff *skb;
941 int err;
942
943 skb = sctp_skb_recv_datagram(sk, MSG_PEEK, 1, &err);
944 if (skb != NULL) {
945 __sctp_ulpevent_read_nxtinfo(sctp_skb2event(skb),
946 msghdr, skb);
947
948 kfree_skb(skb);
949 }
950}
951
952
953
954
955static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
956 struct sctp_association *asoc)
957{
958 struct sk_buff *skb, *frag;
959
960 skb = sctp_event2skb(event);
961
962 sctp_ulpevent_set_owner(event, asoc);
963 sctp_assoc_rwnd_decrease(asoc, skb_headlen(skb));
964
965 if (!skb->data_len)
966 return;
967
968
969
970
971
972
973
974 skb_walk_frags(skb, frag)
975 sctp_ulpevent_receive_data(sctp_skb2event(frag), asoc);
976}
977
978
979
980
981static void sctp_ulpevent_release_data(struct sctp_ulpevent *event)
982{
983 struct sk_buff *skb, *frag;
984 unsigned int len;
985
986
987
988
989
990
991
992
993 skb = sctp_event2skb(event);
994 len = skb->len;
995
996 if (!skb->data_len)
997 goto done;
998
999
1000 skb_walk_frags(skb, frag) {
1001
1002
1003
1004
1005 sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
1006 }
1007
1008done:
1009 sctp_assoc_rwnd_increase(event->asoc, len);
1010 sctp_ulpevent_release_owner(event);
1011}
1012
1013static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event)
1014{
1015 struct sk_buff *skb, *frag;
1016
1017 skb = sctp_event2skb(event);
1018
1019 if (!skb->data_len)
1020 goto done;
1021
1022
1023 skb_walk_frags(skb, frag) {
1024
1025
1026
1027
1028 sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
1029 }
1030
1031done:
1032 sctp_ulpevent_release_owner(event);
1033}
1034
1035
1036
1037
1038
1039void sctp_ulpevent_free(struct sctp_ulpevent *event)
1040{
1041 if (sctp_ulpevent_is_notification(event))
1042 sctp_ulpevent_release_owner(event);
1043 else
1044 sctp_ulpevent_release_data(event);
1045
1046 kfree_skb(sctp_event2skb(event));
1047}
1048
1049
1050unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list)
1051{
1052 struct sk_buff *skb;
1053 unsigned int data_unread = 0;
1054
1055 while ((skb = skb_dequeue(list)) != NULL) {
1056 struct sctp_ulpevent *event = sctp_skb2event(skb);
1057
1058 if (!sctp_ulpevent_is_notification(event))
1059 data_unread += skb->len;
1060
1061 sctp_ulpevent_free(event);
1062 }
1063
1064 return data_unread;
1065}
1066