Skip to content

Commit 312f3de

Browse files
committed
L2TP: Avoid reinventing nd_printjn()
1 parent ecb0867 commit 312f3de

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

print-l2tp.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,6 @@ static char *l2tp_error_code_general[] = {
263263
/******************************/
264264
/* generic print out routines */
265265
/******************************/
266-
static void
267-
print_string(netdissect_options *ndo, const u_char *dat, u_int length)
268-
{
269-
u_int i;
270-
for (i=0; i<length; i++) {
271-
fn_print_char(ndo, GET_U_1(dat));
272-
dat++;
273-
}
274-
}
275-
276266
static void
277267
print_octets(netdissect_options *ndo, const u_char *dat, u_int length)
278268
{
@@ -336,7 +326,7 @@ l2tp_result_code_print(netdissect_options *ndo, const u_char *dat, u_int length)
336326
if (length == 0)
337327
return;
338328
ND_PRINT(" ");
339-
print_string(ndo, dat, length);
329+
nd_printjn(ndo, dat, length);
340330
}
341331

342332
static void
@@ -393,7 +383,7 @@ l2tp_q931_cc_print(netdissect_options *ndo, const u_char *dat, u_int length)
393383
length -= 3;
394384
if (length != 0) {
395385
ND_PRINT(" ");
396-
print_string(ndo, dat, length);
386+
nd_printjn(ndo, dat, length);
397387
}
398388
}
399389

@@ -559,7 +549,7 @@ l2tp_ppp_discon_cc_print(netdissect_options *ndo, const u_char *dat, u_int lengt
559549

560550
if (length != 0) {
561551
ND_PRINT(" ");
562-
print_string(ndo, (const u_char *)dat, length);
552+
nd_printjn(ndo, (const u_char *)dat, length);
563553
}
564554
}
565555

@@ -659,7 +649,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, u_int length)
659649
case L2TP_AVP_SUB_ADDRESS:
660650
case L2TP_AVP_PROXY_AUTH_NAME:
661651
case L2TP_AVP_PRIVATE_GRP_ID:
662-
print_string(ndo, dat, len-6);
652+
nd_printjn(ndo, dat, len-6);
663653
break;
664654
case L2TP_AVP_CHALLENGE:
665655
case L2TP_AVP_INI_RECV_LCP:

0 commit comments

Comments
 (0)