stream_interleave.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SCTP kernel implementation
  2. * (C) Copyright Red Hat Inc. 2017
  3. *
  4. * These are definitions used by the stream schedulers, defined in RFC
  5. * draft ndata (https://tools.ietf.org/html/draft-ietf-tsvwg-sctp-ndata-11)
  6. *
  7. * This SCTP implementation is free software;
  8. * you can redistribute it and/or modify it under the terms of
  9. * the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2, or (at your option)
  11. * any later version.
  12. *
  13. * This SCTP implementation is distributed in the hope that it
  14. * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  15. * ************************
  16. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. * See the GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with GNU CC; see the file COPYING. If not, see
  21. * <http://www.gnu.org/licenses/>.
  22. *
  23. * Please send any bug reports or fixes you make to the
  24. * email addresses:
  25. * lksctp developers <linux-sctp@vger.kernel.org>
  26. *
  27. * Written or modified by:
  28. * Xin Long <lucien.xin@gmail.com>
  29. */
  30. #ifndef __sctp_stream_interleave_h__
  31. #define __sctp_stream_interleave_h__
  32. struct sctp_stream_interleave {
  33. __u16 data_chunk_len;
  34. __u16 ftsn_chunk_len;
  35. /* (I-)DATA process */
  36. struct sctp_chunk *(*make_datafrag)(const struct sctp_association *asoc,
  37. const struct sctp_sndrcvinfo *sinfo,
  38. int len, __u8 flags, gfp_t gfp);
  39. void (*assign_number)(struct sctp_chunk *chunk);
  40. bool (*validate_data)(struct sctp_chunk *chunk);
  41. int (*ulpevent_data)(struct sctp_ulpq *ulpq,
  42. struct sctp_chunk *chunk, gfp_t gfp);
  43. int (*enqueue_event)(struct sctp_ulpq *ulpq,
  44. struct sctp_ulpevent *event);
  45. void (*renege_events)(struct sctp_ulpq *ulpq,
  46. struct sctp_chunk *chunk, gfp_t gfp);
  47. void (*start_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
  48. void (*abort_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
  49. /* (I-)FORWARD-TSN process */
  50. void (*generate_ftsn)(struct sctp_outq *q, __u32 ctsn);
  51. bool (*validate_ftsn)(struct sctp_chunk *chunk);
  52. void (*report_ftsn)(struct sctp_ulpq *ulpq, __u32 ftsn);
  53. void (*handle_ftsn)(struct sctp_ulpq *ulpq,
  54. struct sctp_chunk *chunk);
  55. };
  56. void sctp_stream_interleave_init(struct sctp_stream *stream);
  57. #endif /* __sctp_stream_interleave_h__ */