- fix bugs in dissect_per_octet_string() introduced with unaligned variant

- step to new ASN.1 API - pass asn_ctx_t* through PER dissectors instead of packet_info*
- PER ALIGNED/UNALIGNED flag moved to asn_ctx_t
- PER created tree item pointer moved to asn_ctx_t
- add nbap into PER dissectors in asn1/Makefile.nmake
- use add_oid_str_name() instead of register_ber_oid_name() in H.225 and H.245
- export asn_ctx_init from library
- PER dissectors regenerated

svn path=/trunk/; revision=18209
This commit is contained in:
Tomas Kukosa 2006-05-22 11:49:50 +00:00
parent 18ffc28bb1
commit fbd2a3fe3e
43 changed files with 28433 additions and 28403 deletions

View File

@ -290,6 +290,7 @@ per: \
h235 \
h245 \
h450 \
nbap \
ranap \
rnsap \
rrlp \

View File

@ -1,7 +1,7 @@
# Do not modify this file.
# It is created automatically by the ASN.1 to Ethereal dissector compiler
# It is created automatically by the ASN.1 to Wireshark dissector compiler
# .\h225-exp.cnf
# ../../tools/asn2eth.py -e -p h225 -c h225.cnf -s packet-h225-template h225.asn
# ../../tools/asn2wrs.py -e -p h225 -c h225.cnf -s packet-h225-template h225.asn
#.MODULE
H323-MESSAGES h225

View File

@ -138,8 +138,8 @@ CallIdentifier/guid guid
contains_faststart = FALSE;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO)){
col_append_fstr(pinfo->cinfo, COL_INFO, "CS: %%s ",
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "CS: %%s ",
val_to_str(message_body_val, T_h323_message_body_vals, "<unknown>"));
}
@ -150,13 +150,13 @@ CallIdentifier/guid guid
if (contains_faststart == TRUE )
{
if (check_col(pinfo->cinfo, COL_INFO))
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO))
{
col_append_str(pinfo->cinfo, COL_INFO, "OpenLogicalChannel " );
col_append_str(%(ACTX)s->pinfo->cinfo, COL_INFO, "OpenLogicalChannel " );
}
}
col_set_fence(pinfo->cinfo,COL_INFO);
col_set_fence(%(ACTX)s->pinfo->cinfo,COL_INFO);
#.END
#----------------------------------------------------------------------------------------
@ -166,7 +166,7 @@ CallIdentifier/guid guid
%(DEFAULT_BODY)s
if (value_tvb && tvb_length(value_tvb)) {
dissect_h245_OpenLogicalChannelCodec(value_tvb, pinfo, tree, codec_str);
dissect_h245_OpenLogicalChannelCodec(value_tvb, %(ACTX)s->pinfo, tree, codec_str);
}
/* Add to packet info */
@ -180,8 +180,8 @@ CallIdentifier/guid guid
guint32 rasmessage_value;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO)){
col_add_fstr(pinfo->cinfo, COL_INFO, "RAS: %%s ",
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){
col_add_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "RAS: %%s ",
val_to_str(rasmessage_value, RasMessage_vals, "<unknown>"));
}
@ -327,7 +327,7 @@ CallIdentifier/guid guid
h225_pi->h245_address = ipv4_address;
h225_pi->h245_port = ipv4_port;
if((!pinfo->fd->flags.visited) && ipv4_address!=0 && ipv4_port!=0 && h245_handle){
if((!actx->pinfo->fd->flags.visited) && ipv4_address!=0 && ipv4_port!=0 && h245_handle){
address src_addr;
conversation_t *conv=NULL;
@ -335,9 +335,9 @@ CallIdentifier/guid guid
src_addr.len=4;
src_addr.data=(const guint8 *)&ipv4_address;
conv=find_conversation(pinfo->fd->num, &src_addr, &src_addr, PT_TCP, ipv4_port, ipv4_port, NO_ADDR_B|NO_PORT_B);
conv=find_conversation(actx->pinfo->fd->num, &src_addr, &src_addr, PT_TCP, ipv4_port, ipv4_port, NO_ADDR_B|NO_PORT_B);
if(!conv){
conv=conversation_new(pinfo->fd->num, &src_addr, &src_addr, PT_TCP, ipv4_port, ipv4_port, NO_ADDR2|NO_PORT2);
conv=conversation_new(actx->pinfo->fd->num, &src_addr, &src_addr, PT_TCP, ipv4_port, ipv4_port, NO_ADDR2|NO_PORT2);
conversation_set_dissector(conv, h245_handle);
}
}
@ -445,7 +445,7 @@ ReleaseCompleteReason VAL_PTR = &value
#.FN_BODY CallIdentifier/guid
tvbuff_t *guid_tvb;
offset = dissect_per_octet_string(tvb,offset,pinfo,tree,hf_index,GUID_LEN,GUID_LEN,&guid_tvb);
offset = dissect_per_octet_string(tvb,offset,%(ACTX)s,tree,hf_index,GUID_LEN,GUID_LEN,&guid_tvb);
tvb_memcpy(guid_tvb,(guint8 *)&h225_pi->guid,0,GUID_LEN);
#.END
#----------------------------------------------------------------------------------------
@ -456,7 +456,7 @@ ReleaseCompleteReason VAL_PTR = &value
%(DEFAULT_BODY)s
if (h4501_tvb && tvb_length(h4501_tvb)) {
call_dissector(h4501_handle, h4501_tvb, pinfo, tree);
call_dissector(h4501_handle, h4501_tvb, %(ACTX)s->pinfo, tree);
}
#.END
#----------------------------------------------------------------------------------------
@ -525,7 +525,7 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
%(DEFAULT_BODY)s
if (next_tvb && tvb_length(next_tvb)) {
call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree);
call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, %(ACTX)s->pinfo, tree);
}
#.END

View File

@ -44,13 +44,13 @@
#include <string.h>
#include <epan/prefs.h>
#include <epan/oid_resolv.h>
#include "tap.h"
#include "packet-tpkt.h"
#include "packet-per.h"
#include "packet-h225.h"
#include <epan/t35.h>
#include <epan/h225-persistentdata.h>
#include "packet-ber.h"
#include "packet-h235.h"
#include "packet-h245.h"
#include "packet-q931.h"
@ -203,6 +203,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
proto_item *it;
proto_tree *tr;
int offset = 0;
asn_ctx_t asn_ctx;
pi_current++;
if(pi_current==5){
@ -227,8 +228,8 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, tvb_length(tvb), PSNAME" CS");
tr=proto_item_add_subtree(it, ett_h225);
per_aligment_type_callback(TRUE);
offset = dissect_h225_H323_UserInformation(tvb, offset,pinfo, tr, hf_h225_H323_UserInformation);
asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
offset = dissect_h225_H323_UserInformation(tvb, offset, &asn_ctx, tr, hf_h225_H323_UserInformation);
if (h245_list.count && check_col(pinfo->cinfo, COL_PROTOCOL)){
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
@ -247,6 +248,7 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_item *it;
proto_tree *tr;
guint32 offset=0;
asn_ctx_t asn_ctx;
pi_current++;
if(pi_current==5){
@ -265,8 +267,8 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, tvb_length(tvb), PSNAME" RAS");
tr=proto_item_add_subtree(it, ett_h225);
per_aligment_type_callback(TRUE);
offset = dissect_h225_RasMessage(tvb, 0, pinfo,tr, hf_h225_RasMessage );
asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
offset = dissect_h225_RasMessage(tvb, 0, &asn_ctx, tr, hf_h225_RasMessage );
ras_call_matching(tvb, pinfo, tr, h225_pi);
@ -345,8 +347,8 @@ void proto_register_h225(void) {
register_init_routine(&h225_init_routine);
h225_tap = register_tap("h225");
register_ber_oid_name("0.0.8.2250.0.2","itu-t(0) recommendation(0) h(8) h225-0(2250) version(0) 2");
register_ber_oid_name("0.0.8.2250.0.4","itu-t(0) recommendation(0) h(8) h225-0(2250) version(0) 4");
add_oid_str_name("0.0.8.2250.0.2","itu-t(0) recommendation(0) h(8) h225-0(2250) version(0) 2");
add_oid_str_name("0.0.8.2250.0.4","itu-t(0) recommendation(0) h(8) h225-0(2250) version(0) 4");
}

View File

@ -76,6 +76,7 @@ typedef struct _h225_packet_info {
* libethereal.dll, we need a special declaration.
*/
#include "packet-per.h"
#include "packet-h225-exp.h"

View File

@ -1,7 +1,7 @@
# Do not modify this file.
# It is created automatically by the ASN.1 to Ethereal dissector compiler
# It is created automatically by the ASN.1 to Wireshark dissector compiler
# .\h235-exp.cnf
# ../../tools/asn2eth.py -e -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn H235-SRTP.asn
# ../../tools/asn2wrs.py -e -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn H235-SRTP.asn
#.MODULE
H235-SECURITY-MESSAGES h235

View File

@ -50,7 +50,7 @@ int proto_h235 = -1;
#include "packet-h235-ett.c"
static guint32
dissect_xxx_ToBeSigned(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_) {
dissect_xxx_ToBeSigned(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
PER_NOT_DECODED_YET("ToBeSigned");
return offset;
}

View File

@ -1,7 +1,7 @@
# Do not modify this file.
# It is created automatically by the ASN.1 to Ethereal dissector compiler
# It is created automatically by the ASN.1 to Wireshark dissector compiler
# .\h245-exp.cnf
# ../../tools/asn2eth.py -e -p h245 -c h245.cnf -s packet-h245-template h245.asn
# ../../tools/asn2wrs.py -e -p h245 -c h245.cnf -s packet-h245-template h245.asn
#.MODULE
MULTIMEDIA-SYSTEM-CONTROL h245

View File

@ -18,7 +18,7 @@ OpenLogicalChannel
h223_mc = 0;
%(DEFAULT_BODY)s
if(h223_set_mc_handle)
(*h223_set_mc_handle)(pinfo, h223_mc, h223_me);
(*h223_set_mc_handle)(%(ACTX)s->pinfo, h223_mc, h223_me);
/* stuff */
#.END
#----------------------------------------------------------------------------------------
@ -92,8 +92,8 @@ OpenLogicalChannel
pending->fw_channel_params = h223_fw_lc_params;
pending->rev_channel_params = h223_rev_lc_params;
temp = h223_fw_lc_num;
if (pinfo->p2p_dir > -1)
g_hash_table_insert(h223_pending_olc_reqs[pinfo->p2p_dir], GINT_TO_POINTER(temp), pending);
if (%(ACTX)s->pinfo->p2p_dir > -1)
g_hash_table_insert(h223_pending_olc_reqs[%(ACTX)s->pinfo->p2p_dir], GINT_TO_POINTER(temp), pending);
}
#.END
#----------------------------------------------------------------------------------------
@ -215,25 +215,25 @@ OpenLogicalChannel
%(DEFAULT_BODY)s
temp = h223_fw_lc_num;
p2p_dir = pinfo->p2p_dir;
p2p_dir = %(ACTX)s->pinfo->p2p_dir;
if(pinfo->p2p_dir == P2P_DIR_SENT)
pinfo->p2p_dir = P2P_DIR_RECV;
if(%(ACTX)s->pinfo->p2p_dir == P2P_DIR_SENT)
%(ACTX)s->pinfo->p2p_dir = P2P_DIR_RECV;
else
pinfo->p2p_dir = P2P_DIR_SENT;
pend = g_hash_table_lookup( h223_pending_olc_reqs[pinfo->p2p_dir], GINT_TO_POINTER(temp) );
%(ACTX)s->pinfo->p2p_dir = P2P_DIR_SENT;
pend = g_hash_table_lookup( h223_pending_olc_reqs[%(ACTX)s->pinfo->p2p_dir], GINT_TO_POINTER(temp) );
if (pend) {
DISSECTOR_ASSERT( ( h223_rev_lc_num && pend->rev_channel_params)
|| (!h223_rev_lc_num && !pend->rev_channel_params) );
if(h223_add_lc_handle) {
(*h223_add_lc_handle)( pinfo, h223_fw_lc_num, pend->fw_channel_params );
(*h223_add_lc_handle)( %(ACTX)s->pinfo, h223_fw_lc_num, pend->fw_channel_params );
if(h223_rev_lc_num)
(*h223_add_lc_handle)( pinfo, h223_rev_lc_num, pend->rev_channel_params );
(*h223_add_lc_handle)( %(ACTX)s->pinfo, h223_rev_lc_num, pend->rev_channel_params );
}
} else {
/* we missed the OpenLogicalChannel packet */
}
pinfo->p2p_dir = p2p_dir;
%(ACTX)s->pinfo->p2p_dir = p2p_dir;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR OpenLogicalChannelAck/forwardLogicalChannelNumber
@ -252,24 +252,24 @@ OpenLogicalChannel
guint32 value;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO)){
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){
if ( h245_shorttypes == TRUE )
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_RequestMessage_short_vals, "<unknown>"));
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_RequestMessage_vals, "<unknown>"));
}
}
if (( check_col(pinfo->cinfo, COL_INFO)) && ( codec_type != NULL ) && ( value == 3) ){
col_append_fstr(pinfo->cinfo, COL_INFO, "(%%s) ", codec_type );
if (( check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)) && ( codec_type != NULL ) && ( value == 3) ){
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "(%%s) ", codec_type );
}
col_set_fence(pinfo->cinfo,COL_INFO);
col_set_fence(%(ACTX)s->pinfo->cinfo,COL_INFO);
/* Add to packet info */
@ -290,20 +290,20 @@ OpenLogicalChannel
guint32 value;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO)){
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){
if ( h245_shorttypes == TRUE )
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_ResponseMessage_short_vals, "<unknown>"));
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_ResponseMessage_vals, "<unknown>"));
}
}
col_set_fence(pinfo->cinfo,COL_INFO);
col_set_fence(%(ACTX)s->pinfo->cinfo,COL_INFO);
/* Add to packet info */
g_snprintf(h245_pi->frame_label, 50, "%%s %%s ", h245_pi->frame_label, val_to_str(value, h245_ResponseMessage_short_vals, "UKN"));
@ -315,20 +315,20 @@ OpenLogicalChannel
guint32 value;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO)){
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){
if ( h245_shorttypes == TRUE )
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_IndicationMessage_short_vals, "<unknown>"));
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_IndicationMessage_vals, "<unknown>"));
}
}
col_set_fence(pinfo->cinfo,COL_INFO);
col_set_fence(%(ACTX)s->pinfo->cinfo,COL_INFO);
/* Add to packet info */
g_snprintf(h245_pi->frame_label, 50, "%%s %%s ", h245_pi->frame_label, val_to_str(value, h245_IndicationMessage_short_vals, "UKN"));
g_strlcat(h245_pi->comment, val_to_str(value, h245_IndicationMessage_vals, "<unknown>"), 50);
@ -339,20 +339,20 @@ OpenLogicalChannel
guint32 value;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO)){
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO)){
if ( h245_shorttypes == TRUE )
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_CommandMessage_short_vals, "<unknown>"));
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ",
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ",
val_to_str(value, h245_CommandMessage_vals, "<unknown>"));
}
}
col_set_fence(pinfo->cinfo,COL_INFO);
col_set_fence(%(ACTX)s->pinfo->cinfo,COL_INFO);
/* Add to packet info */
g_snprintf(h245_pi->frame_label, 50, "%%s %%s ", h245_pi->frame_label, val_to_str(value, h245_CommandMessage_short_vals, "UKN"));
g_strlcat(h245_pi->comment, val_to_str(value, h245_CommandMessage_vals, "<unknown>"), 50);
@ -578,7 +578,7 @@ OpenLogicalChannel
#----------------------------------------------------------------------------------------
#.FN_FTR OpenLogicalChannelAck/forwardMultiplexAckParameters
if (!pinfo->fd->flags.visited) {
if (!actx->pinfo->fd->flags.visited) {
if (codec_type && strcmp(codec_type, "t38fax")==0) {
if(ipv4_address!=0 && ipv4_port!=0 && t38_handle){
address src_addr;
@ -587,7 +587,7 @@ OpenLogicalChannel
src_addr.len=4;
src_addr.data=(guint8*)&ipv4_address;
t38_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num);
t38_add_address(actx->pinfo, &src_addr, ipv4_port, 0, "H245", actx->pinfo->fd->num);
}
} else {
if(ipv4_address!=0 && ipv4_port!=0 && rtp_handle){
@ -597,7 +597,7 @@ OpenLogicalChannel
src_addr.len=4;
src_addr.data=(guint8*)&ipv4_address;
rtp_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num, NULL);
rtp_add_address(actx->pinfo, &src_addr, ipv4_port, 0, "H245", actx->pinfo->fd->num, NULL);
}
if(rtcp_ipv4_address!=0 && rtcp_ipv4_port!=0 && rtcp_handle){
address src_addr;
@ -606,7 +606,7 @@ OpenLogicalChannel
src_addr.len=4;
src_addr.data=(guint8*)&rtcp_ipv4_address;
rtcp_add_address(pinfo, &src_addr, rtcp_ipv4_port, 0, "H245", pinfo->fd->num);
rtcp_add_address(actx->pinfo, &src_addr, rtcp_ipv4_port, 0, "H245", actx->pinfo->fd->num);
}
}
}
@ -622,7 +622,7 @@ OpenLogicalChannel
#----------------------------------------------------------------------------------------
#.FN_FTR OpenLogicalChannel/reverseLogicalChannelParameters/multiplexParameters
if (!pinfo->fd->flags.visited) {
if (!actx->pinfo->fd->flags.visited) {
if (codec_type && (strcmp(codec_type, "t38fax")==0)) {
if(ipv4_address!=0 && ipv4_port!=0 && t38_handle){
address src_addr;
@ -631,7 +631,7 @@ OpenLogicalChannel
src_addr.len=4;
src_addr.data=(guint8*)&ipv4_address;
t38_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num);
t38_add_address(actx->pinfo, &src_addr, ipv4_port, 0, "H245", actx->pinfo->fd->num);
}
} else {
if(ipv4_address!=0 && ipv4_port!=0 && rtp_handle){
@ -641,7 +641,7 @@ OpenLogicalChannel
src_addr.len=4;
src_addr.data=(guint8*)&ipv4_address;
rtp_add_address(pinfo, &src_addr, ipv4_port, 0, "H245", pinfo->fd->num, NULL);
rtp_add_address(actx->pinfo, &src_addr, ipv4_port, 0, "H245", actx->pinfo->fd->num, NULL);
}
if(rtcp_ipv4_address!=0 && rtcp_ipv4_port!=0 && rtcp_handle){
address src_addr;
@ -650,7 +650,7 @@ OpenLogicalChannel
src_addr.len=4;
src_addr.data=(guint8*)&rtcp_ipv4_address;
rtcp_add_address(pinfo, &src_addr, rtcp_ipv4_port, 0, "H245", pinfo->fd->num);
rtcp_add_address(actx->pinfo, &src_addr, rtcp_ipv4_port, 0, "H245", actx->pinfo->fd->num);
}
}
}
@ -700,7 +700,7 @@ NonStandardIdentifier/h221NonStandard/manufacturerCode VAL_PTR = &manufacturerC
%(DEFAULT_BODY)s
if (next_tvb && tvb_length(next_tvb)) {
call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, pinfo, tree);
call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, %(ACTX)s->pinfo, tree);
}
#.END

