+/*
+ * Save usre-assigned MAP domain names ("tags") in a vector of
+ * extra domain information.
+ */
+static void
+map_save_extras (u32 map_domain_index, char *tag)
+{
+ map_main_t *mm = &map_main;
+ map_domain_extra_t *de;
+ u32 len;
+
+ 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;
+
+ len = strlen (tag) + 1;
+ de->tag = clib_mem_alloc (len);
+ clib_memcpy (de->tag, tag, len);
+}
+
+
+static void
+map_free_extras (u32 map_domain_index)
+{
+ map_main_t *mm = &map_main;
+ map_domain_extra_t *de;
+ char *tag;
+
+ if (map_domain_index == ~0)
+ return;
+
+ de = vec_elt_at_index (mm->domain_extras, map_domain_index);
+ tag = de->tag;
+ if (!tag)
+ return;
+
+ clib_mem_free (tag);
+ de->tag = 0;
+}
+