summaryrefslogtreecommitdiff
path: root/print-udld.c
diff options
context:
space:
mode:
authorMichael Richardson <mcr@sandelman.ca>2014-01-01 21:27:54 -0500
committerMichael Richardson <mcr@sandelman.ca>2014-01-01 21:31:18 -0500
commita97fb2f3ae9731dd13e6854742c090ca9ef454cf (patch)
treef0eecb0f7bbc0d6f32f9ef310bdd19cab32d1345 /print-udld.c
parent35c5cd9911f3fcc385e4a04c31016c253ee7a426 (diff)
downloadtcpdump-a97fb2f3ae9731dd13e6854742c090ca9ef454cf.tar.gz
whitespace changes
Diffstat (limited to 'print-udld.c')
-rw-r--r--print-udld.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/print-udld.c b/print-udld.c
index e8395d0a..c0fc793c 100644
--- a/print-udld.c
+++ b/print-udld.c
@@ -12,7 +12,7 @@
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
- * UNIDIRECTIONAL LINK DETECTION (UDLD) as per
+ * UNIDIRECTIONAL LINK DETECTION (UDLD) as per
* http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt
*
* Original code by Carles Kishimoto <carles.kishimoto@gmail.com>
@@ -29,7 +29,7 @@
#include "interface.h"
#include "addrtoname.h"
-#include "extract.h"
+#include "extract.h"
#include "nlpid.h"
#define UDLD_HEADER_LEN 4
@@ -68,19 +68,19 @@ static const struct tok udld_flags_values[] = {
/*
*
- * 0 1 2 3
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | Ver | Opcode | Flags | Checksum |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | List of TLVs (variable length list) |
- * | ... |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Ver | Opcode | Flags | Checksum |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | List of TLVs (variable length list) |
+ * | ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
-#define UDLD_EXTRACT_VERSION(x) (((x)&0xe0)>>5)
-#define UDLD_EXTRACT_OPCODE(x) ((x)&0x1f)
+#define UDLD_EXTRACT_VERSION(x) (((x)&0xe0)>>5)
+#define UDLD_EXTRACT_OPCODE(x) ((x)&0x1f)
void
udld_print (const u_char *pptr, u_int length)
@@ -91,14 +91,14 @@ udld_print (const u_char *pptr, u_int length)
if (length < UDLD_HEADER_LEN)
goto trunc;
- tptr = pptr;
+ tptr = pptr;
- if (!TTEST2(*tptr, UDLD_HEADER_LEN))
+ if (!TTEST2(*tptr, UDLD_HEADER_LEN))
goto trunc;
code = UDLD_EXTRACT_OPCODE(*tptr);
- printf("UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u",
+ printf("UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u",
UDLD_EXTRACT_VERSION(*tptr),
tok2str(udld_code_values, "Reserved", code),
code,
@@ -119,11 +119,11 @@ udld_print (const u_char *pptr, u_int length)
while (tptr < (pptr+length)) {
- if (!TTEST2(*tptr, 4))
+ if (!TTEST2(*tptr, 4))
goto trunc;
type = EXTRACT_16BITS(tptr);
- len = EXTRACT_16BITS(tptr+2);
+ len = EXTRACT_16BITS(tptr+2);
len -= 4;
tptr += 4;
@@ -140,11 +140,11 @@ udld_print (const u_char *pptr, u_int length)
case UDLD_DEVICE_ID_TLV:
case UDLD_PORT_ID_TLV:
case UDLD_ECHO_TLV:
- case UDLD_DEVICE_NAME_TLV:
+ case UDLD_DEVICE_NAME_TLV:
printf(", %s", tptr);
break;
- case UDLD_MESSAGE_INTERVAL_TLV:
+ case UDLD_MESSAGE_INTERVAL_TLV:
case UDLD_TIMEOUT_INTERVAL_TLV:
printf(", %us", (*tptr));
break;
@@ -155,7 +155,7 @@ udld_print (const u_char *pptr, u_int length)
default:
break;
- }
+ }
tptr += len;
}