For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
[obnox/wireshark/wip.git] / epan / dissectors / packet-h261.c
index 75a5051cfd5feee233724e13f8827430e0cac7cc..f5b6a9dafb96029fd844655ca249d2b059607b9c 100644 (file)
 #include <glib.h>
 #include <epan/packet.h>
 
-#include <stdio.h>
-#include <string.h>
-
 #include <epan/rtp_pt.h>
-#include "iax2_codec_type.h"
+#include <epan/iax2_codec_type.h>
 
 /* H.261 header fields             */
 static int proto_h261          = -1;
@@ -68,21 +65,17 @@ dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
        proto_tree *h261_tree     = NULL;
        unsigned int offset       = 0;
 
-       if ( check_col( pinfo->cinfo, COL_PROTOCOL ) )   {
-               col_set_str( pinfo->cinfo, COL_PROTOCOL, "H.261" );
-       }
+       col_set_str(pinfo->cinfo, COL_PROTOCOL, "H.261");
 
-       if ( check_col( pinfo->cinfo, COL_INFO) ) {
-               col_set_str( pinfo->cinfo, COL_INFO, "H.261 message");
-       }
+       col_set_str(pinfo->cinfo, COL_INFO, "H.261 message");
 
        if ( tree ) {
-               ti = proto_tree_add_item( tree, proto_h261, tvb, offset, -1, FALSE );
+               ti = proto_tree_add_item( tree, proto_h261, tvb, offset, -1, ENC_NA );
                h261_tree = proto_item_add_subtree( ti, ett_h261 );
                /* SBIT 1st octet, 3 bits */
                proto_tree_add_uint( h261_tree, hf_h261_sbit, tvb, offset, 1, tvb_get_guint8( tvb, offset ) >> 5 );
                /* EBIT 1st octet, 3 bits */
-               proto_tree_add_uint( h261_tree, hf_h261_ebit, tvb, offset, 1, ( tvb_get_guint8( tvb, offset )  << 3 ) >> 5 );
+               proto_tree_add_uint( h261_tree, hf_h261_ebit, tvb, offset, 1, ( tvb_get_guint8( tvb, offset )  >> 2 ) & 7 );
                /* I flag, 1 bit */
                proto_tree_add_boolean( h261_tree, hf_h261_ibit, tvb, offset, 1, tvb_get_guint8( tvb, offset ) & 2 );
                /* V flag, 1 bit */
@@ -111,7 +104,7 @@ dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                offset++;
 
                /* The rest of the packet is the H.261 stream */
-               proto_tree_add_item( h261_tree, hf_h261_data, tvb, offset, -1, FALSE );
+               proto_tree_add_item( h261_tree, hf_h261_data, tvb, offset, -1, ENC_NA );
        }
 }
 
@@ -129,7 +122,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -141,7 +134,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -153,7 +146,7 @@ proto_register_h261(void)
                                BASE_NONE,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -165,7 +158,7 @@ proto_register_h261(void)
                                BASE_NONE,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -177,7 +170,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -189,7 +182,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -201,7 +194,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -213,7 +206,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -225,7 +218,7 @@ proto_register_h261(void)
                                BASE_DEC,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
                {
@@ -237,7 +230,7 @@ proto_register_h261(void)
                                BASE_NONE,
                                NULL,
                                0x0,
-                               "", HFILL
+                               NULL, HFILL
                        }
                },
 };
@@ -260,6 +253,6 @@ proto_reg_handoff_h261(void)
        dissector_handle_t h261_handle;
 
        h261_handle = create_dissector_handle(dissect_h261, proto_h261);
-       dissector_add("rtp.pt", PT_H261, h261_handle);
-       dissector_add("iax2.codec", AST_FORMAT_H261, h261_handle);
+       dissector_add_uint("rtp.pt", PT_H261, h261_handle);
+       dissector_add_uint("iax2.codec", AST_FORMAT_H261, h261_handle);
 }