/* specification: draft-ietf-sfc-nsh-01 */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
#include "netdissect.h"
#include "extract.h"
void
nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
{
- int n, vn;
+ u_int n, vn;
uint8_t ver;
uint8_t flags;
- uint8_t length;
+ u_int length;
uint8_t md_type;
uint8_t next_protocol;
uint32_t service_path_id;
ND_PRINT("NSH, ");
if (ndo->ndo_vflag > 1) {
- ND_PRINT("ver %d, ", ver);
+ ND_PRINT("ver %u, ", ver);
}
ND_PRINT("flags [%s], ", bittok2str_nosep(nsh_flags, "none", flags));
if (ndo->ndo_vflag > 2) {
- ND_PRINT("length %d, ", length);
+ ND_PRINT("length %u, ", length);
ND_PRINT("md type 0x%x, ", md_type);
}
if (ndo->ndo_vflag > 1) {
for (n = 0; n < length - 2; n++) {
ctx = EXTRACT_BE_U_4(bp);
bp += NSH_HDR_WORD_SIZE;
- ND_PRINT("\n Context[%02d]: 0x%08x", n, ctx);
+ ND_PRINT("\n Context[%02u]: 0x%08x", n, ctx);
}
}
else if (md_type == 0x02) {
tlv_len = EXTRACT_U_1(bp);
bp += 1;
- ND_PRINT("\n TLV Class %d, Type %d, Len %d",
+ ND_PRINT("\n TLV Class %u, Type %u, Len %u",
tlv_class, tlv_type, tlv_len);
n += 1;
for (vn = 0; vn < tlv_len; vn++) {
ctx = EXTRACT_BE_U_4(bp);
bp += NSH_HDR_WORD_SIZE;
- ND_PRINT("\n Value[%02d]: 0x%08x", vn, ctx);
+ ND_PRINT("\n Value[%02u]: 0x%08x", vn, ctx);
}
n += tlv_len;
}