]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udld.c
Add program_name field in the netdissect_options structure
[tcpdump] / print-udld.c
index f846a884472bef54c7b553717425f57bfa098e5d..4ff889e8d23d96c226e73443b7f1dafb5f8d89ad 100644 (file)
  * Original code by Carles Kishimoto <[email protected]>
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 #include <tcpdump-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "extract.h"
 
 #define UDLD_HEADER_LEN                        4
@@ -89,8 +88,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
 
     tptr = pptr;
 
-    if (!ND_TTEST2(*tptr, UDLD_HEADER_LEN))
-       goto trunc;
+    ND_TCHECK2(*tptr, UDLD_HEADER_LEN);
 
     code = UDLD_EXTRACT_OPCODE(*tptr);
 
@@ -115,8 +113,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
 
     while (tptr < (pptr+length)) {
 
-        if (!ND_TTEST2(*tptr, 4))
-            goto trunc;
+        ND_TCHECK2(*tptr, 4);
 
        type = EXTRACT_16BITS(tptr);
         len  = EXTRACT_16BITS(tptr+2);