/* Check that the version is within the supported range, otherwise warn about it. */
static gshort c_warn_ver(proto_item *ti, gint act, gint min, gint max, c_pkt_data *data)
/* Check that the version is within the supported range, otherwise warn about it. */
static gshort c_warn_ver(proto_item *ti, gint act, gint min, gint max, c_pkt_data *data)
{
	DISSECTOR_ASSERT_CMPINT(min, <=, max);
	if (act < min)
	{
		expert_add_info_format(data->pinfo, ti, &ei_ver_tooold,
				       "Version %d is lower then the minimum "
				       "supported version (%d).",
				       act, min);
		return -1;
	}
	if (act > max)
	{
		expert_add_info_format(data->pinfo, ti, &ei_ver_toonew,
				       "Version %d is higher then the maximum "
				       "supported version (%d).",
				       act, max);
		return 1;
	}
	return 0;
}