stream_interleave.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* SCTP kernel implementation
  3. * (C) Copyright Red Hat Inc. 2017
  4. *
  5. * These are definitions used by the stream schedulers, defined in RFC
  6. * draft ndata (https://tools.ietf.org/html/draft-ietf-tsvwg-sctp-ndata-11)
  7. *
  8. * Please send any bug reports or fixes you make to the
  9. * email addresses:
  10. * lksctp developers <[email protected]>
  11. *
  12. * Written or modified by:
  13. * Xin Long <[email protected]>
  14. */
  15. #ifndef __sctp_stream_interleave_h__
  16. #define __sctp_stream_interleave_h__
  17. struct sctp_stream_interleave {
  18. __u16 data_chunk_len;
  19. __u16 ftsn_chunk_len;
  20. /* (I-)DATA process */
  21. struct sctp_chunk *(*make_datafrag)(const struct sctp_association *asoc,
  22. const struct sctp_sndrcvinfo *sinfo,
  23. int len, __u8 flags, gfp_t gfp);
  24. void (*assign_number)(struct sctp_chunk *chunk);
  25. bool (*validate_data)(struct sctp_chunk *chunk);
  26. int (*ulpevent_data)(struct sctp_ulpq *ulpq,
  27. struct sctp_chunk *chunk, gfp_t gfp);
  28. int (*enqueue_event)(struct sctp_ulpq *ulpq,
  29. struct sctp_ulpevent *event);
  30. void (*renege_events)(struct sctp_ulpq *ulpq,
  31. struct sctp_chunk *chunk, gfp_t gfp);
  32. void (*start_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
  33. void (*abort_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
  34. /* (I-)FORWARD-TSN process */
  35. void (*generate_ftsn)(struct sctp_outq *q, __u32 ctsn);
  36. bool (*validate_ftsn)(struct sctp_chunk *chunk);
  37. void (*report_ftsn)(struct sctp_ulpq *ulpq, __u32 ftsn);
  38. void (*handle_ftsn)(struct sctp_ulpq *ulpq,
  39. struct sctp_chunk *chunk);
  40. };
  41. void sctp_stream_interleave_init(struct sctp_stream *stream);
  42. #endif /* __sctp_stream_interleave_h__ */