Merge remote-tracking branch 'goog/tcpdump'
* goog/tcpdump: (3066 commits)
Remove old version. Getting ready for new tcpdump 4.5
Support -Q for setting the capture direction.
Clean up the TLV processing loop.
With -A and -AA, don't send CRs to the standard output.
Use the new libpcap <pcap/nflog.h> for NFLOG definitions and declarations.
Do our own isascii(), isprint(), isgraph(), and toascii().
Fix a compiler warning.
Don't use the __attribute__((packed)) on most platforms.
The interval in an AODV HELLO extension is not aligned on a 4-byte boundary.
As with memcpy, so with memcmp.
More UNALIGNED_MEM{CPY,CMP} on IP addresses.
Another case where UNALIGNED_MEMCPY() is probably necessary.
No need for casting back and forth.
Only do the unaligned_mem{cpy,cmp} hack if necessary.
No need to declare unaligned_mem{cpy,cmp} in netdissect.h *and* interface.h.
More possibly-unaligned memcpy()s and assignments - use unaligned_memcpy().
Check for compiling for IPv6; don't check whether we can create an IPv6 socket.
Use unaligned_memcmp() to compare with IPv{4,6} addresses in a packet.
Use EXTRACT_nBITS even when just testing against zero.
Fix some more unaligned accesses.
...
Change-Id: I9e98707d30c989b9e32dcd5af798bd0746ab4434
diff --git a/print-lmp.c b/print-lmp.c
index 84d166f..c03e12e 100644
--- a/print-lmp.c
+++ b/print-lmp.c
@@ -10,6 +10,8 @@
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
+ * Support for the Link Management Protocol as per rfc 4204.
+ *
* Original code by Hannes Gredler (hannes@juniper.net)
* Support for LMP service discovery extensions (defined by UNI 1.0) added
* by Manu Pathak (mapathak@cisco.com), May 2005
@@ -17,7 +19,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lmp.c,v 1.5.2.4 2006/06/23 02:07:27 hannes Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lmp.c,v 1.11 2007-08-02 17:32:49 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -91,21 +93,21 @@
};
static const struct tok lmp_obj_begin_verify_error_values[] = {
- { 0x01, "\n\t\tLink Verification Procedure Not supported"},
- { 0x02, "\n\t\tUnwilling to verify"},
- { 0x04, "\n\t\tUnsupported verification transport mechanism"},
- { 0x08, "\n\t\tLink_Id configuration error"},
- { 0x10, "\n\t\tUnknown object c-type"},
+ { 0x01, "Link Verification Procedure Not supported"},
+ { 0x02, "Unwilling to verify"},
+ { 0x04, "Unsupported verification transport mechanism"},
+ { 0x08, "Link-Id configuration error"},
+ { 0x10, "Unknown object c-type"},
{ 0, NULL}
};
static const struct tok lmp_obj_link_summary_error_values[] = {
- { 0x01, "\n\t\tUnacceptable non-negotiable LINK_SUMMARY parameters"},
- { 0x02, "\n\t\tRenegotiate LINK_SUMMARY parameters"},
- { 0x04, "\n\t\tInvalid TE-LINK Object"},
- { 0x08, "\n\t\tInvalid DATA-LINK Object"},
- { 0x10, "\n\t\tUnknown TE-LINK Object c-type"},
- { 0x20, "\n\t\tUnknown DATA-LINK Object c-type"},
+ { 0x01, "Unacceptable non-negotiable LINK-SUMMARY parameters"},
+ { 0x02, "Renegotiate LINK-SUMMARY parameters"},
+ { 0x04, "Invalid TE-LINK Object"},
+ { 0x08, "Invalid DATA-LINK Object"},
+ { 0x10, "Unknown TE-LINK Object c-type"},
+ { 0x20, "Unknown DATA-LINK Object c-type"},
{ 0, NULL}
};
@@ -532,7 +534,7 @@
case LMP_OBJ_HELLO:
switch(lmp_obj_ctype) {
case LMP_CTYPE_HELLO:
- printf("\n\t TxSeqNum: %u\n\t RcvSeqNum: %u",
+ printf("\n\t Tx Seq: %u, Rx Seq: %u",
EXTRACT_32BITS(obj_tptr),
EXTRACT_32BITS(obj_tptr+4));
break;
@@ -550,8 +552,8 @@
switch(lmp_obj_ctype) {
case LMP_CTYPE_IPV4:
- printf("\n\t Local Link-ID: %s (0x%08x) \
- \n\t Remote Link-ID: %s (0x%08x)",
+ printf("\n\t Local Link-ID: %s (0x%08x)"
+ "\n\t Remote Link-ID: %s (0x%08x)",
ipaddr_string(obj_tptr+4),
EXTRACT_32BITS(obj_tptr+4),
ipaddr_string(obj_tptr+8),
@@ -576,8 +578,8 @@
switch(lmp_obj_ctype) {
case LMP_CTYPE_IPV4:
case LMP_CTYPE_UNMD:
- printf("\n\t Local Interface ID: %s (0x%08x) \
- \n\t Remote Interface ID: %s (0x%08x)",
+ printf("\n\t Local Interface ID: %s (0x%08x)"
+ "\n\t Remote Interface ID: %s (0x%08x)",
ipaddr_string(obj_tptr+4),
EXTRACT_32BITS(obj_tptr+4),
ipaddr_string(obj_tptr+8),
@@ -648,10 +650,10 @@
EXTRACT_32BITS(obj_tptr+4));
printf("\n\t Encoding type: %s",
tok2str(gmpls_encoding_values, "Unknown", *(obj_tptr+8)));
- printf("\n\t Verify Tranport Mechanism: %u (0x%x) %s",
+ printf("\n\t Verify Transport Mechanism: %u (0x%x)%s",
EXTRACT_16BITS(obj_tptr+10),
EXTRACT_16BITS(obj_tptr+10),
- EXTRACT_16BITS(obj_tptr+10)&8000 ? "(Payload test messages capable)" : "");
+ EXTRACT_16BITS(obj_tptr+10)&8000 ? " (Payload test messages capable)" : "");
bw.i = EXTRACT_32BITS(obj_tptr+12);
printf("\n\t Transmission Rate: %.3f Mbps",bw.f*8/1000000);
printf("\n\t Wavelength: %u",
@@ -666,8 +668,8 @@
case LMP_OBJ_VERIFY_BEGIN_ACK:
switch(lmp_obj_ctype) {
case LMP_CTYPE_1:
- printf("\n\t Verify Dead Interval: %u \
- \n\t Verify Transport Response: %u",
+ printf("\n\t Verify Dead Interval: %u"
+ "\n\t Verify Transport Response: %u",
EXTRACT_16BITS(obj_tptr),
EXTRACT_16BITS(obj_tptr+2));
break;
@@ -869,7 +871,7 @@
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1 || hexdump==TRUE)
- print_unknown_data(tptr+sizeof(sizeof(struct lmp_object_header)),"\n\t ",
+ print_unknown_data(tptr+sizeof(struct lmp_object_header),"\n\t ",
lmp_obj_len-sizeof(struct lmp_object_header));
tptr+=lmp_obj_len;