]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-krb.c
Force -t on in TESTonce.
[tcpdump] / print-krb.c
index e726cee9981175b1e81013c793c7139fe2eda7eb..de69054c39395e3b2d6db01010f196b9052a0c69 100644 (file)
  * Initial contribution from John Hawkinson ([email protected]).
  */
 
-#define NETDISSECT_REWORKED
+/* \summary: Kerberos printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 
 static const char tstr[] = " [|kerberos]";
@@ -60,8 +61,8 @@ static void krb4_print(netdissect_options *, const u_char *);
 #define KERB_ERR_NULL_KEY                      10
 
 struct krb {
-       u_int8_t pvno;          /* Protocol Version */
-       u_int8_t type;          /* Type+B */
+       uint8_t pvno;           /* Protocol Version */
+       uint8_t type;           /* Type+B */
 };
 
 static const struct tok type2str[] = {
@@ -137,7 +138,7 @@ krb4_print_hdr(netdissect_options *ndo,
        return (cp);
 
 trunc:
-       ND_PRINT((ndo, tstr));
+       ND_PRINT((ndo, "%s", tstr));
        return (NULL);
 
 #undef PRINT
@@ -156,10 +157,10 @@ krb4_print(netdissect_options *ndo,
 #define IS_LENDIAN(kp) (((kp)->type & 0x01) != 0)
 #define KTOHSP(kp, cp) (IS_LENDIAN(kp) ? EXTRACT_LE_16BITS(cp) : EXTRACT_16BITS(cp))
 
-       kp = (struct krb *)cp;
+       kp = (const struct krb *)cp;
 
        if ((&kp->type) >= ndo->ndo_snapend) {
-               ND_PRINT((ndo, tstr));
+               ND_PRINT((ndo, "%s", tstr));
                return;
        }
 
@@ -218,7 +219,7 @@ krb4_print(netdissect_options *ndo,
 
        return;
 trunc:
-       ND_PRINT((ndo, tstr));
+       ND_PRINT((ndo, "%s", tstr));
 }
 
 void
@@ -227,10 +228,10 @@ krb_print(netdissect_options *ndo,
 {
        register const struct krb *kp;
 
-       kp = (struct krb *)dat;
+       kp = (const struct krb *)dat;
 
        if (dat >= ndo->ndo_snapend) {
-               ND_PRINT((ndo, tstr));
+               ND_PRINT((ndo, "%s", tstr));
                return;
        }