]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lmp.c
Fix the pointer tests in the non-ndoified TTEST2() macro as well.
[tcpdump] / print-lmp.c
index 30b3764f6ce3a60f6e81d3be336c8d66e222737c..556db173e49bd33e2a9603185ef754a8de25379c 100644 (file)
@@ -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 ([email protected])
  * Support for LMP service discovery extensions (defined by UNI 1.0) added
  * by Manu Pathak ([email protected]), May 2005
@@ -17,7 +19,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-lmp.c,v 1.7 2006-03-28 07:32:41 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_flag_values[] = {
 };
 
 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}
 };
 
@@ -307,9 +309,6 @@ static const struct tok lmp_data_link_subobj[] = {
 #define LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH     5 /* UNI 1.0 Sec 9.4.2 */
 #define LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET   6 /* UNI 1.0 Sec 9.4.2 */
 
-#define FALSE 0
-#define TRUE  1
-
 /*
  * the ctypes are not globally unique so for
  * translating it to strings we build a table based
@@ -535,7 +534,7 @@ lmp_print(register const u_char *pptr, register u_int len) {
         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;
@@ -611,10 +610,10 @@ lmp_print(register const u_char *pptr, register u_int len) {
                                        EXTRACT_16BITS(obj_tptr+offset+2)&0x00FF);
                                bw.i = EXTRACT_32BITS(obj_tptr+offset+4);
                                printf("\n\t      Min Reservable Bandwidth: %.3f Mbps",
-                                       bw.f);
+                                       bw.f*8/1000000);
                                bw.i = EXTRACT_32BITS(obj_tptr+offset+8);
                                printf("\n\t      Max Reservable Bandwidth: %.3f Mbps",
-                                       bw.f);
+                                       bw.f*8/1000000);
                                break;  
                        case WAVELENGTH_SUBOBJ:
                                printf("\n\t      Wavelength: %u",
@@ -656,7 +655,7 @@ lmp_print(register const u_char *pptr, register u_int len) {
                        EXTRACT_16BITS(obj_tptr+10),
                        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);
+               printf("\n\t    Transmission Rate: %.3f Mbps",bw.f*8/1000000);
                printf("\n\t    Wavelength: %u",
                        EXTRACT_32BITS(obj_tptr+16));
                break;