sctpIfdef.pkt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Copyright (C) 2014 Irene Ruengeler
  3. // Copyright (c) 2016 Michael Tuexen
  4. // All rights reserved.
  5. //
  6. // Redistribution and use in source and binary forms, with or without
  7. // modification, are permitted provided that the following conditions
  8. // are met:
  9. // 1. Redistributions of source code must retain the above copyright
  10. // notice, this list of conditions and the following disclaimer.
  11. // 2. Redistributions in binary form must reproduce the above copyright
  12. // notice, this list of conditions and the following disclaimer in the
  13. // documentation and/or other materials provided with the distribution.
  14. //
  15. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  16. // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  19. // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21. // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  22. // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  24. // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25. // SUCH DAMAGE.
  26. //
  27. // Create a passive non-blocking 1-to-1 style socket.
  28. +0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
  29. +0.0 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
  30. +0.0 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
  31. +0.0 setsockopt(3, IPPROTO_SCTP, SCTP_INITMSG, {sinit_num_ostreams=1,
  32. sinit_max_instreams=1,
  33. sinit_max_attempts=0,
  34. sinit_max_init_timeo=0}, 8) = 0
  35. +0.0 bind(3, ..., ...) = 0
  36. +0.0 listen(3, 1) = 0
  37. // Establish an association.
  38. +0.0 < sctp: INIT[flgs=0, tag=1, a_rwnd=1500, os=1, is=1, tsn=1]
  39. +0.0 > sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=..., os=1, is=1, tsn=1, ...]
  40. +0.1 < sctp: COOKIE_ECHO[flgs=0, len=..., val=...]
  41. +0.0 > sctp: COOKIE_ACK[flgs=0]
  42. +0.0 accept(3, ..., ...) = 4
  43. +0.0 close(3) = 0
  44. // Inject an empty DATA chunk.
  45. +0.1 < sctp: DATA[flgs=BE, len=16, tsn=1, sid=0, ssn=0, ppid=1234]
  46. #ifdef Omnet
  47. +0.0 > sctp: ABORT[flgs=0]
  48. #endif
  49. #ifdef FreeBSD
  50. +0.0 > sctp: ABORT[flgs=0, NO_USER_DATA[tsn=1]]
  51. #endif
  52. +0.0 close(4) = 0