]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Rename the fn_printX() functions to nd_printX()
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 30 Apr 2018 10:52:10 +0000 (12:52 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 30 Apr 2018 11:35:06 +0000 (13:35 +0200)
The functions are: nd_print, nd_printztn, nd_printn and nd_printzp.
Trying to make it clearer that they currently have to be used only on part
of the packet buffer.
Update some comments.

32 files changed:
netdissect.h
print-802_11.c
print-aoe.c
print-bfd.c
print-bgp.c
print-bootp.c
print-cdp.c
print-dhcp6.c
print-domain.c
print-dtp.c
print-hsrp.c
print-ipx.c
print-isoclns.c
print-lldp.c
print-nfs.c
print-ntp.c
print-olsr.c
print-openflow-1.0.c
print-ppp.c
print-resp.c
print-rip.c
print-rpki-rtr.c
print-rx.c
print-snmp.c
print-stp.c
print-tftp.c
print-timed.c
print-udld.c
print-vrrp.c
print-vtp.c
print-wb.c
util-print.c

index 365b4b95895dd0af37aaf1ce894121d14d97fbb4..a491f5157f6b68bed8dffd3edb009197cc0e42eb 100644 (file)
@@ -331,10 +331,10 @@ extern void signed_relts_print(netdissect_options *, int32_t);
 extern void unsigned_relts_print(netdissect_options *, uint32_t);
 
 extern void fn_print_char(netdissect_options *, u_char);
-extern int fn_print(netdissect_options *, const u_char *, const u_char *);
-extern u_int fn_printztn(netdissect_options *ndo, const u_char *, u_int, const u_char *);
-extern int fn_printn(netdissect_options *, const u_char *, u_int, const u_char *);
-extern int fn_printzp(netdissect_options *, const u_char *, u_int, const u_char *);
+extern int nd_print(netdissect_options *, const u_char *, const u_char *);
+extern u_int nd_printztn(netdissect_options *ndo, const u_char *, u_int, const u_char *);
+extern int nd_printn(netdissect_options *, const u_char *, u_int, const u_char *);
+extern int nd_printzp(netdissect_options *, const u_char *, u_int, const u_char *);
 
 /*
  * Flags for txtproto_print().
index a3d376b6a79daaf09ec63966275a2d0670db0813..e61581dd45df0d900ddc672f38b852fb965fab8b 100644 (file)
@@ -402,7 +402,7 @@ struct meshcntl_t {
 #define PRINT_SSID(p) \
        if (p.ssid_present) { \
                ND_PRINT(" ("); \
-               fn_print(ndo, p.ssid.ssid, NULL); \
+               nd_print(ndo, p.ssid.ssid, NULL); \
                ND_PRINT(")"); \
        }
 
index 322b6fd5ad52a8a776a20135299cc720563b7a79..03ca3164dacd59cf2ac2df76eeb66bcb15ec1a5d 100644 (file)
@@ -238,7 +238,7 @@ aoev1_query_print(netdissect_options *ndo,
        ND_TCHECK_LEN(cp, cslen);
        if (cslen) {
                ND_PRINT("\n\tConfig String (length %u): ", cslen);
-               if (fn_printn(ndo, cp, cslen, ndo->ndo_snapend))
+               if (nd_printn(ndo, cp, cslen, ndo->ndo_snapend))
                        goto trunc;
        }
        return;
index 8daa56d6d7af467d28bd10dbb1a4c833f034f2db..38cbd374e2b1c0074b554afd383e2cbeb792e60d 100644 (file)
@@ -217,7 +217,7 @@ auth_print(netdissect_options *ndo, const u_char *pptr)
                 pptr++;
                 ND_PRINT(", Password: ");
                 /* the length is equal to the password length plus three */
-                if (fn_printn(ndo, pptr, auth_len - 3,
+                if (nd_printn(ndo, pptr, auth_len - 3,
                               ndo->ndo_snapend))
                     goto trunc;
                 break;
index 8a78ae9e881ee663944759dc7084f93671ff4a9f..fe4004d6b2455a6aff2051cbb7f0929b993ab1a5 100644 (file)
@@ -2955,7 +2955,7 @@ bgp_notification_print(netdissect_options *ndo,
             else {
                 ND_TCHECK_LEN(tptr + 1, shutdown_comm_length);
                 ND_PRINT(", Shutdown Communication (length: %u): \"", shutdown_comm_length);
-                (void)fn_printn(ndo, tptr+1, shutdown_comm_length, NULL);
+                (void)nd_printn(ndo, tptr+1, shutdown_comm_length, NULL);
                 ND_PRINT("\"");
                 remainder_offset += shutdown_comm_length + 1;
             }
index aef7063cf568fbd7776d88ff0541bfa7dfe0c765..78d0d2fe9f213df489a381948d8a92a2458211bd 100644 (file)
@@ -361,8 +361,8 @@ bootp_print(netdissect_options *ndo,
        ND_TCHECK_1(bp->bp_sname);              /* check first char only */
        if (EXTRACT_U_1(bp->bp_sname)) {
                ND_PRINT("\n\t  sname \"");
-               if (fn_printztn(ndo, bp->bp_sname, (u_int)sizeof(bp->bp_sname),
-                   ndo->ndo_snapend)) {
+               if (nd_printztn(ndo, bp->bp_sname, (u_int)sizeof(bp->bp_sname),
+                               ndo->ndo_snapend)) {
                        ND_PRINT("\"");
                        ND_PRINT("%s", tstr + 1);
                        return;
@@ -372,8 +372,8 @@ bootp_print(netdissect_options *ndo,
        ND_TCHECK_1(bp->bp_file);               /* check first char only */
        if (EXTRACT_U_1(bp->bp_file)) {
                ND_PRINT("\n\t  file \"");
-               if (fn_printztn(ndo, bp->bp_file, (u_int)sizeof(bp->bp_file),
-                   ndo->ndo_snapend)) {
+               if (nd_printztn(ndo, bp->bp_file, (u_int)sizeof(bp->bp_file),
+                               ndo->ndo_snapend)) {
                        ND_PRINT("\"");
                        ND_PRINT("%s", tstr + 1);
                        return;
@@ -712,7 +712,7 @@ rfc1048_print(netdissect_options *ndo,
                case 'a':
                        /* ASCII strings */
                        ND_PRINT("\"");
-                       if (fn_printn(ndo, bp, len, ndo->ndo_snapend)) {
+                       if (nd_printn(ndo, bp, len, ndo->ndo_snapend)) {
                                ND_PRINT("\"");
                                goto trunc;
                        }
@@ -853,7 +853,7 @@ rfc1048_print(netdissect_options *ndo,
                                        ND_PRINT("%u/%u ", EXTRACT_U_1(bp), EXTRACT_U_1(bp + 1));
                                bp += 2;
                                ND_PRINT("\"");
-                               if (fn_printn(ndo, bp, len - 3, ndo->ndo_snapend)) {
+                               if (nd_printn(ndo, bp, len - 3, ndo->ndo_snapend)) {
                                        ND_PRINT("\"");
                                        goto trunc;
                                }
@@ -876,7 +876,7 @@ rfc1048_print(netdissect_options *ndo,
                                len--;
                                if (type == 0) {
                                        ND_PRINT("\"");
-                                       if (fn_printn(ndo, bp, len, ndo->ndo_snapend)) {
+                                       if (nd_printn(ndo, bp, len, ndo->ndo_snapend)) {
                                                ND_PRINT("\"");
                                                goto trunc;
                                        }
@@ -922,7 +922,7 @@ rfc1048_print(netdissect_options *ndo,
                                        case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
                                        case AGENT_SUBOPTION_REMOTE_ID:
                                        case AGENT_SUBOPTION_SUBSCRIBER_ID:
-                                               if (fn_printn(ndo, bp, suboptlen, ndo->ndo_snapend))
+                                               if (nd_printn(ndo, bp, suboptlen, ndo->ndo_snapend))
                                                        goto trunc;
                                                break;
 
@@ -1020,7 +1020,7 @@ rfc1048_print(netdissect_options *ndo,
                                                break;
                                        }
                                        ND_PRINT("\"");
-                                       if (fn_printn(ndo, bp, suboptlen, ndo->ndo_snapend)) {
+                                       if (nd_printn(ndo, bp, suboptlen, ndo->ndo_snapend)) {
                                                ND_PRINT("\"");
                                                goto trunc;
                                        }
index 1e1d66ab7902b4a17cde52c6061d5fe335209d5e..d77bf2cb7a66d4486105364c148ea4f6ae6a6c27 100644 (file)
@@ -149,7 +149,7 @@ cdp_print(netdissect_options *ndo,
                        if (!ndo->ndo_vflag)
                            ND_PRINT(", Device-ID ");
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x02: /* Address */
@@ -158,7 +158,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x03: /* Port-ID */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x04: /* Capabilities */
@@ -181,7 +181,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x06: /* Platform */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x07: /* Prefixes */
@@ -192,7 +192,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x09: /* VTP Mgmt Domain  - CDPv2 */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x0a: /* Native VLAN ID - CDPv2 */
@@ -251,7 +251,7 @@ cdp_print(netdissect_options *ndo,
                        break;
                    case 0x14: /* System Name - not documented */
                        ND_PRINT("'");
-                       (void)fn_printn(ndo, tptr, len, NULL);
+                       (void)nd_printn(ndo, tptr, len, NULL);
                        ND_PRINT("'");
                        break;
                    case 0x16: /* System Object ID - not documented */
@@ -264,7 +264,7 @@ cdp_print(netdissect_options *ndo,
                        ND_PRINT("0x%02x", EXTRACT_U_1(tptr));
                        if (len > 1) {
                                ND_PRINT("/");
-                               (void)fn_printn(ndo, tptr + 1, len - 1, NULL);
+                               (void)nd_printn(ndo, tptr + 1, len - 1, NULL);
                        }
                        break;
                    default:
index a45fe5c01682b1a6b7354592a2c156c6cf8a3f8c..ca9d053e9a0681aa350930131bef4f52c604613b 100644 (file)
@@ -744,7 +744,7 @@ dhcp6opt_print(netdissect_options *ndo,
                                label_len = EXTRACT_U_1(tp);
                                tp++;
                                if (label_len < remain_len - 1) {
-                                       (void)fn_printn(ndo, tp, label_len, NULL);
+                                       (void)nd_printn(ndo, tp, label_len, NULL);
                                        tp += label_len;
                                        remain_len -= (label_len + 1);
                                        if(EXTRACT_U_1(tp)) ND_PRINT(".");
@@ -764,7 +764,7 @@ dhcp6opt_print(netdissect_options *ndo,
                        }
                        tp = (const u_char *)(dh6o + 1);
                        ND_PRINT("=");
-                       (void)fn_printn(ndo, tp, (u_int)optlen, NULL);
+                       (void)nd_printn(ndo, tp, (u_int)optlen, NULL);
                        ND_PRINT(")");
                        break;
 
index 4e21191833a5608e03e8d604647dd33b903ed94f..d966cb52fcb4fc1cfaae021468698884ce8bd8a9 100644 (file)
@@ -218,7 +218,7 @@ ns_nprint(netdissect_options *ndo,
                                        return(NULL);
                                }
                        } else {
-                               if (fn_printn(ndo, cp, l, ndo->ndo_snapend))
+                               if (nd_printn(ndo, cp, l, ndo->ndo_snapend))
                                        return(NULL);
                        }
 
@@ -249,7 +249,7 @@ ns_cprint(netdissect_options *ndo,
                return (NULL);
        i = EXTRACT_U_1(cp);
        cp++;
-       if (fn_printn(ndo, cp, i, ndo->ndo_snapend))
+       if (nd_printn(ndo, cp, i, ndo->ndo_snapend))
                return (NULL);
        return (cp + i);
 }
@@ -548,7 +548,7 @@ ns_rprint(netdissect_options *ndo,
        case T_UNSPECA:         /* One long string */
                if (!ND_TTEST_LEN(cp, len))
                        return(NULL);
-               if (fn_printn(ndo, cp, len, ndo->ndo_snapend))
+               if (nd_printn(ndo, cp, len, ndo->ndo_snapend))
                        return(NULL);
                break;
 
index 6bb89235c752a0c22410394010b29bf8e8feec8a..6194dc031add2d929d58e7d6bdce318ae03009a6 100644 (file)
@@ -90,7 +90,7 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length)
         switch (type) {
        case DTP_DOMAIN_TLV:
                ND_PRINT(", ");
-               fn_printzp(ndo, tptr+4, len-4, pptr+length);
+               nd_printzp(ndo, tptr+4, len-4, pptr+length);
                break;
 
        case DTP_STATUS_TLV:
index cc9655ca214292f8ef0f573edb288d9aff4964d6..ff5cc55a5f4b068697aae22046a29765693559f8 100644 (file)
@@ -126,8 +126,8 @@ hsrp_print(netdissect_options *ndo, const u_char *bp, u_int len)
                unsigned_relts_print(ndo, EXTRACT_U_1(hp->hsrp_holdtime));
                ND_PRINT(" priority=%u", EXTRACT_U_1(hp->hsrp_priority));
                ND_PRINT(" auth=\"");
-               if (fn_printn(ndo, hp->hsrp_authdata, sizeof(hp->hsrp_authdata),
-                   ndo->ndo_snapend)) {
+               if (nd_printn(ndo, hp->hsrp_authdata, sizeof(hp->hsrp_authdata),
+                             ndo->ndo_snapend)) {
                        ND_PRINT("\"");
                        goto trunc;
                }
index b17cdf61818092b985260f1494c911ad0f2147f0..ed915d06bdf6c4dc22d89d58337277870a5d2370 100644 (file)
@@ -189,7 +189,7 @@ ipx_sap_print(netdissect_options *ndo, const u_char *ipx, u_int length)
                ND_PRINT("'");
                goto trunc;
            }
-           if (fn_printzp(ndo, ipx, 48, ndo->ndo_snapend)) {
+           if (nd_printzp(ndo, ipx, 48, ndo->ndo_snapend)) {
                ND_PRINT("'");
                goto trunc;
            }
index 2b9d338dcc6a3b243d81eff7f5218f6bdf903fbc..4183a6f9fa8881f4876f00c0195bae75fe9e0e94 100644 (file)
@@ -1398,7 +1398,7 @@ isis_print_mcid(netdissect_options *ndo,
   ND_TCHECK_SIZE(mcid);
   ND_PRINT("ID: %u, Name: ", EXTRACT_U_1(mcid->format_id));
 
-  if (fn_printzp(ndo, mcid->name, 32, ndo->ndo_snapend))
+  if (nd_printzp(ndo, mcid->name, 32, ndo->ndo_snapend))
     goto trunc;
 
   ND_PRINT("\n\t              Lvl: %u", EXTRACT_BE_U_2(mcid->revision_lvl));
@@ -2846,7 +2846,7 @@ isis_print(netdissect_options *ndo,
 
            switch (EXTRACT_U_1(tptr)) {
            case ISIS_SUBTLV_AUTH_SIMPLE:
-               if (fn_printzp(ndo, tptr + 1, tlv_len - 1, ndo->ndo_snapend))
+               if (nd_printzp(ndo, tptr + 1, tlv_len - 1, ndo->ndo_snapend))
                    goto trunc;
                break;
            case ISIS_SUBTLV_AUTH_MD5:
@@ -2974,7 +2974,7 @@ isis_print(netdissect_options *ndo,
 
        case ISIS_TLV_HOSTNAME:
            ND_PRINT("\n\t      Hostname: ");
-           if (fn_printzp(ndo, tptr, tmp, ndo->ndo_snapend))
+           if (nd_printzp(ndo, tptr, tmp, ndo->ndo_snapend))
                goto trunc;
            break;
 
index b6af8735c0b5c8bafac9c29e9e96f69f0dc51dcc..1adbae0dc89b57683fa52c4183f2f2547ed68c49 100644 (file)
@@ -958,7 +958,7 @@ lldp_private_iana_print(netdissect_options *ndo,
     switch (subtype) {
     case LLDP_IANA_SUBTYPE_MUDURL:
         ND_PRINT("\n\t  MUD-URL=");
-        (void)fn_printn(ndo, tptr+4, tlv_len-4, NULL);
+        (void)nd_printn(ndo, tptr+4, tlv_len-4, NULL);
         break;
     default:
         hexdump=TRUE;
index 6866b1d39cb650dd9867ba2c45810daec5ba97a1..ca70ef504a73d13a80954e335e57a004d6e73f6e 100644 (file)
@@ -492,7 +492,7 @@ parsefn(netdissect_options *ndo,
        /* Update 32-bit pointer (NFS filenames padded to 32-bit boundaries) */
        dp += ((len + 3) & ~3) / sizeof(*dp);
        ND_PRINT("\"");
-       if (fn_printn(ndo, cp, len, ndo->ndo_snapend)) {
+       if (nd_printn(ndo, cp, len, ndo->ndo_snapend)) {
                ND_PRINT("\"");
                goto trunc;
        }
index b8772e9eab7bb0f7801ddb256bd9cf7125c2d9f0..8adb101df76f14573e6f691ec1c0506e0e757b7e 100644 (file)
@@ -300,7 +300,7 @@ ntp_time_print(netdissect_options *ndo,
                break;
 
        case PRIM_REF:
-               if (fn_printn(ndo, (const u_char *)&(bp->refid), 4, ndo->ndo_snapend))
+               if (nd_printn(ndo, (const u_char *)&(bp->refid), 4, ndo->ndo_snapend))
                        goto trunc;
                break;
 
index ab8b30f7f85aa913da40a4daf038d7bd3e41ce81..a50c063c834dc98d2ed73cb0fef54d8b679cc662 100644 (file)
@@ -688,7 +688,7 @@ olsr_print(netdissect_options *ndo,
                 else
                     ND_PRINT(", address %s, name \"",
                             ipaddr_string(ndo, msg_data));
-                (void)fn_printn(ndo, msg_data + addr_size, name_entry_len, NULL);
+                (void)nd_printn(ndo, msg_data + addr_size, name_entry_len, NULL);
                 ND_PRINT("\"");
 
                 msg_data += addr_size + name_entry_len + name_entry_padding;
index 9004f927ef8dfe1a12712d050359043cc88af926..659ee66b9775a3b186e0051d871fe9f9ce798dd2 100644 (file)
@@ -895,7 +895,7 @@ of10_bsn_message_print(netdissect_options *ndo,
                cp += 4;
                /* data */
                ND_PRINT(", data '");
-               if (fn_printn(ndo, cp, len - 8, ep)) {
+               if (nd_printn(ndo, cp, len - 8, ep)) {
                        ND_PRINT("'");
                        goto trunc;
                }
@@ -916,7 +916,7 @@ of10_bsn_message_print(netdissect_options *ndo,
                /* already checked that len >= 4 */
                /* data */
                ND_PRINT(", data '");
-               if (fn_printn(ndo, cp, len - 4, ep)) {
+               if (nd_printn(ndo, cp, len - 4, ep)) {
                        ND_PRINT("'");
                        goto trunc;
                }
@@ -1158,7 +1158,7 @@ of10_phy_ports_print(netdissect_options *ndo,
                /* name */
                ND_TCHECK_LEN(cp, OFP_MAX_PORT_NAME_LEN);
                ND_PRINT(", name '");
-               fn_print(ndo, cp, cp + OFP_MAX_PORT_NAME_LEN);
+               nd_print(ndo, cp, cp + OFP_MAX_PORT_NAME_LEN);
                ND_PRINT("'");
                cp += OFP_MAX_PORT_NAME_LEN;
 
@@ -1840,31 +1840,31 @@ of10_desc_stats_reply_print(netdissect_options *ndo,
        /* mfr_desc */
        ND_TCHECK_LEN(cp, DESC_STR_LEN);
        ND_PRINT("\n\t  mfr_desc '");
-       fn_print(ndo, cp, cp + DESC_STR_LEN);
+       nd_print(ndo, cp, cp + DESC_STR_LEN);
        ND_PRINT("'");
        cp += DESC_STR_LEN;
        /* hw_desc */
        ND_TCHECK_LEN(cp, DESC_STR_LEN);
        ND_PRINT("\n\t  hw_desc '");
-       fn_print(ndo, cp, cp + DESC_STR_LEN);
+       nd_print(ndo, cp, cp + DESC_STR_LEN);
        ND_PRINT("'");
        cp += DESC_STR_LEN;
        /* sw_desc */
        ND_TCHECK_LEN(cp, DESC_STR_LEN);
        ND_PRINT("\n\t  sw_desc '");
-       fn_print(ndo, cp, cp + DESC_STR_LEN);
+       nd_print(ndo, cp, cp + DESC_STR_LEN);
        ND_PRINT("'");
        cp += DESC_STR_LEN;
        /* serial_num */
        ND_TCHECK_LEN(cp, SERIAL_NUM_LEN);
        ND_PRINT("\n\t  serial_num '");
-       fn_print(ndo, cp, cp + SERIAL_NUM_LEN);
+       nd_print(ndo, cp, cp + SERIAL_NUM_LEN);
        ND_PRINT("'");
        cp += SERIAL_NUM_LEN;
        /* dp_desc */
        ND_TCHECK_LEN(cp, DESC_STR_LEN);
        ND_PRINT("\n\t  dp_desc '");
-       fn_print(ndo, cp, cp + DESC_STR_LEN);
+       nd_print(ndo, cp, cp + DESC_STR_LEN);
        ND_PRINT("'");
        return cp + DESC_STR_LEN;
 
@@ -2012,7 +2012,7 @@ of10_table_stats_reply_print(netdissect_options *ndo,
                /* name */
                ND_TCHECK_LEN(cp, OFP_MAX_TABLE_NAME_LEN);
                ND_PRINT(", name '");
-               fn_print(ndo, cp, cp + OFP_MAX_TABLE_NAME_LEN);
+               nd_print(ndo, cp, cp + OFP_MAX_TABLE_NAME_LEN);
                ND_PRINT("'");
                cp += OFP_MAX_TABLE_NAME_LEN;
                /* wildcards */
index ceb053f56e69d115bf1088775761578ded240291..beb8a69d6678a7403e09c795099fb364ddb4fcdc 100644 (file)
@@ -562,7 +562,7 @@ handle_ctrl_proto(netdissect_options *ndo,
                /* RFC 1661 says this is intended to be human readable */
                if (len > 8) {
                        ND_PRINT("\n\t  Message\n\t    ");
-                       if (fn_printn(ndo, tptr + 4, len - 4, ndo->ndo_snapend))
+                       if (nd_printn(ndo, tptr + 4, len - 4, ndo->ndo_snapend))
                                goto trunc;
                }
                break;
index 76d3744a9399328ba311aba77c76f4e619c209af..cb6a011e6aa45a1d88bed9f91684ec20bf960924 100644 (file)
@@ -205,7 +205,7 @@ static int resp_get_length(netdissect_options *, const u_char *, int, const u_ch
  */
 #define RESP_PRINT_SEGMENT(_ndo, _bp, _len)            \
     ND_PRINT(" \"");                                   \
-    if (fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \
+    if (nd_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \
         goto trunc;                                    \
     fn_print_char(_ndo, '"');
 
index 1ec00d6e1b62f4bd77e30ece542011669658614c..4c78014e65cd08f99774031c5ad89a0ffd71de34 100644 (file)
@@ -233,7 +233,7 @@ rip_entry_print_v2(netdissect_options *ndo, const u_char *p,
                remaining -= sizeof(*eh);
                if (auth_type == 2) {
                        ND_PRINT("\n\t  Simple Text Authentication data: ");
-                       if (fn_printzp(ndo, p, RIP_AUTHLEN, p + remaining))
+                       if (nd_printzp(ndo, p, RIP_AUTHLEN, p + remaining))
                                return (0);
                } else if (auth_type == 3) {
                        const struct rip_auth_crypto_v2 *ch;
index fa8ed9da47d11818671b089ac753763e45e53751..fcc2f1c2c8d0f62d79dffac629df0cf697289221 100644 (file)
@@ -353,9 +353,9 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len
            if (text_length) {
                if (pdu_len < tlen + text_length)
                    goto invalid;
-               /* fn_printn() makes the bounds check */
+               /* nd_printn() makes the bounds check */
                ND_PRINT("%sError text: ", indent_string(indent+2));
-               if (fn_printn(ndo, tptr + tlen, text_length, ndo->ndo_snapend))
+               if (nd_printn(ndo, tptr + tlen, text_length, ndo->ndo_snapend))
                        goto trunc;
            }
        }
index 534278bcba8c8e3ab8734e49f62182cadb05fc90..d687a3bbb2c3781709f604fda200c26389371a21 100644 (file)
@@ -771,7 +771,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
                                goto trunc; \
                        bp += sizeof(uint32_t); \
                        ND_PRINT(" \""); \
-                       if (fn_printn(ndo, bp, _i, ndo->ndo_snapend)) \
+                       if (nd_printn(ndo, bp, _i, ndo->ndo_snapend)) \
                                goto trunc; \
                        ND_PRINT("\""); \
                        bp += ((_i + sizeof(uint32_t) - 1) / sizeof(uint32_t)) * sizeof(uint32_t); \
@@ -869,7 +869,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
                        } \
                        s[(MAX)] = '\0'; \
                        ND_PRINT(" \""); \
-                       fn_print(ndo, s, NULL); \
+                       nd_print(ndo, s, NULL); \
                        ND_PRINT("\""); \
                }
 
@@ -1190,7 +1190,7 @@ acl_print(netdissect_options *ndo,
                        goto finish;
                s += n;
                ND_PRINT(" +{");
-               fn_print(ndo, (u_char *)user, NULL);
+               nd_print(ndo, (u_char *)user, NULL);
                ND_PRINT(" ");
                ACLOUT(acl);
                ND_PRINT("}");
@@ -1204,7 +1204,7 @@ acl_print(netdissect_options *ndo,
                        goto finish;
                s += n;
                ND_PRINT(" -{");
-               fn_print(ndo, (u_char *)user, NULL);
+               nd_print(ndo, (u_char *)user, NULL);
                ND_PRINT(" ");
                ACLOUT(acl);
                ND_PRINT("}");
index 856309b6bfc9c649b63d0651bb2f0b004d817b42..86c772949e21ff0dacdfa1dd63a91e0529ad51d8 100644 (file)
@@ -705,7 +705,7 @@ asn1_print_string(netdissect_options *ndo, struct be *elem)
        p = elem->data.str;
        if (printable) {
                ND_PRINT("\"");
-               if (fn_printn(ndo, p, asnlen, ndo->ndo_snapend)) {
+               if (nd_printn(ndo, p, asnlen, ndo->ndo_snapend)) {
                        ND_PRINT("\"");
                        goto trunc;
                }
index 548278b9795f2c0e69c4243fa675508384fd1e3a..a59b22fba9efe535163da708dbca7d1e6a4f9dc5 100644 (file)
@@ -292,7 +292,7 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
     ND_PRINT("\n\tv3len %u, ", EXTRACT_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET));
     ND_TCHECK_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12);
     ND_PRINT("MCID Name ");
-    if (fn_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend))
+    if (nd_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend))
        goto trunc;
     ND_PRINT(", rev %u,"
             "\n\t\tdigest %08x%08x%08x%08x, ",
@@ -366,7 +366,7 @@ stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
 
     ND_PRINT("\n\tv4len %u, ", EXTRACT_BE_U_2(ptr + offset));
     ND_PRINT("AUXMCID Name ");
-    if (fn_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32,
+    if (nd_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32,
                   ndo->ndo_snapend))
        goto trunc;
     ND_PRINT(", Rev %u,\n\t\tdigest %08x%08x%08x%08x",
index 1cd1c3f8420fdc8c84e96454cf60b0746de3f8e6..548a36c5494ea76186228be1e6d41b933ea46ea0 100644 (file)
@@ -121,7 +121,7 @@ tftp_print(netdissect_options *ndo,
                ND_PRINT(" ");
                /* Print filename */
                ND_PRINT("\"");
-               ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
+               ui = nd_printztn(ndo, bp, length, ndo->ndo_snapend);
                ND_PRINT("\"");
                if (ui == 0)
                        goto trunc;
@@ -132,7 +132,7 @@ tftp_print(netdissect_options *ndo,
                if (length == 0)
                        goto trunc;     /* no mode */
                ND_PRINT(" ");
-               ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
+               ui = nd_printztn(ndo, bp, length, ndo->ndo_snapend);
                if (ui == 0)
                        goto trunc;
                bp += ui;
@@ -143,7 +143,7 @@ tftp_print(netdissect_options *ndo,
                        ND_TCHECK_1(bp);
                        if (EXTRACT_U_1(bp) != '\0')
                                ND_PRINT(" ");
-                       ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
+                       ui = nd_printztn(ndo, bp, length, ndo->ndo_snapend);
                        if (ui == 0)
                                goto trunc;
                        bp += ui;
@@ -157,7 +157,7 @@ tftp_print(netdissect_options *ndo,
                        ND_TCHECK_1(bp);
                        if (EXTRACT_U_1(bp) != '\0')
                                ND_PRINT(" ");
-                       ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
+                       ui = nd_printztn(ndo, bp, length, ndo->ndo_snapend);
                        if (ui == 0)
                                goto trunc;
                        bp += ui;
@@ -186,7 +186,7 @@ tftp_print(netdissect_options *ndo,
                if (length == 0)
                        goto trunc;     /* no error message */
                ND_PRINT(" \"");
-               ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend);
+               ui = nd_printztn(ndo, bp, length, ndo->ndo_snapend);
                ND_PRINT("\"");
                if (ui == 0)
                        goto trunc;
index f6bfc8ecf0ed7c33c76060b5522a6f964149d9c6..1f7bc82308618d0b292c2f4f70fc7d999cb52d68 100644 (file)
@@ -139,7 +139,7 @@ timed_print(netdissect_options *ndo,
                break;
        }
        ND_PRINT(" name ");
-       if (fn_print(ndo, (const u_char *)tsp->tsp_name, (const u_char *)tsp->tsp_name + sizeof(tsp->tsp_name)))
+       if (nd_print(ndo, (const u_char *)tsp->tsp_name, (const u_char *)tsp->tsp_name + sizeof(tsp->tsp_name)))
                goto trunc;
        return;
 
index 3b77dd511232d056baf962935069e41b455eec85..a9ada9e47044be6537d91376a90d82d755652c87 100644 (file)
@@ -155,12 +155,12 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
         case UDLD_PORT_ID_TLV:
         case UDLD_DEVICE_NAME_TLV:
             ND_PRINT(", ");
-            fn_printzp(ndo, tptr, len, NULL);
+            nd_printzp(ndo, tptr, len, NULL);
             break;
 
         case UDLD_ECHO_TLV:
             ND_PRINT(", ");
-            (void)fn_printn(ndo, tptr, len, NULL);
+            (void)nd_printn(ndo, tptr, len, NULL);
             break;
 
         case UDLD_MESSAGE_INTERVAL_TLV:
index ae879647596da58bb287cb1eafae1e4c4485cca6..f628f9056d724a6aed5fda73dbcbbdcf4860059c 100644 (file)
@@ -171,7 +171,7 @@ vrrp_print(netdissect_options *ndo,
                if (version == 2 && auth_type == VRRP_AUTH_SIMPLE) { /* simple text password */
                        ND_TCHECK_1(bp + 7);
                        ND_PRINT(" auth \"");
-                       if (fn_printn(ndo, bp, 8, ndo->ndo_snapend)) {
+                       if (nd_printn(ndo, bp, 8, ndo->ndo_snapend)) {
                                ND_PRINT("\"");
                                goto trunc;
                        }
index 5a10b25fc005319b7d4d7631819334fb97b3702c..358a294e4e258a39210a6fbb1ebcb1d0e25b4b08 100644 (file)
@@ -150,7 +150,7 @@ vtp_print (netdissect_options *ndo,
        ND_PRINT(" [invalid MgmtD Len %u]", mgmtd_len);
        return;
     }
-    fn_printzp(ndo, tptr + 4, mgmtd_len, NULL);
+    nd_printzp(ndo, tptr + 4, mgmtd_len, NULL);
     ND_PRINT(", %s: %u",
           tok2str(vtp_header_values, "Unknown", type),
           EXTRACT_U_1(tptr + 2));
@@ -267,7 +267,7 @@ vtp_print (netdissect_options *ndo,
            if (len < 4*((name_len + 3)/4))
                goto trunc;
            ND_TCHECK_LEN(tptr, name_len);
-           fn_printzp(ndo, tptr, name_len, NULL);
+           nd_printzp(ndo, tptr, name_len, NULL);
 
            /*
             * Vlan names are aligned to 32-bit boundaries.
index 42686906c252a4a3edd9b5cb99f310dbf8bb76af..74591ce1c5573a091d2d352456aa1324ed637bfc 100644 (file)
@@ -205,7 +205,7 @@ wb_id(netdissect_options *ndo,
        cp = (const char *)(io + nid);
        if (ND_TTEST_LEN(cp, len)) {
                ND_PRINT("\"");
-               fn_print(ndo, (const u_char *)cp, (const u_char *)cp + len);
+               nd_print(ndo, (const u_char *)cp, (const u_char *)cp + len);
                ND_PRINT("\"");
        }
 
index b85299ca292ce715194c904099611b7f1f761313..a8cb8f047966d53cfc63e03684a8670f99f48043 100644 (file)
@@ -87,13 +87,14 @@ fn_print_char(netdissect_options *ndo, u_char c)
 }
 
 /*
- * Print out a null-terminated filename (or other ASCII string).
+ * Print out a null-terminated filename (or other ASCII string), part of
+ * the packet buffer.
  * If ep is NULL, assume no truncation check is needed.
  * Return true if truncated.
  * Stop at ep (if given) or before the null char, whichever is first.
  */
 int
-fn_print(netdissect_options *ndo,
+nd_print(netdissect_options *ndo,
          const u_char *s, const u_char *ep)
 {
        int ret;
@@ -114,13 +115,13 @@ fn_print(netdissect_options *ndo,
 
 /*
  * Print out a null-terminated filename (or other ASCII string) from
- * a fixed-length buffer.
+ * a fixed-length buffer, part of the packet buffer.
  * If ep is NULL, assume no truncation check is needed.
  * Return the number of bytes of string processed, including the
  * terminating null, if not truncated.  Return 0 if truncated.
  */
 u_int
-fn_printztn(netdissect_options *ndo,
+nd_printztn(netdissect_options *ndo,
          const u_char *s, u_int n, const u_char *ep)
 {
        u_int bytes;
@@ -156,13 +157,14 @@ fn_printztn(netdissect_options *ndo,
 }
 
 /*
- * Print out a counted filename (or other ASCII string).
+ * Print out a counted filename (or other ASCII string), part of
+ * the packet buffer.
  * If ep is NULL, assume no truncation check is needed.
  * Return true if truncated.
  * Stop at ep (if given) or after n bytes, whichever is first.
  */
 int
-fn_printn(netdissect_options *ndo,
+nd_printn(netdissect_options *ndo,
           const u_char *s, u_int n, const u_char *ep)
 {
        u_char c;
@@ -177,14 +179,15 @@ fn_printn(netdissect_options *ndo,
 }
 
 /*
- * Print out a null-padded filename (or other ASCII string).
+ * Print out a null-padded filename (or other ASCII string), part of
+ * the packet buffer.
  * If ep is NULL, assume no truncation check is needed.
  * Return true if truncated.
  * Stop at ep (if given) or after n bytes or before the null char,
  * whichever is first.
  */
 int
-fn_printzp(netdissect_options *ndo,
+nd_printzp(netdissect_options *ndo,
            const u_char *s, u_int n,
            const u_char *ep)
 {