X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ee68aa36460d7efeca48747f33b7f2adc0900bfb..296d466cd6bbf2f7e75e15bb6a01268e88c76ed0:/print-sctp.c diff --git a/print-sctp.c b/print-sctp.c index e0c22076..e49fc41f 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -35,9 +35,7 @@ /* \summary: Stream Control Transmission Protocol (SCTP) printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -293,7 +291,7 @@ struct sctpUnifiedAbortHeavy{ }; /* For the graceful shutdown we must carry - * the tag (in common header) and the highest consequitive acking value + * the tag (in common header) and the highest consecutive acking value */ struct sctpShutdown { nd_uint32_t TSN_Seen; @@ -467,8 +465,8 @@ sctp_print(netdissect_options *ndo, ndo->ndo_protocol = "sctp"; if (sctpPacketLength < sizeof(struct sctpHeader)) { - ND_PRINT("truncated-sctp - %ld bytes missing!", - (long)(sizeof(struct sctpHeader) - sctpPacketLength)); + ND_PRINT("truncated-sctp - %zu bytes missing!", + sizeof(struct sctpHeader) - sctpPacketLength); return; } sctpPktHdr = (const struct sctpHeader*) bp; @@ -486,16 +484,15 @@ sctp_print(netdissect_options *ndo, if (ip6) { ND_PRINT("%s.%u > %s.%u: sctp", - ip6addr_string(ndo, ip6->ip6_src), + GET_IP6ADDR_STRING(ip6->ip6_src), sourcePort, - ip6addr_string(ndo, ip6->ip6_dst), + GET_IP6ADDR_STRING(ip6->ip6_dst), destPort); - } else - { + } else { ND_PRINT("%s.%u > %s.%u: sctp", - ipaddr_string(ndo, ip->ip_src), + GET_IPADDR_STRING(ip->ip_src), sourcePort, - ipaddr_string(ndo, ip->ip_dst), + GET_IPADDR_STRING(ip->ip_dst), destPort); } @@ -555,14 +552,13 @@ sctp_print(netdissect_options *ndo, chunkID = GET_U_1(chunkDescPtr->chunkID); ND_PRINT("[%s] ", tok2str(sctp_chunkid_str, "Unknown chunk type: 0x%x", chunkID)); - switch (chunkID) - { + switch (chunkID) { case SCTP_DATA : { const struct sctpDataPart *dataHdrPtr; uint8_t chunkFlg; uint32_t ppid; - u_int payload_size; + uint16_t payload_size; chunkFlg = GET_U_1(chunkDescPtr->chunkFlg); if ((chunkFlg & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)