It prints a counted filename (or other ASCII string), part of
the packet buffer, filtering out non-printable characters.
Stop if truncated (via GET_U_1/longjmp) or after n bytes,
whichever is first.
The suffix comes from: j:longJmp, n:after N bytes.
(cherry picked from commit
90ddb17d272bbe39dccc08f7b109077b73996fee)
extern void fn_print_str(netdissect_options *, const u_char *);
extern u_int nd_printztn(netdissect_options *, const u_char *, u_int, const u_char *);
extern int nd_printn(netdissect_options *, const u_char *, u_int, const u_char *);
+extern void nd_printjn(netdissect_options *, const u_char *, u_int);
extern void nd_printjnp(netdissect_options *, const u_char *, u_int);
/*
return (n == 0) ? 0 : 1;
}
+/*
+ * Print a counted filename (or other ASCII string), part of
+ * the packet buffer, filtering out non-printable characters.
+ * Stop if truncated (via GET_U_1/longjmp) or after n bytes,
+ * whichever is first.
+ * The suffix comes from: j:longJmp, n:after N bytes.
+ */
+void
+nd_printjn(netdissect_options *ndo, const u_char *s, u_int n)
+{
+ while (n > 0) {
+ fn_print_char(ndo, GET_U_1(s));
+ n--;
+ s++;
+ }
+}
+
/*
* Print a null-padded filename (or other ASCII string), part of
* the packet buffer, filtering out non-printable characters.