From Martin Mathieson: display the bitfields for
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 9 Nov 2003 22:55:35 +0000 (22:55 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 9 Nov 2003 22:55:35 +0000 (22:55 +0000)
- the first 2 bytes of RTP headers
- the first byte of RTCP report.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8923 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
doc/ethereal.pod
packet-rtcp.c
packet-rtp.c

diff --git a/AUTHORS b/AUTHORS
index 719ccc4d2a48b1cdeb8b5b0f557773bce3ffb36a..296545ac4da6d478dc00c2be7006208b0ba83406 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1933,6 +1933,7 @@ And assorted fixes and enhancements by the people listed above and by:
        Steve Ford <sford [AT] geeky-boy.com>
        Masaki Chikama <masaki-c [AT] is.aist-nara.ac.jp>
        Mohammad Hanif <mhanif [AT] nexthop.com>
+       Martin Mathieson <martin [AT] arca-technologies.com>
 
 Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
 give his permission to use his version of snprintf.c.
index 51c1e6decd9a19662e6698a71366920bf990a3d8..f964f686a1f74f056df29119349b85e8eec77c30 100644 (file)
@@ -2034,6 +2034,7 @@ B<http://www.ethereal.com>.
   Steve Ford               <sford [AT] geeky-boy.com>
   Masaki Chikama           <masaki-c [AT] is.aist-nara.ac.jp>
   Mohammad Hanif           <mhanif [AT] nexthop.com>
+  Martin Mathieson         <martin [AT] arca-technologies.com>
 
 Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
 permission to use his version of snprintf.c.
index 2274dd8bc2168384c93a583172a5cc05eecb6dca..095a5c28778ddc6d53907cd0aaea39176e35bf8b 100644 (file)
@@ -1,6 +1,6 @@
 /* packet-rtcp.c
  *
- * $Id: packet-rtcp.c,v 1.37 2003/05/28 22:40:19 guy Exp $
+ * $Id: packet-rtcp.c,v 1.38 2003/11/09 22:55:34 guy Exp $
  *
  * Routines for RTCP dissection
  * RTCP = Real-time Transport Control Protocol
@@ -282,7 +282,7 @@ static int
 dissect_rtcp_nack( tvbuff_t *tvb, int offset, proto_tree *tree )
 {
        /* Packet type = FIR (H261) */
-       proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 31 );
+       proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) );
        offset++;
        /* Packet type, 8 bits  = APP */
        proto_tree_add_item( tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
@@ -311,7 +311,7 @@ static int
 dissect_rtcp_fir( tvbuff_t *tvb, int offset, proto_tree *tree )
 {
        /* Packet type = FIR (H261) */
-       proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 31 );
+       proto_tree_add_uint( tree, hf_rtcp_rc, tvb, offset, 1, tvb_get_guint8( tvb, offset ) );
        offset++;
        /* Packet type, 8 bits  = APP */
        proto_tree_add_item( tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
@@ -693,17 +693,17 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                        temp_byte = tvb_get_guint8( tvb, offset );
 
                        proto_tree_add_uint( rtcp_tree, hf_rtcp_version, tvb,
-                           offset, 1, RTCP_VERSION( temp_byte ) );
+                           offset, 1, temp_byte);
                        padding_set = RTCP_PADDING( temp_byte );
                        proto_tree_add_boolean( rtcp_tree, hf_rtcp_padding, tvb,
-                           offset, 1, padding_set );
+                           offset, 1, temp_byte );
                        elem_count = RTCP_COUNT( temp_byte );
 
                        switch ( packet_type ) {
                                case RTCP_SR:
                                case RTCP_RR:
                                        /* Receiver report count, 5 bits */
-                                       proto_tree_add_uint( rtcp_tree, hf_rtcp_rc, tvb, offset, 1, elem_count );
+                                       proto_tree_add_uint( rtcp_tree, hf_rtcp_rc, tvb, offset, 1, temp_byte );
                                        offset++;
                                        /* Packet type, 8 bits */
                                        proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
@@ -720,7 +720,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                                        break;
                                case RTCP_SDES:
                                        /* Source count, 5 bits */
-                                       proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, elem_count );
+                                       proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, temp_byte );
                                        offset++;
                                        /* Packet type, 8 bits */
                                        proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
@@ -733,7 +733,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                                        break;
                                case RTCP_BYE:
                                        /* Source count, 5 bits */
-                                       proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, elem_count );
+                                       proto_tree_add_uint( rtcp_tree, hf_rtcp_sc, tvb, offset, 1, temp_byte );
                                        offset++;
                                        /* Packet type, 8 bits */
                                        proto_tree_add_item( rtcp_tree, hf_rtcp_pt, tvb, offset, 1, FALSE );
@@ -800,7 +800,7 @@ proto_register_rtcp(void)
                                FT_UINT8,
                                BASE_DEC,
                                VALS(rtcp_version_vals),
-                               0x0,
+                               0xC0,
                                "", HFILL
                        }
                },
@@ -810,9 +810,9 @@ proto_register_rtcp(void)
                                "Padding",
                                "rtcp.padding",
                                FT_BOOLEAN,
-                               BASE_NONE,
+                               8,
                                NULL,
-                               0x0,
+                               0x20,
                                "", HFILL
                        }
                },
