1 /* Copyright (c) 2001 NETLAB, Temple University
2 * Copyright (c) 2001 Protocol Engineering Lab, University of Delaware
4 * Jerry Heinz <gheinz@astro.temple.edu>
5 * John Fiore <jfiore@joda.cis.temple.edu>
6 * Armando L. Caro Jr. <acaro@cis.udel.edu>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor of the Laboratory may be used
20 * to endorse or promote products derived from this software without
21 * specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #define NETDISSECT_REWORKED
41 #include <tcpdump-stdinc.h>
43 #include "interface.h"
44 #include "addrtoname.h"
45 #include "extract.h" /* must come after interface.h */
53 * SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
55 * Redistribution and use in source and binary forms, with or without
56 * modification, are permitted provided that the following conditions
59 * 1. Redistributions of source code must retain the above copyright
60 * notice, this list of conditions and the following disclaimer.
62 * 2. Redistributions in binary form must reproduce the above copyright
63 * notice, this list of conditions and the following disclaimer in the
64 * documentation and/or other materials provided with the distribution.
66 * 3. Neither the name of Cisco nor of Motorola may be used
67 * to endorse or promote products derived from this software without
68 * specific prior written permission.
70 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
71 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
72 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
73 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
74 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
75 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
76 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
77 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
78 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
79 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
82 * This file is part of the SCTP reference Implementation
85 * Please send any bug reports or fixes you make to one of the following email
88 * rstewar1@email.mot.com
92 * Any bugs reported given to us we will try to fix... any fixes shared will
93 * be incorperated into the next SCTP release.
96 /* The valid defines for all message
97 * types know to SCTP. 0 is reserved
99 #define SCTP_DATA 0x00
100 #define SCTP_INITIATION 0x01
101 #define SCTP_INITIATION_ACK 0x02
102 #define SCTP_SELECTIVE_ACK 0x03
103 #define SCTP_HEARTBEAT_REQUEST 0x04
104 #define SCTP_HEARTBEAT_ACK 0x05
105 #define SCTP_ABORT_ASSOCIATION 0x06
106 #define SCTP_SHUTDOWN 0x07
107 #define SCTP_SHUTDOWN_ACK 0x08
108 #define SCTP_OPERATION_ERR 0x09
109 #define SCTP_COOKIE_ECHO 0x0a
110 #define SCTP_COOKIE_ACK 0x0b
111 #define SCTP_ECN_ECHO 0x0c
112 #define SCTP_ECN_CWR 0x0d
113 #define SCTP_SHUTDOWN_COMPLETE 0x0e
114 #define SCTP_FORWARD_CUM_TSN 0xc0
115 #define SCTP_RELIABLE_CNTL 0xc1
116 #define SCTP_RELIABLE_CNTL_ACK 0xc2
118 static const struct tok sctp_chunkid_str
[] = {
119 { SCTP_DATA
, "DATA" },
120 { SCTP_INITIATION
, "INIT" },
121 { SCTP_INITIATION_ACK
, "INIT ACK" },
122 { SCTP_SELECTIVE_ACK
, "SACK" },
123 { SCTP_HEARTBEAT_REQUEST
, "HB REQ" },
124 { SCTP_HEARTBEAT_ACK
, "HB ACK" },
125 { SCTP_ABORT_ASSOCIATION
, "ABORT" },
126 { SCTP_SHUTDOWN
, "SHUTDOWN" },
127 { SCTP_SHUTDOWN_ACK
, "SHUTDOWN ACK" },
128 { SCTP_OPERATION_ERR
, "OP ERR" },
129 { SCTP_COOKIE_ECHO
, "COOKIE ECHO" },
130 { SCTP_COOKIE_ACK
, "COOKIE ACK" },
131 { SCTP_ECN_ECHO
, "ECN ECHO" },
132 { SCTP_ECN_CWR
, "ECN CWR" },
133 { SCTP_SHUTDOWN_COMPLETE
, "SHUTDOWN COMPLETE" },
134 { SCTP_FORWARD_CUM_TSN
, "FOR CUM TSN" },
135 { SCTP_RELIABLE_CNTL
, "REL CTRL" },
136 { SCTP_RELIABLE_CNTL_ACK
, "REL CTRL ACK" },
140 /* Data Chuck Specific Flags */
141 #define SCTP_DATA_FRAG_MASK 0x03
142 #define SCTP_DATA_MIDDLE_FRAG 0x00
143 #define SCTP_DATA_LAST_FRAG 0x01
144 #define SCTP_DATA_FIRST_FRAG 0x02
145 #define SCTP_DATA_NOT_FRAG 0x03
146 #define SCTP_DATA_UNORDERED 0x04
148 #define SCTP_ADDRMAX 60
154 /* the sctp common header */
158 u_int16_t destination
;
159 u_int32_t verificationTag
;
163 /* various descriptor parsers */
165 struct sctpChunkDesc
{
168 u_int16_t chunkLength
;
171 struct sctpParamDesc
{
173 u_int16_t paramLength
;
177 struct sctpRelChunkDesc
{
178 struct sctpChunkDesc chk
;
179 u_int32_t serialNumber
;
182 struct sctpVendorSpecificParam
{
183 struct sctpParamDesc p
; /* type must be 0xfffe */
184 u_int32_t vendorId
; /* vendor ID from RFC 1700 */
185 u_int16_t vendorSpecificType
;
186 u_int16_t vendorSpecificLen
;
190 /* Structures for the control parts */
194 /* Sctp association init request/ack */
196 /* this is used for init ack, too */
197 struct sctpInitiation
{
198 u_int32_t initTag
; /* tag of mine */
199 u_int32_t rcvWindowCredit
; /* rwnd */
200 u_int16_t NumPreopenStreams
; /* OS */
201 u_int16_t MaxInboundStreams
; /* MIS */
202 u_int32_t initialTSN
;
203 /* optional param's follow in sctpParamDesc form */
206 struct sctpV4IpAddress
{
207 struct sctpParamDesc p
; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */
212 struct sctpV6IpAddress
{
213 struct sctpParamDesc p
; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */
214 u_int8_t ipAddress
[16];
218 struct sctpParamDesc param
;
223 struct sctpCookiePreserve
{
224 struct sctpParamDesc p
; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */
229 struct sctpTimeStamp
{
234 /* wire structure of my cookie */
235 struct cookieMessage
{
236 u_int32_t TieTag_curTag
; /* copied from assoc if present */
237 u_int32_t TieTag_hisTag
; /* copied from assoc if present */
238 int32_t cookieLife
; /* life I will award this cookie */
239 struct sctpTimeStamp timeEnteringState
; /* the time I built cookie */
240 struct sctpInitiation initAckISent
; /* the INIT-ACK that I sent to my peer */
241 u_int32_t addressWhereISent
[4]; /* I make this 4 ints so I get 128bits for future */
242 int32_t addrtype
; /* address type */
243 u_int16_t locScope
; /* V6 local scope flag */
244 u_int16_t siteScope
; /* V6 site scope flag */
245 /* at the end is tacked on the INIT chunk sent in
246 * its entirety and of course our
252 /* this guy is for use when
253 * I have a initiate message gloming the
257 struct sctpUnifiedInit
{
258 struct sctpChunkDesc uh
;
259 struct sctpInitiation initm
;
262 struct sctpSendableInit
{
263 struct sctpHeader mh
;
264 struct sctpUnifiedInit msg
;
268 /* Selective Acknowledgement
269 * has the following structure with
270 * a optional ammount of trailing int's
271 * on the last part (based on the numberOfDesc
275 struct sctpSelectiveAck
{
276 u_int32_t highestConseqTSN
;
277 u_int32_t updatedRwnd
;
278 u_int16_t numberOfdesc
;
279 u_int16_t numDupTsns
;
282 struct sctpSelectiveFrag
{
283 u_int16_t fragmentStart
;
284 u_int16_t fragmentEnd
;
288 struct sctpUnifiedSack
{
289 struct sctpChunkDesc uh
;
290 struct sctpSelectiveAck sack
;
293 /* for both RTT request/response the
297 struct sctpHBrequest
{
298 u_int32_t time_value_1
;
299 u_int32_t time_value_2
;
302 /* here is what I read and respond with to. */
303 struct sctpHBunified
{
304 struct sctpChunkDesc hdr
;
305 struct sctpParamDesc hb
;
309 /* here is what I send */
311 struct sctpChunkDesc hdr
;
312 struct sctpParamDesc hb
;
313 struct sctpHBrequest rtt
;
314 int8_t addrFmt
[SCTP_ADDRMAX
];
320 /* for the abort and shutdown ACK
321 * we must carry the init tag in the common header. Just the
322 * common header is all that is needed with a chunk descriptor.
324 struct sctpUnifiedAbort
{
325 struct sctpChunkDesc uh
;
328 struct sctpUnifiedAbortLight
{
329 struct sctpHeader mh
;
330 struct sctpChunkDesc uh
;
333 struct sctpUnifiedAbortHeavy
{
334 struct sctpHeader mh
;
335 struct sctpChunkDesc uh
;
340 /* For the graceful shutdown we must carry
341 * the tag (in common header) and the highest consequitive acking value
343 struct sctpShutdown
{
347 struct sctpUnifiedShutdown
{
348 struct sctpChunkDesc uh
;
349 struct sctpShutdown shut
;
352 /* in the unified message we add the trailing
353 * stream id since it is the only message
354 * that is defined as a operation error.
356 struct sctpOpErrorCause
{
361 struct sctpUnifiedOpError
{
362 struct sctpChunkDesc uh
;
363 struct sctpOpErrorCause c
;
366 struct sctpUnifiedStreamError
{
367 struct sctpHeader mh
;
368 struct sctpChunkDesc uh
;
369 struct sctpOpErrorCause c
;
374 struct staleCookieMsg
{
375 struct sctpHeader mh
;
376 struct sctpChunkDesc uh
;
377 struct sctpOpErrorCause c
;
381 /* the following is used in all sends
382 * where nothing is needed except the
383 * chunk/type i.e. shutdownAck Abort */
385 struct sctpUnifiedSingleMsg
{
386 struct sctpHeader mh
;
387 struct sctpChunkDesc uh
;
394 u_int32_t payloadtype
;
397 struct sctpUnifiedDatagram
{
398 struct sctpChunkDesc uh
;
399 struct sctpDataPart dp
;
403 struct sctpChunkDesc uh
;
404 u_int32_t Lowest_TSN
;
409 struct sctpChunkDesc uh
;
410 u_int32_t TSN_reduced_at
;
413 static const struct tok ForCES_channels
[] = {
414 { CHAN_HP
, "ForCES HP" },
415 { CHAN_MP
, "ForCES MP" },
416 { CHAN_LP
, "ForCES LP" },
420 static inline int isForCES_port(u_short Port
)
432 void sctp_print(netdissect_options
*ndo
,
433 const u_char
*bp
, /* beginning of sctp packet */
434 const u_char
*bp2
, /* beginning of enclosing */
435 u_int sctpPacketLength
) /* ip packet */
437 const struct sctpHeader
*sctpPktHdr
;
440 const struct ip6_hdr
*ip6
;
442 const void *endPacketPtr
;
443 u_short sourcePort
, destPort
;
445 const struct sctpChunkDesc
*chunkDescPtr
;
446 const void *nextChunk
;
451 sctpPktHdr
= (const struct sctpHeader
*) bp
;
452 endPacketPtr
= (const u_char
*)sctpPktHdr
+sctpPacketLength
;
454 if( (u_long
) endPacketPtr
> (u_long
) ndo
->ndo_snapend
)
455 endPacketPtr
= (const void *) ndo
->ndo_snapend
;
456 ip
= (struct ip
*)bp2
;
459 ip6
= (const struct ip6_hdr
*)bp2
;
463 ND_TCHECK(*sctpPktHdr
);
465 if (sctpPacketLength
< sizeof(struct sctpHeader
))
467 ND_PRINT((ndo
, "truncated-sctp - %ld bytes missing!",
468 (long)sctpPacketLength
-sizeof(struct sctpHeader
)));
472 /* sctpPacketLength -= sizeof(struct sctpHeader); packet length */
473 /* is now only as long as the payload */
475 sourcePort
= EXTRACT_16BITS(&sctpPktHdr
->source
);
476 destPort
= EXTRACT_16BITS(&sctpPktHdr
->destination
);
480 ND_PRINT((ndo
, "%s.%d > %s.%d: sctp",
481 ip6addr_string(ndo
, &ip6
->ip6_src
),
483 ip6addr_string(ndo
, &ip6
->ip6_dst
),
488 ND_PRINT((ndo
, "%s.%d > %s.%d: sctp",
489 ipaddr_string(ndo
, &ip
->ip_src
),
491 ipaddr_string(ndo
, &ip
->ip_dst
),
495 if (isForCES_port(sourcePort
)) {
496 ND_PRINT((ndo
, "[%s]", tok2str(ForCES_channels
, NULL
, sourcePort
)));
499 if (isForCES_port(destPort
)) {
500 ND_PRINT((ndo
, "[%s]", tok2str(ForCES_channels
, NULL
, destPort
)));
504 if (ndo
->ndo_vflag
>= 2)
508 /* cycle through all chunks, printing information on each one */
510 chunkDescPtr
= (const struct sctpChunkDesc
*)
511 ((const u_char
*) sctpPktHdr
+ sizeof(struct sctpHeader
));
512 chunkDescPtr
!= NULL
&&
514 ((const u_char
*) chunkDescPtr
+ sizeof(struct sctpChunkDesc
))
517 chunkDescPtr
= (const struct sctpChunkDesc
*) nextChunk
, chunkCount
++)
519 u_int16_t chunkLength
;
520 const u_char
*chunkEnd
;
523 ND_TCHECK(*chunkDescPtr
);
524 chunkLength
= EXTRACT_16BITS(&chunkDescPtr
->chunkLength
);
525 if (chunkLength
< sizeof(*chunkDescPtr
)) {
526 ND_PRINT((ndo
, "%s%d) [Bad chunk length %u]", sep
, chunkCount
+1, chunkLength
));
530 ND_TCHECK2(*((u_int8_t
*)chunkDescPtr
), chunkLength
);
531 chunkEnd
= ((const u_char
*)chunkDescPtr
+ chunkLength
);
533 align
=chunkLength
% 4;
537 nextChunk
= (const void *) (chunkEnd
+ align
);
539 ND_PRINT((ndo
, "%s%d) ", sep
, chunkCount
+1));
540 ND_PRINT((ndo
, "[%s] ", tok2str(sctp_chunkid_str
, "Unknown chunk type: 0x%x",
541 chunkDescPtr
->chunkID
)));
542 switch (chunkDescPtr
->chunkID
)
546 const struct sctpDataPart
*dataHdrPtr
;
548 if ((chunkDescPtr
->chunkFlg
& SCTP_DATA_UNORDERED
)
549 == SCTP_DATA_UNORDERED
)
550 ND_PRINT((ndo
, "(U)"));
552 if ((chunkDescPtr
->chunkFlg
& SCTP_DATA_FIRST_FRAG
)
553 == SCTP_DATA_FIRST_FRAG
)
554 ND_PRINT((ndo
, "(B)"));
556 if ((chunkDescPtr
->chunkFlg
& SCTP_DATA_LAST_FRAG
)
557 == SCTP_DATA_LAST_FRAG
)
558 ND_PRINT((ndo
, "(E)"));
560 if( ((chunkDescPtr
->chunkFlg
& SCTP_DATA_UNORDERED
)
561 == SCTP_DATA_UNORDERED
)
563 ((chunkDescPtr
->chunkFlg
& SCTP_DATA_FIRST_FRAG
)
564 == SCTP_DATA_FIRST_FRAG
)
566 ((chunkDescPtr
->chunkFlg
& SCTP_DATA_LAST_FRAG
)
567 == SCTP_DATA_LAST_FRAG
) )
568 ND_PRINT((ndo
, " "));
570 dataHdrPtr
=(const struct sctpDataPart
*)(chunkDescPtr
+1);
572 ND_PRINT((ndo
, "[TSN: %u] ", EXTRACT_32BITS(&dataHdrPtr
->TSN
)));
573 ND_PRINT((ndo
, "[SID: %u] ", EXTRACT_16BITS(&dataHdrPtr
->streamId
)));
574 ND_PRINT((ndo
, "[SSEQ %u] ", EXTRACT_16BITS(&dataHdrPtr
->sequence
)));
575 ND_PRINT((ndo
, "[PPID 0x%x] ", EXTRACT_32BITS(&dataHdrPtr
->payloadtype
)));
577 const u_char
*payloadPtr
;
578 u_int chunksize
= sizeof(struct sctpDataPart
)+
579 sizeof(struct sctpChunkDesc
);
580 payloadPtr
= (const u_char
*) (dataHdrPtr
+ 1);
581 if (EXTRACT_16BITS(&chunkDescPtr
->chunkLength
) <
582 sizeof(struct sctpDataPart
)+
583 sizeof(struct sctpChunkDesc
)+1) {
584 /* Less than 1 byte of chunk payload */
585 ND_PRINT((ndo
, "bogus ForCES chunk length %u]",
586 EXTRACT_16BITS(&chunkDescPtr
->chunkLength
)));
590 forces_print(ndo
, payloadPtr
, EXTRACT_16BITS(&chunkDescPtr
->chunkLength
)- chunksize
);
591 } else if (ndo
->ndo_vflag
>= 2) { /* if verbose output is specified */
592 /* at the command line */
593 const u_char
*payloadPtr
;
595 ND_PRINT((ndo
, "[Payload"));
597 if (!ndo
->ndo_suppress_default_print
) {
598 payloadPtr
= (const u_char
*) (++dataHdrPtr
);
599 ND_PRINT((ndo
, ":"));
600 if (EXTRACT_16BITS(&chunkDescPtr
->chunkLength
) <
601 sizeof(struct sctpDataPart
)+
602 sizeof(struct sctpChunkDesc
)+1) {
603 /* Less than 1 byte of chunk payload */
604 ND_PRINT((ndo
, "bogus chunk length %u]",
605 EXTRACT_16BITS(&chunkDescPtr
->chunkLength
)));
608 ND_DEFAULTPRINT(payloadPtr
,
609 EXTRACT_16BITS(&chunkDescPtr
->chunkLength
) -
610 (sizeof(struct sctpDataPart
)+
611 sizeof(struct sctpChunkDesc
)));
613 ND_PRINT((ndo
, "]"));
617 case SCTP_INITIATION
:
619 const struct sctpInitiation
*init
;
621 init
=(const struct sctpInitiation
*)(chunkDescPtr
+1);
622 ND_PRINT((ndo
, "[init tag: %u] ", EXTRACT_32BITS(&init
->initTag
)));
623 ND_PRINT((ndo
, "[rwnd: %u] ", EXTRACT_32BITS(&init
->rcvWindowCredit
)));
624 ND_PRINT((ndo
, "[OS: %u] ", EXTRACT_16BITS(&init
->NumPreopenStreams
)));
625 ND_PRINT((ndo
, "[MIS: %u] ", EXTRACT_16BITS(&init
->MaxInboundStreams
)));
626 ND_PRINT((ndo
, "[init TSN: %u] ", EXTRACT_32BITS(&init
->initialTSN
)));
628 #if(0) /* ALC you can add code for optional params here */
629 if( (init
+1) < chunkEnd
)
630 ND_PRINT((ndo
, " @@@@@ UNFINISHED @@@@@@%s\n",
631 "Optional params present, but not printed."));
635 case SCTP_INITIATION_ACK
:
637 const struct sctpInitiation
*init
;
639 init
=(const struct sctpInitiation
*)(chunkDescPtr
+1);
640 ND_PRINT((ndo
, "[init tag: %u] ", EXTRACT_32BITS(&init
->initTag
)));
641 ND_PRINT((ndo
, "[rwnd: %u] ", EXTRACT_32BITS(&init
->rcvWindowCredit
)));
642 ND_PRINT((ndo
, "[OS: %u] ", EXTRACT_16BITS(&init
->NumPreopenStreams
)));
643 ND_PRINT((ndo
, "[MIS: %u] ", EXTRACT_16BITS(&init
->MaxInboundStreams
)));
644 ND_PRINT((ndo
, "[init TSN: %u] ", EXTRACT_32BITS(&init
->initialTSN
)));
646 #if(0) /* ALC you can add code for optional params here */
647 if( (init
+1) < chunkEnd
)
648 ND_PRINT((ndo
, " @@@@@ UNFINISHED @@@@@@%s\n",
649 "Optional params present, but not printed."));
653 case SCTP_SELECTIVE_ACK
:
655 const struct sctpSelectiveAck
*sack
;
656 const struct sctpSelectiveFrag
*frag
;
658 const u_char
*dupTSN
;
660 sack
=(const struct sctpSelectiveAck
*)(chunkDescPtr
+1);
661 ND_PRINT((ndo
, "[cum ack %u] ", EXTRACT_32BITS(&sack
->highestConseqTSN
)));
662 ND_PRINT((ndo
, "[a_rwnd %u] ", EXTRACT_32BITS(&sack
->updatedRwnd
)));
663 ND_PRINT((ndo
, "[#gap acks %u] ", EXTRACT_16BITS(&sack
->numberOfdesc
)));
664 ND_PRINT((ndo
, "[#dup tsns %u] ", EXTRACT_16BITS(&sack
->numDupTsns
)));
668 for (frag
= ( (const struct sctpSelectiveFrag
*)
669 ((const struct sctpSelectiveAck
*) sack
+1)),
671 (const void *)frag
< nextChunk
&& fragNo
< EXTRACT_16BITS(&sack
->numberOfdesc
);
673 ND_PRINT((ndo
, "\n\t\t[gap ack block #%d: start = %u, end = %u] ",
675 EXTRACT_32BITS(&sack
->highestConseqTSN
) + EXTRACT_16BITS(&frag
->fragmentStart
),
676 EXTRACT_32BITS(&sack
->highestConseqTSN
) + EXTRACT_16BITS(&frag
->fragmentEnd
)));
679 /* print duplicate TSNs */
680 for (dupTSN
= (const u_char
*)frag
, tsnNo
=0;
681 (const void *) dupTSN
< nextChunk
&& tsnNo
<EXTRACT_16BITS(&sack
->numDupTsns
);
682 dupTSN
+= 4, tsnNo
++)
683 ND_PRINT((ndo
, "\n\t\t[dup TSN #%u: %u] ", tsnNo
+1,
684 EXTRACT_32BITS(dupTSN
)));
690 if (ndo
->ndo_vflag
< 2)
696 ND_PRINT((ndo
, "[|sctp]"));