View File

@ -44,17 +44,16 @@
#include <string.h>
#include <epan/prefs.h>
#include "tap.h"
#include "packet-h245.h"
#include "packet-tpkt.h"
#include "packet-per.h"
#include <epan/t35.h>
#include <epan/emem.h>
#include <epan/oid_resolv.h>
#include "tap.h"
#include "packet-tpkt.h"
#include "packet-per.h"
#include "packet-h245.h"
#include "packet-rtp.h"
#include "packet-rtcp.h"
#include "packet-t38.h"
#include "packet-ber.h"
#include <epan/emem.h>
#define PNAME "MULTIMEDIA-SYSTEM-CONTROL"
#define PSNAME "H.245"
@ -304,6 +303,7 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
proto_item *it;
proto_tree *tr;
guint32 offset=0;
asn_ctx_t asn_ctx;
if (check_col(pinfo->cinfo, COL_PROTOCOL)){
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
@ -317,8 +317,8 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=ep_alloc(sizeof(h245_packet_info));
init_h245_packet_info(h245_pi);
per_aligment_type_callback(TRUE);
offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, pinfo ,tr, hf_h245_pdu_type);
asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, &asn_ctx, tr, hf_h245_pdu_type);
tap_queue_packet(h245dg_tap, pinfo, h245_pi);
offset = (offset+0x07) & 0xfffffff8;
CLEANUP_CALL_AND_POP;
@ -384,21 +384,21 @@ void proto_register_h245(void) {
h245_tap = register_tap("h245");
h245dg_tap = register_tap("h245dg");
register_ber_oid_name("0.0.8.239.1.1","itu-t(0) recommendation(0) h(8) h239(239) generic-capabilities(1) h239ControlCapability(1)");
register_ber_oid_name("0.0.8.239.1.2","itu-t(0) recommendation(0) h(8) h239(239) generic-capabilities(1) h239ExtendedVideoCapability(2)");
register_ber_oid_name("0.0.8.239.2","itu-t(0) recommendation(0) h(8) h239(239) generic-message(2)");
register_ber_oid_name("0.0.8.245.0.3","itu-t(0) recommendation(0) h(8) h245(245) version(0) 3");
register_ber_oid_name("0.0.8.245.0.4","itu-t(0) recommendation(0) h(8) h245(245) version(0) 4");
register_ber_oid_name("0.0.8.245.0.5","itu-t(0) recommendation(0) h(8) h245(245) version(0) 5");
register_ber_oid_name("0.0.8.245.0.6","itu-t(0) recommendation(0) h(8) h245(245) version(0) 6");
register_ber_oid_name("0.0.8.245.0.7","itu-t(0) recommendation(0) h(8) h245(245) version(0) 7");
register_ber_oid_name("0.0.8.245.0.8","itu-t(0) recommendation(0) h(8) h245(245) version(0) 8");
register_ber_oid_name("0.0.8.245.0.10","itu-t(0) recommendation(0) h(8) h245(245) version(0) 10");
register_ber_oid_name("0.0.8.245.1.0.0","itu-t(0) recommendation(0) h(8) h245(245) generic-capabilities(1) video (0) ISO/IEC 14496-2 (0)= MPEG-4 video");
register_ber_oid_name("0.0.8.245.1.1.0","itu-t(0) recommendation(0) h(8) h245(245) generic-capabilities(1) audio (1) ISO/IEC 14496-3 (0)= MPEG-4 audio");
register_ber_oid_name("0.0.8.245.1.1.1","itu-t(0) recommendation(0) h(8) h245(245) generic-capabilities(1) audio(1) amr(1)");
add_oid_str_name("0.0.8.239.1.1","itu-t(0) recommendation(0) h(8) h239(239) generic-capabilities(1) h239ControlCapability(1)");
add_oid_str_name("0.0.8.239.1.2","itu-t(0) recommendation(0) h(8) h239(239) generic-capabilities(1) h239ExtendedVideoCapability(2)");
add_oid_str_name("0.0.8.239.2","itu-t(0) recommendation(0) h(8) h239(239) generic-message(2)");
add_oid_str_name("0.0.8.245.0.3","itu-t(0) recommendation(0) h(8) h245(245) version(0) 3");
add_oid_str_name("0.0.8.245.0.4","itu-t(0) recommendation(0) h(8) h245(245) version(0) 4");
add_oid_str_name("0.0.8.245.0.5","itu-t(0) recommendation(0) h(8) h245(245) version(0) 5");
add_oid_str_name("0.0.8.245.0.6","itu-t(0) recommendation(0) h(8) h245(245) version(0) 6");
add_oid_str_name("0.0.8.245.0.7","itu-t(0) recommendation(0) h(8) h245(245) version(0) 7");
add_oid_str_name("0.0.8.245.0.8","itu-t(0) recommendation(0) h(8) h245(245) version(0) 8");
add_oid_str_name("0.0.8.245.0.10","itu-t(0) recommendation(0) h(8) h245(245) version(0) 10");
add_oid_str_name("0.0.8.245.1.0.0","itu-t(0) recommendation(0) h(8) h245(245) generic-capabilities(1) video (0) ISO/IEC 14496-2 (0)= MPEG-4 video");
add_oid_str_name("0.0.8.245.1.1.0","itu-t(0) recommendation(0) h(8) h245(245) generic-capabilities(1) audio (1) ISO/IEC 14496-3 (0)= MPEG-4 audio");
add_oid_str_name("0.0.8.245.1.1.1","itu-t(0) recommendation(0) h(8) h245(245) generic-capabilities(1) audio(1) amr(1)");
register_ber_oid_name("0.0.8.241.0.0.1","itu-t(0) recommendation(0) h(8) h241(241) specificVideoCodecCapabilities(0) h264(0) generic-capabilities(1)");
add_oid_str_name("0.0.8.241.0.0.1","itu-t(0) recommendation(0) h(8) h241(241) specificVideoCodecCapabilities(0) h264(0) generic-capabilities(1)");
}

View File

@ -113,6 +113,8 @@ struct _h223_mux_element {
};
#include <epan/packet_info.h>
#include "packet-per.h"
typedef void (*h223_set_mc_handle_t) ( packet_info* pinfo, guint8 mc, h223_mux_element* me );
extern void h245_set_h223_set_mc_handle( h223_set_mc_handle_t handle );

View File

