Add a function that returns an unique guint32 for each dpc.

svn path=/trunk/; revision=17572
This commit is contained in:
Luis Ontanon 2006-03-10 22:05:23 +00:00
parent 4e1ca8f2c3
commit e50663a09c
2 changed files with 17 additions and 1 deletions

View File

@ -317,6 +317,22 @@ mtp3_addr_to_str_buf(
}
}
guint32 mtp3_pc_hash(const guint8* data) {
const mtp3_addr_pc_t *addr_pc_p = (const mtp3_addr_pc_t *)data;
guint32 pc;
switch (addr_pc_p->type)
{
case ITU_STANDARD:
pc = (addr_pc_p->pc & ITU_PC_MASK) | ((addr_pc_p->ni % 4) << 14) ;
default:
/* assuming 24-bit */
pc = (addr_pc_p->pc & ANSI_PC_MASK) | ((addr_pc_p->ni) << 24) ;
}
return;
}
static void
dissect_mtp3_sio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_tree)
{

View File

@ -68,7 +68,7 @@ extern void mtp3_addr_to_str_buf(const guint8 *data, gchar *buf, int buf_len
extern void mtp3_pc_to_str_buf(const guint32 pc, gchar *buf, int buf_len);
extern gchar* mtp3_pc_to_str(const guint32 pc);
extern gboolean mtp3_pc_structured(void);
extern guint32 mtp3_pc_hash(const guint8* data);
/*
* the following allows TAP code access to the messages