aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-03-25 21:42:26 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-03-25 21:42:26 +0000
commit0b3d2a90ff16fb7e4a7726132d60adcc9bb6bc09 (patch)
tree58ad933a6154c5addfb8a57f637eb97b0cd70b11
parent753ac017605096cca3812855eaa4b9f8f7bd5b96 (diff)
Migrate context tracing code from packet-h248.[ch] to gcp.[ch], so that the same code can be used by megaco (upcoming).
svn path=/trunk/; revision=21189
-rw-r--r--epan/Makefile.common2
-rw-r--r--epan/dissectors/packet-h248.c898
-rw-r--r--epan/dissectors/packet-h248.h164
-rw-r--r--epan/gcp.c718
-rw-r--r--epan/gcp.h217
5 files changed, 1027 insertions, 972 deletions
diff --git a/epan/Makefile.common b/epan/Makefile.common
index 108fe0cbfb..e633057e19 100644
--- a/epan/Makefile.common
+++ b/epan/Makefile.common
@@ -52,6 +52,7 @@ LIBWIRESHARK_SRC = \
follow.c \
frame_data.c \
funnel.c \
+ gcp.c \
guid-utils.c \
h225-persistentdata.c \
in_cksum.c \
@@ -134,6 +135,7 @@ LIBWIRESHARK_INCLUDES = \
follow.h \
frame_data.h \
funnel.h \
+ gcp.h \
gnuc_format_check.h \
greproto.h \
guid-utils.h \
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index 262a846d80..c8aa9b9c16 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -64,14 +64,6 @@ static int hf_h248_term_wild_type = -1;
static int hf_h248_term_wild_level = -1;
static int hf_h248_term_wild_position = -1;
-static int hf_h248_ctx = -1;
-static int hf_h248_ctx_term = -1;
-static int hf_h248_ctx_term_type = -1;
-static int hf_h248_ctx_term_bir = -1;
-static int hf_h248_ctx_term_nsap = -1;
-static int hf_h248_ctx_cmd = -1;
-
-
static int hf_h248_no_pkg = -1;
static int hf_h248_no_sig = -1;
static int hf_h248_no_evt = -1;
@@ -387,7 +379,7 @@ static int hf_h248_NotifyCompletion_otherReason = -1;
static int hf_h248_NotifyCompletion_onIteration = -1;
/*--- End of included file: packet-h248-hf.c ---*/
-#line 75 "packet-h248-template.c"
+#line 67 "packet-h248-template.c"
/* Initialize the subtree pointers */
static gint ett_h248 = -1;
@@ -396,18 +388,14 @@ static gint ett_packagename = -1;
static gint ett_codec = -1;
static gint ett_wildcard = -1;
-static gint ett_cmd = -1;
-static gint ett_ctx = -1;
-static gint ett_ctx_cmds = -1;
-static gint ett_ctx_terms = -1;
-static gint ett_ctx_term = -1;
-
static gint ett_h248_no_pkg = -1;
static gint ett_h248_no_sig = -1;
static gint ett_h248_no_evt = -1;
static int h248_tap = -1;
+static gcp_hf_ett_t h248_arrel = {{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1}};
+
/*--- Included file: packet-h248-ett.c ---*/
#line 1 "packet-h248-ett.c"
@@ -552,7 +540,7 @@ static gint ett_h248_TimeNotation = -1;
static gint ett_h248_Value = -1;
/*--- End of included file: packet-h248-ett.c ---*/
-#line 96 "packet-h248-template.c"
+#line 84 "packet-h248-template.c"
static dissector_handle_t h248_term_handle;
@@ -578,15 +566,6 @@ static dissector_handle_t h248_handle;
static dissector_handle_t h248_term_handle;
static dissector_handle_t h248_tpkt_handle;
-static const value_string term_types[] = {
- { H248_TERM_TYPE_AAL1, "aal1" },
- { H248_TERM_TYPE_AAL2, "aal2" },
- { H248_TERM_TYPE_AAL1_STRUCT, "aal1struct" },
- { H248_TERM_TYPE_IP_RTP, "ipRtp" },
- { H248_TERM_TYPE_TDM, "tdm" },
- { 0, NULL }
-};
-
/* Forward declarations */
static int dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
@@ -995,34 +974,9 @@ static const value_string wildcard_levels[] = {
{ 0, NULL }
};
-
-static const value_string cmd_type[] = {
- { H248_CMD_NONE, "NoCommand"},
- { H248_CMD_ADD_REQ, "addReq"},
- { H248_CMD_MOVE_REQ, "moveReq"},
- { H248_CMD_MOD_REQ, "modReq"},
- { H248_CMD_SUB_REQ, "subtractReq"},
- { H248_CMD_AUDITCAP_REQ, "auditCapRequest"},
- { H248_CMD_AUDITVAL_REQ, "auditValueRequest"},
- { H248_CMD_NOTIFY_REQ, "notifyReq"},
- { H248_CMD_SVCCHG_REQ, "serviceChangeReq"},
- { H248_CMD_TOPOLOGY_REQ, "topologyReq"},
- { H248_CMD_CTX_ATTR_AUDIT_REQ, "ctxAttrAuditReq"},
- { H248_CMD_ADD_REPLY, "addReply"},
- { H248_CMD_MOVE_REPLY, "moveReply"},
- { H248_CMD_MOD_REPLY, "modReply"},
- { H248_CMD_SUB_REPLY, "subtractReply"},
- { H248_CMD_AUDITCAP_REPLY, "auditCapReply"},
- { H248_CMD_AUDITVAL_REPLY, "auditValReply"},
- { H248_CMD_NOTIFY_REPLY, "notifyReply"},
- { H248_CMD_SVCCHG_REPLY, "serviceChangeReply"},
- { H248_CMD_TOPOLOGY_REPLY, "topologyReply"},
- { 0, NULL }
-};
-
static h248_curr_info_t curr_info = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
static guint32 error_code;
-static h248_wildcard_t wild_term;
+static gcp_wildcard_t wild_term;
extern void h248_param_ber_integer(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* u _U_, void* implicit) {
@@ -1643,676 +1597,6 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off
return offset;
}
-/*
- * Context and Transaction Tracing
- */
-
-
-
-static h248_msg_t* h248_msg(packet_info* pinfo, int o) {
- h248_msg_t* m;
- guint32 framenum = (guint32)pinfo->fd->num;
- guint32 offset = (guint32)o;
- address* src = &(pinfo->src);
- address* dst = &(pinfo->dst);
- address* lo_addr;
- address* hi_addr;
-
-
- if (keep_persistent_data) {
- emem_tree_key_t key[] = {
- {1,&(framenum)},
- {1,&offset},
- {0,NULL},
- };
-
- if (( m = se_tree_lookup32_array(msgs,key) )) {
- m->commited = TRUE;
- return m;
- } else {
- m = se_alloc(sizeof(h248_msg_t));
- m->framenum = framenum;
- m->trxs = NULL;
- m->commited = FALSE;
-
- se_tree_insert32_array(msgs,key,m);
- }
- } else {
- m = ep_new0(h248_msg_t);
- m->framenum = framenum;
- m->trxs = NULL;
- m->commited = FALSE;
- }
-
- if (CMP_ADDRESS(src, dst) < 0) {
- lo_addr = src;
- hi_addr = dst;
- } else {
- lo_addr = dst;
- hi_addr = src;
- }
-
- switch(lo_addr->type) {
- case AT_NONE:
- m->lo_addr = 0;
- m->hi_addr = 0;
- break;
- case AT_IPv4:
- memcpy((guint8*)&(m->hi_addr),hi_addr->data,4);
- memcpy((guint8*)&(m->lo_addr),lo_addr->data,4);
- break;
- case AT_SS7PC:
- m->hi_addr = mtp3_pc_hash(hi_addr->data);
- m->lo_addr = mtp3_pc_hash(lo_addr->data);
- break;
- default:
- /* XXX: heuristic and error prone */
- m->hi_addr = g_str_hash(address_to_str(hi_addr));
- m->lo_addr = g_str_hash(address_to_str(lo_addr));
- break;
- }
-
- return m;
-}
-
-static h248_trx_t* h248_trx(h248_msg_t* m ,guint32 t_id , h248_trx_type_t type) {
- h248_trx_t* t = NULL;
- h248_trx_msg_t* trxmsg;
-
- if ( !m ) return NULL;
-
- if (keep_persistent_data) {
- if (m->commited) {
-
- for ( trxmsg = m->trxs; trxmsg; trxmsg = trxmsg->next) {
- if (trxmsg->trx && trxmsg->trx->id == t_id) {
- return trxmsg->trx;
- }
- }
-
- DISSECTOR_ASSERT(! "a trx that should exist does not!" );
-
- } else {
- emem_tree_key_t key[] = {
- {1,&(m->hi_addr)},
- {1,&(m->lo_addr)},
- {1,&(t_id)},
- {0,NULL}
- };
-
- trxmsg = se_alloc(sizeof(h248_trx_msg_t));
- t = se_tree_lookup32_array(trxs,key);
-
- if (!t) {
- t = se_alloc(sizeof(h248_trx_t));
- t->initial = m;
- t->id = t_id;
- t->type = type;
- t->pendings = 0;
- t->error = 0;
- t->cmds = NULL;
-
- se_tree_insert32_array(trxs,key,t);
- }
-
- /* XXX: request, reply and ack + point to frames where they are */
- switch ( type ) {
- case H248_TRX_PENDING:
- t->pendings++;
- break;
- default:
- break;
- }
-
- }
- } else {
- t = ep_new(h248_trx_t);
- trxmsg = ep_new(h248_trx_msg_t);
- t->initial = NULL;
- t->id = t_id;
- t->type = type;
- t->pendings = 0;
- t->error = 0;
- t->cmds = NULL;
- }
-
- trxmsg->trx = t;
- trxmsg->next = NULL;
- trxmsg->last = trxmsg;
-
- if (m->trxs) {
- m->trxs->last = m->trxs->last->next = trxmsg;
- } else {
- m->trxs = trxmsg;
- }
-
- return t;
-}
-
-
-static h248_ctx_t* h248_ctx(h248_msg_t* m, h248_trx_t* t, guint32 c_id) {
- h248_ctx_t* context = NULL;
- h248_ctx_t** context_p = NULL;
-
- if ( !m || !t ) return NULL;
-
- if (keep_persistent_data) {
-
- emem_tree_key_t ctx_key[] = {
- {1,&(m->hi_addr)},
- {1,&(m->lo_addr)},
- {1,&(c_id)},
- {0,NULL}
- };
-
- emem_tree_key_t trx_key[] = {
- {1,&(m->hi_addr)},
- {1,&(m->lo_addr)},
- {1,&(t->id)},
- {0,NULL}
- };
-
- if (m->commited) {
- if (( context = se_tree_lookup32_array(ctxs_by_trx,trx_key) )) {
- return context;
- } if ((context_p = se_tree_lookup32_array(ctxs,ctx_key))) {
- context = *context_p;
-
- do {
- if (context->initial->framenum <= m->framenum) {
- return context;
- }
- } while(( context = context->prev ));
-
- DISSECTOR_ASSERT(! "a context should exist");
- }
- } else {
- if (c_id == CHOOSE_CONTEXT) {
- if (! ( context = se_tree_lookup32_array(ctxs_by_trx,trx_key))) {
- context = se_alloc(sizeof(h248_ctx_t));
- context->initial = m;
- context->cmds = NULL;
- context->id = c_id;
- context->terms.last = &(context->terms);
- context->terms.next = NULL;
- context->terms.term = NULL;
-
- se_tree_insert32_array(ctxs_by_trx,trx_key,context);
- }
- } else {
- if (( context = se_tree_lookup32_array(ctxs_by_trx,trx_key) )) {
- if (( context_p = se_tree_lookup32_array(ctxs,ctx_key) )) {
- if (context != *context_p) {
- context = se_alloc(sizeof(h248_ctx_t));
- context->initial = m;
- context->id = c_id;
- context->cmds = NULL;
- context->terms.last = &(context->terms);
- context->terms.next = NULL;
- context->terms.term = NULL;
-
- context->prev = *context_p;
- *context_p = context;
- }
- } else {
- context_p = se_alloc(sizeof(void*));
- *context_p = context;
- context->initial = m;
- context->id = c_id;
- se_tree_insert32_array(ctxs,ctx_key,context_p);
- }
- } else if (! ( context_p = se_tree_lookup32_array(ctxs,ctx_key) )) {
- context = se_alloc(sizeof(h248_ctx_t));
- context->initial = m;
- context->id = c_id;
- context->cmds = NULL;
- context->terms.last = &(context->terms);
- context->terms.next = NULL;
- context->terms.term = NULL;
-
- context_p = se_alloc(sizeof(void*));
- *context_p = context;
- se_tree_insert32_array(ctxs,ctx_key,context_p);
- } else {
- context = *context_p;
- }
- }
- }
- } else {
- context = ep_new(h248_ctx_t);
- context->initial = m;
- context->cmds = NULL;
- context->id = c_id;
- context->terms.last = &(context->terms);
- context->terms.next = NULL;
- context->terms.term = NULL;
- }
-
- return context;
-}
-
-static h248_cmd_t* h248_cmd(h248_msg_t* m, h248_trx_t* t, h248_ctx_t* c, h248_cmd_type_t type, guint offset) {
- h248_cmd_t* cmd;
- h248_cmd_msg_t* cmdtrx;
- h248_cmd_msg_t* cmdctx;
-
- if ( !m || !t || !c) return NULL;
-
- if (keep_persistent_data) {
- if (m->commited) {
- DISSECTOR_ASSERT(t->cmds != NULL);
-
- for (cmdctx = t->cmds; cmdctx; cmdctx = cmdctx->next) {
- cmd = cmdctx->cmd;
- if (cmd->msg == m && cmd->offset == offset) {
- return cmd;
- }
- }
-
- DISSECTOR_ASSERT(!"called for a command that does not exist!");
-
- return NULL;
- } else {
- cmd = se_alloc(sizeof(h248_cmd_t));
- cmdtrx = se_alloc(sizeof(h248_cmd_msg_t));
- cmdctx = se_alloc(sizeof(h248_cmd_msg_t));
- }
- } else {
- cmd = ep_new(h248_cmd_t);
- cmdtrx = ep_new(h248_cmd_msg_t);
- cmdctx = ep_new(h248_cmd_msg_t);
- }
-
- cmd->type = type;
- cmd->offset = offset;
- cmd->terms.term = NULL;
- cmd->terms.next = NULL;
- cmd->terms.last = &(cmd->terms);
- cmd->str = NULL;
- cmd->msg = m;
- cmd->trx = t;
- cmd->ctx = c;
- cmd->error = 0;
-
- cmdctx->cmd = cmdtrx->cmd = cmd;
- cmdctx->next = cmdtrx->next = NULL;
- cmdctx->last = cmdtrx->last = NULL;
-
- if (t->cmds) {
- t->cmds->last->next = cmdtrx;
- t->cmds->last = cmdtrx;
- } else {
- t->cmds = cmdtrx;
- t->cmds->last = cmdtrx;
- }
-
- if (c->cmds) {
- c->cmds->last->next = cmdctx;
- c->cmds->last = cmdctx;
- } else {
- c->cmds = cmdctx;
- c->cmds->last = cmdctx;
- }
-
- return cmd;
-}
-
-
-static h248_term_t* h248_cmd_add_term(h248_msg_t* m, h248_trx_t* tr, h248_cmd_t* c, h248_term_t* t, h248_wildcard_t wildcard) {
- h248_terms_t* ct;
- h248_terms_t* ct2;
-
- static h248_term_t all_terms = {"$",(guint8*)"",1,H248_TERM_TYPE_UNKNOWN,NULL,NULL,NULL};
-
- if ( !c ) return NULL;
-
- if ( wildcard == H248_WILDCARD_CHOOSE) {
- return &all_terms;
- }
-
- if (keep_persistent_data) {
- if ( c->msg->commited ) {
- if (wildcard == H248_WILDCARD_ALL) {
- for (ct = c->ctx->terms.next; ct; ct = ct->next) {
- /* XXX not handling more wilcards in one msg */
- if ( ct->term->start == m ) {
- return ct->term;
- }
- }
- return NULL;
- } else {
- for (ct = c->ctx->terms.next; ct; ct = ct->next) {
- if ( g_str_equal(ct->term->str,t->str) ) {
- return ct->term;
- }
- }
- return NULL;
- }
- } else {
-
- for (ct = c->ctx->terms.next; ct; ct = ct->next) {
- if ( g_str_equal(ct->term->str,t->str) || ct->term->start == m) {
- break;
- }
- }
-
- if ( ! ct ) {
-
- if (wildcard == H248_WILDCARD_ALL) {
- ct = se_alloc(sizeof(h248_terms_t));
- ct->next = NULL;
- ct->term = se_alloc0(sizeof(h248_term_t));
-
- ct->term->start = m;
- ct->term->str = "*";
- ct->term->buffer = NULL;
- ct->term->len = 0;
-
- c->terms.last = c->terms.last->next = ct;
-
- ct2 = se_alloc0(sizeof(h248_terms_t));
- ct2->term = ct->term;
-
- c->ctx->terms.last->next = ct2;
- c->ctx->terms.last = ct2;
-
- return ct->term;
- } else {
- for (ct = c->ctx->terms.next; ct; ct = ct->next) {
- /* XXX not handling more wilcards in one msg */
- if ( ct->term->buffer == NULL && tr->cmds->cmd->msg == ct->term->start ) {
- ct->term->str = se_strdup(t->str);
- ct->term->buffer = se_memdup(t->buffer,t->len);
- ct->term->len = t->len;
-
- ct2 = se_alloc0(sizeof(h248_terms_t));
- ct2->term = ct->term;
-
- c->terms.last = c->terms.last->next = ct2;
-
- return ct->term;
- }
-
- if ( g_str_equal(ct->term->str,t->str) ) {
- ct2 = se_alloc0(sizeof(h248_terms_t));
- ct2->term = ct->term;
-
- c->terms.last = c->terms.last->next = ct2;
-
- return ct->term;
- }
- }
-
- ct = se_alloc(sizeof(h248_terms_t));
- ct->next = NULL;
- ct->term = se_alloc0(sizeof(h248_term_t));
-
- ct->term->start = m;
- ct->term->str = se_strdup(t->str);
- ct->term->buffer = se_memdup(t->buffer,t->len);
- ct->term->len = t->len;
-
- ct2 = se_alloc0(sizeof(h248_terms_t));
- ct2->term = ct->term;
-
- c->terms.last = c->terms.last->next = ct2;
-
- ct2 = se_alloc0(sizeof(h248_terms_t));
- ct2->term = ct->term;
-
- c->ctx->terms.last = c->ctx->terms.last->next = ct2;
-
- return ct->term;
- }
- } else {
- ct2 = se_alloc0(sizeof(h248_terms_t));
- ct2->term = ct->term;
-
- c->terms.last = c->terms.last->next = ct2;
- return ct->term;
- }
-
- DISSECTOR_ASSERT_NOT_REACHED();
- return NULL;
- }
- } else {
- ct = ep_new(h248_terms_t);
- ct->term = t;
- ct->next = NULL;
- c->terms.last = c->terms.last->next = ct;
-
- return t;
- }
-
-}
-
-static gchar* h248_cmd_to_str(h248_cmd_t* c) {
- gchar* s = "-";
- h248_terms_t* term;
-
- if ( !c ) return "-";
-
- switch (c->type) {
- case H248_CMD_NONE:
- return "-";
- break;
- case H248_CMD_ADD_REQ:
- s = "AddReq {";
- break;
- case H248_CMD_MOVE_REQ:
- s = "MoveReq {";
- break;
- case H248_CMD_MOD_REQ:
- s = "ModReq {";
- break;
- case H248_CMD_SUB_REQ:
- s = "SubReq {";
- break;
- case H248_CMD_AUDITCAP_REQ:
- s = "AuditCapReq {";
- break;
- case H248_CMD_AUDITVAL_REQ:
- s = "AuditValReq {";
- break;
- case H248_CMD_NOTIFY_REQ:
- s = "NotifyReq {";
- break;
- case H248_CMD_SVCCHG_REQ:
- s = "SvcChgReq {";
- break;
- case H248_CMD_TOPOLOGY_REQ:
- s = "TopologyReq {";
- break;
- case H248_CMD_CTX_ATTR_AUDIT_REQ:
- s = "CtxAttribAuditReq {";
- break;
- case H248_CMD_ADD_REPLY:
- s = "AddReply {";
- break;
- case H248_CMD_MOVE_REPLY:
- s = "MoveReply {";
- break;
- case H248_CMD_MOD_REPLY:
- s = "ModReply {";
- break;
- case H248_CMD_SUB_REPLY:
- s = "SubReply {";
- break;
- case H248_CMD_AUDITCAP_REPLY:
- s = "AuditCapReply {";
- break;
- case H248_CMD_AUDITVAL_REPLY:
- s = "AuditValReply {";
- break;
- case H248_CMD_NOTIFY_REPLY:
- s = "NotifyReply {";
- break;
- case H248_CMD_SVCCHG_REPLY:
- s = "SvcChgReply {";
- break;
- case H248_CMD_TOPOLOGY_REPLY:
- s = "TopologyReply {";
- break;
- case H248_CMD_REPLY:
- s = "ActionReply {";
- break;
- }
-
- for (term = c->terms.next; term; term = term->next) {
- s = ep_strdup_printf("%s %s",s,term->term->str);
- };
-
- if (c->error) {
- s = ep_strdup_printf("%s Error=%i",s,c->error);
- }
-
- s = ep_strdup_printf("%s }", s);
-
- if (keep_persistent_data) {
- if (! c->str) c->str = se_strdup(s);
- } else {
- c->str = s;
- }
-
- return s;
-}
-
-static gchar* h248_trx_to_str(h248_msg_t* m, h248_trx_t* t) {
- gchar* s;
- h248_cmd_msg_t* c;
-
- if ( !m || !t ) return "-";
-
- s = ep_strdup_printf("T %x { ",t->id);
-
- if (t->cmds) {
- if (t->cmds->cmd->ctx) {
- s = ep_strdup_printf("%s C %x {",s,t->cmds->cmd->ctx->id);
-
- for (c = t->cmds; c; c = c->next) {
- if (c->cmd->msg == m)
- s = ep_strdup_printf("%s %s",s,h248_cmd_to_str(c->cmd));
- }
-
- s = ep_strdup_printf("%s %s",s,"}");
- }
- }
-
- if (t->error) {
- s = ep_strdup_printf("%s Error=%i",s,t->error);
- }
-
- return ep_strdup_printf("%s %s",s,"}");
-}
-
-static gchar* h248_msg_to_str(h248_msg_t* m) {
- h248_trx_msg_t* t;
- gchar* s = "";
-
- if ( !m ) return "-";
-
- for (t = m->trxs; t; t = t->next) {
- s = ep_strdup_printf("%s %s",s,h248_trx_to_str(m,t->trx));
- };
-
- return s;
-}
-
-typedef struct _h248_ctxs_t {
- struct _h248_ctx_t* ctx;
- struct _h248_ctxs_t* next;
-} h248_ctxs_t;
-
-/*static const gchar* trx_types[] = {"None","Req","Reply","Pending","Ack"};*/
-
-static void analyze_h248_msg(h248_msg_t* m) {
- h248_trx_msg_t* t;
- h248_ctxs_t contexts = {NULL,NULL};
- h248_ctxs_t* ctx_node;
- h248_cmd_msg_t* c;
-
-
- for (t = m->trxs; t; t = t->next) {
- for (c = t->trx->cmds; c; c = c->next) {
- h248_ctx_t* ctx = c->cmd->ctx;
-
- for (ctx_node = contexts.next; ctx_node; ctx_node = ctx_node->next) {
- if (ctx_node->ctx->id == ctx->id) {
- break;
- }
- }
-
- if (! ctx_node) {
- ctx_node = ep_new(h248_ctxs_t);
- ctx_node->ctx = ctx;
- ctx_node->next = contexts.next;
- contexts.next = ctx_node;
- }
-
- }
- }
-
- for (ctx_node = contexts.next; ctx_node; ctx_node = ctx_node->next) {
- h248_ctx_t* ctx = ctx_node->ctx;
- proto_item* ctx_item = proto_tree_add_uint(h248_tree,hf_h248_ctx,h248_tvb,0,0,ctx->id);
- proto_tree* ctx_tree = proto_item_add_subtree(ctx_item,ett_ctx);
- h248_terms_t *ctx_term;
-
- PROTO_ITEM_SET_GENERATED(ctx_item);
-
- if (( c = ctx->cmds )) {
- proto_item* history_item = proto_tree_add_text(ctx_tree,h248_tvb,0,0,"[ Command History ]");
- proto_tree* history_tree = proto_item_add_subtree(history_item,ett_ctx_cmds);
-
- for (c = ctx->cmds; c; c = c->next) {
- proto_item* cmd_item = proto_tree_add_uint(history_tree,hf_h248_ctx_cmd,h248_tvb,0,0,c->cmd->msg->framenum);
- proto_item_append_text(cmd_item," %s ",c->cmd->str);
- PROTO_ITEM_SET_GENERATED(cmd_item);
- if (c->cmd->error) {
- proto_item_set_expert_flags(cmd_item, PI_RESPONSE_CODE, PI_WARN);
- }
- }
- }
-
- if (( ctx_term = ctx->terms.next )) {
- proto_item* terms_item = proto_tree_add_text(ctx_tree,h248_tvb,0,0,"[ Terminations Used ]");
- proto_tree* terms_tree = proto_item_add_subtree(terms_item,ett_ctx_terms);
-
- for (; ctx_term; ctx_term = ctx_term->next ) {
- if ( ctx_term->term && ctx_term->term->str) {
- proto_item* pi = proto_tree_add_string(terms_tree,hf_h248_ctx_term,h248_tvb,0,0,ctx_term->term->str);
- proto_tree* term_tree = proto_item_add_subtree(pi,ett_ctx_term);
-
- PROTO_ITEM_SET_GENERATED(pi);
-
- if (ctx_term->term->type) {
- pi = proto_tree_add_uint(term_tree,hf_h248_ctx_term_type,h248_tvb,0,0,ctx_term->term->type);
- PROTO_ITEM_SET_GENERATED(pi);
- }
-
- if (ctx_term->term->bir) {
- pi = proto_tree_add_string(term_tree,hf_h248_ctx_term_bir,h248_tvb,0,0,ctx_term->term->bir);
- PROTO_ITEM_SET_GENERATED(pi);
- }
-
- if (ctx_term->term->nsap) {
- pi = proto_tree_add_string(term_tree,hf_h248_ctx_term_nsap,h248_tvb,0,0,ctx_term->term->nsap);
- PROTO_ITEM_SET_GENERATED(pi);
- }
-
- if (ctx_term->term->bir && ctx_term->term->nsap) {
- gchar* key = ep_strdup_printf("%s:%s",ctx_term->term->nsap,ctx_term->term->bir);
- g_strdown(key);
- alcap_tree_from_bearer_key(term_tree, h248_tvb, key);
- }
- }
- }
- }
- }
-}
-
-#define h248_cmd_set_error(c,e) (c->error = e)
-#define h248_trx_set_error(t,e) (t->error = e)
#define H248_TAP() do { if (keep_persistent_data && curr_info.cmd) tap_queue_packet(h248_tap, pinfo, curr_info.cmd); } while(0)
@@ -2602,14 +1886,14 @@ static int dissect_serviceChangeMgcId_impl(packet_info *pinfo _U_, proto_tree *t
static int
dissect_h248_T_errorCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 236 "h248.cnf"
+#line 237 "h248.cnf"
offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_h248_error_code, &error_code);
expert_add_info_format(pinfo, get_ber_last_created_item(), PI_RESPONSE_CODE, PI_WARN, "Errored Command");
if (curr_info.cmd) {
- h248_cmd_set_error(curr_info.cmd,error_code);
+ gcp_cmd_set_error(curr_info.cmd,error_code);
} else if (curr_info.trx) {
- h248_trx_set_error(curr_info.trx,error_code);
+ gcp_trx_set_error(curr_info.trx,error_code);
}
return offset;
@@ -2685,10 +1969,10 @@ static int dissect_lastAck_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tv
static int
dissect_h248_transactionId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 91 "h248.cnf"
+#line 92 "h248.cnf"
guint32 trx_id = 0;
offset = dissect_h248_trx_id(implicit_tag, pinfo, tree, tvb, offset, &trx_id);
- curr_info.trx = h248_trx(curr_info.msg,trx_id,H248_TRX_REQUEST);
+ curr_info.trx = gcp_trx(curr_info.msg, trx_id, GCP_TRX_REQUEST, keep_persistent_data);
error_code = 0;
@@ -2700,22 +1984,13 @@ static int dissect_transactionId_impl(packet_info *pinfo _U_, proto_tree *tree _
-static int
-dissect_h248_ContextID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
- NULL);
-
- return offset;
-}
-
-
static int
dissect_h248_contextId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 98 "h248.cnf"
+#line 99 "h248.cnf"
guint32 ctx_id = 0;
offset = dissect_h248_ctx_id(implicit_tag, pinfo, tree, tvb, offset, &ctx_id);
- curr_info.ctx = h248_ctx(curr_info.msg,curr_info.trx,ctx_id);
+ curr_info.ctx = gcp_ctx(curr_info.msg,curr_info.trx,ctx_id,keep_persistent_data);
curr_info.cmd = NULL;
curr_info.term = NULL;
@@ -2782,7 +2057,7 @@ static int dissect_keepActive_impl(packet_info *pinfo _U_, proto_tree *tree _U_,
static int
dissect_h248_WildcardField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 254 "h248.cnf"
+#line 255 "h248.cnf"
tvbuff_t* new_tvb;
offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb);
tree = proto_item_add_subtree(get_ber_last_created_item(),ett_wildcard);
@@ -2790,7 +2065,7 @@ dissect_h248_WildcardField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
proto_tree_add_item(tree,hf_h248_term_wild_level,new_tvb,0,1,FALSE);
proto_tree_add_item(tree,hf_h248_term_wild_position,new_tvb,0,1,FALSE);
- wild_term = tvb_get_guint8(new_tvb,0) & 0x80 ? H248_WILDCARD_CHOOSE : H248_WILDCARD_ALL;
+ wild_term = tvb_get_guint8(new_tvb,0) & 0x80 ? GCP_WILDCARD_CHOOSE : GCP_WILDCARD_ALL;
@@ -2820,7 +2095,7 @@ static int dissect_wildcard_impl(packet_info *pinfo _U_, proto_tree *tree _U_, t
static int
dissect_h248_T_terminationId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 266 "h248.cnf"
+#line 267 "h248.cnf"
tvbuff_t* new_tvb;
offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, &new_tvb);
@@ -2833,7 +2108,7 @@ dissect_h248_T_terminationId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
curr_info.term->str = bytes_to_str(curr_info.term->buffer,curr_info.term->len);
}
- curr_info.term = h248_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term);
+ curr_info.term = gcp_cmd_add_term(curr_info.msg, curr_info.trx, curr_info.cmd, curr_info.term, wild_term, keep_persistent_data);
if (h248_term_handle) {
call_dissector(h248_term_handle, new_tvb, pinfo, tree);
@@ -2860,9 +2135,9 @@ static const ber_sequence_t TerminationID_sequence[] = {
static int
dissect_h248_TerminationID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 249 "h248.cnf"
- curr_info.term = ep_new0(h248_term_t);
- wild_term = H248_WILDCARD_NONE;
+#line 250 "h248.cnf"
+ curr_info.term = ep_new0(gcp_term_t);
+ wild_term = GCP_WILDCARD_NONE;
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
TerminationID_sequence, hf_index, ett_h248_TerminationID);
@@ -2965,14 +2240,14 @@ static const ber_sequence_t T_topologyReq_sequence_of[1] = {
static int
dissect_h248_T_topologyReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 180 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_TOPOLOGY_REQ,offset);
+#line 181 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_TOPOLOGY_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
T_topologyReq_sequence_of, hf_index, ett_h248_T_topologyReq);
-#line 184 "h248.cnf"
+#line 185 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -3346,13 +2621,13 @@ dissect_h248_ContextAttrAuditRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U
static int
dissect_h248_T_contextAttrAuditReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 188 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_CTX_ATTR_AUDIT_REQ,offset);
+#line 189 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_CTX_ATTR_AUDIT_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_ContextAttrAuditRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 192 "h248.cnf"
+#line 193 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5161,13 +4436,13 @@ dissect_h248_AmmRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_h248_T_addReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 113 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_ADD_REQ,offset);
+#line 114 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_ADD_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 118 "h248.cnf"
+#line 119 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5180,14 +4455,14 @@ static int dissect_addReq_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tvb
static int
dissect_h248_T_moveReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 122 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_MOVE_REQ,offset);
+#line 123 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOVE_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 128 "h248.cnf"
+#line 129 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5200,13 +4475,13 @@ static int dissect_moveReq_impl(packet_info *pinfo _U_, proto_tree *tree _U_, tv
static int
dissect_h248_T_modReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 132 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_MOD_REQ,offset);
+#line 133 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOD_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 136 "h248.cnf"
+#line 137 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5234,13 +4509,13 @@ dissect_h248_SubtractRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
static int
dissect_h248_T_subtractReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 140 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_SUB_REQ,offset);
+#line 141 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SUB_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_SubtractRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 144 "h248.cnf"
+#line 145 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5269,13 +4544,13 @@ dissect_h248_AuditRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
static int
dissect_h248_T_auditCapRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 148 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_AUDITCAP_REQ,offset);
+#line 149 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITCAP_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AuditRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 152 "h248.cnf"
+#line 153 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5288,13 +4563,13 @@ static int dissect_auditCapRequest_impl(packet_info *pinfo _U_, proto_tree *tree
static int
dissect_h248_T_auditValueRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 156 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_AUDITVAL_REQ,offset);
+#line 157 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AuditRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 160 "h248.cnf"
+#line 161 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5401,13 +4676,13 @@ dissect_h248_NotifyRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
static int
dissect_h248_T_notifyReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 164 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_NOTIFY_REQ,offset);
+#line 165 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_NOTIFY_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_NotifyRequest(implicit_tag, tvb, offset, pinfo, tree, hf_index);
-#line 168 "h248.cnf"
+#line 169 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5507,7 +4782,7 @@ static int dissect_serviceChangeProfile_impl(packet_info *pinfo _U_, proto_tree
static int
dissect_h248_SCreasonValueOctetStr(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 292 "h248.cnf"
+#line 293 "h248.cnf"
tvbuff_t *parameter_tvb;
offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
@@ -5592,14 +4867,14 @@ static const ber_sequence_t ServiceChangeRequest_sequence[] = {
static int
dissect_h248_ServiceChangeRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 172 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_SVCCHG_REQ,offset);
+#line 173 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SVCCHG_REQ,offset,keep_persistent_data);
H248_TAP();
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
ServiceChangeRequest_sequence, hf_index, ett_h248_ServiceChangeRequest);
-#line 176 "h248.cnf"
+#line 177 "h248.cnf"
curr_info.cmd = NULL;
return offset;
@@ -5868,8 +5143,8 @@ dissect_h248_AmmsReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_h248_T_addReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 196 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_ADD_REPLY,offset);
+#line 197 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_ADD_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmsReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -5884,8 +5159,8 @@ static int dissect_addReply_impl(packet_info *pinfo _U_, proto_tree *tree _U_, t
static int
dissect_h248_T_moveReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 201 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_MOVE_REPLY,offset);
+#line 202 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOVE_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmsReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -5900,8 +5175,8 @@ static int dissect_moveReply_impl(packet_info *pinfo _U_, proto_tree *tree _U_,
static int
dissect_h248_T_modReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 206 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_MOD_REPLY,offset);
+#line 207 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_MOD_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmsReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -5916,8 +5191,8 @@ static int dissect_modReply_impl(packet_info *pinfo _U_, proto_tree *tree _U_, t
static int
dissect_h248_T_subtractReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 211 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_SUB_REPLY,offset);
+#line 212 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SUB_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AmmsReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -5997,8 +5272,8 @@ dissect_h248_AuditReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_h248_T_auditCapReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 226 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_AUDITCAP_REPLY,offset);
+#line 227 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITCAP_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AuditReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -6013,8 +5288,8 @@ static int dissect_auditCapReply_impl(packet_info *pinfo _U_, proto_tree *tree _
static int
dissect_h248_T_auditValueReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 231 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_AUDITVAL_REPLY,offset);
+#line 232 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_AUDITVAL_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_AuditReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -6044,8 +5319,8 @@ dissect_h248_NotifyReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
static int
dissect_h248_T_notifyReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 216 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_NOTIFY_REPLY,offset);
+#line 217 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_NOTIFY_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_h248_NotifyReply(implicit_tag, tvb, offset, pinfo, tree, hf_index);
@@ -6111,8 +5386,8 @@ static const ber_sequence_t ServiceChangeReply_sequence[] = {
static int
dissect_h248_ServiceChangeReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 221 "h248.cnf"
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_SVCCHG_REPLY,offset);
+#line 222 "h248.cnf"
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_SVCCHG_REPLY,offset,keep_persistent_data);
H248_TAP();
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
@@ -6191,9 +5466,9 @@ dissect_h248_ActionReply(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
ActionReply_sequence, hf_index, ett_h248_ActionReply);
-#line 106 "h248.cnf"
+#line 107 "h248.cnf"
if (!curr_info.cmd) {
- curr_info.cmd = h248_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,H248_CMD_REPLY,offset);
+ curr_info.cmd = gcp_cmd(curr_info.msg,curr_info.trx,curr_info.ctx,GCP_CMD_REPLY,offset,keep_persistent_data);
H248_TAP();
}
@@ -6416,18 +5691,18 @@ static const ber_sequence_t Message_sequence[] = {
static int
dissect_h248_Message(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 79 "h248.cnf"
- curr_info.msg = h248_msg(pinfo,TVB_RAW_OFFSET(tvb));
+#line 80 "h248.cnf"
+ curr_info.msg = gcp_msg(pinfo,TVB_RAW_OFFSET(tvb),keep_persistent_data);
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
Message_sequence, hf_index, ett_h248_Message);
-#line 83 "h248.cnf"
+#line 84 "h248.cnf"
if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO, h248_msg_to_str(curr_info.msg));
+ col_set_str(pinfo->cinfo, COL_INFO, gcp_msg_to_str(curr_info.msg,keep_persistent_data));
if (keep_persistent_data)
- analyze_h248_msg(curr_info.msg);
+ gcp_analyze_msg(h248_tree, h248_tvb, curr_info.msg, &h248_arrel);
return offset;
}
@@ -6463,7 +5738,7 @@ dissect_h248_ServiceChangeReasonStr(gboolean implicit_tag _U_, tvbuff_t *tvb _U_
/*--- End of included file: packet-h248-fn.c ---*/
-#line 1859 "packet-h248-template.c"
+#line 1143 "packet-h248-template.c"
static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle);
@@ -6574,7 +5849,7 @@ void proto_register_h248(void) {
VALS(signal_name_vals), 0, "Package", HFILL }},
{ &hf_h248_pkg_bcp_BNCChar_PDU,
{ "BNCChar", "h248.package_bcp.BNCChar",
- FT_UINT32, BASE_DEC, VALS(term_types), 0,
+ FT_UINT32, BASE_DEC, VALS(gcp_term_types), 0,
"BNCChar", HFILL }},
{ &hf_h248_error_code,
@@ -7832,14 +7107,10 @@ void proto_register_h248(void) {
"", HFILL }},
/*--- End of included file: packet-h248-hfarr.c ---*/
-#line 2015 "packet-h248-template.c"
-
- { &hf_h248_ctx, { "Context", "h248.ctx", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }},
- { &hf_h248_ctx_term, { "Termination", "h248.ctx.term", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }},
- { &hf_h248_ctx_term_type, { "Type", "h248.ctx.term.type", FT_UINT32, BASE_HEX, VALS(term_types), 0, "", HFILL }},
- { &hf_h248_ctx_term_bir, { "BIR", "h248.ctx.term.bir", FT_STRING, BASE_HEX, NULL, 0, "", HFILL }},
- { &hf_h248_ctx_term_nsap, { "NSAP", "h248.ctx.term.nsap", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }},
- { &hf_h248_ctx_cmd, { "Command in Frame", "h248.ctx.cmd", FT_FRAMENUM, BASE_DEC, NULL, 0, "", HFILL }},
+#line 1299 "packet-h248-template.c"
+
+ GCP_HF_ARR_ELEMS("h248",h248_arrel)
+
};
/* List of subtrees */
@@ -7849,14 +7120,11 @@ void proto_register_h248(void) {
&ett_packagename,
&ett_codec,
&ett_wildcard,
- &ett_cmd,
- &ett_ctx,
- &ett_ctx_cmds,
- &ett_ctx_terms,
- &ett_ctx_term,
&ett_h248_no_pkg,
&ett_h248_no_sig,
&ett_h248_no_evt,
+ GCP_ETT_ARR_ELEMS(h248_arrel),
+
/*--- Included file: packet-h248-ettarr.c ---*/
#line 1 "packet-h248-ettarr.c"
@@ -8001,7 +7269,7 @@ void proto_register_h248(void) {
&ett_h248_Value,
/*--- End of included file: packet-h248-ettarr.c ---*/
-#line 2040 "packet-h248-template.c"
+#line 1317 "packet-h248-template.c"
};
module_t *h248_module;
@@ -8045,6 +7313,8 @@ void proto_register_h248(void) {
ctxs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "h248_ctxs");
h248_tap = register_tap("h248");
+
+ gcp_init();
}
/*--- proto_reg_handoff_h248 -------------------------------------------*/
diff --git a/epan/dissectors/packet-h248.h b/epan/dissectors/packet-h248.h
index 067a20c258..e9c237f6af 100644
--- a/epan/dissectors/packet-h248.h
+++ b/epan/dissectors/packet-h248.h
@@ -34,163 +34,11 @@
*/
#ifndef PACKET_H248_H
-#define PACKET_H248_H
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <glib.h>
-#include <epan/packet.h>
-#include <epan/conversation.h>
-#include <epan/strutil.h>
-#include <epan/emem.h>
-#include <epan/expert.h>
-#include <epan/prefs.h>
-#include <epan/to_str.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <epan/dissectors/packet-ber.h>
-#include <epan/dissectors/packet-q931.h>
-#include <epan/dissectors/packet-mtp3.h>
-#include <epan/dissectors/packet-alcap.h>
-#include <epan/dissectors/packet-isup.h>
-
-#include <epan/sctpppids.h>
+#include <epan/gcp.h>
/*#include "packet-h248-exp.h"*/
-#define NULL_CONTEXT 0
-#define CHOOSE_CONTEXT 0xFFFFFFFE
-#define ALL_CONTEXTS 0xFFFFFFFF
-
-typedef enum {
- H248_CMD_NONE,
- H248_CMD_ADD_REQ,
- H248_CMD_MOVE_REQ,
- H248_CMD_MOD_REQ,
- H248_CMD_SUB_REQ,
- H248_CMD_AUDITCAP_REQ,
- H248_CMD_AUDITVAL_REQ,
- H248_CMD_NOTIFY_REQ,
- H248_CMD_SVCCHG_REQ,
- H248_CMD_TOPOLOGY_REQ,
- H248_CMD_CTX_ATTR_AUDIT_REQ,
- H248_CMD_ADD_REPLY,
- H248_CMD_MOVE_REPLY,
- H248_CMD_MOD_REPLY,
- H248_CMD_SUB_REPLY,
- H248_CMD_AUDITCAP_REPLY,
- H248_CMD_AUDITVAL_REPLY,
- H248_CMD_NOTIFY_REPLY,
- H248_CMD_SVCCHG_REPLY,
- H248_CMD_TOPOLOGY_REPLY,
- H248_CMD_REPLY
-} h248_cmd_type_t;
-
-typedef enum {
- H248_TRX_NONE,
- H248_TRX_REQUEST,
- H248_TRX_PENDING,
- H248_TRX_REPLY,
- H248_TRX_ACK
-} h248_trx_type_t;
-
-
-typedef struct _h248_msg_t {
- guint32 lo_addr;
- guint32 hi_addr;
- guint32 framenum;
- struct _h248_trx_msg_t* trxs;
- gboolean commited;
-} h248_msg_t;
-
-typedef struct _h248_trx_msg_t {
- struct _h248_trx_t* trx;
- struct _h248_trx_msg_t* next;
- struct _h248_trx_msg_t* last;
-} h248_trx_msg_t;
-
-typedef struct _h248_cmd_msg_t {
- struct _h248_cmd_t* cmd;
- struct _h248_cmd_msg_t* next;
- struct _h248_cmd_msg_t* last;
-} h248_cmd_msg_t;
-
-typedef struct _h248_trx_t {
- h248_msg_t* initial;
- guint32 id;
- h248_trx_type_t type;
- guint pendings;
- struct _h248_cmd_msg_t* cmds;
- struct _h248_trx_ctx_t* ctxs;
- guint error;
-} h248_trx_t;
-
-#define H248_TERM_TYPE_UNKNOWN 0
-#define H248_TERM_TYPE_AAL1 1
-#define H248_TERM_TYPE_AAL2 2
-#define H248_TERM_TYPE_AAL1_STRUCT 3
-#define H248_TERM_TYPE_IP_RTP 4
-#define H248_TERM_TYPE_TDM 5
-
-typedef enum _h248_wildcard_t {
- H248_WILDCARD_NONE,
- H248_WILDCARD_CHOOSE,
- H248_WILDCARD_ALL
-} h248_wildcard_t;
-
-typedef struct _h248_term_t {
- gchar* str;
-
- guint8* buffer;
- guint len;
-
- guint type;
- gchar* bir;
- gchar* nsap;
-
- h248_msg_t* start;
-
- /*
- guint16 vp;
- guint16 vc;
- guint32 ts_mask;
- address* src_addr;
- address* dst_addr;
- guint16 src_pt;
- guint16 dst_pt;
- */
-
-} h248_term_t;
-
-typedef struct _h248_terms_t {
- h248_term_t* term;
- struct _h248_terms_t* next;
- struct _h248_terms_t* last;
-} h248_terms_t;
-
-typedef struct _h248_cmd_t {
- guint offset;
- gchar* str;
- h248_cmd_type_t type;
- h248_terms_t terms;
- struct _h248_msg_t* msg;
- struct _h248_trx_t* trx;
- struct _h248_ctx_t* ctx;
- guint error;
-} h248_cmd_t;
-
-
-typedef struct _h248_ctx_t {
- h248_msg_t* initial;
- guint32 id;
- struct _h248_cmd_msg_t* cmds;
- struct _h248_ctx_t* prev;
- h248_terms_t terms;
-} h248_ctx_t;
-
typedef struct _h248_curr_info_t h248_curr_info_t;
typedef void (*h248_pkg_param_dissector_t)(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_, int hfid, h248_curr_info_t*, void*);
@@ -248,11 +96,11 @@ typedef struct _h248_package_t {
} h248_package_t;
struct _h248_curr_info_t {
- h248_ctx_t* ctx;
- h248_trx_t* trx;
- h248_msg_t* msg;
- h248_term_t* term;
- h248_cmd_t* cmd;
+ gcp_ctx_t* ctx;
+ gcp_trx_t* trx;
+ gcp_msg_t* msg;
+ gcp_term_t* term;
+ gcp_cmd_t* cmd;
const h248_package_t* pkg;
const h248_pkg_evt_t* evt;
const h248_pkg_sig_t* sig;
diff --git a/epan/gcp.c b/epan/gcp.c
new file mode 100644
index 0000000000..bf2a087480
--- /dev/null
+++ b/epan/gcp.c
@@ -0,0 +1,718 @@
+/*
+ * Context and Transaction Tracing
+ */
+
+#include "gcp.h"
+
+static emem_tree_t* msgs = NULL;
+static emem_tree_t* trxs = NULL;
+static emem_tree_t* ctxs_by_trx = NULL;
+static emem_tree_t* ctxs = NULL;
+static gboolean gcp_initailized = FALSE;
+
+
+const value_string gcp_cmd_type[] = {
+ { GCP_CMD_NONE, "NoCommand"},
+ { GCP_CMD_ADD_REQ, "addReq"},
+ { GCP_CMD_MOVE_REQ, "moveReq"},
+ { GCP_CMD_MOD_REQ, "modReq"},
+ { GCP_CMD_SUB_REQ, "subtractReq"},
+ { GCP_CMD_AUDITCAP_REQ, "auditCapRequest"},
+ { GCP_CMD_AUDITVAL_REQ, "auditValueRequest"},
+ { GCP_CMD_NOTIFY_REQ, "notifyReq"},
+ { GCP_CMD_SVCCHG_REQ, "serviceChangeReq"},
+ { GCP_CMD_TOPOLOGY_REQ, "topologyReq"},
+ { GCP_CMD_CTX_ATTR_AUDIT_REQ, "ctxAttrAuditReq"},
+ { GCP_CMD_ADD_REPLY, "addReply"},
+ { GCP_CMD_MOVE_REPLY, "moveReply"},
+ { GCP_CMD_MOD_REPLY, "modReply"},
+ { GCP_CMD_SUB_REPLY, "subtractReply"},
+ { GCP_CMD_AUDITCAP_REPLY, "auditCapReply"},
+ { GCP_CMD_AUDITVAL_REPLY, "auditValReply"},
+ { GCP_CMD_NOTIFY_REPLY, "notifyReply"},
+ { GCP_CMD_SVCCHG_REPLY, "serviceChangeReply"},
+ { GCP_CMD_TOPOLOGY_REPLY, "topologyReply"},
+ { 0, NULL }
+};
+
+const value_string gcp_term_types[] = {
+ { GCP_TERM_TYPE_AAL1, "aal1" },
+ { GCP_TERM_TYPE_AAL2, "aal2" },
+ { GCP_TERM_TYPE_AAL1_STRUCT, "aal1struct" },
+ { GCP_TERM_TYPE_IP_RTP, "ipRtp" },
+ { GCP_TERM_TYPE_TDM, "tdm" },
+ { 0, NULL }
+};
+
+
+void gcp_init(void) {
+ if (gcp_initailized) return;
+
+ msgs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "gcp_msgs");
+ trxs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "gcp_trxs");
+ ctxs_by_trx = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "gcp_ctxs_by_trx");
+ ctxs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "gcp_ctxs");
+ gcp_initailized = TRUE;
+}
+
+gcp_msg_t* gcp_msg(packet_info* pinfo, int o, gboolean keep_persistent_data) {
+ gcp_msg_t* m;
+ guint32 framenum = (guint32)pinfo->fd->num;
+ guint32 offset = (guint32)o;
+ address* src = &(pinfo->src);
+ address* dst = &(pinfo->dst);
+ address* lo_addr;
+ address* hi_addr;
+
+
+ if (keep_persistent_data) {
+ emem_tree_key_t key[] = {
+ {1,&(framenum)},
+ {1,&offset},
+ {0,NULL},
+ };
+
+ if (( m = se_tree_lookup32_array(msgs,key) )) {
+ m->commited = TRUE;
+ return m;
+ } else {
+ m = se_alloc(sizeof(gcp_msg_t));
+ m->framenum = framenum;
+ m->trxs = NULL;
+ m->commited = FALSE;
+
+ se_tree_insert32_array(msgs,key,m);
+ }
+ } else {
+ m = ep_new0(gcp_msg_t);
+ m->framenum = framenum;
+ m->trxs = NULL;
+ m->commited = FALSE;
+ }
+
+ if (CMP_ADDRESS(src, dst) < 0) {
+ lo_addr = src;
+ hi_addr = dst;
+ } else {
+ lo_addr = dst;
+ hi_addr = src;
+ }
+
+ switch(lo_addr->type) {
+ case AT_NONE:
+ m->lo_addr = 0;
+ m->hi_addr = 0;
+ break;
+ case AT_IPv4:
+ memcpy((guint8*)&(m->hi_addr),hi_addr->data,4);
+ memcpy((guint8*)&(m->lo_addr),lo_addr->data,4);
+ break;
+ case AT_SS7PC:
+ m->hi_addr = mtp3_pc_hash(hi_addr->data);
+ m->lo_addr = mtp3_pc_hash(lo_addr->data);
+ break;
+ default:
+ /* XXX: heuristic and error prone */
+ m->hi_addr = g_str_hash(address_to_str(hi_addr));
+ m->lo_addr = g_str_hash(address_to_str(lo_addr));
+ break;
+ }
+
+ return m;
+}
+
+gcp_trx_t* gcp_trx(gcp_msg_t* m ,guint32 t_id , gcp_trx_type_t type, gboolean keep_persistent_data) {
+ gcp_trx_t* t = NULL;
+ gcp_trx_msg_t* trxmsg;
+
+ if ( !m ) return NULL;
+
+ if (keep_persistent_data) {
+ if (m->commited) {
+
+ for ( trxmsg = m->trxs; trxmsg; trxmsg = trxmsg->next) {
+ if (trxmsg->trx && trxmsg->trx->id == t_id) {
+ return trxmsg->trx;
+ }
+ }
+
+ DISSECTOR_ASSERT(! "a trx that should exist does not!" );
+
+ } else {
+ emem_tree_key_t key[] = {
+ {1,&(m->hi_addr)},
+ {1,&(m->lo_addr)},
+ {1,&(t_id)},
+ {0,NULL}
+ };
+
+ trxmsg = se_alloc(sizeof(gcp_trx_msg_t));
+ t = se_tree_lookup32_array(trxs,key);
+
+ if (!t) {
+ t = se_alloc(sizeof(gcp_trx_t));
+ t->initial = m;
+ t->id = t_id;
+ t->type = type;
+ t->pendings = 0;
+ t->error = 0;
+ t->cmds = NULL;
+
+ se_tree_insert32_array(trxs,key,t);
+ }
+
+ /* XXX: request, reply and ack + point to frames where they are */
+ switch ( type ) {
+ case GCP_TRX_PENDING:
+ t->pendings++;
+ break;
+ default:
+ break;
+ }
+
+ }
+ } else {
+ t = ep_new(gcp_trx_t);
+ trxmsg = ep_new(gcp_trx_msg_t);
+ t->initial = NULL;
+ t->id = t_id;
+ t->type = type;
+ t->pendings = 0;
+ t->error = 0;
+ t->cmds = NULL;
+ }
+
+ trxmsg->trx = t;
+ trxmsg->next = NULL;
+ trxmsg->last = trxmsg;
+
+ if (m->trxs) {
+ m->trxs->last = m->trxs->last->next = trxmsg;
+ } else {
+ m->trxs = trxmsg;
+ }
+
+ return t;
+}
+
+
+gcp_ctx_t* gcp_ctx(gcp_msg_t* m, gcp_trx_t* t, guint32 c_id, gboolean persistent) {
+ gcp_ctx_t* context = NULL;
+ gcp_ctx_t** context_p = NULL;
+
+ if ( !m || !t ) return NULL;
+
+ if (persistent) {
+
+ emem_tree_key_t ctx_key[] = {
+ {1,&(m->hi_addr)},
+ {1,&(m->lo_addr)},
+ {1,&(c_id)},
+ {0,NULL}
+ };
+
+ emem_tree_key_t trx_key[] = {
+ {1,&(m->hi_addr)},
+ {1,&(m->lo_addr)},
+ {1,&(t->id)},
+ {0,NULL}
+ };
+
+ if (m->commited) {
+ if (( context = se_tree_lookup32_array(ctxs_by_trx,trx_key) )) {
+ return context;
+ } if ((context_p = se_tree_lookup32_array(ctxs,ctx_key))) {
+ context = *context_p;
+
+ do {
+ if (context->initial->framenum <= m->framenum) {
+ return context;
+ }
+ } while(( context = context->prev ));
+
+ DISSECTOR_ASSERT(! "a context should exist");
+ }
+ } else {
+ if (c_id == CHOOSE_CONTEXT) {
+ if (! ( context = se_tree_lookup32_array(ctxs_by_trx,trx_key))) {
+ context = se_alloc(sizeof(gcp_ctx_t));
+ context->initial = m;
+ context->cmds = NULL;
+ context->id = c_id;
+ context->terms.last = &(context->terms);
+ context->terms.next = NULL;
+ context->terms.term = NULL;
+
+ se_tree_insert32_array(ctxs_by_trx,trx_key,context);
+ }
+ } else {
+ if (( context = se_tree_lookup32_array(ctxs_by_trx,trx_key) )) {
+ if (( context_p = se_tree_lookup32_array(ctxs,ctx_key) )) {
+ if (context != *context_p) {
+ context = se_alloc(sizeof(gcp_ctx_t));
+ context->initial = m;
+ context->id = c_id;
+ context->cmds = NULL;
+ context->terms.last = &(context->terms);
+ context->terms.next = NULL;
+ context->terms.term = NULL;
+
+ context->prev = *context_p;
+ *context_p = context;
+ }
+ } else {
+ context_p = se_alloc(sizeof(void*));
+ *context_p = context;
+ context->initial = m;
+ context->id = c_id;
+ se_tree_insert32_array(ctxs,ctx_key,context_p);
+ }
+ } else if (! ( context_p = se_tree_lookup32_array(ctxs,ctx_key) )) {
+ context = se_alloc(sizeof(gcp_ctx_t));
+ context->initial = m;
+ context->id = c_id;
+ context->cmds = NULL;
+ context->terms.last = &(context->terms);
+ context->terms.next = NULL;
+ context->terms.term = NULL;
+
+ context_p = se_alloc(sizeof(void*));
+ *context_p = context;
+ se_tree_insert32_array(ctxs,ctx_key,context_p);
+ } else {
+ context = *context_p;
+ }
+ }
+ }
+ } else {
+ context = ep_new(gcp_ctx_t);
+ context->initial = m;
+ context->cmds = NULL;
+ context->id = c_id;
+ context->terms.last = &(context->terms);
+ context->terms.next = NULL;
+ context->terms.term = NULL;
+ }
+
+ return context;
+}
+
+gcp_cmd_t* gcp_cmd(gcp_msg_t* m, gcp_trx_t* t, gcp_ctx_t* c, gcp_cmd_type_t type, guint offset, gboolean persistent) {
+ gcp_cmd_t* cmd;
+ gcp_cmd_msg_t* cmdtrx;
+ gcp_cmd_msg_t* cmdctx;
+
+ if ( !m || !t || !c) return NULL;
+
+ if (persistent) {
+ if (m->commited) {
+ DISSECTOR_ASSERT(t->cmds != NULL);
+
+ for (cmdctx = t->cmds; cmdctx; cmdctx = cmdctx->next) {
+ cmd = cmdctx->cmd;
+ if (cmd->msg == m && cmd->offset == offset) {
+ return cmd;
+ }
+ }
+
+ DISSECTOR_ASSERT(!"called for a command that does not exist!");
+
+ return NULL;
+ } else {
+ cmd = se_alloc(sizeof(gcp_cmd_t));
+ cmdtrx = se_alloc(sizeof(gcp_cmd_msg_t));
+ cmdctx = se_alloc(sizeof(gcp_cmd_msg_t));
+ }
+ } else {
+ cmd = ep_new(gcp_cmd_t);
+ cmdtrx = ep_new(gcp_cmd_msg_t);
+ cmdctx = ep_new(gcp_cmd_msg_t);
+ }
+
+ cmd->type = type;
+ cmd->offset = offset;
+ cmd->terms.term = NULL;
+ cmd->terms.next = NULL;
+ cmd->terms.last = &(cmd->terms);
+ cmd->str = NULL;
+ cmd->msg = m;
+ cmd->trx = t;
+ cmd->ctx = c;
+ cmd->error = 0;
+
+ cmdctx->cmd = cmdtrx->cmd = cmd;
+ cmdctx->next = cmdtrx->next = NULL;
+ cmdctx->last = cmdtrx->last = NULL;
+
+ if (t->cmds) {
+ t->cmds->last->next = cmdtrx;
+ t->cmds->last = cmdtrx;
+ } else {
+ t->cmds = cmdtrx;
+ t->cmds->last = cmdtrx;
+ }
+
+ if (c->cmds) {
+ c->cmds->last->next = cmdctx;
+ c->cmds->last = cmdctx;
+ } else {
+ c->cmds = cmdctx;
+ c->cmds->last = cmdctx;
+ }
+
+ return cmd;
+}
+
+
+gcp_term_t* gcp_cmd_add_term(gcp_msg_t* m, gcp_trx_t* tr, gcp_cmd_t* c, gcp_term_t* t, gcp_wildcard_t wildcard, gboolean persistent) {
+ gcp_terms_t* ct;
+ gcp_terms_t* ct2;
+
+ static gcp_term_t all_terms = {"$",(guint8*)"",1,GCP_TERM_TYPE_UNKNOWN,NULL,NULL,NULL};
+
+ if ( !c ) return NULL;
+
+ if ( wildcard == GCP_WILDCARD_CHOOSE) {
+ return &all_terms;
+ }
+
+ if (persistent) {
+ if ( c->msg->commited ) {
+ if (wildcard == GCP_WILDCARD_ALL) {
+ for (ct = c->ctx->terms.next; ct; ct = ct->next) {
+ /* XXX not handling more wilcards in one msg */
+ if ( ct->term->start == m ) {
+ return ct->term;
+ }
+ }
+ return NULL;
+ } else {
+ for (ct = c->ctx->terms.next; ct; ct = ct->next) {
+ if ( g_str_equal(ct->term->str,t->str) ) {
+ return ct->term;
+ }
+ }
+ return NULL;
+ }
+ } else {
+
+ for (ct = c->ctx->terms.next; ct; ct = ct->next) {
+ if ( g_str_equal(ct->term->str,t->str) || ct->term->start == m) {
+ break;
+ }
+ }
+
+ if ( ! ct ) {
+
+ if (wildcard == GCP_WILDCARD_ALL) {
+ ct = se_alloc(sizeof(gcp_terms_t));
+ ct->next = NULL;
+ ct->term = se_alloc0(sizeof(gcp_term_t));
+
+ ct->term->start = m;
+ ct->term->str = "*";
+ ct->term->buffer = NULL;
+ ct->term->len = 0;
+
+ c->terms.last = c->terms.last->next = ct;
+
+ ct2 = se_alloc0(sizeof(gcp_terms_t));
+ ct2->term = ct->term;
+
+ c->ctx->terms.last->next = ct2;
+ c->ctx->terms.last = ct2;
+
+ return ct->term;
+ } else {
+ for (ct = c->ctx->terms.next; ct; ct = ct->next) {
+ /* XXX not handling more wilcards in one msg */
+ if ( ct->term->buffer == NULL && tr->cmds->cmd->msg == ct->term->start ) {
+ ct->term->str = se_strdup(t->str);
+ ct->term->buffer = se_memdup(t->buffer,t->len);
+ ct->term->len = t->len;
+
+ ct2 = se_alloc0(sizeof(gcp_terms_t));
+ ct2->term = ct->term;
+
+ c->terms.last = c->terms.last->next = ct2;
+
+ return ct->term;
+ }
+
+ if ( g_str_equal(ct->term->str,t->str) ) {
+ ct2 = se_alloc0(sizeof(gcp_terms_t));
+ ct2->term = ct->term;
+
+ c->terms.last = c->terms.last->next = ct2;
+
+ return ct->term;
+ }
+ }
+
+ ct = se_alloc(sizeof(gcp_terms_t));
+ ct->next = NULL;
+ ct->term = se_alloc0(sizeof(gcp_term_t));
+
+ ct->term->start = m;
+ ct->term->str = se_strdup(t->str);
+ ct->term->buffer = se_memdup(t->buffer,t->len);
+ ct->term->len = t->len;
+
+ ct2 = se_alloc0(sizeof(gcp_terms_t));
+ ct2->term = ct->term;
+
+ c->terms.last = c->terms.last->next = ct2;
+
+ ct2 = se_alloc0(sizeof(gcp_terms_t));
+ ct2->term = ct->term;
+
+ c->ctx->terms.last = c->ctx->terms.last->next = ct2;
+
+ return ct->term;
+ }
+ } else {
+ ct2 = se_alloc0(sizeof(gcp_terms_t));
+ ct2->term = ct->term;
+
+ c->terms.last = c->terms.last->next = ct2;
+ return ct->term;
+ }
+
+ DISSECTOR_ASSERT_NOT_REACHED();
+ return NULL;
+ }
+ } else {
+ ct = ep_new(gcp_terms_t);
+ ct->term = t;
+ ct->next = NULL;
+ c->terms.last = c->terms.last->next = ct;
+
+ return t;
+ }
+
+}
+
+gchar* gcp_cmd_to_str(gcp_cmd_t* c, gboolean persistent) {
+ gchar* s = "-";
+ gcp_terms_t* term;
+
+ if ( !c ) return "-";
+
+ switch (c->type) {
+ case GCP_CMD_NONE:
+ return "-";
+ break;
+ case GCP_CMD_ADD_REQ:
+ s = "AddReq {";
+ break;
+ case GCP_CMD_MOVE_REQ:
+ s = "MoveReq {";
+ break;
+ case GCP_CMD_MOD_REQ:
+ s = "ModReq {";
+ break;
+ case GCP_CMD_SUB_REQ:
+ s = "SubReq {";
+ break;
+ case GCP_CMD_AUDITCAP_REQ:
+ s = "AuditCapReq {";
+ break;
+ case GCP_CMD_AUDITVAL_REQ:
+ s = "AuditValReq {";
+ break;
+ case GCP_CMD_NOTIFY_REQ:
+ s = "NotifyReq {";
+ break;
+ case GCP_CMD_SVCCHG_REQ:
+ s = "SvcChgReq {";
+ break;
+ case GCP_CMD_TOPOLOGY_REQ:
+ s = "TopologyReq {";
+ break;
+ case GCP_CMD_CTX_ATTR_AUDIT_REQ:
+ s = "CtxAttribAuditReq {";
+ break;
+ case GCP_CMD_ADD_REPLY:
+ s = "AddReply {";
+ break;
+ case GCP_CMD_MOVE_REPLY:
+ s = "MoveReply {";
+ break;
+ case GCP_CMD_MOD_REPLY:
+ s = "ModReply {";
+ break;
+ case GCP_CMD_SUB_REPLY:
+ s = "SubReply {";
+ break;
+ case GCP_CMD_AUDITCAP_REPLY:
+ s = "AuditCapReply {";
+ break;
+ case GCP_CMD_AUDITVAL_REPLY:
+ s = "AuditValReply {";
+ break;
+ case GCP_CMD_NOTIFY_REPLY:
+ s = "NotifyReply {";
+ break;
+ case GCP_CMD_SVCCHG_REPLY:
+ s = "SvcChgReply {";
+ break;
+ case GCP_CMD_TOPOLOGY_REPLY:
+ s = "TopologyReply {";
+ break;
+ case GCP_CMD_REPLY:
+ s = "ActionReply {";
+ break;
+ }
+
+ for (term = c->terms.next; term; term = term->next) {
+ s = ep_strdup_printf("%s %s",s,term->term->str);
+ };
+
+ if (c->error) {
+ s = ep_strdup_printf("%s Error=%i",s,c->error);
+ }
+
+ s = ep_strdup_printf("%s }", s);
+
+ if (persistent) {
+ if (! c->str) c->str = se_strdup(s);
+ } else {
+ c->str = s;
+ }
+
+ return s;
+}
+
+gchar* gcp_trx_to_str(gcp_msg_t* m, gcp_trx_t* t, gboolean persistent) {
+ gchar* s;
+ gcp_cmd_msg_t* c;
+
+ if ( !m || !t ) return "-";
+
+ s = ep_strdup_printf("T %x { ",t->id);
+
+ if (t->cmds) {
+ if (t->cmds->cmd->ctx) {
+ s = ep_strdup_printf("%s C %x {",s,t->cmds->cmd->ctx->id);
+
+ for (c = t->cmds; c; c = c->next) {
+ if (c->cmd->msg == m)
+ s = ep_strdup_printf("%s %s",s,gcp_cmd_to_str(c->cmd,persistent));
+ }
+
+ s = ep_strdup_printf("%s %s",s,"}");
+ }
+ }
+
+ if (t->error) {
+ s = ep_strdup_printf("%s Error=%i",s,t->error);
+ }
+
+ return ep_strdup_printf("%s %s",s,"}");
+}
+
+gchar* gcp_msg_to_str(gcp_msg_t* m, gboolean persistent) {
+ gcp_trx_msg_t* t;
+ gchar* s = "";
+
+ if ( !m ) return "-";
+
+ for (t = m->trxs; t; t = t->next) {
+ s = ep_strdup_printf("%s %s",s,gcp_trx_to_str(m,t->trx, persistent));
+ };
+
+ return s;
+}
+
+typedef struct _gcp_ctxs_t {
+ struct _gcp_ctx_t* ctx;
+ struct _gcp_ctxs_t* next;
+} gcp_ctxs_t;
+
+/*static const gchar* trx_types[] = {"None","Req","Reply","Pending","Ack"};*/
+
+void gcp_analyze_msg(proto_tree* gcp_tree, tvbuff_t* gcp_tvb, gcp_msg_t* m, gcp_hf_ett_t* ids) {
+ gcp_trx_msg_t* t;
+ gcp_ctxs_t contexts = {NULL,NULL};
+ gcp_ctxs_t* ctx_node;
+ gcp_cmd_msg_t* c;
+
+
+ for (t = m->trxs; t; t = t->next) {
+ for (c = t->trx->cmds; c; c = c->next) {
+ gcp_ctx_t* ctx = c->cmd->ctx;
+
+ for (ctx_node = contexts.next; ctx_node; ctx_node = ctx_node->next) {
+ if (ctx_node->ctx->id == ctx->id) {
+ break;
+ }
+ }
+
+ if (! ctx_node) {
+ ctx_node = ep_new(gcp_ctxs_t);
+ ctx_node->ctx = ctx;
+ ctx_node->next = contexts.next;
+ contexts.next = ctx_node;
+ }
+
+ }
+ }
+
+ for (ctx_node = contexts.next; ctx_node; ctx_node = ctx_node->next) {
+ gcp_ctx_t* ctx = ctx_node->ctx;
+ proto_item* ctx_item = proto_tree_add_uint(gcp_tree,ids->hf.ctx,gcp_tvb,0,0,ctx->id);
+ proto_tree* ctx_tree = proto_item_add_subtree(ctx_item,ids->ett.ctx);
+ gcp_terms_t *ctx_term;
+
+ PROTO_ITEM_SET_GENERATED(ctx_item);
+
+ if (( c = ctx->cmds )) {
+ proto_item* history_item = proto_tree_add_text(ctx_tree,gcp_tvb,0,0,"[ Command History ]");
+ proto_tree* history_tree = proto_item_add_subtree(history_item,ids->ett.ctx_cmds);
+
+ for (c = ctx->cmds; c; c = c->next) {
+ proto_item* cmd_item = proto_tree_add_uint(history_tree,ids->hf.ctx_cmd,gcp_tvb,0,0,c->cmd->msg->framenum);
+ proto_item_append_text(cmd_item," %s ",c->cmd->str);
+ PROTO_ITEM_SET_GENERATED(cmd_item);
+ if (c->cmd->error) {
+ proto_item_set_expert_flags(cmd_item, PI_RESPONSE_CODE, PI_WARN);
+ }
+ }
+ }
+
+ if (( ctx_term = ctx->terms.next )) {
+ proto_item* terms_item = proto_tree_add_text(ctx_tree,gcp_tvb,0,0,"[ Terminations Used ]");
+ proto_tree* terms_tree = proto_item_add_subtree(terms_item,ids->ett.ctx_terms);
+
+ for (; ctx_term; ctx_term = ctx_term->next ) {
+ if ( ctx_term->term && ctx_term->term->str) {
+ proto_item* pi = proto_tree_add_string(terms_tree,ids->hf.ctx_term,gcp_tvb,0,0,ctx_term->term->str);
+ proto_tree* term_tree = proto_item_add_subtree(pi,ids->ett.ctx_term);
+
+ PROTO_ITEM_SET_GENERATED(pi);
+
+ if (ctx_term->term->type) {
+ pi = proto_tree_add_uint(term_tree,ids->hf.ctx_term_type,gcp_tvb,0,0,ctx_term->term->type);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
+
+ if (ctx_term->term->bir) {
+ pi = proto_tree_add_string(term_tree,ids->hf.ctx_term_bir,gcp_tvb,0,0,ctx_term->term->bir);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
+
+ if (ctx_term->term->nsap) {
+ pi = proto_tree_add_string(term_tree,ids->hf.ctx_term_nsap,gcp_tvb,0,0,ctx_term->term->nsap);
+ PROTO_ITEM_SET_GENERATED(pi);
+ }
+
+ if (ctx_term->term->bir && ctx_term->term->nsap) {
+ gchar* key = ep_strdup_printf("%s:%s",ctx_term->term->nsap,ctx_term->term->bir);
+ g_strdown(key);
+ alcap_tree_from_bearer_key(term_tree, gcp_tvb, key);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/epan/gcp.h b/epan/gcp.h
new file mode 100644
index 0000000000..74fad77aa0
--- /dev/null
+++ b/epan/gcp.h
@@ -0,0 +1,217 @@
+/* gcp.h
+ * Gateway Control Protocol -- Context Tracking
+ *
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#ifndef __GCP_H_
+#define __GCP_H_
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <glib.h>
+#include <epan/packet.h>
+#include <epan/conversation.h>
+#include <epan/strutil.h>
+#include <epan/emem.h>
+#include <epan/expert.h>
+#include <epan/prefs.h>
+#include <epan/to_str.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <epan/dissectors/packet-ber.h>
+#include <epan/dissectors/packet-q931.h>
+#include <epan/dissectors/packet-mtp3.h>
+#include <epan/dissectors/packet-alcap.h>
+#include <epan/dissectors/packet-isup.h>
+
+#include <epan/sctpppids.h>
+
+typedef struct _gcp_hf_ett_t {
+ struct {
+ int ctx;
+ int ctx_cmd;
+ int ctx_term;
+ int ctx_term_type;
+ int ctx_term_bir;
+ int ctx_term_nsap;
+ } hf;
+
+ struct {
+ gint ctx;
+ gint ctx_cmds;
+ gint ctx_terms;
+ gint ctx_term;
+ } ett;
+} gcp_hf_ett_t;
+
+#define NULL_CONTEXT 0
+#define CHOOSE_CONTEXT 0xFFFFFFFE
+#define ALL_CONTEXTS 0xFFFFFFFF
+
+
+typedef enum {
+ GCP_CMD_NONE,
+ GCP_CMD_ADD_REQ,
+ GCP_CMD_MOVE_REQ,
+ GCP_CMD_MOD_REQ,
+ GCP_CMD_SUB_REQ,
+ GCP_CMD_AUDITCAP_REQ,
+ GCP_CMD_AUDITVAL_REQ,
+ GCP_CMD_NOTIFY_REQ,
+ GCP_CMD_SVCCHG_REQ,
+ GCP_CMD_TOPOLOGY_REQ,
+ GCP_CMD_CTX_ATTR_AUDIT_REQ,
+ GCP_CMD_ADD_REPLY,
+ GCP_CMD_MOVE_REPLY,
+ GCP_CMD_MOD_REPLY,
+ GCP_CMD_SUB_REPLY,
+ GCP_CMD_AUDITCAP_REPLY,
+ GCP_CMD_AUDITVAL_REPLY,
+ GCP_CMD_NOTIFY_REPLY,
+ GCP_CMD_SVCCHG_REPLY,
+ GCP_CMD_TOPOLOGY_REPLY,
+ GCP_CMD_REPLY
+} gcp_cmd_type_t;
+
+typedef enum {
+ GCP_TRX_NONE,
+ GCP_TRX_REQUEST,
+ GCP_TRX_PENDING,
+ GCP_TRX_REPLY,
+ GCP_TRX_ACK
+} gcp_trx_type_t;
+
+
+typedef struct _gcp_msg_t {
+ guint32 lo_addr;
+ guint32 hi_addr;
+ guint32 framenum;
+ struct _gcp_trx_msg_t* trxs;
+ gboolean commited;
+} gcp_msg_t;
+
+typedef struct _gcp_trx_msg_t {
+ struct _gcp_trx_t* trx;
+ struct _gcp_trx_msg_t* next;
+ struct _gcp_trx_msg_t* last;
+} gcp_trx_msg_t;
+
+typedef struct _gcp_cmd_msg_t {
+ struct _gcp_cmd_t* cmd;
+ struct _gcp_cmd_msg_t* next;
+ struct _gcp_cmd_msg_t* last;
+} gcp_cmd_msg_t;
+
+typedef struct _gcp_trx_t {
+ gcp_msg_t* initial;
+ guint32 id;
+ gcp_trx_type_t type;
+ guint pendings;
+ struct _gcp_cmd_msg_t* cmds;
+ struct _gcp_trx_ctx_t* ctxs;
+ guint error;
+} gcp_trx_t;
+
+#define GCP_TERM_TYPE_UNKNOWN 0
+#define GCP_TERM_TYPE_AAL1 1
+#define GCP_TERM_TYPE_AAL2 2
+#define GCP_TERM_TYPE_AAL1_STRUCT 3
+#define GCP_TERM_TYPE_IP_RTP 4
+#define GCP_TERM_TYPE_TDM 5
+
+typedef enum _gcp_wildcard_t {
+ GCP_WILDCARD_NONE,
+ GCP_WILDCARD_CHOOSE,
+ GCP_WILDCARD_ALL
+} gcp_wildcard_t;
+
+typedef struct _gcp_term_t {
+ gchar* str;
+
+ guint8* buffer;
+ guint len;
+
+ guint type;
+ gchar* bir;
+ gchar* nsap;
+
+ gcp_msg_t* start;
+
+} gcp_term_t;
+
+typedef struct _gcp_terms_t {
+ gcp_term_t* term;
+ struct _gcp_terms_t* next;
+ struct _gcp_terms_t* last;
+} gcp_terms_t;
+
+typedef struct _gcp_cmd_t {
+ guint offset;
+ gchar* str;
+ gcp_cmd_type_t type;
+ gcp_terms_t terms;
+ struct _gcp_msg_t* msg;
+ struct _gcp_trx_t* trx;
+ struct _gcp_ctx_t* ctx;
+ guint error;
+} gcp_cmd_t;
+
+
+typedef struct _gcp_ctx_t {
+ gcp_msg_t* initial;
+ guint32 id;
+ struct _gcp_cmd_msg_t* cmds;
+ struct _gcp_ctx_t* prev;
+ gcp_terms_t terms;
+} gcp_ctx_t;
+
+WS_VAR_IMPORT const value_string gcp_cmd_type[];
+WS_VAR_IMPORT const value_string gcp_term_types[];
+
+extern void gcp_init(void);
+extern gcp_msg_t* gcp_msg(packet_info* pinfo, int o, gboolean persistent);
+extern gcp_trx_t* gcp_trx(gcp_msg_t* m ,guint32 t_id , gcp_trx_type_t type, gboolean persistent);
+extern gcp_ctx_t* gcp_ctx(gcp_msg_t* m, gcp_trx_t* t, guint32 c_id, gboolean persistent);
+extern gcp_cmd_t* gcp_cmd(gcp_msg_t* m, gcp_trx_t* t, gcp_ctx_t* c, gcp_cmd_type_t type, guint offset, gboolean persistent);
+extern gcp_term_t* gcp_cmd_add_term(gcp_msg_t* m, gcp_trx_t* tr, gcp_cmd_t* c, gcp_term_t* t, gcp_wildcard_t wildcard, gboolean persistent);
+extern void gcp_analyze_msg(proto_tree* gcp_tree, tvbuff_t* gcp_tvb, gcp_msg_t* m, gcp_hf_ett_t* ids);
+
+extern gchar* gcp_cmd_to_str(gcp_cmd_t* c, gboolean persistent);
+extern gchar* gcp_msg_to_str(gcp_msg_t* m, gboolean persistent);
+
+#define gcp_cmd_set_error(c,e) (c->error = e)
+#define gcp_trx_set_error(t,e) (t->error = e)
+
+#define GCP_ETT_ARR_ELEMS(gi) &(gi.ett.ctx),&(gi.ett.ctx_cmds),&(gi.ett.ctx_terms),&(gi.ett.ctx_term)
+
+#define GCP_HF_ARR_ELEMS(n,gi) \
+ { &(gi.hf.ctx), { "Context", n ".ctx", FT_UINT32, BASE_HEX, NULL, 0, "", HFILL }}, \
+ { &(gi.hf.ctx_term), { "Termination", n ".ctx.term", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }}, \
+ { &(gi.hf.ctx_term_type), { "Type", n ".ctx.term.type", FT_UINT32, BASE_HEX, VALS(gcp_term_types), 0, "", HFILL }}, \
+ { &(gi.hf.ctx_term_bir), { "BIR", n ".ctx.term.bir", FT_STRING, BASE_HEX, NULL, 0, "", HFILL }}, \
+ { &(gi.hf.ctx_term_nsap), { "NSAP", n ".ctx.term.nsap", FT_STRING, BASE_NONE, NULL, 0, "", HFILL }}, \
+ { &(gi.hf.ctx_cmd), { "Command in Frame", n ".ctx.cmd", FT_FRAMENUM, BASE_DEC, NULL, 0, "", HFILL }}
+
+#endif