~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/sctp/ulpevent.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
554
554
        memcpy(&ssf->ssf_info, &chunk->sinfo, sizeof(struct sctp_sndrcvinfo));
555
555
 
556
556
        /* Per TSVWG discussion with Randy. Allow the application to
557
 
         * ressemble a fragmented message.
 
557
         * reassemble a fragmented message.
558
558
         */
559
559
        ssf->ssf_info.sinfo_flags = chunk->chunk_hdr->flags;
560
560
 
843
843
        ak = (struct sctp_authkey_event *)
844
844
                skb_put(skb, sizeof(struct sctp_authkey_event));
845
845
 
846
 
        ak->auth_type = SCTP_AUTHENTICATION_INDICATION;
 
846
        ak->auth_type = SCTP_AUTHENTICATION_EVENT;
847
847
        ak->auth_flags = 0;
848
848
        ak->auth_length = sizeof(struct sctp_authkey_event);
849
849
 
862
862
        return NULL;
863
863
}
864
864
 
 
865
/*
 
866
 * Socket Extensions for SCTP
 
867
 * 6.3.10. SCTP_SENDER_DRY_EVENT
 
868
 */
 
869
struct sctp_ulpevent *sctp_ulpevent_make_sender_dry_event(
 
870
        const struct sctp_association *asoc, gfp_t gfp)
 
871
{
 
872
        struct sctp_ulpevent *event;
 
873
        struct sctp_sender_dry_event *sdry;
 
874
        struct sk_buff *skb;
 
875
 
 
876
        event = sctp_ulpevent_new(sizeof(struct sctp_sender_dry_event),
 
877
                                  MSG_NOTIFICATION, gfp);
 
878
        if (!event)
 
879
                return NULL;
 
880
 
 
881
        skb = sctp_event2skb(event);
 
882
        sdry = (struct sctp_sender_dry_event *)
 
883
                skb_put(skb, sizeof(struct sctp_sender_dry_event));
 
884
 
 
885
        sdry->sender_dry_type = SCTP_SENDER_DRY_EVENT;
 
886
        sdry->sender_dry_flags = 0;
 
887
        sdry->sender_dry_length = sizeof(struct sctp_sender_dry_event);
 
888
        sctp_ulpevent_set_owner(event, asoc);
 
889
        sdry->sender_dry_assoc_id = sctp_assoc2id(asoc);
 
890
 
 
891
        return event;
 
892
}
865
893
 
866
894
/* Return the notification type, assuming this is a notification
867
895
 * event.
1053
1081
}
1054
1082
 
1055
1083
/* Purge the skb lists holding ulpevents. */
1056
 
void sctp_queue_purge_ulpevents(struct sk_buff_head *list)
 
1084
unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list)
1057
1085
{
1058
1086
        struct sk_buff *skb;
1059
 
        while ((skb = skb_dequeue(list)) != NULL)
1060
 
                sctp_ulpevent_free(sctp_skb2event(skb));
 
1087
        unsigned int data_unread = 0;
 
1088
 
 
1089
        while ((skb = skb_dequeue(list)) != NULL) {
 
1090
                struct sctp_ulpevent *event = sctp_skb2event(skb);
 
1091
 
 
1092
                if (!sctp_ulpevent_is_notification(event))
 
1093
                        data_unread += skb->len;
 
1094
 
 
1095
                sctp_ulpevent_free(event);
 
1096
        }
 
1097
 
 
1098
        return data_unread;
1061
1099
}