Wireshark-dev: [Wireshark-dev] Wierd code in m2m plugin

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Fri, 27 Jul 2007 18:19:19 +0200
Hi,

Can anyone tell me why this hideous hack is in the m2m plugin?

				case TLV_FRAME_NUM:
					/* get the frame number */
					g_frame_number = tvb_get_ntoh24( tvb, offset );
					/* add the description */
					proto_tree_add_item(tlv_tree, hf_m2m_frame_number, tvb, offset, 3, FALSE);
					proto_item_append_text(ti, ": %d", g_frame_number);
					if (!checked_frame)
					{
						/* See if a "Frame" column is defined */
						if (pinfo->cinfo != NULL)
						{
							for (i=0; i < pinfo->cinfo->num_cols; i++ )
							{
								if (strcmp(pinfo->cinfo->col_title[i], "Frame") == 0)
								{
									frame_col = i;
								}
							}
						}
						checked_frame = TRUE;
					}
					if (check_col(pinfo->cinfo, COL_IF_DIR))
					{
						/* Check if Frame column is present */
						if (frame_col != -1)
						{
							/* Display frame number in Frame column */
							
							col_append_fstr(pinfo->cinfo, COL_IF_DIR, "%7u", g_frame_number);
						}
					}
				break;

Thanx,
Jaap