+static gint getge(proto_tree *tt, const hfge *hf, tvbuff_t *b, gint off)
+{
+ guint16 len = tvb_get_ntohs(b, off), len2;
+ guint r;
+ proto_item *ti;
+ r = tvb_length_remaining(b, off);
+ if (r < 4 + len ||
+ (len2 = tvb_get_ntohs(b, off + 2 + len), r < 4 + len + len2)) {
+ ti = proto_tree_add_item(tt, hf->hf, b, off, len + 2, FALSE);
+ tt = proto_item_add_subtree(ti, hf->tt);
+ proto_tree_add_item(tt, hf->hf_len, b, off, 2, FALSE);
+ proto_tree_add_item(tt, hf->hf_val, b, off + 2, len, FALSE);
+ r = off + len + 2;
+ } else {
+ ti = proto_tree_add_item(tt, hf->hf, b, off, len + len2 + 4, FALSE);
+ tt = proto_item_add_subtree(ti, hf->tt);
+ proto_tree_add_item(tt, hf->hfx_len, b, off, 2, FALSE);
+ proto_tree_add_item(tt, hf->hfx_val, b, off + 2, len, FALSE);
+ proto_tree_add_item(tt, hf->hfy_len, b, off + 2 + len, 2, FALSE);
+ proto_tree_add_item(tt, hf->hfy_val, b, off + 4 + len, len2, FALSE);
+ r = off + len + len2 + 4;
+ }
+ return (r);
+}
+