]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-sctp.c
CMake: Fix the comment about versions. [skip ci]
[tcpdump] / print-sctp.c
index e0c22076edf9e76819c1cbeba7660d3ffa9705fb..e49fc41fad263a05840a8e877a1faa8784228910 100644 (file)
@@ -35,9 +35,7 @@
 
 /* \summary: Stream Control Transmission Protocol (SCTP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#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)