/* \summary: Trivial File Transfer Protocol (TFTP) printer */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
#include <string.h>
const u_char *bp, u_int length)
{
const char *cp;
- int opcode;
+ u_int opcode;
u_int ui;
/* Print length */
- ND_PRINT(" %d", length);
+ ND_PRINT(" %u", length);
/* Print tftp request type */
if (length < 2)
goto trunc;
ND_TCHECK_2(bp);
opcode = EXTRACT_BE_U_2(bp);
- cp = tok2str(op2str, "tftp-#%d", opcode);
+ cp = tok2str(op2str, "tftp-#%u", opcode);
ND_PRINT(" %s", cp);
/* Bail if bogus opcode */
if (*cp == 't')
if (length < 2)
goto trunc; /* no block number */
ND_TCHECK_2(bp);
- ND_PRINT(" block %d", EXTRACT_BE_U_2(bp));
+ ND_PRINT(" block %u", EXTRACT_BE_U_2(bp));
break;
case TFTP_ERROR:
if (length < 2)
goto trunc; /* no error code */
ND_TCHECK_2(bp);
- ND_PRINT(" %s", tok2str(err2str, "tftp-err-#%d \"",
+ ND_PRINT(" %s", tok2str(err2str, "tftp-err-#%u \"",
EXTRACT_BE_U_2(bp)));
bp += 2;
length -= 2;
default:
/* We shouldn't get here */
- ND_PRINT("(unknown #%d)", opcode);
+ ND_PRINT("(unknown #%u)", opcode);
break;
}
return;