• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/sctp/

Lines Matching defs:chunk

66 	struct sctp_chunk *chunk, *tmp;
69 list_for_each_entry_safe(chunk, tmp, &queue->in_chunk_list, list) {
70 list_del_init(&chunk->list);
71 sctp_chunk_free(chunk);
91 void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk)
94 if (chunk->rcvr->dead) {
95 sctp_chunk_free(chunk);
104 list_add_tail(&chunk->list, &q->in_chunk_list);
108 /* Peek at the next chunk on the inqeue. */
111 struct sctp_chunk *chunk;
114 chunk = queue->in_progress;
116 if (chunk->singleton ||
117 chunk->end_of_packet ||
118 chunk->pdiscard)
121 ch = (sctp_chunkhdr_t *)chunk->chunk_end;
127 /* Extract a chunk from an SCTP inqueue.
129 * WARNING: If you need to put the chunk on another queue, you need to
134 struct sctp_chunk *chunk;
141 if ((chunk = queue->in_progress)) {
145 if (chunk->singleton ||
146 chunk->end_of_packet ||
147 chunk->pdiscard) {
148 sctp_chunk_free(chunk);
149 chunk = queue->in_progress = NULL;
151 /* Nothing to do. Next chunk in the packet, please. */
152 ch = (sctp_chunkhdr_t *) chunk->chunk_end;
154 /* Force chunk->skb->data to chunk->chunk_end. */
155 skb_pull(chunk->skb,
156 chunk->chunk_end - chunk->skb->data);
158 /* Verify that we have at least chunk headers
161 if (skb_headlen(chunk->skb) < sizeof(sctp_chunkhdr_t)) {
162 sctp_chunk_free(chunk);
163 chunk = queue->in_progress = NULL;
169 if (!chunk) {
177 chunk = queue->in_progress =
181 /* This is the first chunk in the packet. */
182 chunk->singleton = 1;
183 ch = (sctp_chunkhdr_t *) chunk->skb->data;
184 chunk->data_accepted = 0;
187 chunk->chunk_hdr = ch;
188 chunk->chunk_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length));
193 if (unlikely(skb_is_nonlinear(chunk->skb))) {
194 if (chunk->chunk_end > skb_tail_pointer(chunk->skb))
195 chunk->chunk_end = skb_tail_pointer(chunk->skb);
197 skb_pull(chunk->skb, sizeof(sctp_chunkhdr_t));
198 chunk->subh.v = NULL; /* Subheader is no longer valid. */
200 if (chunk->chunk_end < skb_tail_pointer(chunk->skb)) {
202 chunk->singleton = 0;
203 } else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {
207 * If the receiver detects a partial chunk, it MUST drop
208 * the chunk.
210 * Since the end of the chunk is past the end of our buffer
214 sctp_chunk_free(chunk);
215 chunk = queue->in_progress = NULL;
219 /* We are at the end of the packet, so mark the chunk
222 chunk->end_of_packet = 1;
225 SCTP_DEBUG_PRINTK("+++sctp_inq_pop+++ chunk %p[%s],"
226 " length %d, skb->len %d\n",chunk,
227 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)),
228 ntohs(chunk->chunk_hdr->length), chunk->skb->len);
229 return chunk;