[SCTP]: Implement the receive and verification of AUTH chunk
[safe/jmp/linux-2.6] / net / sctp / inqueue.c
index e4ea7fd..f10fe7f 100644 (file)
@@ -100,6 +100,25 @@ void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk)
        q->immediate.func(&q->immediate);
 }
 
+/* Peek at the next chunk on the inqeue. */
+struct sctp_chunkhdr *sctp_inq_peek(struct sctp_inq *queue)
+{
+       struct sctp_chunk *chunk;
+       sctp_chunkhdr_t *ch = NULL;
+
+       chunk = queue->in_progress;
+       /* If there is no more chunks in this packet, say so */
+       if (chunk->singleton ||
+           chunk->end_of_packet ||
+           chunk->pdiscard)
+                   return NULL;
+
+       ch = (sctp_chunkhdr_t *)chunk->chunk_end;
+
+       return ch;
+}
+
+
 /* Extract a chunk from an SCTP inqueue.
  *
  * WARNING:  If you need to put the chunk on another queue, you need to