+/*
+ * Save user-assigned MAP domain names ("tags") in a vector of
+ * extra domain information.
+ */
+static void
+map_save_extras (u32 map_domain_index, u8 * tag)
+{
+ map_main_t *mm = &map_main;
+ map_domain_extra_t *de;
+
+ if (map_domain_index == ~0)
+ return;
+
+ vec_validate (mm->domain_extras, map_domain_index);
+ de = vec_elt_at_index (mm->domain_extras, map_domain_index);
+ clib_memset (de, 0, sizeof (*de));
+
+ if (!tag)
+ return;
+
+ de->tag = vec_dup (tag);
+}
+
+
+static void
+map_free_extras (u32 map_domain_index)
+{
+ map_main_t *mm = &map_main;
+ map_domain_extra_t *de;
+ u8 *tag;
+
+ if (map_domain_index == ~0)
+ return;
+
+ de = vec_elt_at_index (mm->domain_extras, map_domain_index);
+ tag = de->tag;
+ if (!tag)
+ return;
+
+ vec_free (tag);
+ de->tag = 0;
+}
+