]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't specify struct as "const" within sizeof().
authorDenis Ovsienko <[email protected]>
Wed, 13 Sep 2017 12:26:02 +0000 (13:26 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 13 Sep 2017 12:33:02 +0000 (13:33 +0100)
The only difference the const qualifier makes in this context is visual,
make it consistent with the rest of the source code.

13 files changed:
print-bfd.c
print-cfm.c
print-eap.c
print-eigrp.c
print-isoclns.c
print-ldp.c
print-lmp.c
print-lspping.c
print-lwapp.c
print-mpcp.c
print-rsvp.c
print-sflow.c
print-vqp.c

index 10b8f35ba30f9ca7d5b3c25fd30f4ba0c47a787c..e7ec5ff26d4f0f27a49670450c0f2f60f2e9d2a9 100644 (file)
@@ -183,7 +183,7 @@ auth_print(netdissect_options *ndo, register const u_char *pptr)
         const struct bfd_auth_header_t *bfd_auth_header;
         int i;
 
-        pptr += sizeof (const struct bfd_header_t);
+        pptr += sizeof (struct bfd_header_t);
         bfd_auth_header = (const struct bfd_auth_header_t *)pptr;
         ND_TCHECK(*bfd_auth_header);
         ND_PRINT((ndo, "\n\tAuthentication: %s (%u), length: %u",
index 85aebb1317fc2ee7de4a6aa9c23d4bfc46f32d78..bf915a255c191071a3f9a4a4ab2cfe8e29d4eb6a 100644 (file)
@@ -320,7 +320,7 @@ cfm_print(netdissect_options *ndo,
 
     ND_PRINT((ndo, "\n\tFirst TLV offset %u", cfm_common_header->first_tlv_offset));
 
-    tptr += sizeof(const struct cfm_common_header_t);
+    tptr += sizeof(struct cfm_common_header_t);
     tlen = length - sizeof(struct cfm_common_header_t);
 
     /*
index d76aea3395a75b641181754e9014835b2120e188..5126c96fe5ad8f7f81b1e21ef50f335bf304fa3b 100644 (file)
@@ -177,8 +177,8 @@ eap_print(netdissect_options *ndo,
            eap->version,
            EXTRACT_16BITS(eap->length)));
 
-    tptr += sizeof(const struct eap_frame_t);
-    tlen -= sizeof(const struct eap_frame_t);
+    tptr += sizeof(struct eap_frame_t);
+    tlen -= sizeof(struct eap_frame_t);
 
     switch (eap->type) {
     case EAP_FRAME_TYPE_PACKET:
index aa113415f93cbb4959dee3852c696335a1515b39..d6884c26d87caf23c256e51e65e8328505c96e77 100644 (file)
@@ -269,7 +269,7 @@ eigrp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
            EXTRACT_32BITS(&eigrp_com_header->asn),
            tlen));
 
-    tptr+=sizeof(const struct eigrp_common_header);
+    tptr+=sizeof(struct eigrp_common_header);
 
     while(tlen>0) {
         /* did we capture enough for fully decoding the object header ? */
index 5e08c3c2a516933f4b52973ad99220f9bf72a3d5..5cd06edb1a4f116db55ab24c2387f5a501c593c2 100644 (file)
@@ -877,7 +877,7 @@ clnp_print(netdissect_options *ndo,
                isonsap_string(ndo, dest_address, dest_address_length)));
 
         if (clnp_flags & CLNP_SEGMENT_PART) {
-                if (li < sizeof(const struct clnp_segment_header_t)) {
+                if (li < sizeof(struct clnp_segment_header_t)) {
                     ND_PRINT((ndo, "li < size of fixed part of CLNP header, addresses, and segment part"));
                     return (0);
                 }
@@ -887,8 +887,8 @@ clnp_print(netdissect_options *ndo,
                        EXTRACT_16BITS(clnp_segment_header->data_unit_id),
                        EXTRACT_16BITS(clnp_segment_header->segment_offset),
                        EXTRACT_16BITS(clnp_segment_header->total_length)));
-                pptr+=sizeof(const struct clnp_segment_header_t);
-                li-=sizeof(const struct clnp_segment_header_t);
+                pptr+=sizeof(struct clnp_segment_header_t);
+                li-=sizeof(struct clnp_segment_header_t);
         }
 
         /* now walk the options */
index 2a3d1f97303ee4470f92d84f6a080188259710fb..d556a6835aae35e47735d8bed7fbfb896e5fa95a 100644 (file)
@@ -581,12 +581,12 @@ ldp_pdu_print(netdissect_options *ndo,
     }
 
     pdu_len = EXTRACT_16BITS(&ldp_com_header->pdu_length);
-    if (pdu_len < sizeof(const struct ldp_common_header)-4) {
+    if (pdu_len < sizeof(struct ldp_common_header)-4) {
         /* length too short */
         ND_PRINT((ndo, "%sLDP, pdu-length: %u (too short, < %u)",
                (ndo->ndo_vflag < 1) ? "" : "\n\t",
                pdu_len,
-               (u_int)(sizeof(const struct ldp_common_header)-4)));
+               (u_int)(sizeof(struct ldp_common_header)-4)));
         return 0;
     }
 
@@ -602,8 +602,8 @@ ldp_pdu_print(netdissect_options *ndo,
         return 0;
 
     /* ok they seem to want to know everything - lets fully decode it */
-    tptr = pptr + sizeof(const struct ldp_common_header);
-    tlen = pdu_len - (sizeof(const struct ldp_common_header)-4);       /* Type & Length fields not included */
+    tptr = pptr + sizeof(struct ldp_common_header);
+    tlen = pdu_len - (sizeof(struct ldp_common_header)-4);     /* Type & Length fields not included */
 
     while(tlen>0) {
         /* did we capture enough for fully decoding the msg header ? */
index 916a1d675b07fbfa71531ab9dbc15f6300abfdcf..289a6afc1dca5245fd023e0cf8458458b0f9fb2e 100644 (file)
@@ -469,7 +469,7 @@ lmp_print(netdissect_options *ndo,
            tok2str(lmp_msg_type_values, "unknown, type: %u",lmp_com_header->msg_type),
            bittok2str(lmp_header_flag_values,"none",lmp_com_header->flags),
            tlen));
-    if (tlen < sizeof(const struct lmp_common_header)) {
+    if (tlen < sizeof(struct lmp_common_header)) {
         ND_PRINT((ndo, " (too short)"));
         return;
     }
@@ -478,8 +478,8 @@ lmp_print(netdissect_options *ndo,
         tlen = len;
     }
 
-    tptr+=sizeof(const struct lmp_common_header);
-    tlen-=sizeof(const struct lmp_common_header);
+    tptr+=sizeof(struct lmp_common_header);
+    tlen-=sizeof(struct lmp_common_header);
 
     while(tlen>0) {
         /* did we capture enough for fully decoding the object header ? */
index 274cc68b7630978415b7136c120c2ef48754d290..cd00652462090dcbcfe57323122b8b11db7a9014 100644 (file)
@@ -523,7 +523,7 @@ lspping_print(netdissect_options *ndo,
 
     tptr=pptr;
     lspping_com_header = (const struct lspping_common_header *)pptr;
-    if (len < sizeof(const struct lspping_common_header))
+    if (len < sizeof(struct lspping_common_header))
         goto tooshort;
     ND_TCHECK(*lspping_com_header);
 
@@ -596,8 +596,8 @@ lspping_print(netdissect_options *ndo,
     else
         ND_PRINT((ndo, "no timestamp"));
 
-    tptr+=sizeof(const struct lspping_common_header);
-    tlen-=sizeof(const struct lspping_common_header);
+    tptr+=sizeof(struct lspping_common_header);
+    tlen-=sizeof(struct lspping_common_header);
 
     while (tlen != 0) {
         /* Does the TLV go past the end of the packet? */
index bab3219f10ec4e6e3fe788bdfd3edc943524c28c..c4393338203827272e76f75ea62523c84b5b157b 100644 (file)
@@ -214,9 +214,9 @@ lwapp_control_print(netdissect_options *ndo,
 
     if (has_ap_ident) {
         ND_PRINT((ndo, "\n\tAP identity: %s", etheraddr_string(ndo, tptr)));
-        tptr+=sizeof(const struct lwapp_transport_header)+6;
+        tptr+=sizeof(struct lwapp_transport_header)+6;
     } else {
-        tptr+=sizeof(const struct lwapp_transport_header);
+        tptr+=sizeof(struct lwapp_transport_header);
     }
 
     while(tlen>0) {
@@ -329,8 +329,8 @@ lwapp_data_print(netdissect_options *ndo,
            lwapp_trans_header->frag_id,
            tlen));
 
-    tptr+=sizeof(const struct lwapp_transport_header);
-    tlen-=sizeof(const struct lwapp_transport_header);
+    tptr+=sizeof(struct lwapp_transport_header);
+    tlen-=sizeof(struct lwapp_transport_header);
 
     /* FIX - An IEEE 802.11 frame follows - hexdump for now */
     print_unknown_data(ndo, tptr, "\n\t", tlen);
index 3e022ad4a9a3e875ffd8c0e7b367e5da60e5cf31..acb83cbcf059f489014a910dedab17116d99a390 100644 (file)
@@ -140,7 +140,7 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
     tptr=pptr;
     mpcp.common_header = (const struct mpcp_common_header_t *)pptr;
 
-    ND_TCHECK2(*tptr, sizeof(const struct mpcp_common_header_t));
+    ND_TCHECK2(*tptr, sizeof(struct mpcp_common_header_t));
     opcode = EXTRACT_16BITS(mpcp.common_header->opcode);
     ND_PRINT((ndo, "MPCP, Opcode %s", tok2str(mpcp_opcode_values, "Unknown (%u)", opcode)));
     if (opcode != MPCP_OPCODE_PAUSE) {
@@ -151,7 +151,7 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
     if (!ndo->ndo_vflag)
         return;
 
-    tptr += sizeof(const struct mpcp_common_header_t);
+    tptr += sizeof(struct mpcp_common_header_t);
 
     switch (opcode) {
     case MPCP_OPCODE_PAUSE:
@@ -168,13 +168,13 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
         tptr++;
 
         for (grant = 1; grant <= grant_numbers; grant++) {
-            ND_TCHECK2(*tptr, sizeof(const struct mpcp_grant_t));
+            ND_TCHECK2(*tptr, sizeof(struct mpcp_grant_t));
             mpcp.grant = (const struct mpcp_grant_t *)tptr;
             ND_PRINT((ndo, "\n\tGrant #%u, Start-Time %u ticks, duration %u ticks",
                    grant,
                    EXTRACT_32BITS(mpcp.grant->starttime),
                    EXTRACT_16BITS(mpcp.grant->duration)));
-            tptr += sizeof(const struct mpcp_grant_t);
+            tptr += sizeof(struct mpcp_grant_t);
         }
 
         ND_TCHECK2(*tptr, MPCP_TIMESTAMP_DURATION_LEN);
@@ -212,7 +212,7 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
         break;
 
     case MPCP_OPCODE_REG_REQ:
-        ND_TCHECK2(*tptr, sizeof(const struct mpcp_reg_req_t));
+        ND_TCHECK2(*tptr, sizeof(struct mpcp_reg_req_t));
         mpcp.reg_req = (const struct mpcp_reg_req_t *)tptr;
         ND_PRINT((ndo, "\n\tFlags [ %s ], Pending-Grants %u",
                bittok2str(mpcp_reg_req_flag_values, "Reserved", mpcp.reg_req->flags),
@@ -220,7 +220,7 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
         break;
 
     case MPCP_OPCODE_REG:
-        ND_TCHECK2(*tptr, sizeof(const struct mpcp_reg_t));
+        ND_TCHECK2(*tptr, sizeof(struct mpcp_reg_t));
         mpcp.reg = (const struct mpcp_reg_t *)tptr;
         ND_PRINT((ndo, "\n\tAssigned-Port %u, Flags [ %s ]" \
                "\n\tSync-Time %u ticks, Echoed-Pending-Grants %u",
@@ -231,7 +231,7 @@ mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int
         break;
 
     case MPCP_OPCODE_REG_ACK:
-        ND_TCHECK2(*tptr, sizeof(const struct mpcp_reg_ack_t));
+        ND_TCHECK2(*tptr, sizeof(struct mpcp_reg_ack_t));
         mpcp.reg_ack = (const struct mpcp_reg_ack_t *)tptr;
         ND_PRINT((ndo, "\n\tEchoed-Assigned-Port %u, Flags [ %s ]" \
                "\n\tEchoed-Sync-Time %u ticks",
index b0fb34469401e1eaa353cf7e6845dbb2caba4be2..00b7e0775ade6ad1cb979dcb872a125d07830170 100644 (file)
@@ -693,7 +693,7 @@ rsvp_obj_print(netdissect_options *ndo,
         }
         if(rsvp_obj_len < sizeof(struct rsvp_object_header)) {
             ND_PRINT((ndo, "%sERROR: object header too short %u < %lu", ident, rsvp_obj_len,
-                   (unsigned long)sizeof(const struct rsvp_object_header)));
+                   (unsigned long)sizeof(struct rsvp_object_header)));
             return -1;
         }
 
@@ -1889,14 +1889,14 @@ rsvp_print(netdissect_options *ndo,
            rsvp_com_header->ttl,
            EXTRACT_16BITS(rsvp_com_header->checksum)));
 
-    if (tlen < sizeof(const struct rsvp_common_header)) {
+    if (tlen < sizeof(struct rsvp_common_header)) {
         ND_PRINT((ndo, "ERROR: common header too short %u < %lu", tlen,
-               (unsigned long)sizeof(const struct rsvp_common_header)));
+               (unsigned long)sizeof(struct rsvp_common_header)));
         return;
     }
 
-    tptr+=sizeof(const struct rsvp_common_header);
-    tlen-=sizeof(const struct rsvp_common_header);
+    tptr+=sizeof(struct rsvp_common_header);
+    tlen-=sizeof(struct rsvp_common_header);
 
     switch(rsvp_com_header->msg_type) {
 
@@ -1935,9 +1935,9 @@ rsvp_print(netdissect_options *ndo,
                    rsvp_com_header->ttl,
                    EXTRACT_16BITS(rsvp_com_header->checksum)));
 
-            if (subtlen < sizeof(const struct rsvp_common_header)) {
+            if (subtlen < sizeof(struct rsvp_common_header)) {
                 ND_PRINT((ndo, "ERROR: common header too short %u < %lu", subtlen,
-                       (unsigned long)sizeof(const struct rsvp_common_header)));
+                       (unsigned long)sizeof(struct rsvp_common_header)));
                 return;
             }
 
@@ -1947,8 +1947,8 @@ rsvp_print(netdissect_options *ndo,
                 return;
             }
 
-            subtptr+=sizeof(const struct rsvp_common_header);
-            subtlen-=sizeof(const struct rsvp_common_header);
+            subtptr+=sizeof(struct rsvp_common_header);
+            subtlen-=sizeof(struct rsvp_common_header);
 
             /*
              * Print all objects in the submessage.
@@ -1956,8 +1956,8 @@ rsvp_print(netdissect_options *ndo,
             if (rsvp_obj_print(ndo, subpptr, subplen, subtptr, "\n\t    ", subtlen, rsvp_com_header) == -1)
                 return;
 
-            tptr+=subtlen+sizeof(const struct rsvp_common_header);
-            tlen-=subtlen+sizeof(const struct rsvp_common_header);
+            tptr+=subtlen+sizeof(struct rsvp_common_header);
+            tlen-=subtlen+sizeof(struct rsvp_common_header);
         }
 
         break;
index 37a41b529cd322194505772ec1e3afdec0d2b7d6..dc64e63e748f605d71d25d97188657d4ffe41eda 100644 (file)
@@ -915,8 +915,8 @@ sflow_print(netdissect_options *ndo,
            len));
 
     /* skip Common header */
-    tptr += sizeof(const struct sflow_datagram_t);
-    tlen -= sizeof(const struct sflow_datagram_t);
+    tptr += sizeof(struct sflow_datagram_t);
+    tlen -= sizeof(struct sflow_datagram_t);
 
     while (nsamples > 0 && tlen > 0) {
         sflow_sample = (const struct sflow_sample_header *)tptr;
index 90cf8ddfef9bf785395447184afafb7054dc9834..6e1c909fa361681381712f54258bfa52cfad8882 100644 (file)
@@ -148,8 +148,8 @@ vqp_print(netdissect_options *ndo, register const u_char *pptr, register u_int l
            len));
 
     /* skip VQP Common header */
-    tptr+=sizeof(const struct vqp_common_header_t);
-    tlen-=sizeof(const struct vqp_common_header_t);
+    tptr+=sizeof(struct vqp_common_header_t);
+    tlen-=sizeof(struct vqp_common_header_t);
 
     while (nitems > 0 && tlen > 0) {