@ -298,8 +298,8 @@ static const value_string localOpcode_vals[] = {
{ 0, NULL }
};
static int dissect_h4501_argument(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
static int dissect_ros_ROSxxx(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_ind _U_);
static int dissect_h4501_argument(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree);
static int dissect_ros_ROSxxx(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_ind _U_);
@ -317,9 +317,9 @@ static const value_string InvokeProblem_vals[] = {
{ 0, NULL }
};
static int
dissect_h4501_InvokeProblem(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_InvokeProblem(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_h4501_InvokeProblem, 0, 7, NULL, NULL, FALSE);
offset=dissect_per_constrained_integer(tvb, offset, actx, tree, hf_h4501_InvokeProblem, 0, 7, NULL, FALSE);
return offset;
}
@ -331,9 +331,9 @@ static const value_string ReturnResultProblem_vals[] = {
{ 0, NULL }
};
static int
dissect_h4501_ReturnResultProblem(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_ReturnResultProblem(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_h4501_ReturnResultProblem, 0, 2, NULL, NULL, FALSE);
offset=dissect_per_constrained_integer(tvb, offset, actx, tree, hf_h4501_ReturnResultProblem, 0, 2, NULL, FALSE);
return offset;
}
@ -347,9 +347,9 @@ static const value_string ReturnErrorProblem_vals[] = {
{ 0, NULL }
};
static int
dissect_h4501_ReturnErrorProblem(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_ReturnErrorProblem(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_h4501_ReturnErrorProblem, 0, 4, NULL, NULL, FALSE);
offset=dissect_per_constrained_integer(tvb, offset, actx, tree, hf_h4501_ReturnErrorProblem, 0, 4, NULL, FALSE);
return offset;
}
@ -360,56 +360,56 @@ static const value_string GeneralProblem_vals[] = {
{ 0, NULL }
};
static int
dissect_h4501_GeneralProblem(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_GeneralProblem(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_h4501_GeneralProblem, 0, 2, NULL, NULL, FALSE);
offset=dissect_per_constrained_integer(tvb, offset, actx, tree, hf_h4501_GeneralProblem, 0, 2, NULL, FALSE);
return offset;
}
static int
dissect_h4501_ReturnResult_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_ReturnResult_result(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
tvbuff_t *result_tvb = NULL;
offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, NO_BOUND, NO_BOUND, &result_tvb);
offset=dissect_per_octet_string(tvb, offset, actx, tree, -1, NO_BOUND, NO_BOUND, &result_tvb);
if(tvb_length(result_tvb)){
switch (localOpcode) {
case CallTransferIdentify:
dissect_h450_CTIdentifyRes(result_tvb, 0, pinfo, tree, hf_h4502_CTIdentifyRes);
dissect_h450_CTIdentifyRes(result_tvb, 0, actx, tree, hf_h4502_CTIdentifyRes);
break;
case CallTransferInitiate:
case CallTransferSetup:
dissect_h450_DummyRes(result_tvb, 0, pinfo , tree, hf_h4502_DummyRes);
dissect_h450_DummyRes(result_tvb, 0, actx , tree, hf_h4502_DummyRes);
break;
case ActivateDiversionQ:
dissect_ActivateDiversionQRes_PDU(result_tvb, pinfo, tree);
dissect_ActivateDiversionQRes_PDU(result_tvb, actx->pinfo, tree);
break;
case DeactivateDiversionQ:
dissect_DeactivateDiversionQRes_PDU(result_tvb, pinfo, tree);
dissect_DeactivateDiversionQRes_PDU(result_tvb, actx->pinfo, tree);
break;
case InterrogateDiversionQ:
dissect_InterrogateDiversionQRes_PDU(result_tvb, pinfo, tree);
dissect_InterrogateDiversionQRes_PDU(result_tvb, actx->pinfo, tree);
break;
case CheckRestriction:
dissect_CheckRestrictionRes_PDU(result_tvb, pinfo, tree);
dissect_CheckRestrictionRes_PDU(result_tvb, actx->pinfo, tree);
break;
case CallRerouting:
dissect_CallReroutingRes_PDU(result_tvb, pinfo, tree);
dissect_CallReroutingRes_PDU(result_tvb, actx->pinfo, tree);
break;
case RemoteRetrieve:
dissect_h450_RemoteRetrieveRes(result_tvb, 0, pinfo , tree, hf_h4504_RemoteRetrieveRes);
dissect_h450_RemoteRetrieveRes(result_tvb, 0, actx , tree, hf_h4504_RemoteRetrieveRes);
break;
case MWIActivate:
dissect_h450_MwiDummyRes(result_tvb, 0, pinfo , tree, hf_h4507_MwiDummyRes);
dissect_h450_MwiDummyRes(result_tvb, 0, actx , tree, hf_h4507_MwiDummyRes);
break;
case MWIDeactivate:
dissect_h450_MwiDummyRes(result_tvb, 0, pinfo , tree, hf_h4507_MwiDummyRes);
dissect_h450_MwiDummyRes(result_tvb, 0, actx , tree, hf_h4507_MwiDummyRes);
break;
case MWIInterrogate:
dissect_h450_MWIInterrogateRes(result_tvb, 0, pinfo , tree, hf_h4507_MWIInterrogateRes);
dissect_h450_MWIInterrogateRes(result_tvb, 0, actx , tree, hf_h4507_MWIInterrogateRes);
break;
default:
@ -422,18 +422,18 @@ PER_NOT_DECODED_YET("Unrecognized H.450.x return result");
}
static int
dissect_h4501_localOpcode(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_localOpcode(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_integer(tvb, offset, pinfo, tree, hf_h4501_localOpcode, &localOpcode, NULL);
offset=dissect_per_integer(tvb, offset, actx, tree, hf_h4501_localOpcode, &localOpcode);
is_globalcode = FALSE;
return offset;
}
static int
dissect_h4501_globalCode(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_globalCode(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_object_identifier_str(tvb, offset, pinfo, tree, hf_h4501_globalCode, &globalcode_oid_str);
offset=dissect_per_object_identifier_str(tvb, offset, actx, tree, hf_h4501_globalCode, &globalcode_oid_str);
is_globalcode = TRUE;
return offset;
}
@ -452,9 +452,9 @@ static const per_choice_t opcode_choice[] = {
{ 0, NULL, 0, NULL }
};
static int
dissect_h4501_opcode(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_opcode(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_choice(tvb, offset, pinfo, tree, hf_h4501_opcode, ett_h4501_opcode, opcode_choice, NULL);
offset=dissect_per_choice(tvb, offset, actx, tree, hf_h4501_opcode, ett_h4501_opcode, opcode_choice, NULL);
return offset;
}
@ -466,17 +466,17 @@ static const per_sequence_t result_sequence[] = {
{ NULL, 0, 0, NULL }
};
static int
dissect_h4501_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_result(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo, tree, hf_h4501_result, ett_h4501_result, result_sequence);
offset=dissect_per_sequence(tvb, offset, actx, tree, hf_h4501_result, ett_h4501_result, result_sequence);
return offset;
}
static int
dissect_h4501_parameter(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_parameter(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
/* TODO - decode return error parameter based on localErrorCode */
offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_parameter, NO_BOUND, NO_BOUND, NULL);
offset=dissect_per_octet_string(tvb, offset, actx, tree, hf_h4501_parameter, NO_BOUND, NO_BOUND, NULL);
return offset;
}
static const value_string localErrorCode_vals[] = {
@ -528,9 +528,9 @@ static const value_string localErrorCode_vals[] = {
{ 0, NULL }
};
static int
dissect_h4501_localErrorCode(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_localErrorCode(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_integer(tvb, offset, pinfo, tree, hf_h4501_localErrorCode, &localErrorCode, NULL);
offset=dissect_per_integer(tvb, offset, actx, tree, hf_h4501_localErrorCode, &localErrorCode);
return offset;
}
@ -548,9 +548,9 @@ static const per_choice_t errorCode_choice[] = {
{ 0, NULL, 0, NULL }
};
static int
dissect_h4501_errorCode(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_errorCode(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_choice(tvb, offset, pinfo, tree, hf_h4501_errorCode, ett_h4501_errorCode, errorCode_choice, NULL);
offset=dissect_per_choice(tvb, offset, actx, tree, hf_h4501_errorCode, ett_h4501_errorCode, errorCode_choice, NULL);
return offset;
}
@ -573,23 +573,23 @@ static const per_choice_t problem_choice[] = {
{ 0, NULL, 0, NULL }
};
static int
dissect_h4501_problem(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_problem(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_choice(tvb, offset, pinfo, tree, hf_h4501_problem, ett_h4501_problem, problem_choice, NULL);
offset=dissect_per_choice(tvb, offset, actx, tree, hf_h4501_problem, ett_h4501_problem, problem_choice, NULL);
return offset;
}
static int
dissect_h4501_constrained_invokeId(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_constrained_invokeId(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_h4501_constrained_invokeId, 0, 65535, NULL, NULL, FALSE);
offset=dissect_per_constrained_integer(tvb, offset, actx, tree, hf_h4501_constrained_invokeId, 0, 65535, NULL, FALSE);
return offset;
}
static int
dissect_h4501_invokeId(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_invokeId(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_integer(tvb, offset, pinfo, tree, hf_h4501_invokeId, NULL, NULL);
offset=dissect_per_integer(tvb, offset, actx, tree, hf_h4501_invokeId, NULL);
return offset;
}
@ -601,9 +601,9 @@ static const per_sequence_t Reject_sequence[] = {
{ NULL, 0, 0, NULL }
};
static int
dissect_h4501_Reject(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_Reject(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo, tree, hf_h4501_Reject, ett_h4501_Reject, Reject_sequence);
offset=dissect_per_sequence(tvb, offset, actx, tree, hf_h4501_Reject, ett_h4501_Reject, Reject_sequence);
return offset;
}
@ -617,9 +617,9 @@ static const per_sequence_t ReturnError_sequence[] = {
{ NULL, 0, 0, NULL }
};
static int
dissect_h4501_ReturnError(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_ReturnError(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo, tree, hf_h4501_ReturnError, ett_h4501_ReturnError, ReturnError_sequence);
offset=dissect_per_sequence(tvb, offset, actx, tree, hf_h4501_ReturnError, ett_h4501_ReturnError, ReturnError_sequence);
return offset;
}
@ -631,9 +631,9 @@ static const per_sequence_t ReturnResult_sequence[] = {
{ NULL, 0, 0, NULL }
};
static int
dissect_h4501_ReturnResult(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_ReturnResult(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo, tree, hf_h4501_ReturnResult, ett_h4501_ReturnResult, ReturnResult_sequence);
offset=dissect_per_sequence(tvb, offset, actx, tree, hf_h4501_ReturnResult, ett_h4501_ReturnResult, ReturnResult_sequence);
return offset;
}
@ -649,9 +649,9 @@ static const per_sequence_t Invoke_sequence[] = {
{ NULL, 0, 0, NULL }
};
static int
dissect_h4501_Invoke(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_Invoke(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo, tree, hf_h4501_Invoke, ett_h4501_Invoke, Invoke_sequence);
offset=dissect_per_sequence(tvb, offset, actx, tree, hf_h4501_Invoke, ett_h4501_Invoke, Invoke_sequence);
return offset;
}
@ -674,14 +674,14 @@ static const per_choice_t ROS_choice[] = {
{ 0, NULL, 0, NULL }
};
static int
dissect_h4501_ROS(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_ROS(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_choice(tvb, offset, pinfo, tree, hf_h4501_ROS, ett_h4501_ROS, ROS_choice, NULL);
offset=dissect_per_choice(tvb, offset, actx, tree, hf_h4501_ROS, ett_h4501_ROS, ROS_choice, NULL);
return offset;
}
static int
dissect_h4501_argument(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_h4501_argument(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
tvbuff_t *argument_tvb = NULL;
@ -689,84 +689,84 @@ dissect_h4501_argument(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
/* TODO call oid dissector
* call_ber_oid_callback isn't realy apropriate ?
*/
offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_h4501_globalargument, NO_BOUND, NO_BOUND, NULL);
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_h4501_globalargument, NO_BOUND, NO_BOUND, NULL);
is_globalcode = FALSE;
return offset;
}
offset=dissect_per_octet_string(tvb, offset, pinfo, tree, -1, NO_BOUND, NO_BOUND, &argument_tvb);
offset=dissect_per_octet_string(tvb, offset, actx, tree, -1, NO_BOUND, NO_BOUND, &argument_tvb);
if(tvb_length(argument_tvb)){
switch (localOpcode) {
/* h450.2 */
case CallTransferIdentify: /* Localvalue 7 */
dissect_CallTransferIdentify_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferIdentify_PDU(argument_tvb, actx->pinfo, tree);
break;
case CallTransferAbandon: /* Localvalue 8 */
dissect_CallTransferAbandon_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferAbandon_PDU(argument_tvb, actx->pinfo, tree);
break;
case CallTransferInitiate: /* Localvalue 9 */
dissect_CallTransferInitiate_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferInitiate_PDU(argument_tvb, actx->pinfo, tree);
break;
case CallTransferSetup: /* Localvalue 10 */
dissect_CallTransferSetup_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferSetup_PDU(argument_tvb, actx->pinfo, tree);
break;
case CallTransferUpdate: /* Localvalue 13 */
dissect_CallTransferUpdate_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferUpdate_PDU(argument_tvb, actx->pinfo, tree);
break;
case SubaddressTransfer: /* Localvalue 14 */
dissect_SubaddressTransfer_PDU(argument_tvb, pinfo, tree);
dissect_SubaddressTransfer_PDU(argument_tvb, actx->pinfo, tree);
break;
case CallTransferComplete: /* Localvalue 12 */
dissect_CallTransferComplete_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferComplete_PDU(argument_tvb, actx->pinfo, tree);
break;
case CallTransferActive: /* Localvalue 11 */
dissect_CallTransferActive_PDU(argument_tvb, pinfo, tree);
dissect_CallTransferActive_PDU(argument_tvb, actx->pinfo, tree);
break;
/* h450.3*/
case ActivateDiversionQ: /* Localvalue 15 */
dissect_ActivateDiversionQArg_PDU(argument_tvb, pinfo, tree);
dissect_ActivateDiversionQArg_PDU(argument_tvb, actx->pinfo, tree);
break;
case DeactivateDiversionQ: /* Localvalue 16 */
dissect_h450_DeactivateDiversionQArg(argument_tvb, 0, pinfo , tree, hf_h4503DeactivateDiversionQArg);
dissect_h450_DeactivateDiversionQArg(argument_tvb, 0, actx , tree, hf_h4503DeactivateDiversionQArg);
break;
case InterrogateDiversionQ: /* Localvalue 17 */
dissect_h450_InterrogateDiversionQ(argument_tvb, 0, pinfo , tree, hf_h4503InterrogateDiversionQ);
dissect_h450_InterrogateDiversionQ(argument_tvb, 0, actx , tree, hf_h4503InterrogateDiversionQ);
break;
case CheckRestriction: /* Localvalue 18 */
dissect_h450_CheckRestrictionArg(argument_tvb, 0, pinfo , tree, hf_h4503CheckRestrictionArg);
dissect_h450_CheckRestrictionArg(argument_tvb, 0, actx , tree, hf_h4503CheckRestrictionArg);
break;
case CallRerouting: /* Localvalue 19 */
dissect_h450_CallReroutingArg(argument_tvb, 0, pinfo , tree, hf_h4503CallReroutingArg);
dissect_h450_CallReroutingArg(argument_tvb, 0, actx , tree, hf_h4503CallReroutingArg);
break;
case DivertingLegInformation1: /* Localvalue 20 */
dissect_h450_DivertingLegInformation1Arg(argument_tvb, 0, pinfo , tree, hf_h4503DivertingLegInformation1Arg);
dissect_h450_DivertingLegInformation1Arg(argument_tvb, 0, actx , tree, hf_h4503DivertingLegInformation1Arg);
break;
case DivertingLegInformation2: /* Localvalue 21 */
dissect_h450_DivertingLegInformation2Arg(argument_tvb, 0, pinfo , tree, hf_h4503DivertingLegInformation2Arg);
dissect_h450_DivertingLegInformation2Arg(argument_tvb, 0, actx , tree, hf_h4503DivertingLegInformation2Arg);
break;
case DivertingLegInformation3: /* Localvalue 22 */
dissect_h450_DivertingLegInformation3Arg(argument_tvb, 0, pinfo , tree, hf_h4503DivertingLegInformation3Arg);
dissect_h450_DivertingLegInformation3Arg(argument_tvb, 0, actx , tree, hf_h4503DivertingLegInformation3Arg);
break;
case DivertingLegInformation4: /* Localvalue 100 */
dissect_h450_DivertingLegInformation4Arg(argument_tvb, 0, pinfo , tree, hf_h4503DivertingLegInformation4Arg);
dissect_h450_DivertingLegInformation4Arg(argument_tvb, 0, actx , tree, hf_h4503DivertingLegInformation4Arg);
break;
case CfnrDivertedLegFailed: /* Localvalue 23 */
dissect_h450_CfnrDivertedLegFailedArg(argument_tvb, 0, pinfo , tree, hf_h4503CfnrDivertedLegFailedArg);
dissect_h450_CfnrDivertedLegFailedArg(argument_tvb, 0, actx , tree, hf_h4503CfnrDivertedLegFailedArg);
break;
/* H.450.4 Call Hold */
case HoldNotific: /* Localvalue 101 */
dissect_h450_HoldNotificArg(argument_tvb, 0, pinfo , tree, hf_h4504_HoldNotificArg);
dissect_h450_HoldNotificArg(argument_tvb, 0, actx , tree, hf_h4504_HoldNotificArg);
break;
case RetrieveNotific: /* Localvalue 102 */
dissect_h450_RetrieveNotificArg(argument_tvb, 0, pinfo , tree, hf_h4504_RetrieveNotificArg);
dissect_h450_RetrieveNotificArg(argument_tvb, 0, actx , tree, hf_h4504_RetrieveNotificArg);
break;
case RemoteHold: /* Localvalue 103 */
dissect_h450_RemoteHoldArg(argument_tvb, 0, pinfo , tree, hf_h4504_RemoteHoldArg);
dissect_h450_RemoteHoldArg(argument_tvb, 0, actx , tree, hf_h4504_RemoteHoldArg);
break;
case RemoteRetrieve: /* Localvalue 104 */
dissect_h450_RemoteRetrieveArg(argument_tvb, 0, pinfo , tree, hf_h4504_RemoteRetrieveArg);
dissect_h450_RemoteRetrieveArg(argument_tvb, 0, actx , tree, hf_h4504_RemoteRetrieveArg);
break;
/* H.450.5 Call Park and Pickup constants */
@ -787,27 +787,27 @@ PER_NOT_DECODED_YET("Unrecognized H.450.x operation");
/* H.450.7 Message Waiting Indication */
case MWIActivate: /* Localvalue 80 */
dissect_h450_MWIActivateArg(argument_tvb, 0, pinfo , tree, hf_h4507_MWIActivateArg);
dissect_h450_MWIActivateArg(argument_tvb, 0, actx , tree, hf_h4507_MWIActivateArg);
break;
case MWIDeactivate: /* Localvalue 81 */
dissect_h450_MWIDeactivateArg(argument_tvb, 0, pinfo , tree, hf_h4507_MWIDeactivateArg);
dissect_h450_MWIDeactivateArg(argument_tvb, 0, actx , tree, hf_h4507_MWIDeactivateArg);
break;
case MWIInterrogate: /* Localvalue 82 */
dissect_h450_MWIInterrogateArg(argument_tvb, 0, pinfo , tree, hf_h4507_MWIInterrogateArg);
dissect_h450_MWIInterrogateArg(argument_tvb, 0, actx , tree, hf_h4507_MWIInterrogateArg);
break;
/* H.450.8 Name Identification */
case NIcallingName: /* Localvalue 0 */
dissect_h450_NameArg(argument_tvb, 0, pinfo , tree, hf_h4508_CallingNameArg);
dissect_h450_NameArg(argument_tvb, 0, actx , tree, hf_h4508_CallingNameArg);
break;
case NIalertingName: /* Localvalue 1 */
dissect_h450_NameArg(argument_tvb, 0, pinfo , tree, hf_h4508_AlertingNameArg);
dissect_h450_NameArg(argument_tvb, 0, actx , tree, hf_h4508_AlertingNameArg);
break;
case NIconnectedName: /* Localvalue 2 */
dissect_h450_NameArg(argument_tvb, 0, pinfo , tree, hf_h4508_ConnectedNameArg);
dissect_h450_NameArg(argument_tvb, 0, actx , tree, hf_h4508_ConnectedNameArg);
break;
case NIbusyName: /* Localvalue 3 */
dissect_h450_NameArg(argument_tvb, 0, pinfo , tree, hf_h4508_BusyNameArg);
dissect_h450_NameArg(argument_tvb, 0, actx , tree, hf_h4508_BusyNameArg);
break;
/* H.450.9 Call Completion constants */
@ -836,10 +836,10 @@ PER_NOT_DECODED_YET("Unrecognized H.450.x operation");
break;
/* H.450.12 Common Information Operations constants */
case CmnRequest: /* Localvalue 84 */
dissect_h450_CmnRequestArg(argument_tvb, 0, pinfo , tree, hf_h45012_CmnRequest);
dissect_h450_CmnRequestArg(argument_tvb, 0, actx , tree, hf_h45012_CmnRequest);
break;
case CmnInform: /* Localvalue 85 */
dissect_h450_CmnArg(argument_tvb, 0, pinfo , tree, hf_h45012_CmnInform);
dissect_h450_CmnArg(argument_tvb, 0, actx , tree, hf_h45012_CmnInform);
break;
/* TODO - decode other H.450.x invoke arguments here */
@ -851,9 +851,9 @@ PER_NOT_DECODED_YET("Unrecognized H.450.x operation");
return offset;
}
static int
dissect_ros_ROSxxx(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_ind _U_){
dissect_ros_ROSxxx(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_ind _U_){
offset = dissect_h4501_ROS(tvb, offset, pinfo, tree);
offset = dissect_h4501_ROS(tvb, offset, actx, tree);
return offset;
}
@ -863,11 +863,13 @@ dissect_h4501(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree)
proto_item *it;
proto_tree *tr;
guint32 offset=0;
asn_ctx_t asn_ctx;
it=proto_tree_add_protocol_format(tree, proto_h4501, tvb, 0, -1, "H.450.1");
tr=proto_item_add_subtree(it, ett_h4501);
dissect_h450_H4501SupplementaryService(tvb, offset, pinfo, tr, hf_h4501);
asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
dissect_h450_H4501SupplementaryService(tvb, offset, &asn_ctx, tr, hf_h4501);
}
/*--- proto_register_h450 -------------------------------------------*/

View File

@ -1,7 +1,7 @@
# nbap.cnf
# nbap conformation file
# Copyright 2005 Anders Broman
# $Id:$
# $Id$
#.PDU
NBAP-PDU
@ -20,8 +20,8 @@ CellSyncBurstTiming/initialPhase initialPhase_0_1048575
VAL_PTR = &ProcedureCode
#.FN_FTR ProcedureCode
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
val_to_str(ProcedureCode, nbap_ProcedureCode_vals,
"unknown message"));
#.FN_PARS ProtocolIE-ID
@ -36,39 +36,39 @@ VAL_PTR = &ddMode
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_nbap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_nbap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
#.FN_BODY InitiatingMessageValue
offset = dissect_nbap_InitiatingMessageValueValue(tvb, offset, pinfo, tree);
offset = dissect_nbap_InitiatingMessageValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY SuccessfulOutcomeValue
offset = dissect_nbap_SuccessfulOutcomeValueValue(tvb, offset, pinfo, tree);
offset = dissect_nbap_SuccessfulOutcomeValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY OutcomeValue
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_nbap_pdu_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_nbap_pdu_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
#.FN_BODY UnsuccessfulOutcomeValue
offset = dissect_nbap_UnsuccessfulOutcomeValueValue(tvb, offset, pinfo, tree);
offset = dissect_nbap_UnsuccessfulOutcomeValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY ProtocolIEValue
offset = dissect_nbap_ProtocolIEValueValue(tvb, offset, pinfo, tree);
offset = dissect_nbap_ProtocolIEValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY FirstValue
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_nbap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_nbap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
@ -76,7 +76,7 @@ VAL_PTR = &ddMode
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_nbap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_nbap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
@ -85,6 +85,6 @@ VAL_PTR = &ddMode
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_nbap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_nbap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -30,8 +30,8 @@ VAL_PTR = &type_of_message
VAL_PTR = &ProcedureCode
#.FN_FTR ProcedureCode
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
val_to_str(ProcedureCode, ranap_ProcedureCode_vals,
"unknown message"));
#.FN_PARS ProtocolIE-ID
@ -44,11 +44,11 @@ VAL_PTR = &ProtocolIE_ID
#.FN_BODY Value
offset = dissect_ranap_messages(tvb, offset, pinfo, tree);
offset = dissect_ranap_messages(tvb, offset, %(ACTX)s, tree);
#.FN_BODY RANAP_PROTOCOL_IES_Value
offset = dissect_ranap_ies(tvb, offset, pinfo, tree);
offset = dissect_ranap_ies(tvb, offset, %(ACTX)s, tree);
#.FN_BODY NAS-PDU VAL_PTR = &nas_pdu_tvb
@ -57,17 +57,17 @@ tvbuff_t *nas_pdu_tvb=NULL;
%(DEFAULT_BODY)s
if (nas_pdu_tvb)
dissector_try_port(nas_pdu_dissector_table, 0x1, nas_pdu_tvb, pinfo, top_tree);
dissector_try_port(nas_pdu_dissector_table, 0x1, nas_pdu_tvb, %(ACTX)s->pinfo, top_tree);
#.FN_BODY SecondValue
offset = dissect_ranap_SecondValue_ies(tvb, offset, pinfo, tree);
offset = dissect_ranap_SecondValue_ies(tvb, offset, %(ACTX)s, tree);
#.FN_BODY FirstValue
offset = dissect_ranap_FirstValue_ies(tvb, offset, pinfo, tree);
offset = dissect_ranap_FirstValue_ies(tvb, offset, %(ACTX)s, tree);
#.FN_BODY Extension
offset = dissect_ranap_ies(tvb, offset, pinfo, tree);
offset = dissect_ranap_ies(tvb, offset, %(ACTX)s, tree);
#.FN_BODY RANAP_PRIVATE_IES_Value
/* FIX ME */

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,8 @@ RNSAP-PDU
VAL_PTR = &ProcedureCode
#.FN_FTR ProcedureCode
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
val_to_str(ProcedureCode, rnsap_ProcedureCode_vals,
"unknown message"));
#.FN_PARS ProtocolIE-ID
@ -29,37 +29,37 @@ VAL_PTR = &ddMode
#.FN_BODY Extension
offset = dissect_rnsap_ProtocolIEValueValue(tvb, offset, pinfo, tree);
offset = dissect_rnsap_ProtocolIEValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY InitiatingMessageValue
offset = dissect_rnsap_InitiatingMessageValueValue(tvb, offset, pinfo, tree);
offset = dissect_rnsap_InitiatingMessageValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY SuccessfulOutcomeValue
offset = dissect_rnsap_SuccessfulOutcomeValueValue(tvb, offset, pinfo, tree);
offset = dissect_rnsap_SuccessfulOutcomeValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY OutcomeValue
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_rnsap_pdu_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_rnsap_pdu_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
#.FN_BODY UnsuccessfulOutcomeValue
offset = dissect_rnsap_UnsuccessfulOutcomeValueValue(tvb, offset, pinfo, tree);
offset = dissect_rnsap_UnsuccessfulOutcomeValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY ProtocolIEValue
offset = dissect_rnsap_ProtocolIEValueValue(tvb, offset, pinfo, tree);
offset = dissect_rnsap_ProtocolIEValueValue(tvb, offset, %(ACTX)s, tree);
#.FN_BODY FirstValue
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_rnsap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_rnsap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
@ -67,7 +67,7 @@ VAL_PTR = &ddMode
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_rnsap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_rnsap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)
@ -76,7 +76,7 @@ VAL_PTR = &ddMode
/* FIX ME */
guint length;
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_rnsap_IE_length, &length);
offset = dissect_per_length_determinant(tvb, offset, %(ACTX)s, tree, hf_rnsap_IE_length, &length);
offset = offset + length;
BYTE_ALIGN_OFFSET(offset)

View File

@ -10,10 +10,10 @@ PDU
proto_tree_add_item(tree, proto_rrlp, tvb, 0, -1, FALSE);
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
if (check_col(%(ACTX)s->pinfo->cinfo, COL_PROTOCOL))
col_set_str(%(ACTX)s->pinfo->cinfo, COL_PROTOCOL, PSNAME);
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO))
col_clear(%(ACTX)s->pinfo->cinfo, COL_INFO);
%(DEFAULT_BODY)s
#.END
@ -26,4 +26,4 @@ tvbuff_t *parameter_tvb = NULL;
%(DEFAULT_BODY)s
if(parameter_tvb)
dissect_geographical_description(parameter_tvb, pinfo, tree);
dissect_geographical_description(parameter_tvb, %(ACTX)s->pinfo, tree);

View File

@ -10,10 +10,10 @@ ULP-PDU
proto_tree_add_item(tree, proto_ulp, tvb, 0, -1, FALSE);
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
if (check_col(%(ACTX)s->pinfo->cinfo, COL_PROTOCOL))
col_set_str(%(ACTX)s->pinfo->cinfo, COL_PROTOCOL, PSNAME);
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO))
col_clear(%(ACTX)s->pinfo->cinfo, COL_INFO);
%(DEFAULT_BODY)s
@ -23,9 +23,9 @@ guint32 UlpMessage;
%(DEFAULT_BODY)s
if (check_col(pinfo->cinfo, COL_INFO))
if (check_col(%(ACTX)s->pinfo->cinfo, COL_INFO))
{
col_append_fstr(pinfo->cinfo, COL_INFO, "%%s ", val_to_str(UlpMessage,ulp_UlpMessage_vals,"Unknown"));
col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "%%s ", val_to_str(UlpMessage,ulp_UlpMessage_vals,"Unknown"));
}
#.END
@ -35,6 +35,6 @@ guint32 UlpMessage;
%(DEFAULT_BODY)s
if (rrlp_tvb){
call_dissector(rrlp_handle, rrlp_tvb, pinfo, tree);
call_dissector(rrlp_handle, rrlp_tvb, %(ACTX)s->pinfo, tree);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-h225.h */
/* ../../tools/asn2eth.py -e -p h225 -c h225.cnf -s packet-h225-template h225.asn */
/* ../../tools/asn2wrs.py -e -p h225 -c h225.cnf -s packet-h225-template h225.asn */
/* Input file: packet-h225-template.h */
@ -81,9 +81,10 @@ typedef struct _h225_packet_info {
/*
* the following allows TAP code access to the messages
* without having to duplicate it. With MSVC and a
* libwireshark.dll, we need a special declaration.
* libethereal.dll, we need a special declaration.
*/
#include "packet-per.h"
/*--- Included file: packet-h225-exp.h ---*/
@ -106,17 +107,17 @@ ETH_VAR_IMPORT const value_string LocationRejectReason_vals[];
ETH_VAR_IMPORT const value_string DisengageReason_vals[];
ETH_VAR_IMPORT const value_string DisengageRejectReason_vals[];
ETH_VAR_IMPORT const value_string InfoRequestNakReason_vals[];
int dissect_h225_PresentationIndicator(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_ScreeningIndicator(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_NonStandardParameter(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_AliasAddress(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_PartyNumber(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_CallIdentifier(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_GenericData(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_RasMessage(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h225_PresentationIndicator(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_ScreeningIndicator(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_NonStandardParameter(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_AliasAddress(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_PartyNumber(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_CallIdentifier(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_GenericData(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h225_RasMessage(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
/*--- End of included file: packet-h225-exp.h ---*/
#line 81 "packet-h225-template.h"
#line 82 "packet-h225-template.h"
#endif /* PACKET_H225_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-h235.h */
/* ../../tools/asn2eth.py -e -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn H235-SRTP.asn */
/* ../../tools/asn2wrs.py -e -p h235 -c h235.cnf -s packet-h235-template H235-SECURITY-MESSAGES.asn H235-SRTP.asn */
/* Input file: packet-h235-template.h */
@ -39,15 +39,15 @@
#line 1 "packet-h235-exp.h"
extern const value_string h235_AuthenticationMechanism_vals[];
extern const value_string h235_CryptoToken_vals[];
int dissect_h235_TimeStamp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_AuthenticationMechanism(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_ClearToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_SIGNEDxxx(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_ENCRYPTEDxxx(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_HASHEDxxx(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_CryptoToken(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_SrtpCryptoCapability(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_SrtpKeys(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h235_TimeStamp(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_AuthenticationMechanism(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_ClearToken(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_SIGNEDxxx(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_ENCRYPTEDxxx(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_HASHEDxxx(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_CryptoToken(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_SrtpCryptoCapability(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h235_SrtpKeys(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
/*--- End of included file: packet-h235-exp.h ---*/
#line 30 "packet-h235-template.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-h245.h */
/* ../../tools/asn2eth.py -X -e -p h245 -c h245.cnf -s packet-h245-template h245.asn */
/* ../../tools/asn2wrs.py -e -p h245 -c h245.cnf -s packet-h245-template h245.asn */
/* Input file: packet-h245-template.h */
@ -121,6 +121,8 @@ struct _h223_mux_element {
};
#include <epan/packet_info.h>
#include "packet-per.h"
typedef void (*h223_set_mc_handle_t) ( packet_info* pinfo, guint8 mc, h223_mux_element* me );
extern void h245_set_h223_set_mc_handle( h223_set_mc_handle_t handle );
@ -131,12 +133,12 @@ extern void h245_set_h223_add_lc_handle( h223_add_lc_handle_t handle );
/*--- Included file: packet-h245-exp.h ---*/
#line 1 "packet-h245-exp.h"
extern const value_string DataProtocolCapability_vals[];
int dissect_h245_DataProtocolCapability(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h245_T38FaxProfile(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h245_OpenLogicalChannel(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_h245_DataProtocolCapability(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h245_T38FaxProfile(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
int dissect_h245_OpenLogicalChannel(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
/*--- End of included file: packet-h245-exp.h ---*/
#line 123 "packet-h245-template.h"
#line 125 "packet-h245-template.h"
void dissect_h245_OpenLogicalChannelCodec(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, char *codec_str);

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-h450.h */
/* ../../tools/asn2eth.py -X -e -p h450 -c h450.cnf -s packet-h450-template h4501.asn */
/* ../../tools/asn2wrs.py -e -p h450 -c h450.cnf -s packet-h450-template h4501.asn */
/* Input file: packet-h450-template.h */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* ./packet-nbap.h */
/* ../../tools/asn2eth.py -X -e -p nbap -c nbap.cnf -s packet-nbap-template nbap.asn */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-nbap.h */
/* ../../tools/asn2wrs.py -e -p nbap -c nbap.cnf -s packet-nbap-template nbap.asn */
/* Input file: packet-nbap-template.h */

View File

@ -67,7 +67,7 @@ static gint ett_per_sequence_of_item = -1;
/*
#define DEBUG_ENTRY(x) \
printf("#%d %s tvb:0x%08x\n",pinfo->fd->num,x,(int)tvb);
printf("#%d %s tvb:0x%08x\n",actx->pinfo->fd->num,x,(int)tvb);
*/
#define DEBUG_ENTRY(x) \
;
@ -98,15 +98,15 @@ static const true_false_string tfs_optional_field_bit = {
""
};
gboolean is_per_byte_aligned = TRUE;
void
per_aligment_type_callback(gboolean byte_aligned){
is_per_byte_aligned = byte_aligned;
void asn_ctx_init(asn_ctx_t *actx, asn_enc_e encoding, gboolean aligned, packet_info *pinfo) {
actx->encoding = encoding;
actx->aligned = aligned;
actx->pinfo = pinfo;
actx->created_item = NULL;
actx->private_data = NULL;
}
#define BYTE_ALIGN_OFFSET(offset) \
if(offset&0x07){ \
offset=(offset&0xfffffff8)+8; \
@ -114,7 +114,7 @@ per_aligment_type_callback(gboolean byte_aligned){
/* 10.9 General rules for encoding a length determinant -------------------- */
guint32
dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, guint32 *length)
dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index, guint32 *length)
{
guint8 byte;
guint32 len;
@ -156,7 +156,7 @@ dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, packet_info *pinfo
/* 10.6 normally small non-negative whole number */
static guint32
dissect_per_normally_small_nonnegative_whole_number(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 *length)
dissect_per_normally_small_nonnegative_whole_number(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 *length)
{
gboolean small_number;
guint32 len;
@ -167,14 +167,14 @@ DEBUG_ENTRY("dissect_per_normally_small_nonnegative_whole_number");
length=&len;
}
offset=dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_small_number_bit, &small_number, &pi);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
offset=dissect_per_boolean(tvb, offset, actx, tree, hf_per_small_number_bit, &small_number);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
if(!small_number){
int i;
/* 10.6.1 */
*length=0;
for(i=0;i<6;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &small_number, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &small_number);
*length<<=1;
if(small_number){
*length|=1;
@ -192,7 +192,7 @@ DEBUG_ENTRY("dissect_per_normally_small_nonnegative_whole_number");
}
/* 10.6.2 */
offset=dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_index, length);
offset=dissect_per_length_determinant(tvb, offset, actx, tree, hf_index, length);
return offset;
}
@ -208,11 +208,11 @@ DEBUG_ENTRY("dissect_per_normally_small_nonnegative_whole_number");
there is a 1 byte general string encoded
*/
guint32
dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index)
dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index)
{
guint32 length;
offset=dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_GeneralString_length, &length);
offset=dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_GeneralString_length, &length);
proto_tree_add_item(tree, hf_index, tvb, offset>>3, length, FALSE);
@ -223,7 +223,7 @@ dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, pro
/* 17 Encoding the null type */
guint32
dissect_per_null(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
dissect_per_null(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
proto_item *ti_tmp;
ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE);
@ -234,7 +234,7 @@ dissect_per_null(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tr
/* 19 this function dissects a sequence of */
static guint32
dissect_per_sequence_of_helper(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int (*func)(tvbuff_t *, int , packet_info *, proto_tree *), guint32 length)
dissect_per_sequence_of_helper(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int (*func)(tvbuff_t *, int , asn_ctx_t *, proto_tree *), guint32 length)
{
guint32 i;
@ -247,14 +247,14 @@ DEBUG_ENTRY("dissect_per_sequence_of_helper");
litem=proto_tree_add_text(tree, tvb, offset>>3, 0, "Item %d", i);
ltree=proto_item_add_subtree(litem, ett_per_sequence_of_item);
offset=(*func)(tvb, offset, pinfo, ltree);
offset=(*func)(tvb, offset, actx, ltree);
proto_item_set_len(litem, (offset>>3)!=(lold_offset>>3)?(offset>>3)-(lold_offset>>3):1);
}
return offset;
}
guint32
dissect_per_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq)
dissect_per_sequence_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq)
{
proto_item *item;
proto_tree *tree;
@ -267,7 +267,7 @@ DEBUG_ENTRY("dissect_per_sequence_of");
/* semi-constrained whole number for number of elements */
/* each element encoded as 10.9 */
offset=dissect_per_length_determinant(tvb, offset, pinfo, parent_tree, hf_per_sequence_of_length, &length);
offset=dissect_per_length_determinant(tvb, offset, actx, parent_tree, hf_per_sequence_of_length, &length);
hfi = proto_registrar_get_nth(hf_index);
if (IS_FT_UINT(hfi->type)) {
@ -278,7 +278,7 @@ DEBUG_ENTRY("dissect_per_sequence_of");
}
tree=proto_item_add_subtree(item, ett_index);
offset=dissect_per_sequence_of_helper(tvb, offset, pinfo, tree, seq->func, length);
offset=dissect_per_sequence_of_helper(tvb, offset, actx, tree, seq->func, length);
proto_item_set_len(item, (offset>>3)!=(old_offset>>3)?(offset>>3)-(old_offset>>3):1);
@ -290,16 +290,16 @@ DEBUG_ENTRY("dissect_per_sequence_of");
i.e. no FROM stuff limiting the alphabet
*/
guint32
dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len)
{
offset=dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index, min_len, max_len, NULL);
offset=dissect_per_octet_string(tvb, offset, actx, tree, hf_index, min_len, max_len, NULL);
return offset;
}
/* XXX we dont do >64k length strings yet */
static guint32
dissect_per_restricted_character_string_sorted(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb)
dissect_per_restricted_character_string_sorted(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb)
{
guint32 length;
gboolean byte_aligned;
@ -307,7 +307,6 @@ dissect_per_restricted_character_string_sorted(tvbuff_t *tvb, guint32 offset, pa
guint char_pos;
int bits_per_char;
guint32 old_offset;
proto_item *pi;
DEBUG_ENTRY("dissect_per_restricted_character_string");
@ -369,14 +368,14 @@ DEBUG_ENTRY("dissect_per_restricted_character_string");
/* xx.x */
length=max_len;
if (max_len == NO_BOUND) {
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_octet_string_length, &length);
offset = dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_octet_string_length, &length);
/* the unconstrained strings are always byte aligned (27.6.3)*/
byte_aligned=TRUE;
} else if(min_len!=max_len){
offset=dissect_per_constrained_integer(tvb, offset, pinfo,
offset=dissect_per_constrained_integer(tvb, offset, actx,
tree, hf_per_octet_string_length, min_len, max_len,
&length, &pi, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
&length, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
}
if(!length){
@ -399,7 +398,7 @@ DEBUG_ENTRY("dissect_per_restricted_character_string");
val=0;
for(i=0;i<bits_per_char;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
val=(val<<1)|bit;
}
/* ALIGNED PER does not do any remapping of chars if
@ -450,7 +449,7 @@ sort_alphabet(char *sorted_alphabet, const char *alphabet, int alphabet_length)
}
guint32
dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb)
dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb)
{
const char *alphabet_ptr;
char sorted_alphabet[128];
@ -460,37 +459,36 @@ dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 offset, packet_in
} else {
alphabet_ptr = sort_alphabet(sorted_alphabet, alphabet, alphabet_length);
}
return dissect_per_restricted_character_string_sorted(tvb, offset, pinfo, tree, hf_index, min_len, max_len, alphabet_ptr, alphabet_length, value_tvb);
return dissect_per_restricted_character_string_sorted(tvb, offset, actx, tree, hf_index, min_len, max_len, alphabet_ptr, alphabet_length, value_tvb);
}
guint32
dissect_per_NumericString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
dissect_per_NumericString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len)
{
offset=dissect_per_restricted_character_string_sorted(tvb, offset, pinfo, tree, hf_index, min_len, max_len,
offset=dissect_per_restricted_character_string_sorted(tvb, offset, actx, tree, hf_index, min_len, max_len,
" 0123456789", 11, NULL);
return offset;
}
guint32
dissect_per_PrintableString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
dissect_per_PrintableString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len)
{
offset=dissect_per_restricted_character_string_sorted(tvb, offset, pinfo, tree, hf_index, min_len, max_len,
offset=dissect_per_restricted_character_string_sorted(tvb, offset, actx, tree, hf_index, min_len, max_len,
" '()+,-.*0123456789:=?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 74, NULL);
return offset;
}
guint32
dissect_per_VisibleString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
dissect_per_VisibleString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len)
{
offset=dissect_per_restricted_character_string_sorted(tvb, offset, pinfo, tree, hf_index, min_len, max_len,
offset=dissect_per_restricted_character_string_sorted(tvb, offset, actx, tree, hf_index, min_len, max_len,
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", 95, NULL);
return offset;
}
guint32
dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len)
dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len)
{
guint32 length;
static char *str;
proto_item *pi;
/* xx.x if the length is 0 bytes there will be no encoding */
if(max_len==0){
@ -506,10 +504,10 @@ dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_t
/* xx.x */
length=max_len;
if(min_len!=max_len){
offset=dissect_per_constrained_integer(tvb, offset, pinfo,
offset=dissect_per_constrained_integer(tvb, offset, actx,
tree, hf_per_octet_string_length, min_len, max_len,
&length, &pi, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
&length, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
}
@ -533,14 +531,13 @@ dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_t
/* this function dissects a constrained sequence of */
guint32
dissect_per_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len)
dissect_per_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len)
{
proto_item *item;
proto_tree *tree;
guint32 old_offset=offset;
guint32 length;
header_field_info *hfi;
proto_item *pi;
DEBUG_ENTRY("dissect_per_constrained_sequence_of");
@ -554,16 +551,16 @@ DEBUG_ENTRY("dissect_per_constrained_sequence_of");
if(max_len>=65536){
/* semi-constrained whole number for number of elements */
/* each element encoded as 10.9 */
offset=dissect_per_length_determinant(tvb, offset, pinfo, parent_tree, hf_per_sequence_of_length, &length);
offset=dissect_per_length_determinant(tvb, offset, actx, parent_tree, hf_per_sequence_of_length, &length);
length+=min_len;
goto call_sohelper;
}
/* constrained whole number for number of elements */
offset=dissect_per_constrained_integer(tvb, offset, pinfo,
offset=dissect_per_constrained_integer(tvb, offset, actx,
parent_tree, hf_per_sequence_of_length, min_len, max_len,
&length, &pi, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
&length, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
call_sohelper:
hfi = proto_registrar_get_nth(hf_index);
@ -575,7 +572,7 @@ call_sohelper:
}
tree=proto_item_add_subtree(item, ett_index);
offset=dissect_per_sequence_of_helper(tvb, offset, pinfo, tree, seq->func, length);
offset=dissect_per_sequence_of_helper(tvb, offset, actx, tree, seq->func, length);
proto_item_set_len(item, (offset>>3)!=(old_offset>>3)?(offset>>3)-(old_offset>>3):1);
@ -584,11 +581,11 @@ call_sohelper:
/* this function dissects a constrained set of */
guint32
dissect_per_constrained_set_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len)
dissect_per_constrained_set_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len)
{
/* for basic-per a set-of is encoded in the same way as a sequence-of */
DEBUG_ENTRY("dissect_per_constrained_set_of");
offset=dissect_per_constrained_sequence_of(tvb, offset, pinfo, parent_tree, hf_index, ett_index, seq, min_len, max_len);
offset=dissect_per_constrained_sequence_of(tvb, offset, actx, parent_tree, hf_index, ett_index, seq, min_len, max_len);
return offset;
}
@ -599,11 +596,11 @@ DEBUG_ENTRY("dissect_per_constrained_set_of");
/* this function dissects a set of */
guint32
dissect_per_set_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq)
dissect_per_set_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq)
{
/* for basic-per a set-of is encoded in the same way as a sequence-of */
DEBUG_ENTRY("dissect_per_set_of");
offset=dissect_per_sequence_of(tvb, offset, pinfo, parent_tree, hf_index, ett_index, seq);
offset=dissect_per_sequence_of(tvb, offset, actx, parent_tree, hf_index, ett_index, seq);
return offset;
}
@ -612,7 +609,7 @@ DEBUG_ENTRY("dissect_per_set_of");
/* 23 Encoding the object identifier type */
guint32
dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, tvbuff_t **value_tvb)
dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index, tvbuff_t **value_tvb)
{
guint length;
char *str;
@ -621,7 +618,7 @@ dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, packet_info *pinfo
DEBUG_ENTRY("dissect_per_object_identifier");
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_object_identifier_length, &length);
offset = dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_object_identifier_length, &length);
hfi = proto_registrar_get_nth(hf_index);
if (hfi->type == FT_OID) {
@ -642,12 +639,12 @@ DEBUG_ENTRY("dissect_per_object_identifier");
}
guint32
dissect_per_object_identifier_str(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, const char **value_string)
dissect_per_object_identifier_str(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, const char **value_string)
{
tvbuff_t *value_tvb = NULL;
guint length;
offset = dissect_per_object_identifier(tvb, offset, pinfo, tree, hf_index, (value_string) ? &value_tvb : NULL);
offset = dissect_per_object_identifier(tvb, offset, actx, tree, hf_index, (value_string) ? &value_tvb : NULL);
if (value_string) {
if (value_tvb && (length = tvb_length(value_tvb))) {
@ -664,12 +661,11 @@ dissect_per_object_identifier_str(tvbuff_t *tvb, guint32 offset, packet_info *pi
/* this function reads a single bit */
guint32
dissect_per_boolean(tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index, gboolean *bool, proto_item **item)
dissect_per_boolean(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index, gboolean *bool)
{
guint8 ch, mask;
gboolean value;
header_field_info *hfi;
proto_item *it;
DEBUG_ENTRY("dissect_per_boolean");
@ -696,10 +692,9 @@ DEBUG_ENTRY("dissect_per_boolean");
hfi->name,
value?"True":"False"
);
it=proto_tree_add_boolean_format(tree, hf_index, tvb, offset>>3, 1, value, str);
if(item){
*item=it;
}
actx->created_item = proto_tree_add_boolean_format(tree, hf_index, tvb, offset>>3, 1, value, str);
} else {
actx->created_item = NULL;
}
if(bool){
@ -713,7 +708,7 @@ DEBUG_ENTRY("dissect_per_boolean");
/* we currently only handle integers up to 32 bits in length. */
guint32
dissect_per_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gint32 *value, proto_item **item)
dissect_per_integer(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, gint32 *value)
{
guint32 i, length;
gint32 val;
@ -721,7 +716,7 @@ dissect_per_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tre
header_field_info *hfi;
/* 12.2.6 b */
offset=dissect_per_length_determinant(tvb, offset, pinfo, tree, -1, &length);
offset=dissect_per_length_determinant(tvb, offset, actx, tree, -1, &length);
/* gassert here? */
if(length>4){
PER_NOT_DECODED_YET("too long integer");
@ -756,9 +751,8 @@ PER_NOT_DECODED_YET("too long integer");
}
if(item){
*item=it;
}
actx->created_item = it;
if(value){
*value=val;
}
@ -789,7 +783,7 @@ PER_NOT_DECODED_YET("too long integer");
10.5.7.4
*/
guint32
dissect_per_constrained_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 min, guint32 max, guint32 *value, proto_item **item, gboolean has_extension)
dissect_per_constrained_integer(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 min, guint32 max, guint32 *value, gboolean has_extension)
{
proto_item *it=NULL;
guint32 range, val;
@ -799,17 +793,14 @@ dissect_per_constrained_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinf
int num_bits;
int pad;
gboolean tmp;
proto_item *pi;
DEBUG_ENTRY("dissect_per_constrained_integer");
if(has_extension){
gboolean extension_present;
offset=dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_extension_present_bit, &extension_present, &pi);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
offset=dissect_per_boolean(tvb, offset, actx, tree, hf_per_extension_present_bit, &extension_present);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
if(extension_present){
offset=dissect_per_integer(tvb, offset, pinfo, tree,
hf_index,
value, NULL);
offset = dissect_per_integer(tvb, offset, actx, tree, hf_index, value);
return offset;
}
}
@ -820,7 +811,7 @@ DEBUG_ENTRY("dissect_per_constrained_integer");
* 10.5.7 In the case of the ALIGNED variant the encoding depends on whether
* d) "range" is greater than 64K (the indefinite length case).
*/
if(((max-min)>65536)&&(is_per_byte_aligned)){
if(((max-min)>65536)&&(actx->aligned)){
/* just set range really big so it will fall through
to the bottom of the encoding */
range=1000000;
@ -836,7 +827,7 @@ DEBUG_ENTRY("dissect_per_constrained_integer");
if(range==1){
val_start = offset>>3; val_length = 0;
val = min;
} else if((range<=255)||(!is_per_byte_aligned)) {
} else if((range<=255)||(!actx->aligned)) {
/* 10.5.7.1
* 10.5.6 In the case of the UNALIGNED variant the value ("n" - "lb") shall be encoded
* as a non-negative binary integer in a bit field as specified in 10.3 with the minimum
@ -882,7 +873,7 @@ DEBUG_ENTRY("dissect_per_constrained_integer");
strcat(str, " ");
}
bit++;
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &tmp, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &tmp);
val<<=1;
if(tmp){
val|=1;
@ -934,9 +925,9 @@ DEBUG_ENTRY("dissect_per_constrained_integer");
/* 10.5.7.4 */
/* 12.2.6 */
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
num_bytes=bit;
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
num_bytes=(num_bytes<<1)|bit;
num_bytes++; /* lower bound for length determinant is 1 */
@ -964,32 +955,31 @@ DEBUG_ENTRY("dissect_per_constrained_integer");
} else {
THROW(ReportedBoundsError);
}
if (item) *item = it;
actx->created_item = it;
if (value) *value = val;
return offset;}
/* 13 Enemerated */
guint32
dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 root_num, guint32 *value, proto_item **item, gboolean has_extension, guint32 ext_num, guint32 *value_map)
dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 root_num, guint32 *value, gboolean has_extension, guint32 ext_num, guint32 *value_map)
{
proto_item *it=NULL;
guint32 enum_index, val;
proto_item *pi;
guint32 start_offset = offset;
gboolean extension_present = FALSE;
header_field_info *hfi;
if (has_extension) {
/* Extension bit */
offset = dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_extension_present_bit, &extension_present, &pi);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
offset = dissect_per_boolean(tvb, offset, actx, tree, hf_per_extension_present_bit, &extension_present);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
}
if (!extension_present) {
/* 13.2 */
offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree, hf_per_enum_index, 0, root_num - 1, &enum_index, &pi, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_per_enum_index, 0, root_num - 1, &enum_index, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
} else {
/* 13.3 */
if (ext_num == 1) {
@ -1007,7 +997,7 @@ dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_
*
*/
BYTE_ALIGN_OFFSET(offset);
offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, pinfo, tree, hf_per_enum_extension_index, &enum_index);
offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, actx, tree, hf_per_enum_extension_index, &enum_index);
}
enum_index += root_num;
}
@ -1018,14 +1008,14 @@ dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_
} else {
THROW(ReportedBoundsError);
}
if (item) *item = it;
actx->created_item = it;
if (value) *value = val;
return offset;
}
/* 22 Encoding the choice type */
guint32
dissect_per_choice(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gint ett_index, const per_choice_t *choice, guint32 *value)
dissect_per_choice(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, gint ett_index, const per_choice_t *choice, guint32 *value)
{
gboolean extension_present, extension_flag;
int extension_root_entries;
@ -1036,7 +1026,6 @@ dissect_per_choice(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree
guint32 old_offset = offset;
proto_item *choice_item = NULL;
proto_tree *choice_tree = NULL;
proto_item *pi;
DEBUG_ENTRY("dissect_per_choice");
@ -1046,8 +1035,8 @@ DEBUG_ENTRY("dissect_per_choice");
extension_flag = FALSE;
} else {
extension_present = TRUE;
offset = dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_extension_bit, &extension_flag, &pi);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
offset = dissect_per_boolean(tvb, offset, actx, tree, hf_per_extension_bit, &extension_flag);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
}
/* count the number of entries in the extension root and extension addition */
@ -1069,10 +1058,10 @@ DEBUG_ENTRY("dissect_per_choice");
if (extension_root_entries == 1) { /* 22.5 */
choice_index = 0;
} else {
offset = dissect_per_constrained_integer(tvb, offset, pinfo,
offset = dissect_per_constrained_integer(tvb, offset, actx,
tree, hf_per_choice_index, 0, extension_root_entries - 1,
&choice_index, &pi, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
&choice_index, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
}
index = -1; cidx = choice_index;
@ -1083,8 +1072,8 @@ DEBUG_ENTRY("dissect_per_choice");
}
}
} else { /* 22.8 */
offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, pinfo, tree, hf_per_choice_extension_index, &choice_index);
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_open_type_length, &ext_length);
offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, actx, tree, hf_per_choice_extension_index, &choice_index);
offset = dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_open_type_length, &ext_length);
index = -1; cidx = choice_index;
for (i=0; choice[i].func; i++) {
@ -1099,9 +1088,9 @@ DEBUG_ENTRY("dissect_per_choice");
choice_item = proto_tree_add_uint(tree, hf_index, tvb, old_offset>>3, 0, choice[index].value);
choice_tree = proto_item_add_subtree(choice_item, ett_index);
if (!extension_flag) {
offset = choice[index].func(tvb, offset, pinfo, choice_tree);
offset = choice[index].func(tvb, offset, actx, choice_tree);
} else {
choice[index].func(tvb, offset, pinfo, choice_tree);
choice[index].func(tvb, offset, actx, choice_tree);
offset += ext_length * 8;
}
proto_item_set_len(choice_item, BLEN(old_offset, offset));
@ -1166,7 +1155,7 @@ index_get_extension_name(const per_sequence_t *sequence, int index)
18.9
*/
guint32
dissect_per_sequence(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *sequence)
dissect_per_sequence(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *sequence)
{
gboolean extension_present, extension_flag, optional_field_flag;
proto_item *item;
@ -1174,8 +1163,6 @@ dissect_per_sequence(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tr
guint32 old_offset=offset;
guint32 i, num_opts;
guint32 optional_mask;
proto_item *pi;
DEBUG_ENTRY("dissect_per_sequence");
@ -1192,8 +1179,8 @@ DEBUG_ENTRY("dissect_per_sequence");
extension_present=0;
} else {
extension_present=1;
offset=dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_extension_bit, &extension_flag, &pi);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
offset=dissect_per_boolean(tvb, offset, actx, tree, hf_per_extension_bit, &extension_flag);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
}
/* 18.2 */
num_opts=0;
@ -1206,8 +1193,8 @@ DEBUG_ENTRY("dissect_per_sequence");
optional_mask=0;
for(i=0;i<num_opts;i++){
proto_item *it=NULL;
offset=dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_optional_field_bit, &optional_field_flag, &it);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(it);
offset=dissect_per_boolean(tvb, offset, actx, tree, hf_per_optional_field_bit, &optional_field_flag);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
optional_mask<<=1;
if(optional_field_flag){
optional_mask|=0x01;
@ -1234,7 +1221,7 @@ DEBUG_ENTRY("dissect_per_sequence");
}
}
if(sequence[i].func){
offset=sequence[i].func(tvb, offset, pinfo, tree);
offset=sequence[i].func(tvb, offset, actx, tree);
} else {
PER_NOT_DECODED_YET(sequence[i].name);
}
@ -1249,7 +1236,7 @@ DEBUG_ENTRY("dissect_per_sequence");
guint32 extension_mask;
proto_item *it=NULL;
offset=dissect_per_normally_small_nonnegative_whole_number(tvb, offset, pinfo, tree, hf_per_num_sequence_extensions, &num_extensions);
offset=dissect_per_normally_small_nonnegative_whole_number(tvb, offset, actx, tree, hf_per_num_sequence_extensions, &num_extensions);
/* the X.691 standard is VERY unclear here.
there is no mention that the lower bound lb for this
(apparently) semiconstrained value is 1,
@ -1270,8 +1257,8 @@ DEBUG_ENTRY("dissect_per_sequence");
extension_mask=0;
for(i=0;i<num_extensions;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, hf_per_extension_present_bit, &extension_bit, &it);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(it);
offset=dissect_per_boolean(tvb, offset, actx, tree, hf_per_extension_present_bit, &extension_bit);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
extension_mask=(extension_mask<<1)|extension_bit;
if(it){
proto_item_append_text(it, " (%s %s present)",
@ -1302,7 +1289,7 @@ DEBUG_ENTRY("dissect_per_sequence");
continue;
}
offset=dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_open_type_length, &length);
offset=dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_open_type_length, &length);
if(i>=num_known_extensions){
/* we dont know how to decode this extension */
@ -1323,7 +1310,7 @@ DEBUG_ENTRY("dissect_per_sequence");
}
if(sequence[extension_index].func){
new_offset=sequence[extension_index].func(tvb, offset, pinfo, tree);
new_offset=sequence[extension_index].func(tvb, offset, actx, tree);
} else {
PER_NOT_DECODED_YET(sequence[extension_index].name);
}
@ -1345,7 +1332,7 @@ DEBUG_ENTRY("dissect_per_sequence");
*/
guint32
dissect_per_bit_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension)
dissect_per_bit_string(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension)
{
guint32 length;
header_field_info *hfi;
@ -1372,17 +1359,17 @@ DEBUG_ENTRY("dissect_per_bit_string");
bytes[0]=bytes[1]=bytes[2]=0;
if(min_len<=8){
for(i=0;i<min_len;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
bytes[0]=(bytes[0]<<1)|bit;
}
}
if(min_len>8){
for(i=0;i<8;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
bytes[0]=(bytes[0]<<1)|bit;
}
for(i=8;i<min_len;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
bytes[1]=(bytes[1]<<1)|bit;
}
}
@ -1406,14 +1393,12 @@ DEBUG_ENTRY("dissect_per_bit_string");
/* 15.11 */
if (max_len != NO_BOUND) {
proto_item *pi;
offset=dissect_per_constrained_integer(tvb, offset, pinfo,
offset=dissect_per_constrained_integer(tvb, offset, actx,
tree, hf_per_bit_string_length, min_len, max_len,
&length, &pi, has_extension);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
&length, has_extension);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
} else {
offset=dissect_per_length_determinant(tvb, offset, pinfo, tree, hf_per_bit_string_length, &length);
offset=dissect_per_length_determinant(tvb, offset, actx, tree, hf_per_bit_string_length, &length);
}
if(length){
/* align to byte */
@ -1443,7 +1428,7 @@ DEBUG_ENTRY("dissect_per_bit_string");
hf_index can either be a FT_BYTES or an FT_STRING
*/
guint32
dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, tvbuff_t **value_tvb)
dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, tvbuff_t **value_tvb)
{
proto_item *it = NULL;
gint val_start, val_length;
@ -1451,7 +1436,6 @@ dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, prot
header_field_info *hfi;
static guint8 bytes[4];
guint8 *pbytes = NULL;
proto_item *pi;
tvbuff_t *out_tvb = NULL;
hfi = (hf_index==-1) ? NULL : proto_registrar_get_nth(hf_index);
@ -1470,12 +1454,12 @@ DEBUG_ENTRY("dissect_per_octet_string");
gboolean bit;
for(i=0;i<8;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
bytes[0]=(bytes[0]<<1)|bit;
}
if(min_len==2){
for(i=0;i<8;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
bytes[1]=(bytes[1]<<1)|bit;
}
}
@ -1485,11 +1469,11 @@ DEBUG_ENTRY("dissect_per_octet_string");
val_length = min_len+((offset&0x07)?1:0);
} else if ((min_len==max_len)&&(min_len<65536)) { /* 16.7 if length is fixed and less than to 64k*/
/* align to byte */
val_start = offset>>3;
if (is_per_byte_aligned){
/* align to byte */
if (actx->aligned){
BYTE_ALIGN_OFFSET(offset);
val_start = offset>>3;
val_length = min_len;
offset+=min_len*8;
}else{
@ -1498,10 +1482,11 @@ DEBUG_ENTRY("dissect_per_octet_string");
guint32 j = 0;
gboolean bit;
val_start = offset>>3;
buff = ep_alloc(min_len);
while (j < (guint32)min_len){
for(i=0;i<8;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
buff[j]=(buff[j]<<1)|bit;
}
j = j+1;
@ -1513,21 +1498,21 @@ DEBUG_ENTRY("dissect_per_octet_string");
} else { /* 16.8 */
if(max_len>0) {
offset = dissect_per_constrained_integer(tvb, offset, pinfo, tree,
offset = dissect_per_constrained_integer(tvb, offset, actx, tree,
hf_per_octet_string_length, min_len, max_len,
&length, &pi, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(pi);
&length, FALSE);
if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item);
} else {
offset = dissect_per_length_determinant(tvb, offset, pinfo, tree,
offset = dissect_per_length_determinant(tvb, offset, actx, tree,
hf_per_octet_string_length, &length);
}
if(length){
/* align to byte */
if (is_per_byte_aligned){
if (actx->aligned){
BYTE_ALIGN_OFFSET(offset);
offset+=length*8;
val_start = offset>>3;
offset+=length*8;
}else{
guint8 *buff;
guint32 i = 0;
@ -1538,7 +1523,7 @@ DEBUG_ENTRY("dissect_per_octet_string");
buff = g_malloc(length);
while (j < length){
for(i=0;i<8;i++){
offset=dissect_per_boolean(tvb, offset, pinfo, tree, -1, &bit, NULL);
offset=dissect_per_boolean(tvb, offset, actx, tree, -1, &bit);
buff[j]=(buff[j]<<1)|bit;
}
j = j+1;
@ -1550,7 +1535,7 @@ DEBUG_ENTRY("dissect_per_octet_string");
*/
tvb_set_free_cb(out_tvb, g_free );
tvb_set_child_real_data_tvbuff(tvb,out_tvb);
add_new_data_source(pinfo, out_tvb, "PER unaligned decoded OCTET STRING");
add_new_data_source(actx->pinfo, out_tvb, "PER unaligned decoded OCTET STRING");
}
}
val_length = length;

View File

@ -26,15 +26,36 @@
#ifndef __PACKET_PER_H__
#define __PACKET_PER_H__
/*--- ASN.1 Context, will be moved to common ASN.1 header when created --- */
typedef enum {
ASN_ENC_BER, /* X.690 - BER, CER, DER */
ASN_ENC_PER, /* X.691 - PER */
ASN_ENC_ECN, /* X.692 - ECN */
ASN_ENC_XER, /* X.693 - XER */
} asn_enc_e;
typedef struct _asn_ctx_t {
asn_enc_e encoding;
gboolean aligned;
packet_info *pinfo;
proto_item *created_item;
void *private_data;
} asn_ctx_t;
void asn_ctx_init(asn_ctx_t *actx, asn_enc_e encoding, gboolean aligned, packet_info *pinfo);
#define PER_NOT_DECODED_YET(x) \
proto_tree_add_text(tree, tvb, 0, 0, "something unknown here [%s]",x); \
fprintf(stderr,"[%s %u] Not decoded yet in packet : %d [%s]\n", __FILE__, __LINE__, pinfo->fd->num,x); \
if (check_col(pinfo->cinfo, COL_INFO)){ \
col_append_fstr(pinfo->cinfo, COL_INFO, "[UNKNOWN PER: %s]", x); \
fprintf(stderr,"[%s %u] Not decoded yet in packet : %d [%s]\n", __FILE__, __LINE__, actx->pinfo->fd->num,x); \
if (check_col(actx->pinfo->cinfo, COL_INFO)){ \
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "[UNKNOWN PER: %s]", x); \
} \
tvb_get_guint8(tvb, 9999);
typedef int (*per_callback)(tvbuff_t *, int, packet_info *, proto_tree *);
typedef int (*per_callback)(tvbuff_t *, int, asn_ctx_t *, proto_tree *);
/* in all functions here, offset is guint32 and is
byteposition<<3 + bitposition
@ -67,51 +88,49 @@ typedef struct _per_sequence_t {
per_callback func;
} per_sequence_t;
extern void per_aligment_type_callback(gboolean byte_aligned);
extern guint32 dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 *length);
extern guint32 dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 *length);
extern guint32 dissect_per_null(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
extern guint32 dissect_per_null(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index);
extern guint32 dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index);
extern guint32 dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index);
extern guint32 dissect_per_sequence_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq);
extern guint32 dissect_per_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq);
extern guint32 dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_NumericString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_NumericString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_PrintableString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_PrintableString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_VisibleString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_VisibleString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_BMPString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len);
extern guint32 dissect_per_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len);
extern guint32 dissect_per_constrained_sequence_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len);
extern guint32 dissect_per_constrained_set_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len);
extern guint32 dissect_per_constrained_set_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq, int min_len, int max_len);
extern guint32 dissect_per_set_of(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq);
extern guint32 dissect_per_set_of(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *seq);
extern guint32 dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
extern guint32 dissect_per_object_identifier_str(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, const char **value_string);
extern guint32 dissect_per_object_identifier(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, tvbuff_t **value_tvb);
extern guint32 dissect_per_object_identifier_str(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, const char **value_string);
extern guint32 dissect_per_boolean(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, gboolean *bool);
extern guint32 dissect_per_boolean(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gboolean *bool, proto_item **item);
extern guint32 dissect_per_integer(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, gint32 *value);
extern guint32 dissect_per_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gint32 *value, proto_item **item);
extern guint32 dissect_per_constrained_integer(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 min, guint32 max, guint32 *value, gboolean has_extension);
extern guint32 dissect_per_constrained_integer(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 min, guint32 max, guint32 *value, proto_item **item, gboolean has_extension);
extern guint32 dissect_per_choice(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, gint ett_index, const per_choice_t *choice, guint32 *value);
extern guint32 dissect_per_choice(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, gint ett_index, const per_choice_t *choice, guint32 *value);
extern guint32 dissect_per_sequence(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *sequence);
extern guint32 dissect_per_sequence(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *parent_tree, int hf_index, gint ett_index, const per_sequence_t *sequence);
extern guint32 dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, tvbuff_t **value_tvb);
extern guint32 dissect_per_octet_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, tvbuff_t **value_tvb);
extern guint32 dissect_per_bit_string(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
extern guint32 dissect_per_bit_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension);
extern guint32 dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb);
extern guint32 dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, int min_len, int max_len, const char *alphabet, int alphabet_length, tvbuff_t **value_tvb);
extern guint32 dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index, guint32 root_num, guint32 *value, proto_item **item, gboolean has_extension, guint32 ext_num, guint32 *value_map);
extern guint32 dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, asn_ctx_t *actx, proto_tree *tree, int hf_index, guint32 root_num, guint32 *value, gboolean has_extension, guint32 ext_num, guint32 *value_map);
#endif /* __PACKET_PER_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-ranap.h */
/* ../../tools/asn2eth.py -e -p ranap -c ranap.cnf -s packet-ranap-template ranap.asn */
/* ../../tools/asn2wrs.py -e -p ranap -c ranap.cnf -s packet-ranap-template ranap.asn */
/* Input file: packet-ranap-template.h */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-rnsap.h */
/* ../../tools/asn2eth.py -X -e -p rnsap -c rnsap.cnf -s packet-rnsap-template rnsap.asn */
/* ../../tools/asn2wrs.py -e -p rnsap -c rnsap.cnf -s packet-rnsap-template rnsap.asn */
/* Input file: packet-rnsap-template.h */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-rrlp.h */
/* ../../tools/asn2eth.py -u -e -p rrlp -c rrlp.cnf -s packet-rrlp-template rrlp.asn */
/* ../../tools/asn2wrs.py -u -e -p rrlp -c rrlp.cnf -s packet-rrlp-template rrlp.asn */
/* Input file: packet-rrlp-template.h */

View File

@ -1233,7 +1233,7 @@ dissect_t30_hdlc(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
/* T38 Routines */
static int
dissect_t38_NULL(tvbuff_t *tvb _U_, int offset, packet_info *pinfo _U_, proto_tree *tree _U_)
dissect_t38_NULL(tvbuff_t *tvb _U_, int offset, asn_ctx_t *actx _U_, proto_tree *tree _U_)
{
return offset;
}
@ -1316,14 +1316,14 @@ const value_string t30_indicator_vals[] = {
};
static int
dissect_t38_t30_indicator(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_t30_indicator(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_choice(tvb, offset, pinfo,
offset=dissect_per_choice(tvb, offset, actx,
tree, hf_t38_t30_indicator, ett_t38_t30_indicator,
t30_indicator_choice, &T30ind_value);
if (check_col(pinfo->cinfo, COL_INFO) && primary_part){
col_append_fstr(pinfo->cinfo, COL_INFO, " t30ind: %s",
if (check_col(actx->pinfo->cinfo, COL_INFO) && primary_part){
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " t30ind: %s",
val_to_str(T30ind_value,t30_indicator_vals,"<unknown>"));
}
@ -1388,14 +1388,14 @@ const value_string t30_data_vals[] = {
};
static int
dissect_t38_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_data(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_choice(tvb, offset, pinfo,
offset=dissect_per_choice(tvb, offset, actx,
tree, hf_t38_data, ett_t38_data,
data_choice, &Data_value);
if (check_col(pinfo->cinfo, COL_INFO) && primary_part){
col_append_fstr(pinfo->cinfo, COL_INFO, " data:%s:",
if (check_col(actx->pinfo->cinfo, COL_INFO) && primary_part){
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " data:%s:",
val_to_str(Data_value,t30_data_vals,"<unknown>"));
}
@ -1421,8 +1421,8 @@ static const value_string Type_of_msg_vals[] = {
{ 0, NULL}
};
static int
dissect_t38_Type_of_msg(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_per_choice(tvb, offset, pinfo, tree, hf_index,
dissect_t38_Type_of_msg(tvbuff_t *tvb, int offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_t38_Type_of_msg, Type_of_msg_choice,
&Type_of_msg_value);
@ -1433,8 +1433,8 @@ dissect_t38_Type_of_msg(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto
return offset;
}
static int dissect_type_of_msg(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
return dissect_t38_Type_of_msg(tvb, offset, pinfo, tree, hf_t38_Type_of_msg);
static int dissect_type_of_msg(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree) {
return dissect_t38_Type_of_msg(tvb, offset, actx, tree, hf_t38_Type_of_msg);
}
static const per_choice_t Data_Field_field_type_PreCorrigendum_choice[] = {
@ -1606,21 +1606,21 @@ force_reassmeble_seq(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id,
}
static int
dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
if(use_pre_corrigendum_asn1_specification){
offset=dissect_per_choice(tvb, offset, pinfo,
offset=dissect_per_choice(tvb, offset, actx,
tree, hf_t38_Data_Field_field_type, ett_t38_Data_Field_field_type,
Data_Field_field_type_PreCorrigendum_choice, &Data_Field_field_type_value);
}
else{
offset=dissect_per_choice(tvb, offset, pinfo,
offset=dissect_per_choice(tvb, offset, actx,
tree, hf_t38_Data_Field_field_type, ett_t38_Data_Field_field_type,
Data_Field_field_type_choice, &Data_Field_field_type_value);
}
if (check_col(pinfo->cinfo, COL_INFO) && primary_part){
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
if (check_col(actx->pinfo->cinfo, COL_INFO) && primary_part){
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s",
val_to_str(Data_Field_field_type_value,Data_Field_field_type_vals,"<unknown>"));
}
@ -1632,13 +1632,13 @@ dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (Data_Field_field_type_value == 2 || Data_Field_field_type_value == 4 || Data_Field_field_type_value == 7) {/* hdlc-fcs-OK or hdlc-fcs-OK-sig-end or t4-non-ecm-sig-end*/
fragment_data *frag_msg = NULL;
tvbuff_t* new_tvb = NULL;
gboolean save_fragmented = pinfo->fragmented;
gboolean save_fragmented = actx->pinfo->fragmented;
pinfo->fragmented = TRUE;
actx->pinfo->fragmented = TRUE;
/* if reass_start_seqnum=-1 it means we have received the end of the fragmente, without received any fragment data */
if (p_t38_packet_conv_info->reass_start_seqnum != -1) {
frag_msg = fragment_add_seq(tvb, offset, pinfo,
frag_msg = fragment_add_seq(tvb, offset, actx->pinfo,
p_t38_packet_conv_info->reass_ID, /* ID for fragments belonging together */
data_fragment_table, /* list of message fragments */
seq_number + Data_Field_item_num - (guint32)p_t38_packet_conv_info->reass_start_seqnum, /* fragment sequence number */
@ -1652,13 +1652,13 @@ dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, packet_info *pinfo,
* and get some stat, like packet lost and burst number of packet lost
*/
if (!frag_msg) {
force_reassmeble_seq(tvb, offset, pinfo,
force_reassmeble_seq(tvb, offset, actx->pinfo,
p_t38_packet_conv_info->reass_ID, /* ID for fragments belonging together */
data_fragment_table, /* list of message fragments */
seq_number + Data_Field_item_num - (guint32)p_t38_packet_conv_info->reass_start_seqnum); /* fragment sequence number */
} else {
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO, " (t4-data Reassembled: No packet lost)");
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_append_str(actx->pinfo->cinfo, COL_INFO, " (t4-data Reassembled: No packet lost)");
g_snprintf(t38_info->desc_comment, MAX_T38_DESC, "No packet lost");
}
@ -1670,33 +1670,33 @@ dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, packet_info *pinfo,
g_snprintf(t38_info->desc_comment, MAX_T38_DESC, "No packet lost");
}
new_tvb = process_reassembled_data(tvb, offset, pinfo,
new_tvb = process_reassembled_data(tvb, offset, actx->pinfo,
"Reassembled Message", frag_msg, &data_frag_items, NULL, tree);
/* Now reset fragmentation information in pinfo */
pinfo->fragmented = save_fragmented;
actx->pinfo->fragmented = save_fragmented;
t38_info->time_first_t4_data = p_t38_packet_conv_info->time_first_t4_data;
t38_info->frame_num_first_t4_data = p_t38_packet_conv_info->reass_ID; /* The reass_ID is the Frame number of the first t4 fragment */
} else {
new_tvb = process_reassembled_data(tvb, offset, pinfo,
new_tvb = process_reassembled_data(tvb, offset, actx->pinfo,
"Reassembled Message", frag_msg, &data_frag_items, NULL, tree);
/* Now reset fragmentation information in pinfo */
pinfo->fragmented = save_fragmented;
actx->pinfo->fragmented = save_fragmented;
if (new_tvb) dissect_t30_hdlc(new_tvb, 0, pinfo, tree);
if (new_tvb) dissect_t30_hdlc(new_tvb, 0, actx->pinfo, tree);
}
} else {
if(tree){
proto_tree_add_text(tree, tvb, offset, tvb_reported_length_remaining(tvb, offset),
"[RECEIVED END OF FRAGMENT W/OUT ANY FRAGMENT DATA]");
}
if (check_col(pinfo->cinfo, COL_INFO)){
col_append_fstr(pinfo->cinfo, COL_INFO, " [Malformed?]");
if (check_col(actx->pinfo->cinfo, COL_INFO)){
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " [Malformed?]");
}
pinfo->fragmented = save_fragmented;
actx->pinfo->fragmented = save_fragmented;
}
}
@ -1711,23 +1711,23 @@ dissect_t38_Data_Field_field_type(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
static int
dissect_t38_Data_Field_field_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_Data_Field_field_data(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
tvbuff_t *value_tvb = NULL;
guint32 value_len;
offset=dissect_per_octet_string(tvb, offset, pinfo,
offset=dissect_per_octet_string(tvb, offset, actx,
tree, hf_t38_Data_Field_field_data, 1, 65535,
&value_tvb);
value_len = tvb_length(value_tvb);
if (check_col(pinfo->cinfo, COL_INFO) && primary_part){
if (check_col(actx->pinfo->cinfo, COL_INFO) && primary_part){
if(value_len < 8){
col_append_fstr(pinfo->cinfo, COL_INFO, "[%s]",
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "[%s]",
tvb_bytes_to_str(value_tvb,0,value_len));
}
else {
col_append_fstr(pinfo->cinfo, COL_INFO, "[%s...]",
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "[%s...]",
tvb_bytes_to_str(value_tvb,0,7));
}
}
@ -1742,43 +1742,43 @@ dissect_t38_Data_Field_field_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* HDLC Data or t4-non-ecm-data */
if (Data_Field_field_type_value == 0 || Data_Field_field_type_value == 6) { /* 0=HDLC Data or 6=t4-non-ecm-data*/
gboolean save_fragmented = pinfo->fragmented;
gboolean save_fragmented = actx->pinfo->fragmented;
pinfo->fragmented = TRUE;
actx->pinfo->fragmented = TRUE;
/* if we have not reassembled this packet and it is the first fragment, reset the reassemble ID and the start seq number*/
if (p_t38_packet_conv && p_t38_conv && (p_t38_packet_conv_info->reass_ID == 0)) {
/* we use the first fragment's frame_number as fragment ID because the protocol doesn't provide it */
p_t38_conv_info->reass_ID = pinfo->fd->num;
p_t38_conv_info->reass_ID = actx->pinfo->fd->num;
p_t38_conv_info->reass_start_seqnum = seq_number;
p_t38_conv_info->time_first_t4_data = nstime_to_sec(&pinfo->fd->rel_ts);
p_t38_conv_info->time_first_t4_data = nstime_to_sec(&actx->pinfo->fd->rel_ts);
p_t38_packet_conv_info->reass_ID = p_t38_conv_info->reass_ID;
p_t38_packet_conv_info->reass_start_seqnum = p_t38_conv_info->reass_start_seqnum;
p_t38_packet_conv_info->time_first_t4_data = p_t38_conv_info->time_first_t4_data;
}
frag_msg = fragment_add_seq(value_tvb, 0, pinfo,
frag_msg = fragment_add_seq(value_tvb, 0, actx->pinfo,
p_t38_packet_conv_info->reass_ID, /* ID for fragments belonging together */
data_fragment_table, /* list of message fragments */
seq_number - (guint32)p_t38_packet_conv_info->reass_start_seqnum, /* fragment sequence number */
value_len, /* fragment length */
TRUE); /* More fragments */
new_tvb = process_reassembled_data(tvb, offset, pinfo,
new_tvb = process_reassembled_data(tvb, offset, actx->pinfo,
"Reassembled Message", frag_msg, &data_frag_items, NULL, tree);
if (!frag_msg) { /* Not last packet of reassembled */
if (Data_Field_field_type_value == 0) {
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO," (HDLC fragment %u)", seq_number - (guint32)p_t38_packet_conv_info->reass_start_seqnum);
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_append_fstr(actx->pinfo->cinfo, COL_INFO," (HDLC fragment %u)", seq_number - (guint32)p_t38_packet_conv_info->reass_start_seqnum);
} else {
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO," (t4-data fragment %u)", seq_number - (guint32)p_t38_packet_conv_info->reass_start_seqnum);
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_append_fstr(actx->pinfo->cinfo, COL_INFO," (t4-data fragment %u)", seq_number - (guint32)p_t38_packet_conv_info->reass_start_seqnum);
}
}
/* Now reset fragmentation information in pinfo */
pinfo->fragmented = save_fragmented;
actx->pinfo->fragmented = save_fragmented;
}
}
@ -1794,9 +1794,9 @@ static const per_sequence_t Data_Field_item_sequence[] = {
};
static int
dissect_t38_Data_Field_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_Data_Field_item(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo,
offset=dissect_per_sequence(tvb, offset, actx,
tree, hf_t38_Data_Field_item, ett_t38_Data_Field_item,
Data_Field_item_sequence);
@ -1810,14 +1810,14 @@ static const per_sequence_t t38_Data_Field_sequence_of[1] = {
};
static int
dissect_t38_Data_Field(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_per_sequence_of(tvb, offset, pinfo, tree, hf_index,
dissect_t38_Data_Field(tvbuff_t *tvb, int offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
offset = dissect_per_sequence_of(tvb, offset, actx, tree, hf_index,
ett_t38_Data_Field, t38_Data_Field_sequence_of);
return offset;
}
static int dissect_data_field(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
return dissect_t38_Data_Field(tvb, offset, pinfo, tree, hf_t38_Data_Field);
static int dissect_data_field(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree) {
return dissect_t38_Data_Field(tvb, offset, actx, tree, hf_t38_Data_Field);
}
static const per_sequence_t IFPPacket_sequence[] = {
@ -1827,45 +1827,45 @@ static const per_sequence_t IFPPacket_sequence[] = {
};
static int
dissect_t38_IFPPacket(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_IFPPacket(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo,
offset=dissect_per_sequence(tvb, offset, actx,
tree, hf_t38_IFPPacket, ett_t38_IFPPacket,
IFPPacket_sequence);
return offset;
}
static int
dissect_t38_seq_number(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_seq_number(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_constrained_integer(tvb, offset, pinfo,
offset=dissect_per_constrained_integer(tvb, offset, actx,
tree, hf_t38_seq_number, 0, 65535,
&seq_number, NULL, FALSE);
&seq_number, FALSE);
/* info for tap */
if (primary_part)
t38_info->seq_num = seq_number;
if (check_col(pinfo->cinfo, COL_INFO)){
col_append_fstr(pinfo->cinfo, COL_INFO, "Seq=%05u ",seq_number);
if (check_col(actx->pinfo->cinfo, COL_INFO)){
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "Seq=%05u ",seq_number);
}
return offset;
}
static int
dissect_t38_primary_ifp_packet(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_primary_ifp_packet(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
guint32 length;
primary_part = TRUE;
offset=dissect_per_length_determinant(tvb, offset, pinfo,
offset=dissect_per_length_determinant(tvb, offset, actx,
tree, hf_t38_primary_ifp_packet_length, &length);
offset=dissect_t38_IFPPacket(tvb, offset, pinfo, tree);
offset=dissect_t38_IFPPacket(tvb, offset, actx, tree);
/* if is a valid t38 packet, add to tap */
if (p_t38_packet_conv && (!pinfo->in_error_pkt) && ((gint32) seq_number != p_t38_packet_conv_info->last_seqnum))
tap_queue_packet(t38_tap, pinfo, t38_info);
if (p_t38_packet_conv && (!actx->pinfo->in_error_pkt) && ((gint32) seq_number != p_t38_packet_conv_info->last_seqnum))
tap_queue_packet(t38_tap, actx->pinfo, t38_info);
if (p_t38_conv) p_t38_conv_info->last_seqnum = (gint32) seq_number;
@ -1873,13 +1873,13 @@ dissect_t38_primary_ifp_packet(tvbuff_t *tvb, int offset, packet_info *pinfo, pr
}
static int
dissect_t38_secondary_ifp_packets_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_secondary_ifp_packets_item(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
guint32 length;
offset=dissect_per_length_determinant(tvb, offset, pinfo,
offset=dissect_per_length_determinant(tvb, offset, actx,
tree, hf_t38_secondary_ifp_packets_item_length, &length);
offset=dissect_t38_IFPPacket(tvb, offset, pinfo, tree);
offset=dissect_t38_IFPPacket(tvb, offset, actx, tree);
return offset;
}
@ -1888,7 +1888,7 @@ static const per_sequence_t SEQUENCE_OF_t38_secondary_ifp_packets_sequence_of[1]
};
static int
dissect_t38_secondary_ifp_packets(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_secondary_ifp_packets(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
/* When the field-data is not present, we MUST offset 1 byte*/
if((Data_Field_field_type_value != 0) &&
@ -1898,25 +1898,23 @@ dissect_t38_secondary_ifp_packets(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset=offset+8;
}
offset=dissect_per_sequence_of(tvb, offset, pinfo,
offset=dissect_per_sequence_of(tvb, offset, actx,
tree, hf_t38_secondary_ifp_packets, ett_t38_secondary_ifp_packets,
SEQUENCE_OF_t38_secondary_ifp_packets_sequence_of);
return offset;
}
static int
dissect_t38_fec_npackets(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_fec_npackets(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_integer(tvb, offset, pinfo,
tree, hf_t38_fec_npackets,
NULL, NULL);
offset=dissect_per_integer(tvb, offset, actx, tree, hf_t38_fec_npackets, NULL);
return offset;
}
static int
dissect_t38_fec_data_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_fec_data_item(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_octet_string(tvb, offset, pinfo,
offset=dissect_per_octet_string(tvb, offset, actx,
tree, hf_t38_fec_data_item, NO_BOUND, NO_BOUND,
NULL);
return offset;
@ -1925,9 +1923,9 @@ static const per_sequence_t T_t38_fec_data_sequence_of[1] = {
{ "" , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_t38_fec_data_item },
};
static int
dissect_t38_fec_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_fec_data(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence_of(tvb, offset, pinfo,
offset=dissect_per_sequence_of(tvb, offset, actx,
tree, hf_t38_fec_data, ett_t38_fec_data,
T_t38_fec_data_sequence_of);
return offset;
@ -1942,9 +1940,9 @@ static const per_sequence_t fec_info_sequence[] = {
};
static int
dissect_t38_fec_info(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_fec_info(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
offset=dissect_per_sequence(tvb, offset, pinfo,
offset=dissect_per_sequence(tvb, offset, actx,
tree, hf_t38_fec_info, ett_t38_fec_info,
fec_info_sequence);
return offset;
@ -1965,11 +1963,11 @@ static const value_string error_recovery_vals[] = {
};
static int
dissect_t38_error_recovery(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_error_recovery(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
primary_part = FALSE;
offset=dissect_per_choice(tvb, offset, pinfo,
offset=dissect_per_choice(tvb, offset, actx,
tree, hf_t38_error_recovery, ett_t38_error_recovery,
error_recovery_choice, NULL);
@ -1989,12 +1987,12 @@ static const per_sequence_t UDPTLPacket_sequence[] = {
};
static int
dissect_t38_UDPTLPacket(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
dissect_t38_UDPTLPacket(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree)
{
/* Initialize to something else than data type */
Data_Field_field_type_value = 1;
offset=dissect_per_sequence(tvb, offset, pinfo,
offset=dissect_per_sequence(tvb, offset, actx,
tree, hf_t38_UDPTLPacket, ett_t38_UDPTLPacket,
UDPTLPacket_sequence);
return offset;
@ -2109,6 +2107,7 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *it;
proto_tree *tr;
guint32 offset=0;
asn_ctx_t asn_ctx;
/*
* XXX - heuristic to check for misidentified packets.
@ -2148,7 +2147,8 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_fstr(pinfo->cinfo, COL_INFO, "UDP: UDPTLPacket ");
}
offset=dissect_t38_UDPTLPacket(tvb, offset, pinfo, tr);
asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
offset=dissect_t38_UDPTLPacket(tvb, offset, &asn_ctx, tr);
if (offset&0x07){
offset=(offset&0xfffffff8)+8;
@ -2171,6 +2171,7 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *tr;
guint32 offset=0;
guint16 ifp_packet_number=1;
asn_ctx_t asn_ctx;
if (check_col(pinfo->cinfo, COL_PROTOCOL)){
col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.38");
@ -2201,7 +2202,8 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while(tvb_length_remaining(tvb,offset>>3)>0)
{
offset=dissect_t38_IFPPacket(tvb, offset, pinfo, tr);
asn_ctx_init(&asn_ctx, ASN_ENC_PER, TRUE, pinfo);
offset=dissect_t38_IFPPacket(tvb, offset, &asn_ctx, tr);
ifp_packet_number++;
if(offset&0x07){

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-ulp.h */
/* ../../tools/asn2eth.py -u -e -p ulp -c ulp.cnf -s packet-ulp-template ULP.asn */
/* ../../tools/asn2wrs.py -u -e -p ulp -c ulp.cnf -s packet-ulp-template ULP.asn */
/* Input file: packet-ulp-template.h */

View File

@ -34,6 +34,7 @@ asn1_subid_decode
asn1_tag_decode
asn1_uint32_decode
asn1_uint32_value_decode
asn_ctx_init
BandRejectReason_vals DATA
build_follow_filter
bytes_to_str_punct

View File

@ -848,7 +848,7 @@ class EthCtx:
if (self.Ber()):
out += "dissect_%s_%s(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index)" % (self.eth_type[tname]['proto'], tname)
elif (self.Per()):
out += "dissect_%s_%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index)" % (self.eth_type[tname]['proto'], tname)
out += "dissect_%s_%s(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree, int hf_index)" % (self.eth_type[tname]['proto'], tname)
out += ";\n"
return out
@ -878,7 +878,7 @@ class EthCtx:
if (self.Ber()):
out += "dissect_%s_%s(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {\n" % (self.eth_type[tname]['proto'], tname)
elif (self.Per()):
out += "dissect_%s_%s(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {\n" % (self.eth_type[tname]['proto'], tname)
out += "dissect_%s_%s(tvbuff_t *tvb, int offset, asn_ctx_t *actx _U_, proto_tree *tree, int hf_index) {\n" % (self.eth_type[tname]['proto'], tname)
if self.conform.get_fn_presence(tname):
out += self.conform.get_fn_text(tname, 'FN_HDR')
elif self.conform.get_fn_presence(self.eth_type[tname]['ref'][0]):
@ -1053,8 +1053,8 @@ class EthCtx:
out += 'static int dissect_'+f+postfix+'(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {\n'
par=((impl, 'tvb', 'offset', 'pinfo', 'tree', self.eth_hf[f]['fullname']),)
else:
out += 'static int dissect_'+f+'(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {\n'
par=(('tvb', 'offset', 'pinfo', 'tree', self.eth_hf[f]['fullname']),)
out += 'static int dissect_'+f+'(tvbuff_t *tvb, int offset, asn_ctx_t *actx, proto_tree *tree) {\n'
par=(('tvb', 'offset', 'actx', 'tree', self.eth_hf[f]['fullname']),)
out += self.eth_fn_call('dissect_%s_%s' % (self.eth_type[t]['proto'], t), ret='return',
par=par)
out += '}\n'
@ -1078,11 +1078,12 @@ class EthCtx:
aligned = 'TRUE'
else:
aligned = 'FALSE'
out += self.eth_fn_call('per_aligment_type_callback', par=((aligned,),))
out += " asn_ctx_t asn_ctx;\n"
out += self.eth_fn_call('asn_ctx_init', par=(('&asn_ctx', 'ASN_ENC_PER', aligned, 'pinfo'),))
if (self.Ber()):
par=((impl, 'tvb', '0', 'pinfo', 'tree', self.eth_hf[f]['fullname']),)
elif (self.Per()):
par=(('tvb', '0', 'pinfo', 'tree', self.eth_hf[f]['fullname']),)
par=(('tvb', '0', '&asn_ctx', 'tree', self.eth_hf[f]['fullname']),)
else:
par=((),)
ret = None
@ -1987,17 +1988,18 @@ class Type (Node):
'TNAME' : tname,
'ER' : ectx.encp(),
'FN_VARIANT' : '',
'PINFO' : 'pinfo',
'TREE' : 'tree',
'TVB' : 'tvb',
'OFFSET' : 'offset',
'OFFSET' : 'offset',
'ACTX' : 'actx',
'HF_INDEX' : 'hf_index',
'VAL_PTR' : 'NULL',
'IMPLICIT_TAG' : 'implicit_tag',
'CREATED_ITEM_PTR' : 'NULL',
}
if ectx.eth_type[tname]['tree']:
if (ectx.eth_type[tname]['tree']):
pars['ETT_INDEX'] = ectx.eth_type[tname]['tree']
if (not ectx.Per()):
pars['PINFO'] = 'pinfo'
return pars
def eth_type_fn(self, proto, tname, ectx):
@ -2246,7 +2248,7 @@ class Type_Ref (Type):
par=(('%(IMPLICIT_TAG)s', '%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),))
elif (ectx.Per()):
body = ectx.eth_fn_call('%(TYPE_REF_FN)s', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),))
else:
body = '#error Can not decode %s' % (tname)
return body
@ -2377,11 +2379,11 @@ class SequenceOfType (SeqOfType):
('%(TABLE)s', '%(HF_INDEX)s', '%(ETT_INDEX)s',),))
elif (ectx.Per() and not self.HasConstraint()):
body = ectx.eth_fn_call('dissect_%(ER)s_sequence_of', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),))
elif (ectx.Per() and self.constr.type == 'Size'):
body = ectx.eth_fn_call('dissect_%(ER)s_constrained_sequence_of', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),
('%(MIN_VAL)s', '%(MAX_VAL)s',),))
else:
@ -2429,11 +2431,11 @@ class SetOfType (SeqOfType):
('%(TABLE)s', '%(HF_INDEX)s', '%(ETT_INDEX)s',),))
elif (ectx.Per() and not self.HasConstraint()):
body = ectx.eth_fn_call('dissect_%(ER)s_set_of', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),))
elif (ectx.Per() and self.constr.type == 'Size'):
body = ectx.eth_fn_call('dissect_%(ER)s_constrained_set_of', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),
('%(MIN_VAL)s', '%(MAX_VAL)s',),))
else:
@ -2534,7 +2536,7 @@ class SequenceType (SeqType):
('%(TABLE)s', '%(HF_INDEX)s', '%(ETT_INDEX)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_sequence', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),))
else:
body = '#error Can not decode %s' % (tname)
@ -2567,7 +2569,7 @@ class SetType(SeqType):
('%(TABLE)s', '%(HF_INDEX)s', '%(ETT_INDEX)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_set', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),))
else:
body = '#error Can not decode %s' % (tname)
@ -2756,7 +2758,7 @@ class ChoiceType (Type):
('%(VAL_PTR)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_choice', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ETT_INDEX)s', '%(TABLE)s',),
('%(VAL_PTR)s',),))
else:
@ -2868,8 +2870,8 @@ class EnumeratedType (Type):
('%(VAL_PTR)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_enumerated', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ROOT_NUM)s', '%(VAL_PTR)s', '%(CREATED_ITEM_PTR)s', '%(EXT)s', '%(EXT_NUM)s', '%(TABLE)s',),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(ROOT_NUM)s', '%(VAL_PTR)s', '%(EXT)s', '%(EXT_NUM)s', '%(TABLE)s',),))
else:
body = '#error Can not decode %s' % (tname)
return body
@ -2910,7 +2912,7 @@ class NullType (Type):
par=(('%(IMPLICIT_TAG)s', '%(PINFO)s', '%(TREE)s', '%(TVB)s', '%(OFFSET)s', '%(HF_INDEX)s'),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_null', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),))
else:
body = '#error Can not decode %s' % (tname)
return body
@ -2947,8 +2949,7 @@ class BooleanType (Type):
par=(('%(IMPLICIT_TAG)s', '%(PINFO)s', '%(TREE)s', '%(TVB)s', '%(OFFSET)s', '%(HF_INDEX)s'),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_boolean', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(VAL_PTR)s', '%(CREATED_ITEM_PTR)s'),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s', '%(VAL_PTR)s',),))
else:
body = '#error Can not decode %s' % (tname)
return body
@ -2984,7 +2985,7 @@ class OctetStringType (Type):
('%(VAL_PTR)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_octet_string', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s', '%(VAL_PTR)s',),))
else:
body = '#error Can not decode %s' % (tname)
@ -3040,24 +3041,24 @@ class RestrictedCharacterStringType (CharacterStringType):
('%(VAL_PTR)s',),))
elif (ectx.Per() and self.HasPermAlph()):
body = ectx.eth_fn_call('dissect_%(ER)s_restricted_character_string', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s', '%(ALPHABET)s', '%(ALPHABET_LEN)s'),
('%(VAL_PTR)s',),))
elif (ectx.Per()):
if (self.eth_tsname() == 'GeneralString'):
body = ectx.eth_fn_call('dissect_%(ER)s_%(STRING_TYPE)s', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),))
elif (self.eth_tsname() == 'GeneralizedTime'):
body = ectx.eth_fn_call('dissect_%(ER)s_VisibleString', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s',),))
elif (self.eth_tsname() == 'UTCTime'):
body = ectx.eth_fn_call('dissect_%(ER)s_VisibleString', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s',),))
else:
body = ectx.eth_fn_call('dissect_%(ER)s_%(STRING_TYPE)s', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s',),))
else:
body = '#error Can not decode %s' % (tname)
@ -3167,7 +3168,7 @@ class ObjectIdentifierType (Type):
par=(('%(IMPLICIT_TAG)s', '%(PINFO)s', '%(TREE)s', '%(TVB)s', '%(OFFSET)s', '%(HF_INDEX)s', '%(VAL_PTR)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_object_identifier%(FN_VARIANT)s', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s', '%(VAL_PTR)s',),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s', '%(VAL_PTR)s',),))
else:
body = '#error Can not decode %s' % (tname)
return body
@ -3283,12 +3284,11 @@ class IntegerType (Type):
('%(VAL_PTR)s',),))
elif (ectx.Per() and not self.HasConstraint()):
body = ectx.eth_fn_call('dissect_%(ER)s_integer', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(VAL_PTR)s', '%(CREATED_ITEM_PTR)s'),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s', '%(VAL_PTR)s'),))
elif (ectx.Per() and ((self.constr.type == 'SingleValue') or (self.constr.type == 'ValueRange'))):
body = ectx.eth_fn_call('dissect_%(ER)s_constrained_integer', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s', '%(VAL_PTR)s', '%(CREATED_ITEM_PTR)s', '%(EXT)s'),))
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s', '%(VAL_PTR)s', '%(EXT)s'),))
else:
body = '#error Can not decode %s' % (tname)
return body
@ -3351,7 +3351,7 @@ class BitStringType (Type):
('%(VAL_PTR)s',),))
elif (ectx.Per()):
body = ectx.eth_fn_call('dissect_%(ER)s_bit_string', ret='offset',
par=(('%(TVB)s', '%(OFFSET)s', '%(PINFO)s', '%(TREE)s', '%(HF_INDEX)s'),
par=(('%(TVB)s', '%(OFFSET)s', '%(ACTX)s', '%(TREE)s', '%(HF_INDEX)s'),
('%(MIN_VAL)s', '%(MAX_VAL)s','%(EXT)s'),))
else:
body = '#error Can not decode %s' % (tname)