#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;
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 */
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 );
}
}
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_NONE,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_NONE,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_DEC,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
{
BASE_NONE,
NULL,
0x0,
- "", HFILL
+ NULL, HFILL
}
},
};
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);
}