@@ -824,7 +824,7 @@ proto_register_rtcp(void)
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
-                               0x0,
+                               0x1F,
                                "", HFILL
                        }
                },
@@ -836,7 +836,7 @@ proto_register_rtcp(void)
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
-                               0x0,
+                               0x1F,
                                "", HFILL
                        }
                },
index ed028ef8b28814b1831a8593ff55659bb262f41b..ac2eb7df69f2688b53c33c52a88e14597587e5f1 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2000, Philips Electronics N.V.
  * Written by Andreas Sikkema <andreas.sikkema@philips.com>
  *
- * $Id: packet-rtp.c,v 1.41 2003/08/23 06:36:46 guy Exp $
+ * $Id: packet-rtp.c,v 1.42 2003/11/09 22:55:34 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -289,7 +289,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
        proto_item *ti            = NULL;
        proto_tree *rtp_tree      = NULL;
        proto_tree *rtp_csrc_tree = NULL;
-       guint8      octet;
+       guint8      octet1, octet2;
        unsigned int version;
        gboolean    padding_set;
        gboolean    extension_set;
@@ -309,8 +309,8 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
        static struct _rtp_info rtp_info;
 
        /* Get the fields in the first octet */
-       octet = tvb_get_guint8( tvb, offset );
-       version = RTP_VERSION( octet );
+       octet1 = tvb_get_guint8( tvb, offset );
+       version = RTP_VERSION( octet1 );
 
        if (version != 2) {
                /*
@@ -330,19 +330,19 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                        rtp_tree = proto_item_add_subtree( ti, ett_rtp );
 
                        proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
-                           offset, 1, version );
+                           offset, 1, octet1);
                }
                return;
        }
 
-       padding_set = RTP_PADDING( octet );
-       extension_set = RTP_EXTENSION( octet );
-       csrc_count = RTP_CSRC_COUNT( octet );
+       padding_set = RTP_PADDING( octet1 );
+       extension_set = RTP_EXTENSION( octet1 );
+       csrc_count = RTP_CSRC_COUNT( octet1 );
 
        /* Get the fields in the second octet */
-       octet = tvb_get_guint8( tvb, offset + 1 );
-       marker_set = RTP_MARKER( octet );
-       payload_type = RTP_PAYLOAD_TYPE( octet );
+       octet2 = tvb_get_guint8( tvb, offset + 1 );
+       marker_set = RTP_MARKER( octet2 );
+       payload_type = RTP_PAYLOAD_TYPE( octet2 );
 
        /* Get the subsequent fields */
        seq_num = tvb_get_ntohs( tvb, offset + 2 );
@@ -378,19 +378,19 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                rtp_tree = proto_item_add_subtree( ti, ett_rtp );
 
                proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb,
-                   offset, 1, version );
+                   offset, 1, octet1 );
                proto_tree_add_boolean( rtp_tree, hf_rtp_padding, tvb,
-                   offset, 1, padding_set );
+                   offset, 1, octet1 );
                proto_tree_add_boolean( rtp_tree, hf_rtp_extension, tvb,
-                   offset, 1, extension_set );
+                   offset, 1, octet1 );
                proto_tree_add_uint( rtp_tree, hf_rtp_csrc_count, tvb,
-                   offset, 1, csrc_count );
+                   offset, 1, octet1 );
                offset++;
 
                proto_tree_add_boolean( rtp_tree, hf_rtp_marker, tvb, offset,
-                   1, marker_set );
+                   1, octet2 );
                proto_tree_add_uint( rtp_tree, hf_rtp_payload_type, tvb,
-                   offset, 1, payload_type );
+                   offset, 1, octet2 );
                offset++;
 
                /* Sequence number 16 bits (2 octets) */
@@ -550,7 +550,7 @@ proto_register_rtp(void)
                                FT_UINT8,
                                BASE_DEC,
                                VALS(rtp_version_vals),
-                               0x0,
+                               0xC0,
                                "", HFILL
                        }
                },
@@ -560,9 +560,9 @@ proto_register_rtp(void)
                                "Padding",
                                "rtp.padding",
                                FT_BOOLEAN,
-                               BASE_NONE,
+                               8,
                                NULL,
-                               0x0,
+                               0x20,
                                "", HFILL
                        }
                },
@@ -572,9 +572,9 @@ proto_register_rtp(void)
                                "Extension",
                                "rtp.ext",
                                FT_BOOLEAN,
-                               BASE_NONE,
+                               8,
                                NULL,
-                               0x0,
+                               0x10,
                                "", HFILL
                        }
                },
@@ -586,7 +586,7 @@ proto_register_rtp(void)
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
-                               0x0,
+                               0x0F,
                                "", HFILL
                        }
                },
@@ -596,9 +596,9 @@ proto_register_rtp(void)
                                "Marker",
                                "rtp.marker",
                                FT_BOOLEAN,
-                               BASE_NONE,
+                               8,
                                NULL,
-                               0x0,
+                               0x80,
                                "", HFILL
                        }
                },
@@ -610,7 +610,7 @@ proto_register_rtp(void)
                                FT_UINT8,
                                BASE_DEC,
                                VALS(rtp_payload_type_vals),
-                               0x0,
+                               0x7F,
                                "", HFILL
                        }
                },