]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udld.c
Fix spaces
[tcpdump] / print-udld.c
index e4c7bdca0cc35f9aecd374f118e243580f84e6c5..224d482556381f76d627f2d81cc2d4e063fdd508 100644 (file)
 /* specification: RFC 5171 */
 
 #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"
 
-static const char tstr[] = " [|udld]";
 
 #define UDLD_HEADER_LEN                        4
 #define UDLD_DEVICE_ID_TLV             0x0001
@@ -94,11 +93,12 @@ static const struct tok udld_flags_values[] = {
 #define        UDLD_EXTRACT_OPCODE(x) ((x)&0x1f)
 
 void
-udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
+udld_print(netdissect_options *ndo, const u_char *pptr, u_int length)
 {
     int code, type, len;
     const u_char *tptr;
 
+    ndo->ndo_protocol = "udld";
     if (length < UDLD_HEADER_LEN)
         goto trunc;
 
@@ -154,12 +154,12 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
         case UDLD_PORT_ID_TLV:
         case UDLD_DEVICE_NAME_TLV:
             ND_PRINT(", ");
-            fn_printzp(ndo, tptr, len, NULL);
+            nd_printzp(ndo, tptr, len, NULL);
             break;
 
         case UDLD_ECHO_TLV:
             ND_PRINT(", ");
-            (void)fn_printn(ndo, tptr, len, NULL);
+            (void)nd_printn(ndo, tptr, len, NULL);
             break;
 
         case UDLD_MESSAGE_INTERVAL_TLV:
@@ -187,12 +187,5 @@ invalid:
     ND_PRINT("%s", istr);
     return;
 trunc:
-    ND_PRINT("%s", tstr);
+    nd_print_trunc(ndo);
 }
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 4
- * End:
- */