You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/11/01 17:55:16 UTC

[trafficserver] branch master updated (be4cdc6 -> af92bb6)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from be4cdc6  list packages for building in Ubuntu
     new 76834d0  Removes the Configuration Context Manager
     new 372e9de  Removes the rest of the CfgContext files and objects
     new af92bb6  This removes all configuration Element ctor/dtor code

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/perl/lib/Apache/TS/AdminClient.pm |   43 +-
 mgmt/api/APITestCliRemote.cc          |  711 +--------
 mgmt/api/CfgContextDefs.h             |   73 -
 mgmt/api/CfgContextImpl.cc            | 2135 -------------------------
 mgmt/api/CfgContextImpl.h             |  435 ------
 mgmt/api/CfgContextManager.cc         |  560 -------
 mgmt/api/CfgContextManager.h          |   74 -
 mgmt/api/CfgContextUtils.cc           | 2756 ---------------------------------
 mgmt/api/CfgContextUtils.h            |  194 ---
 mgmt/api/CoreAPI.cc                   |   53 -
 mgmt/api/CoreAPI.h                    |   11 +-
 mgmt/api/CoreAPIRemote.cc             |   61 +-
 mgmt/api/EventControlMain.cc          |    1 -
 mgmt/api/INKMgmtAPI.cc                |  974 +-----------
 mgmt/api/Makefile.am                  |    7 -
 mgmt/api/NetworkMessage.cc            |    6 -
 mgmt/api/NetworkMessage.h             |    1 -
 mgmt/api/TSControlMain.cc             |   40 -
 mgmt/api/include/mgmtapi.h            |  541 +------
 19 files changed, 31 insertions(+), 8645 deletions(-)
 delete mode 100644 mgmt/api/CfgContextDefs.h
 delete mode 100644 mgmt/api/CfgContextImpl.cc
 delete mode 100644 mgmt/api/CfgContextImpl.h
 delete mode 100644 mgmt/api/CfgContextManager.cc
 delete mode 100644 mgmt/api/CfgContextManager.h
 delete mode 100644 mgmt/api/CfgContextUtils.cc
 delete mode 100644 mgmt/api/CfgContextUtils.h

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].

[trafficserver] 01/03: Removes the Configuration Context Manager

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 76834d0741e9c5430539f78bfbb4f2b61ed41ce1
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Thu Oct 12 17:22:14 2017 -0600

    Removes the Configuration Context Manager
    
    This is a set of management APIs that was used by the Web UI, for creating,
    modifying and deleting configuration files and entries. This is another step
    towards removing the requirements for writing to configuration files.
---
 mgmt/api/APITestCliRemote.cc  | 126 ----------
 mgmt/api/CfgContextManager.cc | 560 ------------------------------------------
 mgmt/api/CfgContextManager.h  |  74 ------
 mgmt/api/INKMgmtAPI.cc        |  91 -------
 mgmt/api/Makefile.am          |   2 -
 mgmt/api/include/mgmtapi.h    | 107 --------
 6 files changed, 960 deletions(-)

diff --git a/mgmt/api/APITestCliRemote.cc b/mgmt/api/APITestCliRemote.cc
index f2e38b9..73a25dd 100644
--- a/mgmt/api/APITestCliRemote.cc
+++ b/mgmt/api/APITestCliRemote.cc
@@ -726,68 +726,6 @@ print_storage_ele(TSStorageEle *ele)
   }
 }
 
-//
-// print_ele_list
-//
-// prints a list of Ele's
-//
-
-void
-print_ele_list(TSFileNameT file, TSCfgContext ctx)
-{
-  TSFileNameT filename = file;
-  TSCfgEle *ele;
-
-  if (!ctx) {
-    printf("[print_ele_list] invalid TSCFgContext\n");
-    return;
-  }
-
-  int count = TSCfgContextGetCount(ctx);
-  printf("\n[print_ele_list] %d rules\n", count);
-  for (int i = 0; i < count; i++) {
-    ele = TSCfgContextGetEleAt(ctx, i);
-
-    switch (filename) {
-    case TS_FNAME_CACHE_OBJ:
-      print_cache_ele((TSCacheEle *)ele);
-      break;
-    case TS_FNAME_HOSTING:
-      print_hosting_ele((TSHostingEle *)ele);
-      break;
-    case TS_FNAME_IP_ALLOW:
-      print_ip_allow_ele((TSIpAllowEle *)ele);
-      break;
-    case TS_FNAME_PARENT_PROXY:
-      print_parent_ele((TSParentProxyEle *)ele);
-      break;
-    case TS_FNAME_VOLUME:
-      print_volume_ele((TSVolumeEle *)ele);
-      break;
-    case TS_FNAME_PLUGIN:
-      print_plugin_ele((TSPluginEle *)ele);
-      break;
-    case TS_FNAME_REMAP:
-      print_remap_ele((TSRemapEle *)ele);
-      break;
-    case TS_FNAME_SOCKS:
-      print_socks_ele((TSSocksEle *)ele);
-      break;
-    case TS_FNAME_SPLIT_DNS:
-      print_split_dns_ele((TSSplitDnsEle *)ele);
-      break;
-    case TS_FNAME_STORAGE:
-      print_storage_ele((TSStorageEle *)ele);
-      break;
-    default:
-      printf("[print_ele_list] invalid file type \n");
-      return;
-    }
-  }
-
-  return;
-}
-
 /***************************************************************************
  * Control Testing
  ***************************************************************************/
@@ -1355,68 +1293,6 @@ test_read_file()
 }
 
 /***************************************************************************
- * TSCfgContext Testing
- ***************************************************************************/
-// tests the TSCfgContextMoveEleUp/Down functions (which end up calling
-// the new "copy" utility functions in CfgContextUtils.cc
-
-// uses TSCfgContextGet to read in a file and print out all the rules
-void
-test_cfg_context_get(char *args)
-{
-  TSCfgContext ctx;
-  TSFileNameT file;
-  char *filename;
-
-  strtok(args, ":");
-  filename = strtok(nullptr, ":");
-  fprintf(stderr, "modify file: %s\n", filename);
-  char *name = TSstrdup(filename);
-
-  // convert file name to TSFileNameT
-  if (strcmp(name, "cache.config") == 0) {
-    file = TS_FNAME_CACHE_OBJ;
-  } else if (strcmp(name, "congestion.config") == 0) {
-    file = TS_FNAME_CONGESTION;
-  } else if (strcmp(name, "hosting.config") == 0) {
-    file = TS_FNAME_HOSTING;
-  } else if (strcmp(name, "ip_allow.config") == 0) {
-    file = TS_FNAME_IP_ALLOW;
-  } else if (strcmp(name, "parent.config") == 0) {
-    file = TS_FNAME_PARENT_PROXY;
-  } else if (strcmp(name, "volume.config") == 0) {
-    file = TS_FNAME_VOLUME;
-  } else if (strcmp(name, "plugin.config") == 0) {
-    file = TS_FNAME_PLUGIN;
-  } else if (strcmp(name, "remap.config") == 0) {
-    file = TS_FNAME_REMAP;
-  } else if (strcmp(name, "socks.config") == 0) {
-    file = TS_FNAME_SOCKS;
-  } else if (strcmp(name, "storage.config") == 0) {
-    file = TS_FNAME_STORAGE;
-  } else if (strcmp(name, "splitdns.config") == 0) {
-    file = TS_FNAME_SPLIT_DNS;
-  } else {
-    TSfree(name);
-    return;
-  }
-
-  ctx = TSCfgContextCreate(file);
-  if (TSCfgContextGet(ctx) != TS_ERR_OKAY) {
-    printf("ERROR READING FILE\n");
-  }
-
-  int count = TSCfgContextGetCount(ctx);
-  printf("%d rules in file: %s\n", count, name);
-
-  print_ele_list(file, ctx);
-
-  TSCfgContextDestroy(ctx);
-  TSfree(name);
-  return;
-}
-
-/***************************************************************************
  * Events Testing
  ***************************************************************************/
 /* ------------------------------------------------------------------------
@@ -1736,8 +1612,6 @@ runInteractive()
       test_read_url(true);
     } else if (strstr(buf, "test_url")) {
       test_read_url(false);
-    } else if (strstr(buf, "cfg_get:")) {
-      test_cfg_context_get(buf);
     } else if (strstr(buf, "reset_stats")) {
       reset_stats();
     } else if (strstr(buf, "set_stats")) {
diff --git a/mgmt/api/CfgContextManager.cc b/mgmt/api/CfgContextManager.cc
deleted file mode 100644
index acc1dbb..0000000
--- a/mgmt/api/CfgContextManager.cc
+++ /dev/null
@@ -1,560 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/*****************************************************************************
- * Filename: ContextManager.cc
- * ------------------------------------------------------------------------
- * Purpose:
- * 1) CfgContext class manipulations
- * 2) conversions from parser value tags into Ele value format
- *
- * Created by: Lan Tran
- *
- ***************************************************************************/
-#include "ts/ink_platform.h"
-#include "ts/ink_string.h"
-#include "CfgContextManager.h"
-#include "CfgContextUtils.h"
-#include "CoreAPI.h"
-#include "GenericParser.h"
-
-//--------------------------------------------------------------------------
-// Defines
-//--------------------------------------------------------------------------
-
-#define FORMAT_TO_RULE_ERROR "# ERROR: Can't convert Ele to rule format."
-
-/* ---------------------------------------------------------------
- * CfgContextCreate
- * ---------------------------------------------------------------
- * Allocates memory for a CfgContext struct and initializes its members.
- * Must pass in a valid file name type; TS_FNAME_UNDEFINED is
- * considered valid.
- */
-CfgContext *
-CfgContextCreate(TSFileNameT file)
-{
-  CfgContext *ctx = nullptr;
-  ctx             = new CfgContext(file);
-  return ctx;
-}
-
-/* ---------------------------------------------------------------
- * CfgContextDestroy
- * ---------------------------------------------------------------
- * frees all memory allocated for the CfgContext
- */
-TSMgmtError
-CfgContextDestroy(CfgContext *ctx)
-{
-  if (!ctx) {
-    return TS_ERR_PARAMS;
-  }
-  delete ctx;
-  return TS_ERR_OKAY;
-}
-
-/* ---------------------------------------------------------------
- * CfgContextGet
- * ---------------------------------------------------------------
- * Read the file, get a copy of it, parse the file, convert the
- * parse structure into ones which will be stored by ctx. The
- * ctx should also store the version number of the file being read.
- * If invalid rule, it is skipped and not added to the CfgContext.
- */
-TSMgmtError
-CfgContextGet(CfgContext *ctx)
-{
-  TSMgmtError ret;
-  int size, ver;
-  char *old_text      = nullptr;
-  RuleList *rule_list = nullptr;
-  CfgEleObj *ele      = nullptr;
-
-  ink_release_assert(ctx);
-
-  // get copy of the file
-  ret = ReadFile(ctx->getFilename(), &old_text, &size, &ver);
-  if (ret != TS_ERR_OKAY) {
-    // TODO: Hmmm, this looks almost like a memory leak, why the strcmp ??
-    if (old_text && strcmp(old_text, "") != 0) {
-      ats_free(old_text); // need to free memory
-    }
-    return ret; // Pass the error code along
-  }
-  // store version number
-  ctx->setVersion(ver);
-
-  rule_list = new RuleList();
-  rule_list->parse(old_text, (ctx->getFilename()));
-
-  // iterate through each TokenList in rule_list
-  for (Rule *rule_node = rule_list->first(); rule_node; rule_node = rule_list->next(rule_node)) {
-    // rule_node->Print();
-    ele = create_ele_obj_from_rule_node(rule_node);
-    if (ele == nullptr) { // invalid rule; skip it
-      continue;
-    }
-
-    ret = ctx->addEle(ele);
-    if (ret != TS_ERR_OKAY) {
-      ats_free(old_text); // need to free memory
-      return ret;
-    }
-  }
-  delete (rule_list); // free RuleList memory
-  // TODO: Hmmm, this looks almost like a memory leak, why the strcmp ??
-  if (old_text && strcmp(old_text, "") != 0) {
-    ats_free(old_text); // need to free memory
-  }
-  return TS_ERR_OKAY;
-}
-
-/***************************************************************
- * CfgContext Operations
- ***************************************************************/
-/*--------------------------------------------------------------
- * CfgContextGetCount
- *--------------------------------------------------------------
- * returns number of (non-comment) ele's in the CfgContext*;
- * returns -1 if an error
- */
-int
-CfgContextGetCount(CfgContext *ctx)
-{
-  CfgEleObj *curr_ele;
-  int count = 0;
-
-  ink_assert(ctx);
-  if (!ctx) {
-    return -1;
-  }
-
-  // iterate CfgContext; return the first EleObj that's not a comment
-  curr_ele = ctx->first(); // get head of ele
-  while (curr_ele) {
-    if (curr_ele->getRuleType() != TS_TYPE_COMMENT) {
-      count++; // only count non-comments
-    }
-    curr_ele = ctx->next(curr_ele);
-  }
-
-  return count;
-}
-
-/*--------------------------------------------------------------
- * CfgContextGetObjAt
- *--------------------------------------------------------------
- * user must typecast the TSCfgObj to appropriate TSObj before using;
- * iterate through the CfgContext, until the count of NON-Comment ObjObj's
- * equals index specified (remember to start counting from 0)
- */
-CfgEleObj *
-CfgContextGetObjAt(CfgContext *ctx, int index)
-{
-  CfgEleObj *curr_ele;
-  int count = 0; // start counting from 0
-
-  ink_assert(ctx);
-  if (!ctx) {
-    return nullptr;
-  }
-
-  // iterate through the ctx, keep count of all NON-Comment Obj Objects
-  curr_ele = ctx->first(); // get head of ele
-  while (curr_ele) {
-    if (curr_ele->getRuleType() == TS_TYPE_COMMENT) { /* a comment ele */
-      curr_ele = ctx->next(curr_ele);
-      continue;
-    } else {
-      if (count == index) { // got right ele
-        return curr_ele;
-      }
-      curr_ele = ctx->next(curr_ele);
-      count++;
-    }
-  }
-
-  return nullptr; // invalid index
-}
-
-/*--------------------------------------------------------------
- * CfgContextGetEleAt
- *--------------------------------------------------------------
- * user must typecast the TSCfgEle to appropriate TSEle before using;
- * iterate through the CfgContext, until the count of NON-Comment EleObj's
- * equals index specified (remember to start counting from 0)
- */
-TSCfgEle *
-CfgContextGetEleAt(CfgContext *ctx, int index)
-{
-  TSCfgEle *cfg_ele;
-  CfgEleObj *curr_ele;
-  int count = 0; // start counting from 0
-
-  ink_assert(ctx);
-  if (!ctx) {
-    return nullptr;
-  }
-
-  // iterate through the ctx, keep count of all NON-Comment Ele Objects
-  curr_ele = ctx->first(); // get head of ele
-  while (curr_ele) {
-    if (curr_ele->getRuleType() == TS_TYPE_COMMENT) { /* a comment ele */
-      curr_ele = ctx->next(curr_ele);
-      continue;
-    } else {
-      if (count == index) { // got right ele
-        // Debug("config", "Get ele at index = %d", index);
-        cfg_ele = curr_ele->getCfgEle();
-        return cfg_ele;
-      }
-      curr_ele = ctx->next(curr_ele);
-      count++;
-    }
-  }
-
-  return nullptr; // invalid index
-}
-
-/*--------------------------------------------------------------
- * CfgContextGetFirst
- *--------------------------------------------------------------
- * Returns pointer to first Non-comment Ele in the CfgContext.
- * Used as part of iterator
- */
-TSCfgEle *
-CfgContextGetFirst(CfgContext *ctx, TSCfgIterState *state)
-{
-  CfgEleObj *curr_ele;
-
-  ink_assert(ctx && state);
-  if (!ctx || !state) {
-    return nullptr;
-  }
-
-  // iterate; return the first CfgEleObj that's not a comment
-  curr_ele = ctx->first(); // get head of ele
-  while (curr_ele) {
-    if (curr_ele->getRuleType() == TS_TYPE_COMMENT) { // a comment ele
-      curr_ele = ctx->next(curr_ele);
-      continue;
-    } else {
-      *state = curr_ele;
-      return (curr_ele->getCfgEle());
-    }
-  }
-
-  return nullptr;
-}
-
-/*--------------------------------------------------------------
- * CfgContextGetNext
- *--------------------------------------------------------------
- * Returns pointer to next Non-comment Ele in the CfgContext.
- * Used as part of iterator.
- */
-TSCfgEle *
-CfgContextGetNext(CfgContext *ctx, TSCfgIterState *state)
-{
-  CfgEleObj *curr_ele;
-
-  ink_assert(ctx && state);
-  if (!ctx || !state) {
-    return nullptr;
-  }
-
-  // iterate through the ctx, keep count of all NON-Comment Ele Objects
-  // when count == state->index, then return next ele
-  curr_ele = (CfgEleObj *)*state;
-  curr_ele = ctx->next(curr_ele); // get next ele
-  while (curr_ele) {
-    if (curr_ele->getRuleType() != TS_TYPE_COMMENT) { // a non-comment ele
-      *state = curr_ele;
-      return curr_ele->getCfgEle();
-    }
-    curr_ele = ctx->next(curr_ele); // get next ele
-
-    /*
-       if (curr_ele->getRuleType() == TS_TYPE_COMMENT) { // a comment ele
-       continue;
-       } else {
-       *state = curr_ele;
-       return curr_ele->getCfgEle();
-       }
-       curr_ele = ctx->next(curr_ele); // get next ele
-     */
-  }
-
-  return nullptr; // ERROR
-}
-
-/*--------------------------------------------------------------
- * CfgContextMoveEleUp
- *--------------------------------------------------------------
- * Remove the EleObj at the specified index (but make a copy of it's m_ele
- * first), and insert the copy at the position of index-1.
- * THIS IS REALLY INEFFICIENT!!!
- */
-TSMgmtError
-CfgContextMoveEleUp(CfgContext *ctx, int index)
-{
-  CfgEleObj *curr_ele_obj;
-  TSCfgEle *ele_copy = nullptr; /* lv: just to make gcc happy */
-  int count          = 0;       // start counting from 0
-  TSMgmtError ret;
-
-  ink_assert(ctx && index >= 0);
-  if (!ctx || index < 0) {
-    return TS_ERR_PARAMS;
-  }
-
-  // moving the first Ele up does nothing
-  if (index == 0) {
-    return TS_ERR_OKAY;
-  }
-
-  // retrieve the ELe and make a copy of it
-  curr_ele_obj = ctx->first(); // get head of ele
-  while (curr_ele_obj) {
-    if (curr_ele_obj->getRuleType() == TS_TYPE_COMMENT) { // a comment ele
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      continue;
-    } else {
-      if (count == index) {
-        // make a copy of ele
-        ele_copy = curr_ele_obj->getCfgEleCopy();
-
-        // remove the ele
-        ctx->removeEle(curr_ele_obj);
-        break;
-      }
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      count++;
-    }
-  }
-  // reached end of CfgContext before hit index
-  if (count != index) {
-    return TS_ERR_FAIL;
-  }
-
-  // reinsert  the ele at index-1
-  ret = CfgContextInsertEleAt(ctx, ele_copy, index - 1);
-
-  return ret;
-}
-
-/*--------------------------------------------------------------
- * CfgContextMoveEleDown
- *--------------------------------------------------------------
- * Locate the EleObj at position index. Remove and delete the EleObj.
- * Make a copy of the ele stored in the EleObj before deleting it and
- * reinserts the new EleObj in the index+1 position.
- */
-TSMgmtError
-CfgContextMoveEleDown(CfgContext *ctx, int index)
-{
-  CfgEleObj *curr_ele_obj;
-  TSCfgEle *ele_copy = nullptr; /* lv: just to make gcc happy */
-  int count          = 0;       // start counting from 0
-  TSMgmtError ret;
-  int tot_ele;
-
-  ink_assert(ctx);
-  if (!ctx) {
-    return TS_ERR_PARAMS;
-  }
-
-  tot_ele = CfgContextGetCount(ctx); // inefficient!
-  if (index < 0 || index >= tot_ele) {
-    return TS_ERR_PARAMS;
-  }
-
-  // moving the last ele down does nothing
-  if (index == (tot_ele - 1)) {
-    return TS_ERR_OKAY;
-  }
-
-  // retrieve the ELe and make a copy of it
-  curr_ele_obj = ctx->first(); // get head of ele
-  while (curr_ele_obj) {
-    if (curr_ele_obj->getRuleType() == TS_TYPE_COMMENT) { /* a comment ele */
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      continue;
-    } else {
-      if (count == index) {
-        // make a copy of ele
-        ele_copy = curr_ele_obj->getCfgEleCopy();
-
-        // remove the ele
-        ctx->removeEle(curr_ele_obj);
-        break;
-      }
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      count++;
-    }
-  }
-  // reached end of CfgContext before hit index
-  if (count != index) {
-    return TS_ERR_FAIL;
-  }
-
-  // reinsert  the ele at index+1
-  ret = CfgContextInsertEleAt(ctx, ele_copy, index + 1);
-
-  return ret;
-}
-
-/*--------------------------------------------------------------
- * CfgContextAppendEle
- *--------------------------------------------------------------
- * Appends the ele to the end of the CfgContext. First must
- * wrap the ele in an CfgEleObj class before can append to CfgContext
- */
-TSMgmtError
-CfgContextAppendEle(CfgContext *ctx, TSCfgEle *ele)
-{
-  CfgEleObj *ele_obj;
-
-  ele_obj = create_ele_obj_from_ele(ele);
-  ctx->addEle(ele_obj);
-
-  return TS_ERR_OKAY;
-}
-
-/*--------------------------------------------------------------
- * CfgContextInsertEleAt
- *--------------------------------------------------------------
- * Inserts the ele into specified position of the CfgContext.  First must
- * wrap the ele in an CfgEleObj class before can insert.
- * If there are comments, before the index specified, the
- * ele will be inserted after the comments.
- * Note: In the special case of inserting in the first position of the list;
- * if there are comments before the current non-comment CfgEleObj,
- * then can just push the new Ele onto the CfgContext. If there are
- * comments before the first non-comment CfgEleObj, then insert the
- * new EleObj right after the last comment
- */
-TSMgmtError
-CfgContextInsertEleAt(CfgContext *ctx, TSCfgEle *ele, int index)
-{
-  CfgEleObj *ele_obj, *curr_ele_obj, *last_comment = nullptr;
-  int count        = 0;
-  TSMgmtError err  = TS_ERR_OKAY;
-  bool has_comment = false;
-
-  // need to convert the ele into appropriate Ele object type
-  ele_obj = create_ele_obj_from_ele(ele);
-
-  // iterate through the ctx, keep count of all NON-Comment Ele Objects
-  // when count == index, then insert the new ele object there
-  curr_ele_obj = ctx->first(); // get head of ele
-  while (curr_ele_obj) {
-    if (curr_ele_obj->getRuleType() == TS_TYPE_COMMENT) { /* a comment ele */
-      last_comment = curr_ele_obj;
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      has_comment  = true;
-      continue;
-    } else {
-      // special case if inserting the ele at head of CfgContext
-      if (index == 0) {
-        if (has_comment) {
-          // insert the ele after the last comment
-          err = ctx->insertEle(ele_obj, last_comment);
-          return err;
-        } else { // has no comments preceding first ele object
-          err = ctx->pushEle(ele_obj);
-          return err;
-        }
-      }
-
-      if (count == index - 1) { // insert the ele after this one
-        err = ctx->insertEle(ele_obj, curr_ele_obj);
-        return err; // DONE!
-      }
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      count++;
-    }
-  }
-
-  return TS_ERR_FAIL; // invalid index
-}
-
-/*--------------------------------------------------------------
- * CfgContextRemoveEleAt
- *--------------------------------------------------------------
- * Removes the non-comment Ele at the specified index. start couting
- * non-comment ele's from 0, eg. if index = 3, that means remove the
- * fourth non-comment ELe in the CfgContext
- */
-TSMgmtError
-CfgContextRemoveEleAt(CfgContext *ctx, int index)
-{
-  CfgEleObj *curr_ele_obj;
-  int count = 0;
-
-  // iterate through the ctx, keep count of all NON-Comment Ele Objects
-  // when count == index, then insert the new ele object there
-  curr_ele_obj = ctx->first(); // get head of ele
-  while (curr_ele_obj) {
-    if (curr_ele_obj->getRuleType() == TS_TYPE_COMMENT) { /* a comment ele */
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      continue;
-    } else {
-      if (count == index) { // reached the Ele
-        ctx->removeEle(curr_ele_obj);
-        return TS_ERR_OKAY; // DONE!
-      }
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      count++;
-    }
-  }
-
-  return TS_ERR_FAIL; // invalid index
-}
-
-/*--------------------------------------------------------------
- * CfgContextRemoveAll
- *--------------------------------------------------------------
- * Removes all the Ele rules from Cfg Context leaving all the
- * comments behind
- */
-TSMgmtError
-CfgContextRemoveAll(CfgContext *ctx)
-{
-  CfgEleObj *curr_ele_obj, *ele_obj_ptr;
-
-  curr_ele_obj = ctx->first();
-  while (curr_ele_obj) {
-    if (curr_ele_obj->getRuleType() == TS_TYPE_COMMENT) { // skip comments
-      curr_ele_obj = ctx->next(curr_ele_obj);
-      continue;
-    } else {
-      ele_obj_ptr = ctx->next(curr_ele_obj);
-      ctx->removeEle(curr_ele_obj);
-    }
-    curr_ele_obj = ele_obj_ptr;
-  }
-
-  return TS_ERR_OKAY;
-}
diff --git a/mgmt/api/CfgContextManager.h b/mgmt/api/CfgContextManager.h
deleted file mode 100644
index b665dc6..0000000
--- a/mgmt/api/CfgContextManager.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/*****************************************************************************
- * Filename: CfgContextManager.h (based on FileOp.h)
- * ------------------------------------------------------------------------
- * Purpose:
- *    Implements some of TSCfgContext functionality in the API; deals only
- *    with the CfgContext class though, not the TSCfgContext; typically
- *    the TSCfgContext function is a wrapper for the function whose purpose
- *    is to make the appropriate typecast to a CfgContext*
- *
- ***************************************************************************/
-
-#ifndef _CFG_CONTEXT_MANAGER_H
-#define _CFG_CONTEXT_MANAGER_H
-
-#include "mgmtapi.h"
-#include "CfgContextImpl.h"
-#include "CfgContextDefs.h"
-
-/***************************************************************************
- * CfgContext Operations
- ***************************************************************************/
-/* based on file to change, dequeues the add/rm rule, and translates it
- * into CoreAPI terms; because the file name stored , knows the format
- * of the rules in the queue
- */
-CfgContext *CfgContextCreate(TSFileNameT filetype);
-TSMgmtError CfgContextDestroy(CfgContext *ctx);
-TSMgmtError CfgContextGet(CfgContext *ctx);
-
-/***************************************************************************
- * CfgContext Operations
- ***************************************************************************/
-/* returns number of ele's in the CfgContext * */
-int CfgContextGetCount(CfgContext *ctx);
-
-/* user must typecast the TSCfgEle to appropriate TSEle before using */
-TSCfgEle *CfgContextGetEleAt(CfgContext *ctx, int index);
-CfgEleObj *CfgContextGetObjAt(CfgContext *ctx, int index);
-
-TSCfgEle *CfgContextGetFirst(CfgContext *ctx, TSCfgIterState *state);
-TSCfgEle *CfgContextGetNext(CfgContext *ctx, TSCfgIterState *state);
-
-TSMgmtError CfgContextMoveEleUp(CfgContext *ctx, int index);
-TSMgmtError CfgContextMoveEleDown(CfgContext *ctx, int index);
-
-TSMgmtError CfgContextAppendEle(CfgContext *ctx, TSCfgEle *ele);
-TSMgmtError CfgContextInsertEleAt(CfgContext *ctx, TSCfgEle *ele, int index);
-TSMgmtError CfgContextRemoveEleAt(CfgContext *ctx, int index);
-TSMgmtError CfgContextRemoveAll(CfgContext *ctx);
-
-#endif
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index 4703c2a..d044dac 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -36,7 +36,6 @@
 #include "ts/I_Layout.h"
 
 #include "mgmtapi.h"
-#include "CfgContextManager.h"
 #include "CfgContextImpl.h"
 #include "CfgContextUtils.h"
 #include "CoreAPI.h"
@@ -2116,96 +2115,6 @@ TSEventSignalCbUnregister(char *event_name, TSEventSignalFunc func)
   return EventSignalCbUnregister(event_name, func);
 }
 
-/***************************************************************************
- * API Helper Functions for Data Carrier Structures
- ***************************************************************************/
-
-/*--- abstracted file operations ------------------------------------------*/
-
-/* calls teh CfgContext class constructor */
-tsapi TSCfgContext
-TSCfgContextCreate(TSFileNameT file)
-{
-  return ((void *)CfgContextCreate(file));
-}
-
-/* calls the CfgContext class destructor */
-tsapi TSMgmtError
-TSCfgContextDestroy(TSCfgContext ctx)
-{
-  return (CfgContextDestroy((CfgContext *)ctx));
-}
-
-tsapi TSMgmtError
-TSCfgContextGet(TSCfgContext ctx)
-{
-  return (CfgContextGet((CfgContext *)ctx));
-}
-
-/*--- helper operations ---------------------------------------------------*/
-/* returns number of ele's in the TSCfgContext */
-int
-TSCfgContextGetCount(TSCfgContext ctx)
-{
-  return CfgContextGetCount((CfgContext *)ctx);
-}
-
-/* user must typecast the TSCfgEle to appropriate TSEle before using */
-TSCfgEle *
-TSCfgContextGetEleAt(TSCfgContext ctx, int index)
-{
-  return CfgContextGetEleAt((CfgContext *)ctx, index);
-}
-
-/* iterator */
-TSCfgEle *
-TSCfgContextGetFirst(TSCfgContext ctx, TSCfgIterState *state)
-{
-  return CfgContextGetFirst((CfgContext *)ctx, state);
-}
-
-TSCfgEle *
-TSCfgContextGetNext(TSCfgContext ctx, TSCfgIterState *state)
-{
-  return CfgContextGetNext((CfgContext *)ctx, state);
-}
-
-TSMgmtError
-TSCfgContextMoveEleUp(TSCfgContext ctx, int index)
-{
-  return CfgContextMoveEleUp((CfgContext *)ctx, index);
-}
-
-TSMgmtError
-TSCfgContextMoveEleDown(TSCfgContext ctx, int index)
-{
-  return CfgContextMoveEleDown((CfgContext *)ctx, index);
-}
-
-TSMgmtError
-TSCfgContextAppendEle(TSCfgContext ctx, TSCfgEle *ele)
-{
-  return CfgContextAppendEle((CfgContext *)ctx, ele);
-}
-
-TSMgmtError
-TSCfgContextInsertEleAt(TSCfgContext ctx, TSCfgEle *ele, int index)
-{
-  return CfgContextInsertEleAt((CfgContext *)ctx, ele, index);
-}
-
-TSMgmtError
-TSCfgContextRemoveEleAt(TSCfgContext ctx, int index)
-{
-  return CfgContextRemoveEleAt((CfgContext *)ctx, index);
-}
-
-TSMgmtError
-TSCfgContextRemoveAll(TSCfgContext ctx)
-{
-  return CfgContextRemoveAll((CfgContext *)ctx);
-}
-
 /* checks if the fields in the ele are all valid */
 bool
 TSIsValid(TSCfgEle *ele)
diff --git a/mgmt/api/Makefile.am b/mgmt/api/Makefile.am
index 2e32dff..d5385e5 100644
--- a/mgmt/api/Makefile.am
+++ b/mgmt/api/Makefile.am
@@ -36,8 +36,6 @@ lib_LTLIBRARIES = libtsmgmt.la
 libmgmtapi_la_SOURCES = \
   CfgContextImpl.cc \
   CfgContextImpl.h \
-  CfgContextManager.cc \
-  CfgContextManager.h \
   CfgContextUtils.cc \
   CfgContextUtils.h \
   CoreAPI.h \
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index 9d60d83..f3b7f1c 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -1022,119 +1022,12 @@ tsapi TSMgmtError TSEventSignalCbRegister(char *event_name, TSEventSignalFunc fu
  */
 tsapi TSMgmtError TSEventSignalCbUnregister(char *event_name, TSEventSignalFunc func);
 
-/*--- abstracted file operations ------------------------------------------*/
-/* TSCfgContextCreate: allocates memory for an empty TSCfgContext for the specified file
- * Input:  file - the file
- * Output: TSCfgContext
- * Note: This function does not read the current rules in the file into
- * the TSCfgContext (must call TSCfgContextGet to do this). If you
- * do not call TSCfgContextGet before calling TSCfgContextCommit, then
- * you will overwite all the old rules in the config file!
- */
-tsapi TSCfgContext TSCfgContextCreate(TSFileNameT file);
-
-/* TSCfgContextDestroy: deallocates all memory for the TSCfgContext
- * Input:  ctx - the TSCfgContext to destroy
- * Output: TSMgmtError
- */
-tsapi TSMgmtError TSCfgContextDestroy(TSCfgContext ctx);
-
-/* TSCfgContextGet: retrieves all the Ele's for the file specified in the ctx and
- *                puts them into ctx; note that the ele's in the TSCfgContext don't
- *                all have to be of the same ele type
- * Input: ctx - where all the most currfile's eles are stored
- * Output: TSMgmtError
- *
- */
-tsapi TSMgmtError TSCfgContextGet(TSCfgContext ctx);
-
 /*--- TSCfgContext Operations --------------------------------------------*/
 /*
  * These operations are used to manipulate the opaque TSCfgContext type,
  * eg. when want to modify a file
  */
 
-/* TSCfgContextGetCount: returns number of Ele's in the TSCfgContext
- * Input:  ctx - the TSCfgContext to count the number of ele's in
- * Output: the number of Ele's
- */
-int TSCfgContextGetCount(TSCfgContext ctx);
-
-/* TSCfgContextGetEleAt: retrieves the Ele at the specified index; user must
- *                        typecast the TSCfgEle to appropriate TSEle before using
- * Input:  ctx   - the TSCfgContext to retrieve the ele from
- *         index - the Ele position desired; first Ele located at index 0
- * Output: the Ele (typecasted as an TSCfgEle)
- */
-TSCfgEle *TSCfgContextGetEleAt(TSCfgContext ctx, int index);
-
-/* TSCfgContextGetFirst: retrieves the first Ele in the TSCfgContext
- * Input:  ctx   - the TSCfgContext
- *         state - the current position in the Ele that the iterator is at
- * Output: returns first Ele in the ctx (typecasted as an TSCfgEle)
- */
-TSCfgEle *TSCfgContextGetFirst(TSCfgContext ctx, TSCfgIterState *state);
-
-/* TSCfgContextGetNext: retrieves the next ele in the ctx that's located after
- *                       the one pointed to by the TSCfgIterState
- * Input:  ctx   - the TSCfgContext
- *         state - the current position in the Ele that the iterator is at
- * Output: returns the next Ele in the ctx (typecasted as an TSCfgEle)
- */
-TSCfgEle *TSCfgContextGetNext(TSCfgContext ctx, TSCfgIterState *state);
-
-/* TSCfgContextMoveEleUp: shifts the Ele at the specified index one position up;
- *                         does nothing if Ele is at first position in the TSCfgContext
- * Input:  ctx   - the TSCfgContext
- *         index - the position of the Ele that needs to be shifted up
- * Output: TSMgmtError
- */
-TSMgmtError TSCfgContextMoveEleUp(TSCfgContext ctx, int index);
-
-/* TSCfgContextMoveEleDown: shifts the Ele at the specified index one position down;
- *                           does nothing if Ele is last in the TSCfgContext
- * Input:  ctx   - the TSCfgContext
- *         index - the position of the Ele that needs to be shifted down
- * Output: TSMgmtError
- */
-TSMgmtError TSCfgContextMoveEleDown(TSCfgContext ctx, int index);
-
-/* TSCfgContextAppendEle: appends the ele to the end of the TSCfgContext
- * Input:  ctx   - the TSCfgContext
- *         ele - the Ele (typecasted as an TSCfgEle) to append to ctx
- * Output: TSMgmtError
- * Note: When appending the ele to the TSCfgContext, this function does NOT
- *       make a copy of the ele passed in; it uses the same memory! So you probably
- *       do not want to append the ele and then free the memory for the ele
- *       without first removing the ele from the TSCfgContext
- */
-TSMgmtError TSCfgContextAppendEle(TSCfgContext ctx, TSCfgEle *ele);
-
-/* TSCfgContextInsertEleAt: inserts the ele at the specified index
- * Input:  ctx   - the TSCfgContext
- *         ele   - the Ele (typecasted as an TSCfgEle) to insert into ctx
- *         index - the position in ctx to insert the Ele
- * Output: TSMgmtError
- * Note: When inserting the ele into the TSCfgContext, this function does NOT
- *       make a copy of the ele passed in; it uses the same memory! So you probably
- *       do not want to insert the ele and then free the memory for the ele
- *       without first removing the ele from the TSCfgContext
- */
-TSMgmtError TSCfgContextInsertEleAt(TSCfgContext ctx, TSCfgEle *ele, int index);
-
-/* TSCfgContextRemoveEleAt: removes the Ele at the specified index from the TSCfgContext
- * Input:  ctx   - the TSCfgContext
- *         index - the position of the Ele in the ctx to remove
- * Output: TSMgmtError
- */
-TSMgmtError TSCfgContextRemoveEleAt(TSCfgContext ctx, int index);
-
-/* TSCfgContextRemoveAll: removes all Eles from the TSCfgContext
- * Input:  ctx   - the TSCfgContext
- * Output: TSMgmtError
- */
-TSMgmtError TSCfgContextRemoveAll(TSCfgContext ctx);
-
 /*--- TS Cache Inspector Operations --------------------------------------------*/
 
 /* TSLookupFromCacheUrl

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 03/03: This removes all configuration Element ctor/dtor code

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit af92bb6b18bf3b285f69ce3ea892ff018ab41572
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Thu Oct 12 20:09:28 2017 -0600

    This removes all configuration Element ctor/dtor code
---
 mgmt/api/APITestCliRemote.cc | 191 ----------
 mgmt/api/CfgContextDefs.h    |  73 ----
 mgmt/api/INKMgmtAPI.cc       | 809 -------------------------------------------
 mgmt/api/include/mgmtapi.h   | 407 +---------------------
 4 files changed, 1 insertion(+), 1479 deletions(-)

diff --git a/mgmt/api/APITestCliRemote.cc b/mgmt/api/APITestCliRemote.cc
index ba7bf37..7092fbd 100644
--- a/mgmt/api/APITestCliRemote.cc
+++ b/mgmt/api/APITestCliRemote.cc
@@ -123,28 +123,6 @@ print_err(const char *module, TSMgmtError err)
   }
 }
 
-/*--------------------------------------------------------------
- * print_ports
- *--------------------------------------------------------------*/
-void
-print_ports(TSPortList list)
-{
-  int i, count;
-  TSPortEle *port_ele;
-
-  count = TSPortListLen(list);
-  for (i = 0; i < count; i++) {
-    port_ele = TSPortListDequeue(list);
-    printf(" %d \n", port_ele->port_a);
-    if (port_ele->port_b != -1) {
-      printf(" %d - %d \n", port_ele->port_a, port_ele->port_b);
-    }
-    TSPortListEnqueue(list, port_ele);
-  }
-
-  return;
-}
-
 /*-------------------------------------------------------------
  * print_string_list
  *-------------------------------------------------------------*/
@@ -188,175 +166,6 @@ print_int_list(TSIntList list)
   printf("Int List: %s \n", buf);
 }
 
-/*-------------------------------------------------------
- * print_domain_list
- *-------------------------------------------------------*/
-void
-print_domain_list(TSDomainList list)
-{
-  int i, count;
-  TSDomain *proxy;
-
-  count = TSDomainListLen(list);
-  for (i = 0; i < count; i++) {
-    proxy = TSDomainListDequeue(list);
-    if (proxy->domain_val) {
-      printf("%s:%d\n", proxy->domain_val, proxy->port);
-    }
-    TSDomainListEnqueue(list, proxy);
-  }
-}
-
-void
-print_ip_addr_ele(TSIpAddrEle *ele)
-{
-  if (!ele) {
-    return;
-  }
-
-  if (ele->type == TS_IP_RANGE) {
-    if (ele->cidr_a != -1) {
-      printf("IP_addr: %s/%d - %s/%d\n", ele->ip_a, ele->cidr_a, ele->ip_b, ele->cidr_b);
-    } else {
-      printf("IP_addr: %s - %s\n", ele->ip_a, ele->ip_b);
-    }
-  } else {
-    if (ele->cidr_a != -1) {
-      printf("IP_addr: %s/%d \n", ele->ip_a, ele->cidr_a);
-    } else {
-      printf("IP_addr: %s \n", ele->ip_a);
-    }
-  }
-}
-
-/*-------------------------------------------------------
- * print_ip_list
- *-------------------------------------------------------*/
-void
-print_ip_list(TSIpAddrList list)
-{
-  int i, count;
-  TSIpAddrEle *ele;
-
-  count = TSIpAddrListLen(list);
-  for (i = 0; i < count; i++) {
-    ele = TSIpAddrListDequeue(list);
-    print_ip_addr_ele(ele);
-
-    TSIpAddrListEnqueue(list, ele);
-  }
-}
-
-/*-------------------------------------------------------
- * print_list_of_ip_list
- *-------------------------------------------------------*/
-void
-print_list_of_ip_list(TSList list)
-{
-  int i, count;
-  TSIpAddrList ele;
-
-  count = TSIpAddrListLen(list);
-  for (i = 0; i < count; i++) {
-    ele = TSListDequeue(list);
-    printf("\n");
-    print_ip_list(ele);
-    printf("\n");
-    TSListEnqueue(list, ele);
-  }
-}
-
-/*-------------------------------------------------------
- * print_pd_sspec
- *-------------------------------------------------------*/
-void
-print_pd_sspec(TSPdSsFormat info)
-{
-  switch (info.pd_type) {
-  case TS_PD_DOMAIN:
-    printf("Prime Dest: dest_domain=%s\n", info.pd_val);
-    break;
-  case TS_PD_HOST:
-    printf("Prime Host: dest_host=%s\n", info.pd_val);
-    break;
-  case TS_PD_IP:
-    printf("Prime IP: dest_ip=%s\n", info.pd_val);
-    break;
-  case TS_PD_URL_REGEX:
-    printf("Prime Url regex: url_regex=%s\n", info.pd_val);
-    break;
-  case TS_PD_URL:
-    printf("Prime Url: url=%s\n", info.pd_val);
-    break;
-  default:
-    break;
-  }
-
-  printf("Secondary Specifiers:\n");
-  printf("\ttime: %d:%d-%d:%d\n", info.sec_spec.time.hour_a, info.sec_spec.time.min_a, info.sec_spec.time.hour_b,
-         info.sec_spec.time.min_b);
-
-  if (info.sec_spec.src_ip) {
-    printf("\tsrc_ip: %s\n", info.sec_spec.src_ip);
-  }
-
-  if (info.sec_spec.prefix) {
-    printf("\tprefix: %s\n", info.sec_spec.prefix);
-  }
-
-  if (info.sec_spec.suffix) {
-    printf("\tsuffix: %s\n", info.sec_spec.suffix);
-  }
-
-  printf("\tport-a: %d\n", info.sec_spec.port->port_a);
-  printf("\tport-b: %d\n", info.sec_spec.port->port_b);
-
-  printf("\tmethod: ");
-  switch (info.sec_spec.method) {
-  case TS_METHOD_NONE:
-    printf("NONE");
-    break;
-  case TS_METHOD_GET:
-    printf("GET");
-    break;
-  case TS_METHOD_POST:
-    printf("POST");
-    break;
-  case TS_METHOD_PUT:
-    printf("PUT");
-    break;
-  case TS_METHOD_TRACE:
-    printf("TRACE");
-    break;
-  case TS_METHOD_UNDEFINED:
-    printf("UNDEFINED");
-    break;
-  default:
-    // Handled here:
-    // TS_METHOD_PUSH
-    break;
-  }
-  printf("\n");
-
-  printf("\tscheme: ");
-  switch (info.sec_spec.scheme) {
-  case TS_SCHEME_NONE:
-    printf("NONE\n");
-    break;
-  case TS_SCHEME_HTTP:
-    printf("HTTP\n");
-    break;
-  case TS_SCHEME_HTTPS:
-    printf("HTTPS\n");
-    break;
-  case TS_SCHEME_UNDEFINED:
-    printf("UNDEFINED\n");
-    break;
-  }
-
-  return;
-}
-
 /***************************************************************************
  * Control Testing
  ***************************************************************************/
diff --git a/mgmt/api/CfgContextDefs.h b/mgmt/api/CfgContextDefs.h
deleted file mode 100644
index 90d984a..0000000
--- a/mgmt/api/CfgContextDefs.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/***************************************************************************
- * Type Definitions
- ***************************************************************************/
-#ifndef _MGMT_API_DEFS_
-#define _MGMT_API_DEFS_
-
-#include "mgmtapi.h"
-#include "ts/ink_llqueue.h"
-
-// for buffer used temporarily to parse incoming commands.
-#ifndef MAX_BUF_SIZE
-#define MAX_BUF_SIZE 4098
-#endif
-
-#ifndef MAX_FILE_SIZE
-#define MAX_FILE_SIZE 4098
-#endif
-
-#ifndef MAX_RULE_SIZE
-#define MAX_RULE_SIZE 1024
-#endif
-
-#define NUM_SEC_SPECS 8
-
-#define DELIMITER '#'
-#define DELIMITER_STR "#"
-#define RANGE_DELIMITER '-'
-#define RANGE_DELIMITER_STR "- "
-#define CIDR_DELIMITER '/'
-#define CIDR_DELIMITER_STR "/"
-#define IP_END_DELIMITER "#"
-#define LIST_DELIMITER ", "
-
-/* Each opaque List handle in the mgmtapi should have
- * a corresponding typedef here. Using LLQ's to implement the
- * lists
- */
-typedef LLQ PortList;
-typedef LLQ IpAddrList;
-typedef LLQ DomainList;
-typedef LLQ StringList;
-
-/* INKCommentEle only used internally by the CfgContext */
-/* should this be defined in CfgContextUtils.h ?? */
-typedef struct {
-  TSCfgEle cfg_ele;
-  char *comment;
-} INKCommentEle;
-
-#endif
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index 50ab43b..25bcb85 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -42,9 +42,6 @@
 
 #include "ts/TextBuffer.h"
 
-// forward declarations
-void init_pdss_format(TSPdSsFormat &info);
-
 /***************************************************************************
  * API Memory Management
  ***************************************************************************/
@@ -167,280 +164,6 @@ TSListIsValid(TSList l)
   return true;
 }
 
-/*--- TSIpAddrList operations -------------------------------------------------*/
-tsapi TSIpAddrList
-TSIpAddrListCreate(void)
-{
-  return (void *)create_queue(); /* this queue will be a list of IpAddrEle* */
-}
-
-tsapi void
-TSIpAddrListDestroy(TSIpAddrList ip_addrl)
-{
-  TSIpAddrEle *ipaddr_ele;
-
-  if (!ip_addrl) {
-    return;
-  }
-
-  /* dequeue each element and free it;
-     currently, an element can only be an TSIpAddrEle
-     or it can be an TSIpAddr ?? */
-  while (!queue_is_empty((LLQ *)ip_addrl)) {
-    ipaddr_ele = (TSIpAddrEle *)dequeue((LLQ *)ip_addrl);
-
-    if (!ipaddr_ele) {
-      continue;
-    }
-
-    TSIpAddrEleDestroy(ipaddr_ele);
-  }
-
-  /* we have removed everything on the list so free list */
-  delete_queue((LLQ *)ip_addrl);
-  return;
-}
-
-tsapi TSMgmtError
-TSIpAddrListEnqueue(TSIpAddrList ip_addrl, TSIpAddrEle *ip_addr)
-{
-  int ret;
-
-  ink_assert(ip_addrl && ip_addr);
-  if (!ip_addrl || !ip_addr) {
-    return TS_ERR_PARAMS;
-  }
-
-  ret = enqueue((LLQ *)ip_addrl, ip_addr);
-  if (ret == 0) {
-    return TS_ERR_FAIL;
-  } else {
-    return TS_ERR_OKAY;
-  }
-}
-
-/* The the TSIpAddrEle returned is actually removed from the end of list */
-tsapi TSIpAddrEle *
-TSIpAddrListDequeue(TSIpAddrList ip_addrl)
-{
-  ink_assert(ip_addrl);
-  if (!ip_addrl || queue_is_empty((LLQ *)ip_addrl)) {
-    return nullptr;
-  }
-
-  return (TSIpAddrEle *)dequeue((LLQ *)ip_addrl);
-}
-
-tsapi int
-TSIpAddrListLen(TSIpAddrList ip_addrl)
-{
-  ink_assert(ip_addrl);
-  if (!ip_addrl) {
-    return -1;
-  }
-
-  return queue_len((LLQ *)ip_addrl);
-}
-
-tsapi bool
-TSIpAddrListIsEmpty(TSIpAddrList ip_addrl)
-{
-  ink_assert(ip_addrl);
-  if (!ip_addrl) {
-    return true;
-  }
-
-  return queue_is_empty((LLQ *)ip_addrl);
-}
-
-/*--- TSPortList operations ----------------------------------------------*/
-tsapi TSPortList
-TSPortListCreate()
-{
-  return (void *)create_queue(); /* this queue will be a list of TSPortEle* */
-}
-
-tsapi void
-TSPortListDestroy(TSPortList portl)
-{
-  TSPortEle *port_ele;
-
-  if (!portl) {
-    return;
-  }
-  // dequeue each element and free it
-  while (!queue_is_empty((LLQ *)portl)) {
-    port_ele = (TSPortEle *)dequeue((LLQ *)portl);
-
-    if (!port_ele) {
-      continue;
-    }
-
-    TSPortEleDestroy(port_ele);
-  }
-
-  /* we have removed everything on the list so free list */
-  delete_queue((LLQ *)portl);
-  return;
-}
-
-tsapi TSMgmtError
-TSPortListEnqueue(TSPortList portl, TSPortEle *port)
-{
-  int ret;
-
-  ink_assert(portl && port);
-  if (!portl || !port) {
-    return TS_ERR_PARAMS;
-  }
-
-  ret = enqueue((LLQ *)portl, port); /* returns TRUE=1 or FALSE=0 */
-  if (ret == 0) {
-    return TS_ERR_FAIL;
-  } else {
-    return TS_ERR_OKAY;
-  }
-}
-
-tsapi TSPortEle *
-TSPortListDequeue(TSPortList portl)
-{
-  ink_assert(portl);
-  if (!portl || queue_is_empty((LLQ *)portl)) {
-    return nullptr;
-  }
-
-  return (TSPortEle *)dequeue((LLQ *)portl);
-}
-
-tsapi int
-TSPortListLen(TSPortList portl)
-{
-  ink_assert(portl);
-  if (!portl) {
-    return -1;
-  }
-
-  return queue_len((LLQ *)portl);
-}
-
-tsapi bool
-TSPortListIsEmpty(TSPortList portl)
-{
-  ink_assert(portl);
-  if (!portl) {
-    return true;
-  }
-
-  return queue_is_empty((LLQ *)portl);
-}
-
-/*--- TSDomainList operations -----------------------------------------*/
-tsapi TSDomainList
-TSDomainListCreate()
-{
-  return (void *)create_queue(); /* this queue will be a list of char* */
-}
-
-tsapi void
-TSDomainListDestroy(TSDomainList domainl)
-{
-  TSDomain *domain;
-
-  if (!domainl) {
-    return;
-  }
-
-  /* dequeue each element and free it */
-  while (!queue_is_empty((LLQ *)domainl)) {
-    domain = (TSDomain *)dequeue((LLQ *)domainl);
-
-    if (!domain) {
-      continue;
-    }
-
-    TSDomainDestroy(domain);
-  }
-
-  delete_queue((LLQ *)domainl);
-}
-
-tsapi TSMgmtError
-TSDomainListEnqueue(TSDomainList domainl, TSDomain *domain)
-{
-  int ret;
-
-  ink_assert(domainl && domain);
-  if (!domainl || !domain) {
-    return TS_ERR_PARAMS;
-  }
-
-  ret = enqueue((LLQ *)domainl, domain); /* returns TRUE=1 or FALSE=0 */
-  if (ret == 0) {
-    return TS_ERR_FAIL;
-  } else {
-    return TS_ERR_OKAY;
-  }
-}
-
-tsapi TSDomain *
-TSDomainListDequeue(TSDomainList domainl)
-{
-  ink_assert(domainl);
-  if (!domainl || queue_is_empty((LLQ *)domainl)) {
-    return nullptr;
-  }
-
-  return (TSDomain *)dequeue((LLQ *)domainl);
-}
-
-tsapi bool
-TSDomainListIsEmpty(TSDomainList domainl)
-{
-  ink_assert(domainl);
-  if (!domainl) {
-    return true;
-  }
-
-  return queue_is_empty((LLQ *)domainl);
-}
-
-tsapi int
-TSDomainListLen(TSDomainList domainl)
-{
-  ink_assert(domainl);
-  if (!domainl) {
-    return -1;
-  }
-
-  return queue_len((LLQ *)domainl);
-}
-
-// returns false if encounter a NULL hostname and ip
-tsapi bool
-TSDomainListIsValid(TSDomainList domainl)
-{
-  int i, len;
-  TSDomain *dom;
-
-  if (!domainl) {
-    return false;
-  }
-
-  len = queue_len((LLQ *)domainl);
-  for (i = 0; i < len; i++) {
-    dom = (TSDomain *)dequeue((LLQ *)domainl);
-    if (!dom) {
-      return false;
-    }
-    if (!dom->domain_val) {
-      return false;
-    }
-    enqueue((LLQ *)domainl, dom);
-  }
-  return true;
-}
-
 /*--- TSStringList operations --------------------------------------*/
 tsapi TSStringList
 TSStringListCreate()
@@ -638,25 +361,6 @@ TSIntListIsValid(TSIntList intl, int min, int max)
   return true;
 }
 
-// helper fn that sets default values for the info passed in
-void
-init_pdss_format(TSPdSsFormat &info)
-{
-  info.pd_type              = TS_PD_UNDEFINED;
-  info.pd_val               = nullptr;
-  info.sec_spec.active      = 0;
-  info.sec_spec.time.hour_a = 0;
-  info.sec_spec.time.min_a  = 0;
-  info.sec_spec.time.hour_b = 0;
-  info.sec_spec.time.min_b  = 0;
-  info.sec_spec.src_ip      = TS_INVALID_IP_ADDR;
-  info.sec_spec.prefix      = nullptr;
-  info.sec_spec.suffix      = nullptr;
-  info.sec_spec.port        = TS_INVALID_PORT;
-  info.sec_spec.method      = TS_METHOD_UNDEFINED;
-  info.sec_spec.scheme      = TS_SCHEME_UNDEFINED;
-}
-
 /*--- allocate/deallocate operations --------------------------------------*/
 tsapi TSMgmtEvent *
 TSEventCreate(void)
@@ -706,519 +410,6 @@ TSRecordEleDestroy(TSRecordEle *ele)
   return;
 }
 
-tsapi TSIpAddrEle *
-TSIpAddrEleCreate(void)
-{
-  TSIpAddrEle *ele = (TSIpAddrEle *)ats_malloc(sizeof(TSIpAddrEle));
-
-  /* set default values */
-  ele->type   = TS_IP_UNDEFINED;
-  ele->ip_a   = TS_INVALID_IP_ADDR;
-  ele->cidr_a = TS_INVALID_IP_CIDR;
-  ele->port_a = TS_INVALID_PORT;
-  ele->ip_b   = TS_INVALID_IP_ADDR;
-  ele->cidr_b = TS_INVALID_IP_CIDR;
-  ele->port_b = TS_INVALID_PORT;
-  return ele;
-}
-
-tsapi void
-TSIpAddrEleDestroy(TSIpAddrEle *ele)
-{
-  if (ele) {
-    ats_free(ele->ip_a);
-    ats_free(ele->ip_b);
-    ats_free(ele);
-  }
-
-  return;
-}
-
-tsapi TSPortEle *
-TSPortEleCreate(void)
-{
-  TSPortEle *ele = (TSPortEle *)ats_malloc(sizeof(TSPortEle));
-
-  ele->port_a = TS_INVALID_PORT;
-  ele->port_b = TS_INVALID_PORT;
-
-  return ele;
-}
-
-tsapi void
-TSPortEleDestroy(TSPortEle *ele)
-{
-  ats_free(ele);
-  return;
-}
-
-tsapi TSDomain *
-TSDomainCreate()
-{
-  TSDomain *ele = (TSDomain *)ats_malloc(sizeof(TSDomain));
-
-  ele->domain_val = nullptr;
-  ele->port       = TS_INVALID_PORT;
-
-  return ele;
-}
-
-tsapi void
-TSDomainDestroy(TSDomain *ele)
-{
-  if (ele) {
-    ats_free(ele->domain_val);
-    ats_free(ele);
-  }
-}
-
-tsapi TSSspec *
-TSSspecCreate(void)
-{
-  TSSspec *sec_spec = (TSSspec *)ats_malloc(sizeof(TSSspec));
-
-  /* set defaults */
-  sec_spec->active        = 0;
-  (sec_spec->time).hour_a = 0;
-  (sec_spec->time).min_a  = 0;
-  (sec_spec->time).hour_b = 0;
-  (sec_spec->time).min_b  = 0;
-  sec_spec->src_ip        = TS_INVALID_IP_ADDR;
-  sec_spec->prefix        = nullptr;
-  sec_spec->suffix        = nullptr;
-  sec_spec->port          = nullptr;
-  sec_spec->method        = TS_METHOD_UNDEFINED;
-  sec_spec->scheme        = TS_SCHEME_UNDEFINED;
-  return sec_spec;
-}
-
-tsapi void
-TSSspecDestroy(TSSspec *ele)
-{
-  if (ele) {
-    ats_free(ele->prefix);
-    ats_free(ele->suffix);
-    if (ele->port) {
-      TSPortEleDestroy(ele->port);
-    }
-    ats_free(ele);
-  }
-  return;
-}
-
-tsapi TSPdSsFormat *
-TSPdSsFormatCreate(void)
-{
-  TSPdSsFormat *ele = (TSPdSsFormat *)ats_malloc(sizeof(TSPdSsFormat));
-
-  /* should set default values here */
-  ele->pd_type = TS_PD_UNDEFINED;
-  ele->pd_val  = nullptr;
-
-  ele->sec_spec.active        = 0;
-  (ele->sec_spec.time).hour_a = -1;
-  (ele->sec_spec.time).min_a  = -1;
-  (ele->sec_spec.time).hour_b = -1;
-  (ele->sec_spec.time).min_b  = -1;
-  ele->sec_spec.src_ip        = TS_INVALID_IP_ADDR;
-  ele->sec_spec.prefix        = nullptr;
-  ele->sec_spec.suffix        = nullptr;
-  ele->sec_spec.port          = nullptr;
-  ele->sec_spec.method        = TS_METHOD_UNDEFINED;
-  ele->sec_spec.scheme        = TS_SCHEME_UNDEFINED;
-
-  return ele;
-}
-
-tsapi void
-TSPdSsFormatDestroy(TSPdSsFormat &ele)
-{
-  ats_free(ele.pd_val);
-  ats_free(ele.sec_spec.src_ip);
-  ats_free(ele.sec_spec.prefix);
-  ats_free(ele.sec_spec.suffix);
-  if (ele.sec_spec.port) {
-    TSPortEleDestroy(ele.sec_spec.port);
-  }
-}
-
-/*-------------------------------------------------------------
- * CacheObj
- *-------------------------------------------------------------*/
-tsapi TSCacheEle *
-TSCacheEleCreate(TSRuleTypeT type)
-{
-  TSCacheEle *ele;
-
-  if (type != TS_CACHE_NEVER && type != TS_CACHE_IGNORE_NO_CACHE && type != TS_CACHE_IGNORE_CLIENT_NO_CACHE &&
-      type != TS_CACHE_IGNORE_SERVER_NO_CACHE && type != TS_CACHE_PIN_IN_CACHE && type != TS_CACHE_REVALIDATE &&
-      type != TS_CACHE_TTL_IN_CACHE && type != TS_CACHE_AUTH_CONTENT && type != TS_TYPE_UNDEFINED) {
-    return nullptr; // invalid type
-  }
-
-  ele = (TSCacheEle *)ats_malloc(sizeof(TSCacheEle));
-
-  /* set defaults */
-  ele->cfg_ele.type  = type;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  init_pdss_format(ele->cache_info);
-  ele->time_period.d = 0;
-  ele->time_period.h = 0;
-  ele->time_period.m = 0;
-  ele->time_period.s = 0;
-
-  return ele;
-}
-
-tsapi void
-TSCacheEleDestroy(TSCacheEle *ele)
-{
-  if (ele) {
-    TSPdSsFormatDestroy(ele->cache_info);
-    ats_free(ele);
-  }
-  return;
-}
-
-/*-------------------------------------------------------------
- * CongestionObj
- *-------------------------------------------------------------*/
-// FIXME: for now use defaults specified in feature spec; the
-// defaults though are configurable as records, so should use
-// records values instead
-tsapi TSCongestionEle *
-TSCongestionEleCreate()
-{
-  TSCongestionEle *ele = (TSCongestionEle *)ats_malloc(sizeof(TSCongestionEle));
-
-  /* set defaults */
-  ele->cfg_ele.type  = TS_CONGESTION;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  // init_pdss_format(ele->congestion_info);
-  ele->pd_type                 = TS_PD_UNDEFINED;
-  ele->pd_val                  = nullptr;
-  ele->prefix                  = nullptr;
-  ele->port                    = TS_INVALID_PORT;
-  ele->scheme                  = TS_HTTP_CONGEST_PER_IP;
-  ele->max_connection_failures = 5;
-  ele->fail_window             = 120;
-  ele->proxy_retry_interval    = 10;
-  ele->client_wait_interval    = 300;
-  ele->wait_interval_alpha     = 30;
-  ele->live_os_conn_timeout    = 60;
-  ele->live_os_conn_retries    = 2;
-  ele->dead_os_conn_timeout    = 15;
-  ele->dead_os_conn_retries    = 1;
-  ele->max_connection          = -1;
-  ele->error_page_uri          = ats_strdup("congestion#retryAfter");
-
-  return ele;
-}
-
-tsapi void
-TSCongestionEleDestroy(TSCongestionEle *ele)
-{
-  if (ele) {
-    ats_free(ele->pd_val);
-    ats_free(ele->prefix);
-    ats_free(ele->error_page_uri);
-    ats_free(ele);
-  }
-  return;
-}
-
-/*-------------------------------------------------------------
- * HostingObj
- *-------------------------------------------------------------*/
-tsapi TSHostingEle *
-TSHostingEleCreate()
-{
-  TSHostingEle *ele = (TSHostingEle *)ats_malloc(sizeof(TSHostingEle));
-
-  ele->cfg_ele.type  = TS_HOSTING;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  ele->pd_type       = TS_PD_UNDEFINED;
-  ele->pd_val        = nullptr;
-  ele->volumes       = TS_INVALID_LIST;
-
-  return ele;
-}
-
-tsapi void
-TSHostingEleDestroy(TSHostingEle *ele)
-{
-  if (ele) {
-    ats_free(ele->pd_val);
-    if (ele->volumes) {
-      TSIntListDestroy(ele->volumes);
-    }
-    ats_free(ele);
-  }
-  return;
-}
-
-/*-------------------------------------------------------------
- * TSIpAllowEle
- *-------------------------------------------------------------*/
-tsapi TSIpAllowEle *
-TSIpAllowEleCreate()
-{
-  TSIpAllowEle *ele = (TSIpAllowEle *)ats_malloc(sizeof(TSIpAllowEle));
-
-  ele->cfg_ele.type  = TS_IP_ALLOW;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  ele->src_ip_addr   = TS_INVALID_IP_ADDR;
-  ele->action        = TS_IP_ALLOW_UNDEFINED;
-
-  return ele;
-}
-
-tsapi void
-TSIpAllowEleDestroy(TSIpAllowEle *ele)
-{
-  if (ele) {
-    if (ele->src_ip_addr) {
-      TSIpAddrEleDestroy(ele->src_ip_addr);
-    }
-    ats_free(ele);
-  }
-  return;
-}
-
-/*-------------------------------------------------------------
- * TSParentProxyEleCreate
- *-------------------------------------------------------------*/
-tsapi TSParentProxyEle *
-TSParentProxyEleCreate(TSRuleTypeT type)
-{
-  TSParentProxyEle *ele;
-
-  if (type != TS_PP_PARENT && type != TS_PP_GO_DIRECT && type != TS_TYPE_UNDEFINED) {
-    return nullptr;
-  }
-
-  ele = (TSParentProxyEle *)ats_malloc(sizeof(TSParentProxyEle));
-
-  ele->cfg_ele.type  = type;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  init_pdss_format(ele->parent_info);
-  ele->rr         = TS_RR_NONE;
-  ele->proxy_list = TS_INVALID_LIST;
-  ele->direct     = false;
-
-  return ele;
-}
-
-tsapi void
-TSParentProxyEleDestroy(TSParentProxyEle *ele)
-{
-  if (ele) {
-    TSPdSsFormatDestroy(ele->parent_info);
-    if (ele->proxy_list) {
-      TSDomainListDestroy(ele->proxy_list);
-    }
-    ats_free(ele);
-  }
-
-  return;
-}
-
-/*-------------------------------------------------------------
- * TSVolumeEle
- *-------------------------------------------------------------*/
-tsapi TSVolumeEle *
-TSVolumeEleCreate()
-{
-  TSVolumeEle *ele = (TSVolumeEle *)ats_malloc(sizeof(TSVolumeEle));
-
-  ele->cfg_ele.type  = TS_VOLUME;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  ele->volume_num    = 0;
-  ele->scheme        = TS_VOLUME_UNDEFINED;
-  ele->volume_size   = 0;
-  ele->size_format   = TS_SIZE_FMT_UNDEFINED;
-
-  return ele;
-}
-
-tsapi void
-TSVolumeEleDestroy(TSVolumeEle *ele)
-{
-  ats_free(ele);
-  return;
-}
-
-/*-------------------------------------------------------------
- * TSPluginEle
- *-------------------------------------------------------------*/
-tsapi TSPluginEle *
-TSPluginEleCreate()
-{
-  TSPluginEle *ele = (TSPluginEle *)ats_malloc(sizeof(TSPluginEle));
-
-  ele->cfg_ele.type  = TS_PLUGIN;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  ele->name          = nullptr;
-  ele->args          = TS_INVALID_LIST;
-
-  return ele;
-}
-
-tsapi void
-TSPluginEleDestroy(TSPluginEle *ele)
-{
-  if (ele) {
-    ats_free(ele->name);
-    if (ele->args) {
-      TSStringListDestroy(ele->args);
-    }
-    ats_free(ele);
-  }
-  return;
-}
-
-/*-------------------------------------------------------------
- * TSRemapEle
- *-------------------------------------------------------------*/
-TSRemapEle *
-TSRemapEleCreate(TSRuleTypeT type)
-{
-  TSRemapEle *ele;
-
-  if (type != TS_REMAP_MAP && type != TS_REMAP_REVERSE_MAP && type != TS_REMAP_REDIRECT && type != TS_REMAP_REDIRECT_TEMP &&
-      type != TS_TYPE_UNDEFINED) {
-    return nullptr;
-  }
-
-  ele                   = (TSRemapEle *)ats_malloc(sizeof(TSRemapEle));
-  ele->cfg_ele.type     = type;
-  ele->cfg_ele.error    = TS_ERR_OKAY;
-  ele->map              = true;
-  ele->from_scheme      = TS_SCHEME_UNDEFINED;
-  ele->from_host        = nullptr;
-  ele->from_port        = TS_INVALID_PORT;
-  ele->from_path_prefix = nullptr;
-  ele->to_scheme        = TS_SCHEME_UNDEFINED;
-  ele->to_host          = nullptr;
-  ele->to_port          = TS_INVALID_PORT;
-  ele->to_path_prefix   = nullptr;
-
-  return ele;
-}
-
-void
-TSRemapEleDestroy(TSRemapEle *ele)
-{
-  if (ele) {
-    ats_free(ele->from_host);
-    ats_free(ele->from_path_prefix);
-    ats_free(ele->to_host);
-    ats_free(ele->to_path_prefix);
-    ats_free(ele);
-  }
-}
-
-/*-------------------------------------------------------------
- * TSSocksEle
- *-------------------------------------------------------------*/
-TSSocksEle *
-TSSocksEleCreate(TSRuleTypeT type)
-{
-  TSSocksEle *ele = (TSSocksEle *)ats_malloc(sizeof(TSSocksEle));
-
-  ele->cfg_ele.type  = type;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  ele->ip_addrs      = TS_INVALID_LIST;
-  ele->dest_ip_addr  = TS_INVALID_IP_ADDR;
-  ele->socks_servers = TS_INVALID_LIST;
-  ele->rr            = TS_RR_NONE;
-  ele->username      = nullptr;
-  ele->password      = nullptr;
-
-  return ele;
-}
-
-void
-TSSocksEleDestroy(TSSocksEle *ele)
-{
-  if (ele) {
-    if (ele->ip_addrs) {
-      TSIpAddrListDestroy(ele->ip_addrs);
-    }
-    if (ele->dest_ip_addr) {
-      TSIpAddrEleDestroy(ele->dest_ip_addr);
-    }
-    if (ele->socks_servers) {
-      TSDomainListDestroy(ele->socks_servers);
-    }
-    ats_free(ele->username);
-    ats_free(ele->password);
-    ats_free(ele);
-  }
-}
-
-/*-------------------------------------------------------------
- * TSSplitDnsEle
- *-------------------------------------------------------------*/
-TSSplitDnsEle *
-TSSplitDnsEleCreate()
-{
-  TSSplitDnsEle *ele = (TSSplitDnsEle *)ats_malloc(sizeof(TSSplitDnsEle));
-
-  ele->cfg_ele.type      = TS_SPLIT_DNS;
-  ele->cfg_ele.error     = TS_ERR_OKAY;
-  ele->pd_type           = TS_PD_UNDEFINED;
-  ele->pd_val            = nullptr;
-  ele->dns_servers_addrs = TS_INVALID_LIST;
-  ele->def_domain        = nullptr;
-  ele->search_list       = TS_INVALID_LIST;
-
-  return ele;
-}
-
-void
-TSSplitDnsEleDestroy(TSSplitDnsEle *ele)
-{
-  if (ele) {
-    ats_free(ele->pd_val);
-    if (ele->dns_servers_addrs) {
-      TSDomainListDestroy(ele->dns_servers_addrs);
-    }
-    ats_free(ele->def_domain);
-    if (ele->search_list) {
-      TSDomainListDestroy(ele->search_list);
-    }
-    ats_free(ele);
-  }
-  return;
-}
-
-/*-------------------------------------------------------------
- * TSStorageEle
- *-------------------------------------------------------------*/
-TSStorageEle *
-TSStorageEleCreate()
-{
-  TSStorageEle *ele = (TSStorageEle *)ats_malloc(sizeof(TSStorageEle));
-
-  ele->cfg_ele.type  = TS_STORAGE;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  ele->pathname      = nullptr;
-  ele->size          = -1;
-
-  return ele;
-}
-
-void
-TSStorageEleDestroy(TSStorageEle *ele)
-{
-  if (ele) {
-    ats_free(ele->pathname);
-    ats_free(ele);
-  }
-  return;
-}
-
 /***************************************************************************
  * API Core
  ***************************************************************************/
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index 6dbea26..7f1be29 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -118,9 +118,6 @@ typedef char *TSIpAddr;
 
 typedef void *TSHandle;
 typedef TSHandle TSList;
-typedef TSHandle TSIpAddrList; /* contains TSIpAddrEle *'s */
-typedef TSHandle TSPortList;   /* conatins TSPortEle *'s   */
-typedef TSHandle TSDomainList; /* contains TSDomain *'s    */
 typedef TSHandle TSStringList; /* contains char* 's         */
 typedef TSHandle TSIntList;    /* contains int* 's          */
 
@@ -173,95 +170,7 @@ typedef enum {
   TS_REC_UNDEFINED,
 } TSRecordT;
 
-typedef enum {
-  TS_IP_SINGLE, /* single ip address */
-  TS_IP_RANGE,  /* range ip address, eg. 1.1.1.1-2.2.2.2 */
-  TS_IP_UNDEFINED
-} TSIpAddrT;
-
-typedef enum {
-  TS_CON_TCP, /* TCP connection */
-  TS_CON_UDP, /* UDP connection */
-  TS_CON_UNDEFINED
-} TSConnectT;
-
-typedef enum       /* primary destination types */
-{ TS_PD_DOMAIN,    /* domain name */
-  TS_PD_HOST,      /* hostname */
-  TS_PD_IP,        /* ip address */
-  TS_PD_URL_REGEX, /* regular expression in url */
-  TS_PD_URL,       /* regular expression in url */
-  TS_PD_UNDEFINED } TSPrimeDestT;
-
-typedef enum /* header information types */
-{ TS_HDR_DATE,
-  TS_HDR_HOST,
-  TS_HDR_COOKIE,
-  TS_HDR_CLIENT_IP,
-  TS_HDR_UNDEFINED } TSHdrT;
-
-/* TODO: This should be removed */
-typedef enum /* access privileges to news articles cached by Traffic Server  */
-{ TS_IP_ALLOW_ALLOW,
-  TS_IP_ALLOW_DENY,
-  TS_IP_ALLOW_UNDEFINED } TSIpAllowT;
-
-typedef enum               /* multicast time to live options */
-{ TS_MC_TTL_SINGLE_SUBNET, /* forward multicast datagrams to single subnet */
-  TS_MC_TTL_MULT_SUBNET,   /* deliver multicast to more than one subnet */
-  TS_MC_TTL_UNDEFINED } TSMcTtlT;
-
-typedef enum              /* methods of specifying groups of clients */
-{ TS_CLIENT_GRP_IP,       /* ip range */
-  TS_CLIENT_GRP_DOMAIN,   /* domain */
-  TS_CLIENT_GRP_HOSTNAME, /* hostname */
-  TS_CLIENT_GRP_UNDEFINED } TSClientGroupT;
-
-typedef enum {
-  TS_RR_TRUE,   /* go through parent cache list in round robin */
-  TS_RR_STRICT, /* Traffic Server machines serve requests striclty in turn */
-  TS_RR_FALSE,  /* no round robin selection */
-  TS_RR_NONE,   /* no round-robin action tag specified */
-  TS_RR_UNDEFINED
-} TSRrT;
-
-typedef enum /* a request URL method; used in Secondary Specifiers */
-{ TS_METHOD_NONE,
-  TS_METHOD_GET,
-  TS_METHOD_POST,
-  TS_METHOD_PUT,
-  TS_METHOD_TRACE,
-  TS_METHOD_PUSH,
-  TS_METHOD_UNDEFINED } TSMethodT;
-
-typedef enum /*  possible URL schemes */
-{ TS_SCHEME_NONE,
-  TS_SCHEME_HTTP,
-  TS_SCHEME_HTTPS,
-  TS_SCHEME_UNDEFINED } TSSchemeT;
-
-typedef enum /* possible schemes to divide volume by */
-{ TS_VOLUME_HTTP,
-  TS_VOLUME_UNDEFINED } TSVolumeSchemeT;
-
-/* specifies how size is specified */
-typedef enum {
-  TS_SIZE_FMT_PERCENT,  /* as a percentage */
-  TS_SIZE_FMT_ABSOLUTE, /* as an absolute value */
-  TS_SIZE_FMT_UNDEFINED,
-} TSSizeFormatT;
-
-typedef enum {
-  TS_HTTP_CONGEST_PER_IP,
-  TS_HTTP_CONGEST_PER_HOST,
-  TS_HTTP_CONGEST_UNDEFINED,
-} TSCongestionSchemeT;
-
-typedef enum {
-  TS_PROTOCOL_DNS,
-  TS_PROTOCOL_UNDEFINED,
-} TSProtocolT;
-
+/* ToDo: This should be moved over to the core, into the GenericParser.h */
 typedef enum {
   TS_FNAME_CACHE_OBJ,       /* cache.config */
   TS_FNAME_CONGESTION,      /* congestion.config */
@@ -280,39 +189,6 @@ typedef enum {
   TS_FNAME_UNDEFINED
 } TSFileNameT;
 
-/* Each rule type within a file has its own enumeration.
- * Need this enumeration because it's possible there are different Ele's used
- * for rule types within the same file
- */
-typedef enum {
-  TS_CACHE_NEVER, /* cache.config */
-  TS_CACHE_IGNORE_NO_CACHE,
-  TS_CACHE_IGNORE_CLIENT_NO_CACHE,
-  TS_CACHE_IGNORE_SERVER_NO_CACHE,
-  TS_CACHE_PIN_IN_CACHE,
-  TS_CACHE_REVALIDATE,
-  TS_CACHE_TTL_IN_CACHE,
-  TS_CACHE_AUTH_CONTENT,
-  TS_CONGESTION, /* congestion.config */
-  TS_HOSTING,    /* hosting.config */
-  TS_IP_ALLOW,   /* ip_allow.config */
-  TS_PP_PARENT,  /* parent.config */
-  TS_PP_GO_DIRECT,
-  TS_VOLUME,    /* volume.config */
-  TS_PLUGIN,    /* plugin.config */
-  TS_REMAP_MAP, /* remap.config */
-  TS_REMAP_REVERSE_MAP,
-  TS_REMAP_REDIRECT,
-  TS_REMAP_REDIRECT_TEMP,
-  TS_SOCKS_BYPASS, /* socks.config */
-  TS_SOCKS_AUTH,
-  TS_SOCKS_MULTIPLE,
-  TS_SPLIT_DNS, /* splitdns.config */
-  TS_STORAGE,   /* storage.config */
-  TS_TYPE_UNDEFINED,
-  TS_TYPE_COMMENT /* for internal use only */
-} TSRuleTypeT;
-
 /* These are initialization options for the Init() function. */
 typedef enum {
   TS_MGMT_OPT_DEFAULTS = 0,
@@ -329,17 +205,7 @@ typedef enum {
  * Structures
  ***************************************************************************/
 
-/*--- general -------------------------------------------------------------*/
-
-typedef struct {
-  int d; /* days */
-  int h; /* hours */
-  int m; /* minutes */
-  int s; /* seconds */
-} TSHmsTime;
-
 /*--- records -------------------------------------------------------------*/
-
 typedef union { /* record value */
   TSInt int_val;
   TSCounter counter_val;
@@ -404,202 +270,9 @@ typedef struct {
   /*unsigned long timestamp; */ /* only applies to active events */
 } TSActiveEvent;
 
-/*--- abstract file operations --------------------------------------------*/
-
-typedef struct {
-  TSIpAddrT type; /* single ip or an ip-range */
-  TSIpAddr ip_a;  /* first ip */
-  int cidr_a;     /* CIDR value, 0 if not defined */
-  int port_a;     /* port, 0 if not defined */
-  TSIpAddr ip_b;  /* second ip (if ip-range) */
-  int cidr_b;     /* CIDR value, 0 if not defined */
-  int port_b;     /* port, 0 if not defined */
-} TSIpAddrEle;
-
-typedef struct {
-  int port_a; /* first port */
-  int port_b; /* second port (0 if not a port range) */
-} TSPortEle;
-
-typedef struct {
-  char *domain_val; /* a server name can be specified by name or IP address */
-  /* used for www.host.com:8080 or 11.22.33.44:8000 */
-  int port; /* (optional) */
-} TSDomain;
-
-/* there are a variety of secondary specifiers that can be used in a rule; more than
- * one secondary specifier can be used per rule, but a secondary specifier can only
- * be used once per rule (eg. time, src_ip, prefix, suffix, port, method, scheme)
- */
-typedef struct {
-  uint32_t active; /* valid field: TS_SSPEC_xxx */
-  struct {         /* time range */
-    int hour_a;
-    int min_a;
-    int hour_b;
-    int min_b;
-  } time;
-  TSIpAddr src_ip;  /* client/source ip */
-  char *prefix;     /* prefix in path part of URL */
-  char *suffix;     /* suffix in the URL */
-  TSPortEle *port;  /* requested URL port */
-  TSMethodT method; /* get, post, put, trace */
-  TSSchemeT scheme; /* HTTP */
-} TSSspec;          /* Sspec = Secondary Specifier */
-
-typedef struct {
-  TSPrimeDestT pd_type; /* primary destination type: TS_PD_xxx */
-  char *pd_val;         /* primary destination value; refers to the requested domain name,
-                           host name, ip address, or regular expression to
-                           be found in a URL  */
-  TSSspec sec_spec;     /* secondary specifier */
-} TSPdSsFormat;         /* PdSs = Primary Destination Secondary Specifier */
-
-/* Generic Ele struct which is used as first member in all other Ele structs.
- * The TSCfgContext operations deal with TSCfgEle* type, so must typecast
- * all Ele's to an TSCfgEle*
- */
-typedef struct {
-  TSRuleTypeT type;
-  TSMgmtError error;
-} TSCfgEle;
-
-/* cache.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSPdSsFormat cache_info; /* general PdSs information */
-  TSHmsTime time_period;   /* only valid if cache_act == TS_CACHE_PIN_IN_CACHE */
-} TSCacheEle;
-
-/* congestion.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSPrimeDestT pd_type;
-  char *pd_val;
-  char *prefix;               /* optional */
-  int port;                   /* optional */
-  TSCongestionSchemeT scheme; /* per_ip or per_host */
-  int max_connection_failures;
-  int fail_window;
-  int proxy_retry_interval;
-  int client_wait_interval;
-  int wait_interval_alpha;
-  int live_os_conn_timeout;
-  int live_os_conn_retries;
-  int dead_os_conn_timeout;
-  int dead_os_conn_retries;
-  int max_connection;
-  char *error_page_uri;
-} TSCongestionEle;
-
-/* hosting.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSPrimeDestT pd_type;
-  char *pd_val;      /* domain or hostname  */
-  TSIntList volumes; /* must be a list of ints */
-} TSHostingEle;
-
-/* ip_allow.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSIpAddrEle *src_ip_addr; /* source ip address (single or range) */
-  TSIpAllowT action;
-} TSIpAllowEle;
-
-/* parent.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSPdSsFormat parent_info; /* general PdSs information */
-  TSRrT rr;                 /*  possible values are TS_RRT_TRUE (go through proxy
-                                parent list in round robin),TS_RRT_STRICT (server
-                                requests striclty in turn), or TS_RRT_FALSE (no
-                                round robin selection) */
-  TSDomainList proxy_list;  /* ordered list of parent proxies */
-  bool direct;              /* indicate if go directly to origin server, default = false and does
-                               not bypass parent heirarchies */
-} TSParentProxyEle;         /* exactly one of rr or parent_proxy_act must be defined */
-
-/* volume.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  int volume_num;            /* must be in range 1 - 255 */
-  TSVolumeSchemeT scheme;    /* http */
-  int volume_size;           /* >= 128 MB, multiple of 128 */
-  TSSizeFormatT size_format; /* percentage or absolute */
-} TSVolumeEle;
-
-/* plugin.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  char *name;        /* name of plugin */
-  TSStringList args; /* list of arguments */
-} TSPluginEle;
-
-/* remap.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  bool map;               /* if true: map, if false: remap */
-  TSSchemeT from_scheme;  /* http, https, <scheme>://<host>:<port>/<path_prefix> */
-  char *from_host;        /* from host */
-  int from_port;          /* from port (can be 0) */
-  char *from_path_prefix; /* from path_prefix (can be NULL) */
-  TSSchemeT to_scheme;
-  char *to_host;        /* to host */
-  int to_port;          /* to port (can be 0) */
-  char *to_path_prefix; /* to path_prefix (can be NULL) */
-} TSRemapEle;
-
-/* socks.config */
-/* TSqa10915: supports two rules types - the first rule type specifies the
-   IP addresses of origin servers that TS should bypass SOCKS and access
-   directly (this is when ip_addrs is used); the second rule
-   type specifies which SOCKS servers to use for the addresses specified
-   in dest_ip_addr; so this means that either ip_addrs is specified OR
-   dest_ip_addr/socks_servers/rr are */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSIpAddrList ip_addrs;      /* list of ip addresses to bypass SOCKS server (TS_SOCKS_BYPASS) */
-  TSIpAddrEle *dest_ip_addr;  /* ip address(es) that will use the socks server
-                                  specified in parent_list (TS_SOCKS_MULTIPLE rule) */
-  TSDomainList socks_servers; /* ordered list of SOCKS servers (TS_SOCKS_MULTIPLE rule) */
-  TSRrT rr;                   /* possible values are TS_RRT_TRUE (go through proxy
-                                  parent list in round robin),TS_RRT_STRICT (server
-                                  requests striclty in turn), or TS_RRT_FALSE (no
-                                  round robin selection) (TS_SOCKS_MULTIPLE rule) */
-  char *username;             /* used for TS_SOCKS_AUTH rule */
-  char *password;             /* used for TS_SOCKS_AUTH rule */
-} TSSocksEle;
-
-/* splitdns.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  TSPrimeDestT pd_type;           /* TS_PD_DOMAIN, TS_PD_HOST, TS_PD_URL_REGEX only */
-  char *pd_val;                   /* primary destination value */
-  TSDomainList dns_servers_addrs; /* list of dns servers */
-  char *def_domain;               /* (optional) default domain name (can be NULL) */
-  TSDomainList search_list;       /* (optinal) domain search list (can be INVALID) */
-} TSSplitDnsEle;
-
-/* storage.config */
-typedef struct {
-  TSCfgEle cfg_ele;
-  char *pathname; /* the name of a disk partition, directory, or file */
-  int size;       /* size of the named pathname (in bytes); optional if raw disk partitions */
-} TSStorageEle;
-
-/* rmserver.cfg */
-typedef struct {
-  TSCfgEle cfg_ele;
-  char *Vname;
-  char *str_val;
-  int int_val;
-} TSRmServerEle;
-
 /***************************************************************************
  * Function Types
  ***************************************************************************/
-
 typedef void (*TSEventSignalFunc)(char *name, char *msg, int pri, void *data);
 typedef void (*TSDisconnectFunc)(void *data);
 
@@ -630,23 +303,6 @@ tsapi bool TSListIsEmpty(TSList l);
 tsapi int TSListLen(TSList l); /* returns -1 if list is invalid */
 tsapi bool TSListIsValid(TSList l);
 
-/*--- TSIpAddrList operations --------------------------------------------*/
-tsapi TSIpAddrList TSIpAddrListCreate();
-tsapi void TSIpAddrListDestroy(TSIpAddrList ip_addrl);
-tsapi TSMgmtError TSIpAddrListEnqueue(TSIpAddrList ip_addrl, TSIpAddrEle *ip_addr);
-tsapi TSIpAddrEle *TSIpAddrListDequeue(TSIpAddrList ip_addrl);
-tsapi int TSIpAddrListLen(TSIpAddrList ip_addrl);
-tsapi bool TSIpAddrListIsEmpty(TSIpAddrList ip_addrl);
-tsapi int TSIpAddrListLen(TSIpAddrList ip_addrl);
-
-/*--- TSPortList operations ----------------------------------------------*/
-tsapi TSPortList TSPortListCreate();
-tsapi void TSPortListDestroy(TSPortList portl);
-tsapi TSMgmtError TSPortListEnqueue(TSPortList portl, TSPortEle *port);
-tsapi TSPortEle *TSPortListDequeue(TSPortList portl);
-tsapi bool TSPortListIsEmpty(TSPortList portl);
-tsapi int TSPortListLen(TSPortList portl);
-
 /*--- TSStringList operations --------------------------------------------*/
 tsapi TSStringList TSStringListCreate();
 tsapi void TSStringListDestroy(TSStringList strl);
@@ -665,71 +321,10 @@ tsapi bool TSIntListIsEmpty(TSIntList intl);
 tsapi int TSIntListLen(TSIntList intl);
 tsapi bool TSIntListIsValid(TSIntList intl, int min, int max);
 
-/*--- TSDomainList operations --------------------------------------------*/
-tsapi TSDomainList TSDomainListCreate();
-tsapi void TSDomainListDestroy(TSDomainList domainl);
-tsapi TSMgmtError TSDomainListEnqueue(TSDomainList domainl, TSDomain *domain);
-tsapi TSDomain *TSDomainListDequeue(TSDomainList domainl);
-tsapi bool TSDomainListIsEmpty(TSDomainList domainl);
-tsapi int TSDomainListLen(TSDomainList domainl);
-tsapi bool TSDomainListIsValid(TSDomainList domainl);
-
-/*--- allocate/deallocate operations -------------------------------------*/
-/* NOTE:
- * 1) Default values for TSxxEleCreate functions:
- *    - for all lists, default value is TS_INVALID_LIST. NO memory is
- *      allocated for an Ele's  list type member. The user must
- *      explicity call the TSxxListCreate() function to initialize it.
- *    - for char*'s and TSIpAddr the default is NULL (or TS_INVALID_IP_ADDR
- *      for TSIpAddr's); user must assign allocated memory to initialize any
- *      string or TSIpAddr members of an TSxxxEle
- *
- * 2) An Ele corresponds to a rule type in a file; this is why each Ele has an
- * TSRuleType to identify which type of rule it corresponds to.
- * For config files which only have one rule type, we can easily set the
- * rule type of the Ele in the EleCreate function since there's only one possible
- * option. However, note that for those config files with more than one rule
- * type, we cannot set the rule type in the EleCreate function since
- * we don't know which rule type the Ele corresponds to yet. Thus, the user must
- * specify the TSRuleTypeT when he/she creates the Ele.
- */
-
 tsapi TSMgmtEvent *TSEventCreate();
 tsapi void TSEventDestroy(TSMgmtEvent *event);
 tsapi TSRecordEle *TSRecordEleCreate();
 tsapi void TSRecordEleDestroy(TSRecordEle *ele);
-tsapi TSIpAddrEle *TSIpAddrEleCreate();
-tsapi void TSIpAddrEleDestroy(TSIpAddrEle *ele);
-tsapi TSPortEle *TSPortEleCreate();
-tsapi void TSPortEleDestroy(TSPortEle *ele);
-tsapi TSDomain *TSDomainCreate();
-tsapi void TSDomainDestroy(TSDomain *ele);
-tsapi TSSspec *TSSspecCreate();
-tsapi void TSSspecDestroy(TSSspec *ele);
-tsapi TSPdSsFormat *TSPdSsFormatCreate();
-tsapi void TSPdSsFormatDestroy(TSPdSsFormat &ele);
-tsapi TSCacheEle *TSCacheEleCreate(TSRuleTypeT type);
-tsapi void TSCacheEleDestroy(TSCacheEle *ele);
-tsapi TSCongestionEle *TSCongestionEleCreate();
-tsapi void TSCongestionEleDestroy(TSCongestionEle *ele);
-tsapi TSHostingEle *TSHostingEleCreate();
-tsapi void TSHostingEleDestroy(TSHostingEle *ele);
-tsapi TSIpAllowEle *TSIpAllowEleCreate();
-tsapi void TSIpAllowEleDestroy(TSIpAllowEle *ele);
-tsapi TSParentProxyEle *TSParentProxyEleCreate(TSRuleTypeT type);
-tsapi void TSParentProxyEleDestroy(TSParentProxyEle *ele);
-tsapi TSVolumeEle *TSVolumeEleCreate();
-tsapi void TSVolumeEleDestroy(TSVolumeEle *ele);
-tsapi TSPluginEle *TSPluginEleCreate();
-tsapi void TSPluginEleDestroy(TSPluginEle *ele);
-tsapi TSRemapEle *TSRemapEleCreate(TSRuleTypeT type);
-tsapi void TSRemapEleDestroy(TSRemapEle *ele);
-tsapi TSSocksEle *TSSocksEleCreate(TSRuleTypeT type);
-tsapi void TSSocksEleDestroy(TSSocksEle *ele);
-tsapi TSSplitDnsEle *TSSplitDnsEleCreate();
-tsapi void TSSplitDnsEleDestroy(TSSplitDnsEle *ele);
-tsapi TSStorageEle *TSStorageEleCreate();
-tsapi void TSStorageEleDestroy(TSStorageEle *ele);
 
 /***************************************************************************
  * API Core

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 02/03: Removes the rest of the CfgContext files and objects

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 372e9dea376c3c28819b4322a37262635b4608f0
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Thu Oct 12 19:28:34 2017 -0600

    Removes the rest of the CfgContext files and objects
---
 lib/perl/lib/Apache/TS/AdminClient.pm |   43 +-
 mgmt/api/APITestCliRemote.cc          |  394 +----
 mgmt/api/CfgContextImpl.cc            | 2135 -------------------------
 mgmt/api/CfgContextImpl.h             |  435 ------
 mgmt/api/CfgContextUtils.cc           | 2756 ---------------------------------
 mgmt/api/CfgContextUtils.h            |  194 ---
 mgmt/api/CoreAPI.cc                   |   53 -
 mgmt/api/CoreAPI.h                    |   11 +-
 mgmt/api/CoreAPIRemote.cc             |   61 +-
 mgmt/api/EventControlMain.cc          |    1 -
 mgmt/api/INKMgmtAPI.cc                |   74 +-
 mgmt/api/Makefile.am                  |    5 -
 mgmt/api/NetworkMessage.cc            |    6 -
 mgmt/api/NetworkMessage.h             |    1 -
 mgmt/api/TSControlMain.cc             |   40 -
 mgmt/api/include/mgmtapi.h            |   27 -
 16 files changed, 30 insertions(+), 6206 deletions(-)

diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index b0aad94..d9c9723 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -30,28 +30,27 @@ use Apache::TS;
 
 # Mgmt API command constants, should track ts/mgmtapi.h
 use constant {
-    TS_FILE_READ                  => 0,
-    TS_RECORD_SET                 => 1,
-    TS_RECORD_GET                 => 2,
-    TS_PROXY_STATE_GET            => 3,
-    TS_PROXY_STATE_SET            => 4,
-    TS_RECONFIGURE                => 5,
-    TS_RESTART                    => 6,
-    TS_BOUNCE                     => 7,
-    TS_EVENT_RESOLVE              => 8,
-    TS_EVENT_GET_MLT              => 9,
-    TS_EVENT_ACTIVE               => 10,
-    TS_EVENT_REG_CALLBACK         => 11,
-    TS_EVENT_UNREG_CALLBACK       => 12,
-    TS_EVENT_NOTIFY               => 13,
-    TS_STATS_RESET_NODE           => 14,
-    TS_STORAGE_DEVICE_CMD_OFFLINE => 15,
-    TS_RECORD_MATCH_GET           => 16,
-    TS_API_PING                   => 17,
-    TS_SERVER_BACKTRACE           => 18,
-    TS_RECORD_DESCRIBE_CONFIG     => 19,
-    TS_LIFECYCLE_MESSAGE          => 20,
-    TS_UNDEFINED_OP               => 21
+    TS_RECORD_SET                 => 0,
+    TS_RECORD_GET                 => 1,
+    TS_PROXY_STATE_GET            => 2,
+    TS_PROXY_STATE_SET            => 3,
+    TS_RECONFIGURE                => 4,
+    TS_RESTART                    => 5,
+    TS_BOUNCE                     => 6,
+    TS_EVENT_RESOLVE              => 7,
+    TS_EVENT_GET_MLT              => 8,
+    TS_EVENT_ACTIVE               => 9,
+    TS_EVENT_REG_CALLBACK         => 10,
+    TS_EVENT_UNREG_CALLBACK       => 11,
+    TS_EVENT_NOTIFY               => 12,
+    TS_STATS_RESET_NODE           => 13,
+    TS_STORAGE_DEVICE_CMD_OFFLINE => 14,
+    TS_RECORD_MATCH_GET           => 15,
+    TS_API_PING                   => 16,
+    TS_SERVER_BACKTRACE           => 17,
+    TS_RECORD_DESCRIBE_CONFIG     => 18,
+    TS_LIFECYCLE_MESSAGE          => 19,
+    TS_UNDEFINED_OP               => 20
 };
 
 use constant {
diff --git a/mgmt/api/APITestCliRemote.cc b/mgmt/api/APITestCliRemote.cc
index 73a25dd..ba7bf37 100644
--- a/mgmt/api/APITestCliRemote.cc
+++ b/mgmt/api/APITestCliRemote.cc
@@ -54,14 +54,6 @@
  * read_url: tests TSReadFromUrl works by retrieving two valid urls
  * test_url: tests robustness of TSReadFromUrl using invalid urls
  *
- * CfgContext operations:
- * ---------------------
- * cfg_get:<config-filename>: prints out the rules in confg-filename
- * cfg:<config-filename>: switches the position of first and last rule of
- *                        <config-filename>
- * cfg_socks: does some basic testing of socks.config (reads in file,
- *            modifies it, eg. add new rules, then commits changes)
- *
  * Event Operations:
  * ----------------
  * active_events: lists the names of all currently active events
@@ -85,6 +77,7 @@
 
 #include "ts/ink_config.h"
 #include "ts/ink_defs.h"
+#include "ts/ink_memory.h"
 #include <cstdlib>
 #include <cstring>
 #include <cstdio>
@@ -92,7 +85,6 @@
 #include "ts/ink_string.h"
 
 #include "mgmtapi.h"
-#include "CfgContextUtils.h"
 
 // refer to test_records() function
 #define TEST_STRING 1
@@ -365,367 +357,6 @@ print_pd_sspec(TSPdSsFormat info)
   return;
 }
 
-void
-print_cache_ele(TSCacheEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  char *pd_str, *time_str;
-
-  char buf[MAX_BUF_SIZE];
-  int buf_pos = 0;
-
-  bzero(buf, MAX_BUF_SIZE);
-
-  pd_str = pdest_sspec_to_string(ele->cache_info.pd_type, ele->cache_info.pd_val, &(ele->cache_info.sec_spec));
-  if (!pd_str) {
-    printf("pd_str is null.\n");
-    return;
-  }
-
-  snprintf(buf, sizeof(buf), "%s ", pd_str);
-  buf_pos = strlen(buf);
-  ats_free(pd_str);
-
-  // now format the message
-  switch (ele->cfg_ele.type) {
-  case TS_CACHE_NEVER:
-    snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "action=never-cache");
-    break;
-  case TS_CACHE_IGNORE_NO_CACHE:
-    snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "action=ignore-no-cache");
-    break;
-  case TS_CACHE_IGNORE_CLIENT_NO_CACHE:
-    snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "action=ignore-server-no-cache");
-    break;
-  case TS_CACHE_IGNORE_SERVER_NO_CACHE:
-    snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "action=ignore-client-no-cache");
-    break;
-  case TS_CACHE_PIN_IN_CACHE:
-    time_str = hms_time_to_string(ele->time_period);
-    if (!time_str) {
-      return;
-    }
-    snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "pin-in-cache=%s", time_str);
-    ats_free(time_str);
-    break;
-  case TS_CACHE_REVALIDATE:
-    time_str = hms_time_to_string(ele->time_period);
-    if (!time_str) {
-      return;
-    }
-    snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "revalidate=%s", time_str);
-    ats_free(time_str);
-    break;
-  default: /* invalid action directive */
-    printf("hello..\n");
-    return;
-  }
-  printf("%s\n", buf);
-
-  /*
-     print_pd_sspec(ele->cache_info);
-     printf("Time: %d day, %d hr, %d min, %d sec\n", ele->time_period.d, ele->time_period.h,
-     ele->time_period.m, ele->time_period.s);
-   */
-  return;
-}
-
-void
-print_hosting_ele(TSHostingEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  switch (ele->pd_type) {
-  case TS_PD_DOMAIN:
-    printf("dest_domain=%s\n", ele->pd_val);
-    break;
-  case TS_PD_HOST:
-    printf("dest_host=%s\n", ele->pd_val);
-    break;
-  case TS_PD_IP:
-    printf("ip=%s\n", ele->pd_val);
-    break;
-  case TS_PD_URL_REGEX:
-    printf("url_regex=%s\n", ele->pd_val);
-    break;
-  case TS_PD_URL:
-    printf("url=%s\n", ele->pd_val);
-    break;
-  default:
-    printf("INVALID Prime Dest specifier\n");
-    break;
-  }
-
-  print_int_list(ele->volumes);
-}
-
-void
-print_ip_allow_ele(TSIpAllowEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  print_ip_addr_ele(ele->src_ip_addr);
-}
-
-void
-print_parent_ele(TSParentProxyEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  printf("parent rule type: %d\n", ele->cfg_ele.type);
-  print_pd_sspec(ele->parent_info);
-  printf("round robin? %d\n", ele->rr);
-  print_domain_list(ele->proxy_list);
-  printf("direct? %d\n", ele->direct);
-}
-
-void
-print_volume_ele(TSVolumeEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  printf("volume #: %d\n", ele->volume_num);
-  printf("scheme: %d\n", ele->scheme);
-  switch (ele->size_format) {
-  case TS_SIZE_FMT_ABSOLUTE:
-    printf("volume_size=%d\n", ele->volume_size);
-    break;
-  case TS_SIZE_FMT_PERCENT:
-    printf("volume_size=%% %d\n", ele->volume_size);
-    break;
-  default:
-    // Handled here:
-    // TS_SIZE_FMT_UNDEFINED
-    break;
-  }
-}
-
-void
-print_plugin_ele(TSPluginEle *ele)
-{
-  if (!ele) {
-    printf("can't print plugin ele\n");
-    return;
-  }
-
-  printf("name: %s\t\t", ele->name);
-  if (ele->args) {
-    printf("args: ");
-    print_string_list(ele->args);
-  } else {
-    printf("NO ARGS\n");
-  }
-}
-
-void
-print_remap_ele(TSRemapEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  char buf[MAX_BUF_SIZE];
-  bzero(buf, MAX_BUF_SIZE);
-
-  switch (ele->cfg_ele.type) {
-  case TS_REMAP_MAP:
-    ink_strlcat(buf, "map", sizeof(buf));
-    break;
-  case TS_REMAP_REVERSE_MAP:
-    ink_strlcat(buf, "reverse_map", sizeof(buf));
-    break;
-  case TS_REMAP_REDIRECT:
-    ink_strlcat(buf, "redirect", sizeof(buf));
-    break;
-  case TS_REMAP_REDIRECT_TEMP:
-    ink_strlcat(buf, "redirect_temporary", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // Lots of cases...
-    break;
-  }
-  // space delimitor
-  ink_strlcat(buf, " ", sizeof(buf));
-
-  // from scheme
-  switch (ele->from_scheme) {
-  case TS_SCHEME_HTTP:
-    ink_strlcat(buf, "http", sizeof(buf));
-    break;
-  case TS_SCHEME_HTTPS:
-    ink_strlcat(buf, "https", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_SCHEME_NONE, TS_SCHEME_UNDEFINED, TS_SCHEME_NONE,
-    // TS_SCHEME_UNDEFINED
-    break;
-  }
-  ink_strlcat(buf, "://", sizeof(buf));
-
-  // from host
-  if (ele->from_host) {
-    ink_strlcat(buf, ele->from_host, sizeof(buf));
-  }
-  // from port
-  if (ele->from_port != TS_INVALID_PORT) {
-    snprintf(buf, sizeof(buf), "%s:%d", buf, ele->from_port);
-  }
-  // from host path
-  if (ele->from_path_prefix) {
-    ink_strlcat(buf, "/", sizeof(buf));
-    ink_strlcat(buf, ele->from_path_prefix, sizeof(buf));
-  }
-  // space delimitor
-  ink_strlcat(buf, " ", sizeof(buf));
-
-  // to scheme
-  switch (ele->to_scheme) {
-  case TS_SCHEME_HTTP:
-    ink_strlcat(buf, "http", sizeof(buf));
-    break;
-  case TS_SCHEME_HTTPS:
-    ink_strlcat(buf, "https", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_SCHEME_NONE, TS_SCHEME_UNDEFINED
-    break;
-  }
-  ink_strlcat(buf, "://", sizeof(buf));
-
-  // to host
-  if (ele->to_host) {
-    ink_strlcat(buf, ele->to_host, sizeof(buf));
-  }
-  // to port
-  if (ele->to_port != TS_INVALID_PORT) {
-    snprintf(buf, sizeof(buf), "%s:%d", buf, ele->to_port);
-  }
-  // to host path
-  if (ele->to_path_prefix) {
-    ink_strlcat(buf, "/", sizeof(buf));
-    ink_strlcat(buf, ele->to_path_prefix, sizeof(buf));
-  }
-
-  printf("%s\n", buf);
-  return;
-}
-
-void
-print_socks_ele(TSSocksEle *ele)
-{
-  printf("\n");
-  if (!ele) {
-    printf("can't print ele\n");
-  } else if (ele->ip_addrs) {
-    print_ip_list(ele->ip_addrs);
-    printf("\n");
-  } else {
-    print_ip_addr_ele(ele->dest_ip_addr);
-    print_domain_list(ele->socks_servers);
-    printf("round_robin=%d\n", ele->rr);
-  }
-}
-
-void
-print_split_dns_ele(TSSplitDnsEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  char *str;
-  char buf[MAX_BUF_SIZE];
-  bzero(buf, MAX_BUF_SIZE);
-
-  char *pd_name = nullptr;
-  switch (ele->pd_type) {
-  case TS_PD_DOMAIN:
-    pd_name = ats_strdup("dest_domain");
-    break;
-  case TS_PD_HOST:
-    pd_name = ats_strdup("dest_host");
-    break;
-  case TS_PD_URL_REGEX:
-    pd_name = ats_strdup("url_regex");
-    break;
-  case TS_PD_URL:
-    pd_name = ats_strdup("url");
-    break;
-  default:
-    pd_name = ats_strdup("?????");
-    // Handled here:
-    // TS_PD_IP, TS_PD_UNDEFINED
-    break;
-  }
-
-  if (ele->pd_val) {
-    ink_strlcat(buf, pd_name, sizeof(buf));
-    ink_strlcat(buf, "=", sizeof(buf));
-    ink_strlcat(buf, ele->pd_val, sizeof(buf));
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-
-  if (ele->dns_servers_addrs) {
-    ink_strlcat(buf, "named=", sizeof(buf));
-    str = ip_addr_list_to_string((LLQ *)ele->dns_servers_addrs, " ");
-    ink_strlcat(buf, str, sizeof(buf));
-    ats_free(str);
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-
-  if (ele->def_domain) {
-    ink_strlcat(buf, "dns_server=", sizeof(buf));
-    ink_strlcat(buf, ele->def_domain, sizeof(buf));
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-
-  if (ele->search_list) {
-    ink_strlcat(buf, "search_list=", sizeof(buf));
-    str = domain_list_to_string(ele->search_list, " ");
-    ink_strlcat(buf, str, sizeof(buf));
-    ats_free(str);
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-  printf("%s\n", buf);
-  ats_free(pd_name);
-
-  return;
-}
-
-void
-print_storage_ele(TSStorageEle *ele)
-{
-  if (!ele) {
-    printf("can't print ele\n");
-    return;
-  }
-
-  if (ele->pathname) {
-    printf("pathname=%s, size=%d\n", ele->pathname, ele->size);
-  }
-}
-
 /***************************************************************************
  * Control Testing
  ***************************************************************************/
@@ -1271,27 +902,6 @@ test_read_url(bool valid)
   }
 }
 
-/* ------------------------------------------------------------------------
- * test_read_file
- * ------------------------------------------------------------------------
- * reads hosting.config file and prints it out
- */
-void
-test_read_file()
-{
-  char *f_text = nullptr;
-  int f_size   = -1;
-  int f_ver    = -1;
-
-  printf("\n");
-  if (TSConfigFileRead(TS_FNAME_HOSTING, &f_text, &f_size, &f_ver) != TS_ERR_OKAY) {
-    printf("[TSConfigFileRead] FAILED!\n");
-  } else {
-    printf("[TSConfigFileRead]\n\tFile Size=%d, Version=%d\n%s\n", f_size, f_ver, f_text);
-    TSfree(f_text);
-  }
-}
-
 /***************************************************************************
  * Events Testing
  ***************************************************************************/
@@ -1596,8 +1206,6 @@ runInteractive()
       test_record_get_mlt();
     } else if (strstr(buf, "set_mlt")) {
       test_record_set_mlt();
-    } else if (strstr(buf, "read_file")) {
-      test_read_file();
     } else if (strstr(buf, "proxy.")) {
       test_rec_get(buf);
     } else if (strstr(buf, "active_events")) {
diff --git a/mgmt/api/CfgContextImpl.cc b/mgmt/api/CfgContextImpl.cc
deleted file mode 100644
index bf88dad..0000000
--- a/mgmt/api/CfgContextImpl.cc
+++ /dev/null
@@ -1,2135 +0,0 @@
-/** @file
-
-  Implementation of CfgContext class and all the CfgEleObj subclasses
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#include "ts/ink_platform.h"
-#include "ts/ink_string.h"
-
-#include "CfgContextImpl.h"
-#include "CfgContextUtils.h"
-#include "mgmtapi.h"
-
-//--------------------------------------------------------------------------
-// Defines
-//--------------------------------------------------------------------------
-
-#define TIGHT_RULE_CHECK true
-
-//--------------------------------------------------------------------------
-// CommentObj
-//--------------------------------------------------------------------------
-CommentObj::CommentObj(char *comment)
-{
-  m_ele   = comment_ele_create(comment);
-  m_valid = (comment ? true : false);
-}
-
-CommentObj::~CommentObj()
-{
-  comment_ele_destroy(m_ele);
-}
-
-char *
-CommentObj::formatEleToRule()
-{
-  return ats_strdup(m_ele->comment);
-}
-
-bool
-CommentObj::isValid()
-{
-  return m_valid;
-}
-
-TSCfgEle *
-CommentObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_comment_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// CacheObj
-//--------------------------------------------------------------------------
-CacheObj::CacheObj(TSCacheEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-// assumes the specifiers are specified in specific order!!
-CacheObj::CacheObj(TokenList *tokens)
-{
-  Token *tok;
-  m_ele                = TSCacheEleCreate(TS_TYPE_UNDEFINED);
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_CACHE_OBJ);
-
-  // if any invalid values, set m_valid=false
-  // convert token name and value into ele field
-  tok = tokens->first();
-  tok = tokens_to_pdss_format(tokens, tok, &(m_ele->cache_info));
-
-  if (!tok) { // INVALID FORMAT
-    goto FORMAT_ERR;
-  }
-
-  tok = tokens->next(tok);
-  if (m_ele->cfg_ele.type == TS_CACHE_REVALIDATE || m_ele->cfg_ele.type == TS_CACHE_PIN_IN_CACHE ||
-      m_ele->cfg_ele.type == TS_CACHE_TTL_IN_CACHE) {
-    // must have a time specified
-    if (strcmp(tok->name, "pin-in-cache") != 0 && strcmp(tok->name, "revalidate") != 0 && strcmp(tok->name, "ttl-in-cache") != 0) {
-      goto FORMAT_ERR; // wrong token!!
-    }
-    if (string_to_hms_time(tok->value, &(m_ele->time_period)) != TS_ERR_OKAY) {
-      goto FORMAT_ERR;
-    }
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-CacheObj::~CacheObj()
-{
-  TSCacheEleDestroy(m_ele);
-}
-
-char *
-CacheObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char *pd_str, *time_str;
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  pd_str = pdest_sspec_to_string(m_ele->cache_info.pd_type, m_ele->cache_info.pd_val, &(m_ele->cache_info.sec_spec));
-  if (!pd_str) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-  ink_strlcat(buf, pd_str, sizeof(buf));
-  ats_free(pd_str);
-
-  switch (m_ele->cfg_ele.type) {
-  case TS_CACHE_NEVER:
-    ink_strlcat(buf, "action=never-cache ", sizeof(buf));
-    break;
-  case TS_CACHE_IGNORE_NO_CACHE:
-    ink_strlcat(buf, "action=ignore-no-cache ", sizeof(buf));
-    break;
-  case TS_CACHE_IGNORE_CLIENT_NO_CACHE:
-    ink_strlcat(buf, "action=ignore-client-no-cache ", sizeof(buf));
-    break;
-  case TS_CACHE_IGNORE_SERVER_NO_CACHE:
-    ink_strlcat(buf, "action=ignore-server-no-cache ", sizeof(buf));
-    break;
-  case TS_CACHE_AUTH_CONTENT:
-    ink_strlcat(buf, "action=cache-auth-content ", sizeof(buf));
-    break;
-  case TS_CACHE_PIN_IN_CACHE:
-    ink_strlcat(buf, "pin-in-cache=", sizeof(buf));
-    time_str = hms_time_to_string(m_ele->time_period);
-    if (time_str) {
-      ink_strlcat(buf, time_str, sizeof(buf));
-      ats_free(time_str);
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-    break;
-  case TS_CACHE_REVALIDATE:
-    ink_strlcat(buf, "revalidate=", sizeof(buf));
-    time_str = hms_time_to_string(m_ele->time_period);
-    if (time_str) {
-      ink_strlcat(buf, time_str, sizeof(buf));
-      ats_free(time_str);
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-    break;
-  case TS_CACHE_TTL_IN_CACHE:
-    ink_strlcat(buf, "ttl-in-cache=", sizeof(buf));
-    time_str = hms_time_to_string(m_ele->time_period);
-    if (time_str) {
-      ink_strlcat(buf, time_str, sizeof(buf));
-      ats_free(time_str);
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // Lots of cases...
-    break;
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-CacheObj::isValid()
-{
-  char *timeStr;
-
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-  // all Cache Ele's should have a prim dest, sec specs are optional
-  if (!ccu_checkPdSspec(m_ele->cache_info)) {
-    m_valid = false;
-  }
-  // only pin-in-cache, ttl, and revalidate rules have time period
-  switch (m_ele->cfg_ele.type) {
-  case TS_CACHE_NEVER:
-  case TS_CACHE_IGNORE_NO_CACHE:
-  case TS_CACHE_IGNORE_CLIENT_NO_CACHE:
-  case TS_CACHE_IGNORE_SERVER_NO_CACHE:
-  case TS_CACHE_AUTH_CONTENT:
-    break;
-  case TS_CACHE_PIN_IN_CACHE:
-  case TS_CACHE_REVALIDATE:
-  case TS_CACHE_TTL_IN_CACHE:
-    timeStr = hms_time_to_string(m_ele->time_period);
-    if (!timeStr) {
-      m_valid = false;
-    }
-    ats_free(timeStr);
-  default:
-    // Handled here:
-    // Lots of cases ...
-    break;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-CacheObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_cache_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// CongestionObj
-//--------------------------------------------------------------------------
-CongestionObj::CongestionObj(TSCongestionEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-CongestionObj::CongestionObj(TokenList *tokens)
-{
-  Token *tok;
-  m_ele                = TSCongestionEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_CONGESTION);
-
-  // if any invalid values, set m_valid=false
-  // convert token name and value into ele field
-  tok = tokens->first();
-  // tok = tokens_to_pdss_format(tokens, tok, &(m_ele->congestion_info));
-
-  if (!tok) { // INVALID FORMAT
-    goto FORMAT_ERR;
-  }
-
-  if (strcmp(tok->name, "dest_domain") == 0) {
-    m_ele->pd_type = TS_PD_DOMAIN;
-  } else if (strcmp(tok->name, "dest_host") == 0) {
-    m_ele->pd_type = TS_PD_HOST;
-  } else if (strcmp(tok->name, "dest_ip") == 0) {
-    m_ele->pd_type = TS_PD_IP;
-  } else if (strcmp(tok->name, "host_regex") == 0) {
-    m_ele->pd_type = TS_PD_URL_REGEX;
-  }
-  m_ele->pd_val = ats_strdup(tok->value);
-
-  // check for remaining tags
-  tok = tokens->next(tok);
-  while (tok) {
-    if (!tok->name || !tok->value) {
-      goto FORMAT_ERR;
-    }
-    if (strcmp(tok->name, "prefix") == 0) {
-      m_ele->prefix = ats_strdup(tok->value);
-    } else if (strcmp(tok->name, "port") == 0) {
-      m_ele->port = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "congestion_scheme") == 0) {
-      if (strcmp(tok->value, "per_ip") == 0) {
-        m_ele->scheme = TS_HTTP_CONGEST_PER_IP;
-      } else if (strcmp(tok->value, "per_host") == 0) {
-        m_ele->scheme = TS_HTTP_CONGEST_PER_HOST;
-      } else {
-        goto FORMAT_ERR;
-      }
-    } else if (strcmp(tok->name, "max_connection_failures") == 0) {
-      m_ele->max_connection_failures = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "fail_window") == 0) {
-      m_ele->fail_window = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "proxy_retry_interval") == 0) {
-      m_ele->proxy_retry_interval = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "client_wait_interval") == 0) {
-      m_ele->client_wait_interval = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "wait_interval_alpha") == 0) {
-      m_ele->wait_interval_alpha = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "live_os_conn_timeout") == 0) {
-      m_ele->live_os_conn_timeout = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "live_os_conn_retries") == 0) {
-      m_ele->live_os_conn_retries = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "dead_os_conn_timeout") == 0) {
-      m_ele->dead_os_conn_timeout = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "dead_os_conn_retries") == 0) {
-      m_ele->dead_os_conn_retries = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "max_connection") == 0) {
-      m_ele->max_connection = ink_atoi(tok->value);
-    } else if (strcmp(tok->name, "error_page_uri") == 0) {
-      m_ele->error_page_uri = ats_strdup(tok->value);
-    } else {
-      goto FORMAT_ERR;
-    }
-    tok = tokens->next(tok);
-  }
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-CongestionObj::~CongestionObj()
-{
-  TSCongestionEleDestroy(m_ele);
-}
-
-//
-// will always print defaults in the rule
-//
-char *
-CongestionObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char buf[MAX_BUF_SIZE];
-  size_t pos = 0;
-  int psize;
-  memset(buf, 0, MAX_BUF_SIZE);
-
-  // push in primary destination
-  if (pos < sizeof(buf)) {
-    switch (m_ele->pd_type) {
-    case TS_PD_DOMAIN:
-      psize = snprintf(buf + pos, sizeof(buf) - pos, "dest_domain=%s ", m_ele->pd_val);
-      break;
-    case TS_PD_HOST:
-      psize = snprintf(buf + pos, sizeof(buf) - pos, "dest_host=%s ", m_ele->pd_val);
-      break;
-    case TS_PD_IP:
-      psize = snprintf(buf + pos, sizeof(buf) - pos, "dest_ip=%s ", m_ele->pd_val);
-      break;
-    case TS_PD_URL_REGEX:
-      psize = snprintf(buf + pos, sizeof(buf) - pos, "host_regex=%s ", m_ele->pd_val);
-      break;
-    default:
-      psize = 0;
-      // Handled here:
-      // TS_PD_UNDEFINED
-      break;
-    }
-    if (psize > 0) {
-      pos += psize;
-    }
-  }
-  // secondary specifiers
-  if (m_ele->prefix) {
-    if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "prefix=%s ", m_ele->prefix)) > 0) {
-      pos += psize;
-    }
-  }
-  if (m_ele->port > 0) {
-    if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "port=%d ", m_ele->port)) > 0) {
-      pos += psize;
-    }
-  }
-
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "max_connection_failures=%d ", m_ele->max_connection_failures)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "fail_window=%d ", m_ele->fail_window)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "proxy_retry_interval=%d ", m_ele->proxy_retry_interval)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "client_wait_interval=%d ", m_ele->client_wait_interval)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "wait_interval_alpha=%d ", m_ele->wait_interval_alpha)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "live_os_conn_timeout=%d ", m_ele->live_os_conn_timeout)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "live_os_conn_retries=%d ", m_ele->live_os_conn_retries)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "dead_os_conn_timeout=%d ", m_ele->dead_os_conn_timeout)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) &&
-      (psize = snprintf(buf + pos, sizeof(buf) - pos, "dead_os_conn_retries=%d ", m_ele->dead_os_conn_retries)) > 0) {
-    pos += psize;
-  }
-  if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "max_connection=%d ", m_ele->max_connection)) > 0) {
-    pos += psize;
-  }
-  if (m_ele->error_page_uri) {
-    if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "error_page=%s ", m_ele->error_page_uri)) > 0) {
-      pos += psize;
-    }
-  }
-  switch (m_ele->scheme) {
-  case TS_HTTP_CONGEST_PER_IP:
-    snprintf(buf + pos, sizeof(buf) - pos, "congestion_scheme=per_ip ");
-    break;
-  case TS_HTTP_CONGEST_PER_HOST:
-    snprintf(buf + pos, sizeof(buf) - pos, "congestion_scheme=per_host ");
-    break;
-  default:
-    break;
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-CongestionObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-  // all Congestion Ele's should have a prim dest, sec specs are optional
-  if (!m_ele->pd_val) {
-    m_valid = false;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-  return m_valid;
-}
-
-TSCfgEle *
-CongestionObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_congestion_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// HostingObj
-//--------------------------------------------------------------------------
-HostingObj::HostingObj(TSHostingEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-HostingObj::HostingObj(TokenList *tokens)
-{
-  Token *token;
-
-  m_ele                = TSHostingEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || tokens->length != 2) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_HOSTING);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-  // First Token
-  token = tokens->first();
-  if (!token->value) {
-    goto FORMAT_ERR;
-  }
-  if (strcmp(token->name, "hostname") == 0) {
-    m_ele->pd_type = TS_PD_HOST;
-  } else if (strcmp(token->name, "domain") == 0) {
-    m_ele->pd_type = TS_PD_DOMAIN;
-  } else {
-    goto FORMAT_ERR;
-  }
-  m_ele->pd_val = ats_strdup(token->value);
-
-  // Second Token
-  token = tokens->next(token);
-  if (!token->value) {
-    goto FORMAT_ERR;
-  }
-  if (strcmp(token->name, "volume") != 0) {
-    goto FORMAT_ERR;
-  }
-  m_ele->volumes = string_to_int_list(token->value, LIST_DELIMITER);
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-HostingObj::~HostingObj()
-{
-  TSHostingEleDestroy(m_ele);
-}
-
-char *
-HostingObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char *list_str;
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  switch (m_ele->pd_type) {
-  case TS_PD_HOST:
-    ink_strlcat(buf, "hostname=", sizeof(buf));
-    break;
-  case TS_PD_DOMAIN:
-    ink_strlcat(buf, "domain=", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // Lots of cases...
-    break;
-  }
-
-  list_str = int_list_to_string(m_ele->volumes, ",");
-  ink_strlcat(buf, m_ele->pd_val, sizeof(buf));
-  ink_strlcat(buf, " volume=", sizeof(buf));
-  ink_strlcat(buf, list_str, sizeof(buf));
-  ats_free(list_str);
-
-  return ats_strdup(buf);
-}
-
-bool
-HostingObj::isValid()
-{
-  int *part;
-  int len, i;
-
-  if (m_ele->pd_type == TS_PD_UNDEFINED) {
-    m_valid = false;
-    goto Lend;
-  }
-
-  if (!m_ele->pd_val) {
-    m_valid = false;
-    goto Lend;
-  }
-
-  if (!m_ele->volumes || !TSIntListIsValid(m_ele->volumes, 0, 50000)) {
-    m_valid = false;
-    goto Lend;
-  }
-  // check that each volume is between 1-255
-  len = TSIntListLen(m_ele->volumes);
-  for (i = 0; i < len; i++) {
-    part = TSIntListDequeue(m_ele->volumes);
-    if (*part < 1 || *part > 255) {
-      TSIntListEnqueue(m_ele->volumes, part);
-      m_valid = false;
-      goto Lend;
-    }
-    TSIntListEnqueue(m_ele->volumes, part);
-  }
-
-Lend:
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-  return m_valid;
-}
-
-TSCfgEle *
-HostingObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_hosting_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// IpAllowObj
-//--------------------------------------------------------------------------
-IpAllowObj::IpAllowObj(TSIpAllowEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-IpAllowObj::IpAllowObj(TokenList *tokens)
-{
-  Token *token;
-
-  m_ele                = TSIpAllowEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || (tokens->length != 2)) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_IP_ALLOW);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-
-  token = tokens->first();
-  if (!token->name || strcmp(token->name, "src_ip")) {
-    goto FORMAT_ERR;
-  }
-  if (!token->value) {
-    goto FORMAT_ERR;
-  } else {
-    m_ele->src_ip_addr = string_to_ip_addr_ele(token->value);
-  }
-
-  token = tokens->next(token);
-  if (!token->name || strcmp(token->name, "action")) {
-    goto FORMAT_ERR;
-  }
-  if (!token->value) {
-    goto FORMAT_ERR;
-  } else {
-    if (!strcmp(token->value, "ip_allow")) {
-      m_ele->action = TS_IP_ALLOW_ALLOW;
-    } else if (strcmp(token->value, "ip_deny") == 0) {
-      m_ele->action = TS_IP_ALLOW_DENY;
-    } else {
-      m_ele->action = TS_IP_ALLOW_UNDEFINED;
-    }
-  }
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-IpAllowObj::~IpAllowObj()
-{
-  TSIpAllowEleDestroy(m_ele);
-}
-
-char *
-IpAllowObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-    ;
-  }
-
-  char *rule;
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  ink_strlcpy(buf, "src_ip=", sizeof(buf));
-  if (m_ele->src_ip_addr) {
-    char *ip_str = ip_addr_ele_to_string(m_ele->src_ip_addr);
-    if (ip_str) {
-      ink_strlcat(buf, ip_str, sizeof(buf));
-      ats_free(ip_str);
-    }
-  }
-
-  ink_strlcat(buf, " action=", sizeof(buf));
-  switch (m_ele->action) {
-  case TS_IP_ALLOW_ALLOW:
-    ink_strlcat(buf, "ip_allow", sizeof(buf));
-    break;
-  case TS_IP_ALLOW_DENY:
-    ink_strlcat(buf, "ip_deny", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_IP_ALLOW_UNDEFINED
-    break;
-  }
-
-  rule = ats_strdup(buf);
-  return rule;
-}
-
-bool
-IpAllowObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-
-  if (!m_ele->src_ip_addr) {
-    m_valid = false;
-  }
-
-  switch (m_ele->action) {
-  case TS_IP_ALLOW_ALLOW:
-  case TS_IP_ALLOW_DENY:
-    break;
-  default:
-    m_valid = false;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-  return m_valid;
-}
-
-TSCfgEle *
-IpAllowObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_ip_allow_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// ParentProxyObj
-//--------------------------------------------------------------------------
-ParentProxyObj::ParentProxyObj(TSParentProxyEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-ParentProxyObj::ParentProxyObj(TokenList *tokens)
-{
-  Token *tok;
-  m_ele                = TSParentProxyEleCreate(TS_TYPE_UNDEFINED);
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || tokens->length < 1) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_PARENT_PROXY);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-
-  tok = tokens->first();
-  tok = tokens_to_pdss_format(tokens, tok, &(m_ele->parent_info));
-  if (tok == nullptr) {
-    goto FORMAT_ERR;
-  }
-  // search parent and round_robin action tags
-  for (tok = tokens->next(tok); tok; tok = tokens->next(tok)) {
-    if (strcmp(tok->name, "round_robin") == 0) {
-      // sanity check
-      if (!tok->value) {
-        goto FORMAT_ERR;
-      }
-      if (strcmp(tok->value, "true") == 0) {
-        m_ele->rr = TS_RR_TRUE;
-      } else if (strcmp(tok->value, "strict") == 0) {
-        m_ele->rr = TS_RR_STRICT;
-      } else if (strcmp(tok->value, "false") == 0) {
-        m_ele->rr = TS_RR_FALSE;
-      } else {
-        m_ele->rr = TS_RR_NONE;
-        goto FORMAT_ERR;
-      }
-
-    } else if (strcmp(tok->name, "parent") == 0) {
-      // sanity check
-      if (!tok->value) {
-        goto FORMAT_ERR;
-      }
-      m_ele->proxy_list = string_to_domain_list(tok->value, ";");
-
-    } else if (strcmp(tok->name, "go_direct") == 0) {
-      // sanity check
-      if (!tok->value) {
-        goto FORMAT_ERR;
-      }
-      if (!strcmp(tok->value, "true")) {
-        m_ele->direct = true;
-      } else if (!strcmp(tok->value, "false")) {
-        m_ele->direct = false;
-      } else {
-        goto FORMAT_ERR;
-      }
-    } else {
-      goto FORMAT_ERR;
-    }
-  }
-
-  // the rule type should tell us whether go_direct or not
-  // the "go_direct" action tag recognization is done in get_rule_type
-  switch (m_ele->cfg_ele.type) {
-  case TS_PP_GO_DIRECT:
-    m_ele->direct = true;
-    break;
-  case TS_PP_PARENT:
-    m_ele->direct = false;
-    break;
-  default:
-    // Handled here:
-    // Lots of cases
-    break;
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_valid = false;
-}
-
-ParentProxyObj::~ParentProxyObj()
-{
-  TSParentProxyEleDestroy(m_ele);
-}
-
-char *
-ParentProxyObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char *pd_str, *list_str;
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  pd_str = pdest_sspec_to_string(m_ele->parent_info.pd_type, m_ele->parent_info.pd_val, &(m_ele->parent_info.sec_spec));
-  if (!pd_str) {
-    return nullptr;
-  }
-  ink_strlcat(buf, pd_str, sizeof(buf));
-  ats_free(pd_str);
-
-  // round_robin
-  if ((m_ele->rr != TS_RR_NONE) && (m_ele->rr != TS_RR_UNDEFINED)) {
-    if (!isspace(buf[strlen(buf) - 1])) {
-      ink_strlcat(buf, " ", sizeof(buf));
-    }
-    ink_strlcat(buf, "round_robin=", sizeof(buf));
-    switch (m_ele->rr) {
-    case TS_RR_TRUE:
-      ink_strlcat(buf, "true", sizeof(buf));
-      break;
-    case TS_RR_STRICT:
-      ink_strlcat(buf, "strict", sizeof(buf));
-      break;
-    case TS_RR_FALSE:
-      ink_strlcat(buf, "false", sizeof(buf));
-      break;
-    default:
-      // Handled here:
-      // TS_RR_NONE, TS_RR_UNDEFINED
-      break;
-    }
-  }
-
-  if (m_ele->proxy_list != nullptr) {
-    // include space delimiter if not already exist
-    if (!isspace(buf[strlen(buf) - 1])) {
-      ink_strlcat(buf, " ", sizeof(buf));
-    }
-    list_str = domain_list_to_string(m_ele->proxy_list, ";");
-    ink_strlcat(buf, "parent=\"", sizeof(buf));
-    if (list_str) {
-      ink_strlcat(buf, list_str, sizeof(buf));
-      ats_free(list_str);
-    }
-    ink_strlcat(buf, "\"", sizeof(buf));
-  }
-
-  if (m_ele->direct) {
-    // include space delimiter if not already exist
-    if (!isspace(buf[strlen(buf) - 1])) {
-      ink_strlcat(buf, " ", sizeof(buf));
-    }
-    ink_strlcat(buf, "go_direct=true", sizeof(buf));
-  } else {
-    if (!isspace(buf[strlen(buf) - 1])) {
-      ink_strlcat(buf, " ", sizeof(buf));
-    }
-    ink_strlcat(buf, "go_direct=false", sizeof(buf));
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-ParentProxyObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-
-  if (!ccu_checkPdSspec(m_ele->parent_info)) {
-    m_valid = false;
-  }
-
-  if (m_ele->proxy_list && !TSDomainListIsValid(m_ele->proxy_list)) {
-    m_valid = false;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-ParentProxyObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_parent_proxy_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// VolumeObj
-//--------------------------------------------------------------------------
-VolumeObj::VolumeObj(TSVolumeEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-VolumeObj::VolumeObj(TokenList *tokens)
-{
-  Token *token;
-
-  m_ele                = TSVolumeEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || tokens->length != 3) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_VOLUME);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-
-  token = tokens->first();
-  if (strcmp(token->name, "volume") || !token->value) {
-    goto FORMAT_ERR;
-  }
-  m_ele->volume_num = ink_atoi(token->value);
-
-  // arguments
-  token = tokens->next(token);
-  while (token) {
-    if (strcmp(token->name, "scheme")) {
-      if (!token->value || m_ele->scheme) {
-        // return a format error if the token doesn't have a
-        // value or the scheme was already set with a previous
-        // duplicated option.
-        goto FORMAT_ERR;
-      }
-      if (!strcmp(token->value, "http")) {
-        m_ele->scheme = TS_VOLUME_HTTP;
-      } else {
-        m_ele->scheme = TS_VOLUME_UNDEFINED;
-      }
-    }
-
-    if (strcmp(token->name, "size")) {
-      if (!token->value || m_ele->volume_size) {
-        // return a format error if the token doesn't have a
-        // value or the size was already set with a previous
-        // duplicated option.
-        goto FORMAT_ERR;
-      }
-      // CAUTION: we may need a tigher error check
-      if (strstr(token->value, "%")) {
-        m_ele->size_format = TS_SIZE_FMT_PERCENT;
-      } else {
-        m_ele->size_format = TS_SIZE_FMT_ABSOLUTE;
-      }
-      m_ele->volume_size = ink_atoi(token->value);
-    }
-
-    if (m_ele->scheme && m_ele->volume_size) {
-      break; // Ignore duplicated options.
-    }
-
-    token = tokens->next(token);
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-VolumeObj::~VolumeObj()
-{
-  TSVolumeEleDestroy(m_ele);
-}
-
-char *
-VolumeObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  snprintf(buf, sizeof(buf), "volume=%d scheme=", m_ele->volume_num);
-
-  switch (m_ele->scheme) {
-  case TS_VOLUME_HTTP:
-    ink_strlcat(buf, "http", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_VOLUME_UNDEFINED, TS_SIZE_FMT_ABSOLUTE, TS_SIZE_FMT_UNDEFINED
-    break;
-  }
-
-  size_t pos = strlen(buf);
-  snprintf(buf + pos, sizeof(buf) - pos, " size=%d", m_ele->volume_size);
-  switch (m_ele->size_format) {
-  case TS_SIZE_FMT_PERCENT:
-    ink_strlcat(buf, "%", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_SIZE_FMT_ABSOLUTE, TS_SIZE_FMT_UNDEFINED
-    break;
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-VolumeObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-  // volume nubmer must be between 1-255 inclusive
-  if (m_ele->volume_num < 1 || m_ele->volume_num > 255) {
-    m_valid = false;
-  }
-
-  switch (m_ele->scheme) {
-  case TS_VOLUME_HTTP:
-    break;
-  default:
-    m_valid = false;
-  }
-
-  // absolute size must be multiple of 128; percentage size <= 100
-  if (m_ele->size_format == TS_SIZE_FMT_ABSOLUTE) {
-    if ((m_ele->volume_size < 0) || (m_ele->volume_size % 128)) {
-      m_valid = false;
-    }
-  } else if (m_ele->size_format == TS_SIZE_FMT_PERCENT) {
-    if ((m_ele->volume_size < 0) || (m_ele->volume_size > 100)) {
-      m_valid = false;
-    }
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-VolumeObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_volume_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// PluginObj
-//--------------------------------------------------------------------------
-PluginObj::PluginObj(TSPluginEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-PluginObj::PluginObj(TokenList *tokens)
-{
-  Token *token;
-
-  m_ele                = TSPluginEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || tokens->length < 1) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_PLUGIN);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-  // plugin name
-  token = tokens->first();
-  if (strcmp(token->name, "") == 0) {
-    goto FORMAT_ERR;
-  }
-  m_ele->name = ats_strdup(token->name);
-
-  // arguments
-  token = tokens->next(token);
-  while (token) {
-    if (m_ele->args == TS_INVALID_LIST) {
-      m_ele->args = TSStringListCreate();
-    }
-    if (token->name) {
-      TSStringListEnqueue(m_ele->args, ats_strdup(token->name));
-    }
-    token = tokens->next(token);
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-PluginObj::~PluginObj()
-{
-  TSPluginEleDestroy(m_ele);
-}
-
-char *
-PluginObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char *list_str;
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  list_str = string_list_to_string(m_ele->args, " ");
-  if (list_str) {
-    snprintf(buf, sizeof(buf), "%s %s", m_ele->name, list_str);
-    ats_free(list_str);
-  } else {
-    snprintf(buf, sizeof(buf), "%s", m_ele->name);
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-PluginObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-  // check plugin name
-  if (!m_ele->name || strcmp(m_ele->name, "") == 0) {
-    m_valid = false;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-PluginObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_plugin_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// RemapObj
-//--------------------------------------------------------------------------
-RemapObj::RemapObj(TSRemapEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-RemapObj::RemapObj(TokenList *tokens)
-{
-  Token *token;
-  short current; // current token index
-  Tokenizer fromTok(":/");
-  Tokenizer toTok(":/");
-  char buf[MAX_RULE_SIZE];
-
-  m_ele                = TSRemapEleCreate(TS_TYPE_UNDEFINED);
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || ((tokens->length != 2) && (tokens->length != 3))) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_REMAP);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-  // The first token must either be "map, "reverse_map", "redirect", and redirect_temporary
-  token = tokens->first();
-
-  // target
-  token = tokens->next(token);
-
-  if (!ccu_checkUrl(token->name)) {
-    goto FORMAT_ERR;
-  }
-
-  // TODO: Should we check the return value (count) here?
-  fromTok.Initialize(token->name, ALLOW_EMPTY_TOKS); // allow empty token for parse sanity check
-
-  if (strcmp(fromTok[0], "http") == 0) {
-    m_ele->from_scheme = TS_SCHEME_HTTP;
-  } else if (strcmp(fromTok[0], "https") == 0) {
-    m_ele->from_scheme = TS_SCHEME_HTTPS;
-  } else {
-    m_ele->from_scheme = TS_SCHEME_UNDEFINED;
-    goto FORMAT_ERR;
-  }
-
-  // from host
-  m_ele->from_host = ats_strdup(fromTok[3]);
-
-  current = 4;
-  if (fromTok[4]) {
-    // from port
-    m_ele->from_port = ink_atoi(fromTok[4]);
-    if (m_ele->from_port != 0) { // Does it have a port
-      current++;
-    } else { // No ports
-      m_ele->from_port = TS_INVALID_PORT;
-    }
-
-    // from prefix
-    if (fromTok[current]) {
-      memset(buf, 0, MAX_RULE_SIZE);
-
-      for (int i = current; fromTok[i]; i++) {
-        ink_strlcat(buf, fromTok[i], sizeof(buf));
-        ink_strlcat(buf, "/", sizeof(buf));
-      }
-
-      if ((token->name)[strlen(token->name) - 1] != '/') {
-        buf[strlen(buf) - 1] = '\0'; // truncate the last '/'
-      }
-
-      m_ele->from_path_prefix = ats_strdup(buf);
-    }
-  } else {
-    if ((token->name)[strlen(token->name) - 1] == '/') {
-      memset(buf, 0, MAX_RULE_SIZE);
-      ink_strlcpy(buf, m_ele->from_host, sizeof(buf));
-      ats_free(m_ele->from_host);
-      ink_strlcat(buf, "/", sizeof(buf));
-      m_ele->from_host = ats_strdup(buf);
-    }
-  }
-
-  if (!ccu_checkUrl(token->value)) {
-    goto FORMAT_ERR;
-  }
-
-  // TODO: Should we check the return value (count) here?
-  toTok.Initialize(token->value, ALLOW_EMPTY_TOKS); // allow empty token for parse sanity check
-
-  if (strcmp(toTok[0], "http") == 0) {
-    m_ele->to_scheme = TS_SCHEME_HTTP;
-  } else if (strcmp(toTok[0], "https") == 0) {
-    m_ele->to_scheme = TS_SCHEME_HTTPS;
-  } else {
-    m_ele->to_scheme = TS_SCHEME_UNDEFINED;
-    goto FORMAT_ERR;
-  }
-
-  // to host
-  m_ele->to_host = ats_strdup(toTok[3]);
-
-  current = 4;
-  if (toTok[4]) {
-    // to port
-    m_ele->to_port = ink_atoi(toTok[4]);
-    if (m_ele->to_port != 0) { // Does it have a port
-      current++;
-    } else { // No ports
-      m_ele->to_port = TS_INVALID_PORT;
-    }
-
-    // to prefix
-    if (toTok[current]) {
-      memset(buf, 0, MAX_RULE_SIZE);
-
-      for (int i = current; toTok[i]; i++) {
-        ink_strlcat(buf, toTok[i], sizeof(buf));
-        ink_strlcat(buf, "/", sizeof(buf));
-      }
-
-      if ((token->name)[strlen(token->name) - 1] != '/') {
-        buf[strlen(buf) - 1] = '\0'; // truncate the last '/'
-      }
-
-      m_ele->to_path_prefix = ats_strdup(buf);
-    }
-  } else {
-    if ((token->value)[strlen(token->value) - 1] == '/') {
-      memset(buf, 0, MAX_RULE_SIZE);
-      ink_strlcpy(buf, m_ele->to_host, sizeof(buf));
-      ats_free(m_ele->to_host);
-      ink_strlcat(buf, "/", sizeof(buf));
-      m_ele->to_host = ats_strdup(buf);
-    }
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-RemapObj::~RemapObj()
-{
-  TSRemapEleDestroy(m_ele);
-}
-
-char *
-RemapObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  switch (m_ele->cfg_ele.type) {
-  case TS_REMAP_MAP:
-    ink_strlcat(buf, "map", sizeof(buf));
-    break;
-  case TS_REMAP_REVERSE_MAP:
-    ink_strlcat(buf, "reverse_map", sizeof(buf));
-    break;
-  case TS_REMAP_REDIRECT:
-    ink_strlcat(buf, "redirect", sizeof(buf));
-    break;
-  case TS_REMAP_REDIRECT_TEMP:
-    ink_strlcat(buf, "redirect_temporary", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // Lots of cases...
-    break;
-  }
-  // space delimitor
-  ink_strlcat(buf, " ", sizeof(buf));
-
-  // from scheme
-  switch (m_ele->from_scheme) {
-  case TS_SCHEME_HTTP:
-    ink_strlcat(buf, "http", sizeof(buf));
-    break;
-  case TS_SCHEME_HTTPS:
-    ink_strlcat(buf, "https", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_SCHEME_NONE, TS_SCHEME_UNDEFINED
-    break;
-  }
-  ink_strlcat(buf, "://", sizeof(buf));
-
-  // from host
-  if (m_ele->from_host) {
-    ink_strlcat(buf, m_ele->from_host, sizeof(buf));
-  }
-  // from port
-  if (m_ele->from_port != TS_INVALID_PORT) {
-    snprintf(buf, sizeof(buf), "%s:%d", buf, m_ele->from_port);
-  }
-  // from host path
-  if (m_ele->from_path_prefix) {
-    ink_strlcat(buf, "/", sizeof(buf));
-    ink_strlcat(buf, m_ele->from_path_prefix, sizeof(buf));
-  }
-  // space delimitor
-  ink_strlcat(buf, " ", sizeof(buf));
-
-  // to scheme
-  switch (m_ele->to_scheme) {
-  case TS_SCHEME_HTTP:
-    ink_strlcat(buf, "http", sizeof(buf));
-    break;
-  case TS_SCHEME_HTTPS:
-    ink_strlcat(buf, "https", sizeof(buf));
-    break;
-  default:
-    // Handled here:
-    // TS_SCHEME_NONE, TS_SCHEME_UNDEFINED
-    break;
-  }
-  ink_strlcat(buf, "://", sizeof(buf));
-
-  // to host
-  if (m_ele->to_host) {
-    ink_strlcat(buf, m_ele->to_host, sizeof(buf));
-  }
-  // to port
-  if (m_ele->to_port != TS_INVALID_PORT) {
-    snprintf(buf, sizeof(buf), "%s:%d", buf, m_ele->to_port);
-  }
-  // to host path
-  if (m_ele->to_path_prefix) {
-    ink_strlcat(buf, "/", sizeof(buf));
-    ink_strlcat(buf, m_ele->to_path_prefix, sizeof(buf));
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-RemapObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-  // rule type
-  switch (m_ele->cfg_ele.type) {
-  case TS_REMAP_MAP:
-  case TS_REMAP_REVERSE_MAP:
-  case TS_REMAP_REDIRECT:
-  case TS_REMAP_REDIRECT_TEMP:
-    break;
-  default:
-    m_valid = false;
-  }
-
-  // from scheme
-  switch (m_ele->from_scheme) {
-  case TS_SCHEME_HTTP:
-  case TS_SCHEME_HTTPS:
-    break;
-  default:
-    m_valid = false;
-  }
-
-  switch (m_ele->to_scheme) {
-  case TS_SCHEME_HTTP:
-  case TS_SCHEME_HTTPS:
-    break;
-  default:
-    m_valid = false;
-  }
-
-  // mandatory field
-  if (!m_ele->from_host || strstr(m_ele->from_host, ":/")) {
-    m_valid = false;
-  }
-  // mandatory field
-  if (!m_ele->to_host || strstr(m_ele->to_host, ":/")) {
-    m_valid = false;
-  }
-
-  if ((m_ele->from_path_prefix && strstr(m_ele->from_path_prefix, ":")) ||
-      (m_ele->to_path_prefix && strstr(m_ele->to_path_prefix, ":"))) {
-    m_valid = false;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-RemapObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_remap_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// SocksObj
-//--------------------------------------------------------------------------
-SocksObj::SocksObj(TSSocksEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-SocksObj::SocksObj(TokenList *tokens)
-{
-  Token *tok;
-
-  m_ele                = TSSocksEleCreate(TS_TYPE_UNDEFINED);
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_SOCKS);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-  // Determine if it's  a "no-socks" rule or a "parent socks servers" rule
-  tok = tokens->first();
-  if (strcmp(tok->name, "no_socks") == 0) { // no-socks rule; TS_SOCKS_BYPASS
-
-    if (m_ele->ip_addrs != nullptr) {
-      goto FORMAT_ERR;
-    }
-    m_ele->ip_addrs = string_to_ip_addr_list(tok->value, ",");
-  } else if (strcmp(tok->name, "auth") == 0) { // TS_SOCKS_AUTH rule
-    if (strcmp(tok->value, "u") == 0) {
-      tok = tokens->next(tok);
-      if (tok && tok->name) {
-        m_ele->username = ats_strdup(tok->name);
-      } else {
-        goto FORMAT_ERR;
-      }
-      if (tok && tok->name) {
-        tok             = tokens->next(tok);
-        m_ele->password = ats_strdup(tok->name);
-      } else {
-        goto FORMAT_ERR;
-      }
-    } else {
-      goto FORMAT_ERR;
-    }
-  } else { // multiple socks servers rule; TS_SOCKS_MULTIPLE
-    // should be dest_ip tag
-    if (strcmp(tok->name, "dest_ip") == 0) {
-      m_ele->dest_ip_addr = string_to_ip_addr_ele(tok->value);
-    } else {
-      goto FORMAT_ERR;
-    }
-
-    // search dest_ip, parent and round_robin action tags
-    for (tok = tokens->next(tok); tok; tok = tokens->next(tok)) {
-      if (strcmp(tok->name, "round_robin") == 0) {
-        // sanity check
-        if (!tok->value) {
-          goto FORMAT_ERR;
-        }
-
-        if (strcmp(tok->value, "true") == 0) {
-          m_ele->rr = TS_RR_TRUE;
-        } else if (strcmp(tok->value, "strict") == 0) {
-          m_ele->rr = TS_RR_STRICT;
-        } else if (strcmp(tok->value, "false") == 0) {
-          m_ele->rr = TS_RR_FALSE;
-        } else {
-          m_ele->rr = TS_RR_NONE;
-          goto FORMAT_ERR; // missing value for round_robin tag
-        }
-
-      } else if (strcmp(tok->name, "parent") == 0) {
-        // sanity check
-        if (!tok->value) {
-          goto FORMAT_ERR;
-        }
-        m_ele->socks_servers = string_to_domain_list(tok->value, ";");
-      }
-    } // end for loop
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-SocksObj::~SocksObj()
-{
-  TSSocksEleDestroy(m_ele);
-}
-
-char *
-SocksObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  if (m_ele->ip_addrs != nullptr) { // TS_SOCKS_BYPASS rule
-    char *str_list = ip_addr_list_to_string((LLQ *)m_ele->ip_addrs, ",");
-    if (str_list) {
-      snprintf(buf, sizeof(buf), "no_socks %s", str_list);
-      ats_free(str_list);
-    } else {
-      return nullptr; // invalid ip_addr_list
-    }
-  } else if (m_ele->username != nullptr) { // TS_SOCKS_AUTH rule
-    snprintf(buf, sizeof(buf), "auth u %s %s", m_ele->username, m_ele->password);
-  } else { // TS_SOCKS_MULTIPLE rule
-    // destination ip
-    char *ip_str = ip_addr_ele_to_string((TSIpAddrEle *)m_ele->dest_ip_addr);
-    if (ip_str) {
-      ink_strlcat(buf, "dest_ip=", sizeof(buf));
-      ink_strlcat(buf, ip_str, sizeof(buf));
-      ats_free(ip_str);
-    } else {
-      return nullptr; // invalid IP
-    }
-
-    // parent server list
-    if (m_ele->socks_servers != nullptr) {
-      // include space delimiter if not already exist
-      if (!isspace(buf[strlen(buf) - 1])) {
-        ink_strlcat(buf, " ", sizeof(buf));
-      }
-      char *list_str = domain_list_to_string(m_ele->socks_servers, ";");
-      if (list_str) {
-        ink_strlcat(buf, "parent=\"", sizeof(buf));
-        ink_strlcat(buf, list_str, sizeof(buf));
-        ink_strlcat(buf, "\"", sizeof(buf));
-        ats_free(list_str);
-      } else {
-        return nullptr; // invalid list
-      }
-    }
-    // round-robin, if specified
-    if ((m_ele->rr != TS_RR_NONE) && (m_ele->rr != TS_RR_UNDEFINED)) {
-      if (!isspace(buf[strlen(buf) - 1])) {
-        ink_strlcat(buf, " ", sizeof(buf));
-      }
-      ink_strlcat(buf, "round_robin=", sizeof(buf));
-      switch (m_ele->rr) {
-      case TS_RR_TRUE:
-        ink_strlcat(buf, "true", sizeof(buf));
-        break;
-      case TS_RR_STRICT:
-        ink_strlcat(buf, "strict", sizeof(buf));
-        break;
-      case TS_RR_FALSE:
-        ink_strlcat(buf, "false", sizeof(buf));
-        break;
-      default:
-        // Handled here:
-        // TS_RR_NONE, TS_RR_UNDEFINED
-        break;
-      }
-    }
-  }
-
-  return ats_strdup(buf);
-}
-
-// the rule must either have an ip addr list (exclusive) OR
-// the dest_ip_addr * socks_servers OR
-// the username and password
-bool
-SocksObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-
-  switch (m_ele->cfg_ele.type) {
-  case TS_SOCKS_BYPASS:
-    if (m_ele->dest_ip_addr || m_ele->username || m_ele->password || !TSIpAddrListIsValid(m_ele->ip_addrs)) {
-      m_valid = false;
-    } else {
-      m_valid = true;
-    }
-    break;
-  case TS_SOCKS_AUTH:
-    if (m_ele->username == nullptr || m_ele->password == nullptr || m_ele->ip_addrs || m_ele->dest_ip_addr) {
-      m_valid = false;
-    } else {
-      m_valid = true;
-    }
-    break;
-  case TS_SOCKS_MULTIPLE:
-    if (m_ele->ip_addrs || m_ele->username || !(m_ele->dest_ip_addr && m_ele->socks_servers) ||
-        !ccu_checkIpAddrEle(m_ele->dest_ip_addr) || !TSDomainListIsValid(m_ele->socks_servers)) {
-      m_valid = false;
-    } else {
-      m_valid = true;
-    }
-    break;
-  default:
-    m_valid = false;
-    break;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-SocksObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_socks_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// SplitDnsObj
-//--------------------------------------------------------------------------
-SplitDnsObj::SplitDnsObj(TSSplitDnsEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid();
-}
-
-SplitDnsObj::SplitDnsObj(TokenList *tokens)
-{
-  Token *tok;
-
-  m_ele                = TSSplitDnsEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || (tokens->length > 6)) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_SPLIT_DNS);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-
-  tok = tokens->first();
-  while (tok) {
-    if (!strcmp(tok->name, "dest_domain")) {
-      if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->pd_type = TS_PD_DOMAIN;
-      m_ele->pd_val  = ats_strdup(tok->value);
-    } else if (strcmp(tok->name, "dest_host") == 0) {
-      if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->pd_type = TS_PD_HOST;
-      m_ele->pd_val  = ats_strdup(tok->value);
-    } else if (strcmp(tok->name, "url_regex") == 0) {
-      if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->pd_type = TS_PD_URL_REGEX;
-      m_ele->pd_val  = ats_strdup(tok->value);
-    } else if (strcmp(tok->name, "url") == 0) {
-      if ((m_ele->pd_type != TS_PD_UNDEFINED) || (m_ele->pd_val != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->pd_type = TS_PD_URL;
-      m_ele->pd_val  = ats_strdup(tok->value);
-    } else if (strcmp(tok->name, "named") == 0) {
-      if ((m_ele->dns_servers_addrs != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->dns_servers_addrs = (TSDomainList)string_to_domain_list(tok->value, "; ");
-    } else if (strcmp(tok->name, "def_domain") == 0) {
-      if ((m_ele->def_domain != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->def_domain = ats_strdup(tok->value);
-    } else if (strcmp(tok->name, "search_list") == 0) {
-      if ((m_ele->search_list != nullptr) || (!tok->value)) {
-        // fields are already defined!!
-        goto FORMAT_ERR;
-      }
-      m_ele->search_list = (TSDomainList)string_to_domain_list(tok->value, "; ");
-    } else {
-      // Not able to recongize token name
-      goto FORMAT_ERR;
-    }
-
-    tok = tokens->next(tok);
-  }
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-SplitDnsObj::~SplitDnsObj()
-{
-  TSSplitDnsEleDestroy(m_ele);
-}
-
-char *
-SplitDnsObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  char *pd_name;
-  switch (m_ele->pd_type) {
-  case TS_PD_DOMAIN:
-    pd_name = ats_strdup("dest_domain");
-    break;
-  case TS_PD_HOST:
-    pd_name = ats_strdup("dest_host");
-    break;
-  case TS_PD_URL_REGEX:
-    pd_name = ats_strdup("url_regex");
-    break;
-  case TS_PD_URL:
-    pd_name = ats_strdup("url");
-    break;
-  default:
-    pd_name = ats_strdup(""); // lv: just to make this junk workable
-    // Handled here:
-    // TS_PD_IP, TS_PD_UNDEFINED
-    break;
-  }
-
-  if (m_ele->pd_val) {
-    ink_strlcat(buf, pd_name, sizeof(buf));
-    ink_strlcat(buf, "=", sizeof(buf));
-    if (strstr(m_ele->pd_val, " ")) {
-      ink_strlcat(buf, "\"", sizeof(buf));
-    }
-    ink_strlcat(buf, m_ele->pd_val, sizeof(buf));
-    if (strstr(m_ele->pd_val, " ")) {
-      ink_strlcat(buf, "\"", sizeof(buf));
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-
-  if (m_ele->dns_servers_addrs) {
-    ink_strlcat(buf, "named=", sizeof(buf));
-    char *temp = domain_list_to_string((LLQ *)m_ele->dns_servers_addrs, ";");
-    if (temp) {
-      if (strstr(temp, " ")) {
-        ink_strlcat(buf, "\"", sizeof(buf));
-      }
-      ink_strlcat(buf, temp, sizeof(buf));
-      if (strstr(temp, " ")) {
-        ink_strlcat(buf, "\"", sizeof(buf));
-      }
-      ats_free(temp);
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-
-  if (m_ele->def_domain) {
-    ink_strlcat(buf, "def_domain=", sizeof(buf));
-    if (strstr(m_ele->def_domain, " ")) {
-      ink_strlcat(buf, "\"", sizeof(buf));
-    }
-    ink_strlcat(buf, m_ele->def_domain, sizeof(buf));
-    if (strstr(m_ele->def_domain, " ")) {
-      ink_strlcat(buf, "\"", sizeof(buf));
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-
-  if (m_ele->search_list) {
-    ink_strlcat(buf, "search_list=", sizeof(buf));
-    char *temp = domain_list_to_string(m_ele->search_list, ";");
-    if (temp) {
-      if (strstr(temp, " ")) {
-        ink_strlcat(buf, "\"", sizeof(buf));
-      }
-      ink_strlcat(buf, temp, sizeof(buf));
-      if (strstr(temp, " ")) {
-        ink_strlcat(buf, "\"", sizeof(buf));
-      }
-      ats_free(temp);
-    }
-    ink_strlcat(buf, " ", sizeof(buf));
-  }
-  // chop the last space
-  while (isspace(buf[strlen(buf) - 1])) {
-    buf[strlen(buf) - 1] = '\0';
-  }
-
-  ats_free(pd_name);
-
-  return ats_strdup(buf);
-}
-
-bool
-SplitDnsObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-
-  switch (m_ele->pd_type) {
-  case TS_PD_DOMAIN:
-  case TS_PD_HOST:
-  case TS_PD_URL_REGEX:
-    break;
-  default:
-    m_valid = false;
-  }
-
-  if (!m_ele->pd_val) {
-    m_valid = false;
-  }
-
-  if (!TSDomainListIsValid(m_ele->dns_servers_addrs)) {
-    m_valid = false;
-  }
-  // search_list is optional
-  if (m_ele->search_list && !TSDomainListIsValid(m_ele->search_list)) {
-    m_valid = false;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-SplitDnsObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_split_dns_ele(m_ele);
-}
-
-//--------------------------------------------------------------------------
-// StorageObj
-//--------------------------------------------------------------------------
-StorageObj::StorageObj(TSStorageEle *ele)
-{
-  m_ele   = ele;
-  m_valid = true;
-  m_valid = isValid(); // now validate
-}
-
-// must have at least 1 token (token-name = pathname, token-value = size (if any) )
-StorageObj::StorageObj(TokenList *tokens)
-{
-  Token *tok;
-
-  m_ele                = TSStorageEleCreate();
-  m_ele->cfg_ele.error = TS_ERR_OKAY;
-  m_valid              = true;
-
-  if (!tokens || (tokens->length > 6)) {
-    goto FORMAT_ERR;
-  }
-
-  m_ele->cfg_ele.type = get_rule_type(tokens, TS_FNAME_STORAGE);
-  if (m_ele->cfg_ele.type == TS_TYPE_UNDEFINED) {
-    goto FORMAT_ERR;
-  }
-  // check first token; must exist
-  tok = tokens->first();
-  if (!tok->name) {
-    goto FORMAT_ERR; // no pathname specified
-  } else {
-    m_ele->pathname = ats_strdup(tok->name);
-  }
-
-  // check if size is specified
-  if (tok->value) { // size is specified in second token
-    m_ele->size = ink_atoi(tok->value);
-  }
-
-  return;
-
-FORMAT_ERR:
-  m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  m_valid              = false;
-}
-
-StorageObj::~StorageObj()
-{
-  TSStorageEleDestroy(m_ele);
-}
-
-char *
-StorageObj::formatEleToRule()
-{
-  if (!isValid()) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-    return nullptr;
-  }
-
-  char buf[MAX_RULE_SIZE];
-  memset(buf, 0, MAX_RULE_SIZE);
-
-  if (m_ele->size < 0) { // if size < 0, then raw volume
-    snprintf(buf, sizeof(buf), "%s", m_ele->pathname);
-  } else {
-    snprintf(buf, sizeof(buf), "%s %d", m_ele->pathname, m_ele->size);
-  }
-
-  return ats_strdup(buf);
-}
-
-bool
-StorageObj::isValid()
-{
-  if (m_ele->cfg_ele.error != TS_ERR_OKAY) {
-    m_valid = false;
-  }
-
-  if (!(m_ele->pathname)) {
-    m_valid = false;
-  }
-
-  if (!m_valid) {
-    m_ele->cfg_ele.error = TS_ERR_INVALID_CONFIG_RULE;
-  }
-
-  return m_valid;
-}
-
-TSCfgEle *
-StorageObj::getCfgEleCopy()
-{
-  return (TSCfgEle *)copy_storage_ele(m_ele);
-}
-
-/*****************************************************************
- * CfgContext
- *****************************************************************/
-CfgContext::CfgContext(TSFileNameT filename)
-{
-  m_file = filename;
-  m_ver  = -1;
-}
-
-CfgContext::~CfgContext()
-{
-  CfgEleObj *ele;
-  while ((ele = m_eles.dequeue())) {
-    delete ele;
-  }
-}
-
-TSMgmtError
-CfgContext::addEle(CfgEleObj *ele)
-{
-  ink_assert(ele != nullptr);
-  m_eles.enqueue(ele); // enqueue CfgEleObj at end of Queue
-  return TS_ERR_OKAY;
-}
-
-TSMgmtError
-CfgContext::removeEle(CfgEleObj *ele)
-{
-  ink_assert(ele != nullptr);
-  m_eles.remove(ele);
-  delete ele;
-
-  return TS_ERR_OKAY;
-}
-
-TSMgmtError
-CfgContext::insertEle(CfgEleObj *ele, CfgEleObj *after_ele)
-{
-  ink_assert(ele != nullptr && after_ele != nullptr);
-  m_eles.insert(ele, after_ele);
-
-  return TS_ERR_OKAY;
-}
-
-// insert Ele at front of the Queue
-TSMgmtError
-CfgContext::pushEle(CfgEleObj *ele)
-{
-  ink_assert(ele != nullptr);
-  m_eles.push(ele);
-
-  return TS_ERR_OKAY;
-}
diff --git a/mgmt/api/CfgContextImpl.h b/mgmt/api/CfgContextImpl.h
deleted file mode 100644
index 93b1e09..0000000
--- a/mgmt/api/CfgContextImpl.h
+++ /dev/null
@@ -1,435 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/***********************************************************************
- * CfgContext.h
- *
- * Describes the CfgContext class. CfgContext has file name and set of Ele's
- ***********************************************************************/
-
-#ifndef _CFG_CONTEXT_IMPL_H_
-#define _CFG_CONTEXT_IMPL_H_
-
-#include "mgmtapi.h"
-#include "CfgContextDefs.h"
-#include "GenericParser.h" /* use for TokenList */
-
-#include "ts/List.h"
-
-/**********************************************************************
- * CfgEleObj
- *
- * abstract base class; basic element in a CfgContext
- **********************************************************************/
-class CfgEleObj
-{
-public:
-  /* Each subclass must provide two constructors:
-     using INK<file>Ele or a TokenList */
-
-  virtual ~CfgEleObj() {} // virtual destructor
-  virtual char *formatEleToRule() = 0;
-  virtual bool isValid()          = 0;
-
-  /* these are implemented as inline functons by subclasses */
-  virtual TSCfgEle *getCfgEle()     = 0; /* returns actual ele */
-  virtual TSCfgEle *getCfgEleCopy() = 0; /* returns copy of ele */
-  virtual TSRuleTypeT getRuleType() = 0;
-
-  LINK(CfgEleObj, link);
-
-protected:
-  bool m_valid; /* stores if Ele has valid fields; by default true */
-};
-
-/********************************************************************
- * Ele Subclasses
- ********************************************************************/
-/* Each subclass can be constructed from a TokenList (creates the Ele)
- * or from passing in the Ele itself. Typically, objects with dynamically
- * allocated memory should also have a copy constructor and an
- * overloaded assignment operator. However, sine these subclasses function
- * more as wrappers for the C based Ele structs, we only require that
- * each subclass implements a function which returns a dynamic copy of
- * its m_ele data member
- */
-
-/* CommentEle */
-class CommentObj : public CfgEleObj
-{
-public:
-  CommentObj(char *comment);
-  ~CommentObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  INKCommentEle *m_ele;
-};
-
-/* cache.config ***************************************************/
-class CacheObj : public CfgEleObj
-{
-public:
-  CacheObj(TSCacheEle *ele);
-  CacheObj(TokenList *tokens); // creates the ele
-  ~CacheObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSCacheEle *m_ele;
-};
-
-/* congestion.config ***************************************************/
-class CongestionObj : public CfgEleObj
-{
-public:
-  CongestionObj(TSCongestionEle *ele);
-  CongestionObj(TokenList *tokens); // creates the ele
-  ~CongestionObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSCongestionEle *m_ele;
-};
-
-/* hosting.config ************************************************/
-class HostingObj : public CfgEleObj
-{
-public:
-  HostingObj(TSHostingEle *ele);
-  HostingObj(TokenList *tokens); // creates the ele
-  ~HostingObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSHostingEle *m_ele;
-};
-
-/* ip_allow.config    *********************************************/
-class IpAllowObj : public CfgEleObj
-{
-public:
-  IpAllowObj(TSIpAllowEle *ele);
-  IpAllowObj(TokenList *tokens);
-  ~IpAllowObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSIpAllowEle *m_ele;
-};
-
-/* parent.config       *******************************************/
-class ParentProxyObj : public CfgEleObj
-{
-public:
-  ParentProxyObj(TSParentProxyEle *ele);
-  ParentProxyObj(TokenList *tokens);
-  ~ParentProxyObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSParentProxyEle *m_ele;
-};
-
-/* volume.config    *******************************************/
-class VolumeObj : public CfgEleObj
-{
-public:
-  VolumeObj(TSVolumeEle *ele);
-  VolumeObj(TokenList *tokens);
-  ~VolumeObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSVolumeEle *m_ele;
-};
-
-/* plugin.config    *******************************************/
-class PluginObj : public CfgEleObj
-{
-public:
-  PluginObj(TSPluginEle *ele);
-  PluginObj(TokenList *tokens);
-  ~PluginObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSPluginEle *m_ele;
-};
-
-/* remap.config        *******************************************/
-class RemapObj : public CfgEleObj
-{
-public:
-  RemapObj(TSRemapEle *ele);
-  RemapObj(TokenList *tokens);
-  ~RemapObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSRemapEle *m_ele;
-};
-
-/* socks.config        *******************************************/
-class SocksObj : public CfgEleObj
-{
-public:
-  SocksObj(TSSocksEle *ele);
-  SocksObj(TokenList *tokens);
-  ~SocksObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSSocksEle *m_ele;
-};
-
-/* splitdns.config     *******************************************/
-class SplitDnsObj : public CfgEleObj
-{
-public:
-  SplitDnsObj(TSSplitDnsEle *ele);
-  SplitDnsObj(TokenList *tokens);
-  ~SplitDnsObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSSplitDnsEle *m_ele;
-};
-
-/* storage.config      *******************************************/
-class StorageObj : public CfgEleObj
-{
-public:
-  StorageObj(TSStorageEle *ele);
-  StorageObj(TokenList *tokens);
-  ~StorageObj();
-
-  virtual char *formatEleToRule();
-  virtual bool isValid();
-  virtual TSCfgEle *getCfgEleCopy();
-  virtual TSCfgEle *
-  getCfgEle()
-  {
-    return (TSCfgEle *)m_ele;
-  }
-  virtual TSRuleTypeT
-  getRuleType()
-  {
-    return m_ele->cfg_ele.type;
-  }
-
-private:
-  TSStorageEle *m_ele;
-};
-
-/*****************************************************************
- * CfgContext
- *****************************************************************/
-class CfgContext
-{
-public:
-  CfgContext(TSFileNameT filename);
-  ~CfgContext();
-
-  TSFileNameT
-  getFilename()
-  {
-    return m_file;
-  }
-  int
-  getVersion()
-  {
-    return m_ver;
-  }
-  void
-  setVersion(int ver)
-  {
-    m_ver = ver;
-  }
-
-  CfgEleObj *
-  first()
-  {
-    return m_eles.head;
-  }
-  CfgEleObj *
-  next(CfgEleObj *here)
-  {
-    return (here->link).next;
-  }
-
-  TSMgmtError addEle(CfgEleObj *ele); /* enqueue EleObj at end of Queue */
-  TSMgmtError removeEle(CfgEleObj *ele);
-  TSMgmtError insertEle(CfgEleObj *ele, CfgEleObj *after_ele);
-  TSMgmtError pushEle(CfgEleObj *ele);
-
-private:
-  TSFileNameT m_file;
-  int m_ver; /* version of the file read */
-  Queue<CfgEleObj> m_eles;
-};
-
-#endif
diff --git a/mgmt/api/CfgContextUtils.cc b/mgmt/api/CfgContextUtils.cc
deleted file mode 100644
index 54d3ca1..0000000
--- a/mgmt/api/CfgContextUtils.cc
+++ /dev/null
@@ -1,2756 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#include "ts/ink_platform.h"
-#include "ts/ParseRules.h"
-#include "ts/ink_string.h"
-#include "CfgContextUtils.h"
-#include "ts/Tokenizer.h"
-/***************************************************************************
- * Conversion Functions
- ***************************************************************************/
-/* ---------------------------------------------------------------------------
- * string_to_ip_addr_ele
- * ---------------------------------------------------------------------------
- * Converts ip address string format to an TSIpAddrEle.
- * Determines if single/range, cidr/not-cidr based on format of string.
- *
- * if SINGLE =  ip_a/cidr_a
- * if RANGE =   ip_a/cidr_a-ip_b/cidr_b (possible to have spaces next to dash)
- * Returns NULL if invalid ele (eg. if ip's are invalid)
- */
-TSIpAddrEle *
-string_to_ip_addr_ele(const char *str)
-{
-  Tokenizer range_tokens(RANGE_DELIMITER_STR);
-  Tokenizer cidr_tokens(CIDR_DELIMITER_STR);
-  Tokenizer cidr_tokens2(CIDR_DELIMITER_STR);
-  TSIpAddrEle *ele;
-  const char *const_ip_a, *const_ip_b;
-  char *ip_a = nullptr, *ip_b = nullptr;
-  int numTokens = 0;
-  char buf[MAX_BUF_SIZE];
-
-  // ink_assert(str);
-  if (!str) {
-    return nullptr;
-  }
-
-  ele = TSIpAddrEleCreate();
-  if (!ele) {
-    return nullptr;
-  }
-
-  memset(buf, 0, MAX_BUF_SIZE);
-  snprintf(buf, sizeof(buf), "%s", str);
-
-  // determine if range or single type
-  range_tokens.Initialize(buf, COPY_TOKS);
-  numTokens = range_tokens.count();
-  if (numTokens == 1) { // SINGLE TYPE
-    ele->type = TS_IP_SINGLE;
-    // determine if cidr type
-    cidr_tokens.Initialize(buf, COPY_TOKS);
-    numTokens = cidr_tokens.count();
-    if (numTokens == 1) { // Single, NON-CIDR TYPE
-      ele->ip_a = string_to_ip_addr(str);
-    } else { // Single, CIDR TYPE
-      if (!isNumber(cidr_tokens[1])) {
-        goto Lerror;
-      }
-      ele->ip_a   = string_to_ip_addr(cidr_tokens[0]);
-      ele->cidr_a = ink_atoi(cidr_tokens[1]);
-    }
-    if (!ele->ip_a) { // ERROR: Invalid ip
-      goto Lerror;
-    }
-  } else { // RANGE TYPE
-    ele->type  = TS_IP_RANGE;
-    const_ip_a = range_tokens[0];
-    const_ip_b = range_tokens[1];
-    ip_a       = ats_strdup(const_ip_a);
-    ip_b       = ats_strdup(const_ip_b);
-
-    // determine if ip's are cidr type; only test if ip_a is cidr, assume both are same
-    cidr_tokens.Initialize(ip_a, COPY_TOKS);
-    numTokens = cidr_tokens.count();
-    if (numTokens == 1) { // Range, NON-CIDR TYPE
-      ele->ip_a = string_to_ip_addr(ip_a);
-      ele->ip_b = string_to_ip_addr(ip_b);
-    } else { // Range, CIDR TYPE */
-      ele->ip_a   = string_to_ip_addr(cidr_tokens[0]);
-      ele->cidr_a = ink_atoi(cidr_tokens[1]);
-      cidr_tokens2.Initialize(ip_b, COPY_TOKS);
-      ele->ip_b   = string_to_ip_addr(cidr_tokens2[0]);
-      ele->cidr_b = ink_atoi(cidr_tokens2[1]);
-      if (!isNumber(cidr_tokens[1]) || !isNumber(cidr_tokens2[1])) {
-        goto Lerror;
-      }
-    }
-    if (!ele->ip_a || !ele->ip_b) { // ERROR: invalid IP
-      goto Lerror;
-    }
-  }
-
-  ats_free(ip_a);
-  ats_free(ip_b);
-  return ele;
-
-Lerror:
-  ats_free(ip_a);
-  ats_free(ip_b);
-  TSIpAddrEleDestroy(ele);
-
-  return nullptr;
-}
-
-/* ----------------------------------------------------------------------------
- * ip_addr_ele_to_string
- * ---------------------------------------------------------------------------
- * Converts an  TSIpAddrEle to following string format:
- * Output:
- * if SINGLE =             ip_a/cidr_a
- * if RANGE =              ip_a/cidr_a-ip_b/cidr_b
- * If there is no cidr =   ip_a-ip_b
- * Returns NULL if invalid ele (needs to check that the ip's are valid too)
- */
-char *
-ip_addr_ele_to_string(TSIpAddrEle *ele)
-{
-  char buf[MAX_BUF_SIZE];
-  char *str, *ip_a_str = nullptr, *ip_b_str = nullptr;
-
-  // ink_assert(ele);
-  if (!ele) {
-    goto Lerror;
-  }
-
-  memset(buf, 0, MAX_BUF_SIZE);
-
-  if (ele->ip_a == TS_INVALID_IP_ADDR) {
-    goto Lerror; // invalid ip_addr
-  }
-
-  if (ele->type == TS_IP_SINGLE) { // SINGLE TYPE
-    ip_a_str = ip_addr_to_string(ele->ip_a);
-    if (!ip_a_str) { // ERROR: invalid IP address
-      goto Lerror;
-    }
-    if (ele->cidr_a != TS_INVALID_IP_CIDR) { // a cidr type
-      snprintf(buf, sizeof(buf), "%s%c%d", ip_a_str, CIDR_DELIMITER, ele->cidr_a);
-    } else { // not cidr type
-      snprintf(buf, sizeof(buf), "%s", ip_a_str);
-    }
-
-    ats_free(ip_a_str);
-    str = ats_strdup(buf);
-
-    return str;
-  } else if (ele->type == TS_IP_RANGE) { // RANGE TYPE
-    ip_a_str = ip_addr_to_string(ele->ip_a);
-    ip_b_str = ip_addr_to_string(ele->ip_b);
-
-    if (!ip_a_str || !ip_b_str) {
-      goto Lerror;
-    }
-
-    if (ele->cidr_a != TS_INVALID_IP_CIDR && ele->cidr_b != TS_INVALID_IP_CIDR) {
-      // a cidr type
-      snprintf(buf, sizeof(buf), "%s%c%d%c%s%c%d", ip_a_str, CIDR_DELIMITER, ele->cidr_a, RANGE_DELIMITER, ip_b_str, CIDR_DELIMITER,
-               ele->cidr_b);
-    } else { // not cidr type
-      snprintf(buf, sizeof(buf), "%s%c%s", ip_a_str, RANGE_DELIMITER, ip_b_str);
-    }
-    ats_free(ip_a_str);
-    ats_free(ip_b_str);
-    str = ats_strdup(buf);
-
-    return str;
-  }
-
-Lerror:
-  ats_free(ip_a_str);
-  ats_free(ip_b_str);
-  return nullptr;
-}
-
-/* ----------------------------------------------------------------------------
- * ip_addr_to_string
- * ---------------------------------------------------------------------------
- * Converts an  TSIpAddr (char*) to dotted decimal string notation. Allocates
- * memory for the new TSIpAddr.
- * Returns NULL if invalid TSIpAddr
- */
-char *
-ip_addr_to_string(TSIpAddr ip)
-{
-  // ink_assert(ip != TS_INVALID_IP_ADDR);
-  if (ip == TS_INVALID_IP_ADDR) {
-    return nullptr;
-  }
-  if (!ccu_checkIpAddr(ip)) {
-    return nullptr;
-  }
-  return ats_strdup((char *)ip);
-}
-
-/* ----------------------------------------------------------------------------
- * string_to_ip_addr
- * ---------------------------------------------------------------------------
- * Converts an ip address in dotted-decimal string format into a string;
- * allocates memory for string. If IP is invalid, then returns TS_INVALID_IP_ADDR.
- */
-TSIpAddr
-string_to_ip_addr(const char *str)
-{
-  // ink_assert(str);
-  if (!ccu_checkIpAddr(str)) {
-    return TS_INVALID_IP_ADDR;
-  }
-
-  char *copy;
-  copy = ats_strdup(str);
-  return (TSIpAddr)copy;
-}
-
-/* ---------------------------------------------------------------
- * ip_addr_list_to_string
- * ---------------------------------------------------------------
- * converts TSIpAddrList <==> ip_addr1<delim>ip_addr2<delim>ip_addr3, ...
- * Returns TSIpAddrList with original elements.
- * If encounters invalid TSIpAddrEle, returns NULL.
- */
-char *
-ip_addr_list_to_string(IpAddrList *list, const char *delimiter)
-{
-  char buf[MAX_BUF_SIZE];
-  int buf_pos = 0;
-  TSIpAddrEle *ip_ele;
-  char *ip_str, *new_str;
-  int num, i;
-
-  // ink_assert(list && delimiter);
-  if (!list || !delimiter) {
-    return nullptr;
-  }
-
-  num = queue_len((LLQ *)list);
-
-  for (i = 0; i < num; i++) {
-    ip_ele = (TSIpAddrEle *)dequeue((LLQ *)list); // read next ip
-    ip_str = ip_addr_ele_to_string(ip_ele);
-
-    if (!ip_str) {
-      enqueue((LLQ *)list, ip_ele);
-      return nullptr;
-    }
-    if (i == num - 1) {
-      snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%s", ip_str);
-    } else {
-      snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%s%s", ip_str, delimiter);
-    }
-    buf_pos = strlen(buf);
-    ats_free(ip_str);
-
-    enqueue((LLQ *)list, ip_ele); // return ip to list
-  }
-
-  new_str = ats_strdup(buf);
-
-  return new_str;
-}
-
-/* ---------------------------------------------------------------
- * string_to_ip_addr_list
- * ---------------------------------------------------------------
- * Converts ip_addr1<delim>ip_addr2<delim>ip_addr3, ...==> TSIpAddrList
- * Does checking to make sure that each ip_addr is valid; if encounter
- * an invalid ip addr, then returns TS_INVALID_LIST
- */
-TSIpAddrList
-string_to_ip_addr_list(const char *str_list, const char *delimiter)
-{
-  Tokenizer tokens(delimiter);
-  int numToks, i;
-  TSIpAddrList ip_list;
-  TSIpAddrEle *ip_ele;
-
-  // ink_assert(str_list && delimiter);
-  if (!str_list || !delimiter) {
-    return TS_INVALID_LIST;
-  }
-
-  tokens.Initialize(str_list);
-  numToks = tokens.count();
-
-  ip_list = TSIpAddrListCreate();
-
-  for (i = 0; i < numToks; i++) {
-    ip_ele = string_to_ip_addr_ele(tokens[i]);
-    if (ip_ele) {
-      TSIpAddrListEnqueue(ip_list, ip_ele);
-    } else { // Error: invalid IP
-      TSIpAddrListDestroy(ip_list);
-      return TS_INVALID_LIST;
-    }
-  }
-  return ip_list;
-}
-
-/* ---------------------------------------------------------------
- * port_list_to_string (REPLACE BY sprintf_ports)
- * ---------------------------------------------------------------
- * Purpose: prints a list of ports in a PortList into string delimited format
- * Input:  ports - the queue of TSPortEle *'s.
- * Output: port_0<delim>port_1<delim>...<delim>port_n
- *         (each port can refer to a port range, eg 80-90)
- *         Return NULL if encounter invalid port or empty port list
- */
-char *
-port_list_to_string(PortList *ports, const char *delimiter)
-{
-  int num_ports;
-  size_t pos = 0;
-  int i, psize;
-  TSPortEle *port_ele;
-  char buf[MAX_BUF_SIZE];
-  char *str;
-
-  // ink_assert(ports && delimiter);
-  if (!ports || !delimiter) {
-    goto Lerror;
-  }
-
-  num_ports = queue_len((LLQ *)ports);
-  if (num_ports <= 0) { // no ports specified
-    goto Lerror;
-  }
-  // now list all the ports, including ranges
-  for (i = 0; i < num_ports; i++) {
-    port_ele = (TSPortEle *)dequeue((LLQ *)ports);
-    if (!ccu_checkPortEle(port_ele)) {
-      enqueue((LLQ *)ports, port_ele); // return TSPortEle to list
-      goto Lerror;
-    }
-
-    if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "%d", port_ele->port_a)) > 0) {
-      pos += psize;
-    }
-    if (port_ele->port_b != TS_INVALID_PORT) { //. is this a range
-      // add in range delimiter & end of range
-      if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "%c%d", RANGE_DELIMITER, port_ele->port_b)) > 0) {
-        pos += psize;
-      }
-    }
-
-    if (i != num_ports - 1) {
-      if (pos < sizeof(buf) && (psize = snprintf(buf + pos, sizeof(buf) - pos, "%s", delimiter)) > 0) {
-        pos += psize;
-      }
-    }
-
-    enqueue((LLQ *)ports, port_ele); // return TSPortEle to list
-  }
-
-  str = ats_strdup(buf);
-  return str;
-
-Lerror:
-  return nullptr;
-}
-
-/* ---------------------------------------------------------------
- * string_to_port_list
- * ---------------------------------------------------------------
- * Converts port1<delim>port2<delim>port3, ...==> TSPortList
- * Does checking to make sure that each ip_addr is valid; if encounter
- * an invalid ip addr, then returns TST_INVALID_LIST
- */
-TSPortList
-string_to_port_list(const char *str_list, const char *delimiter)
-{
-  Tokenizer tokens(delimiter);
-  int numToks, i;
-  TSPortList port_list;
-  TSPortEle *port_ele;
-
-  // ink_assert(str_list && delimiter);
-  if (!str_list || !delimiter) {
-    return TS_INVALID_LIST;
-  }
-
-  tokens.Initialize(str_list);
-
-  numToks = tokens.count();
-
-  port_list = TSPortListCreate();
-
-  for (i = 0; i < numToks; i++) {
-    port_ele = string_to_port_ele(tokens[i]);
-    if (port_ele) {
-      TSPortListEnqueue(port_list, port_ele);
-    } else { // error - invalid port ele
-      TSPortListDestroy(port_list);
-      return TS_INVALID_LIST;
-    }
-  }
-
-  return port_list;
-}
-
-/* ---------------------------------------------------------------------------
- * port_ele_to_string
- * ---------------------------------------------------------------------------
- * Converts a port_ele to string format: <port_a> or <port_a>-<port_b>
- * Returns NULL if invalid PortEle
- */
-char *
-port_ele_to_string(TSPortEle *ele)
-{
-  char buf[MAX_BUF_SIZE];
-  char *str;
-
-  // ink_assert(ele);
-  if (!ele || !ccu_checkPortEle(ele)) {
-    return nullptr;
-  }
-
-  memset(buf, 0, MAX_BUF_SIZE);
-
-  if (ele->port_b == TS_INVALID_PORT) { // Not a range
-    snprintf(buf, sizeof(buf), "%d", ele->port_a);
-  } else {
-    snprintf(buf, sizeof(buf), "%d%c%d", ele->port_a, RANGE_DELIMITER, ele->port_b);
-  }
-
-  str = ats_strdup(buf);
-  return str;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_port_ele
- *---------------------------------------------------------------------------
- * Converts a string formatted port_ele into actual port_ele. Returns NULL if
- * invalid port(s). It is okay to have a single port specified.
- */
-TSPortEle *
-string_to_port_ele(const char *str)
-{
-  Tokenizer tokens(RANGE_DELIMITER_STR);
-  TSPortEle *ele;
-  char copy[MAX_BUF_SIZE];
-
-  // ink_assert(str);
-  if (!str) {
-    return nullptr;
-  }
-
-  memset(copy, 0, MAX_BUF_SIZE);
-  snprintf(copy, sizeof(copy), "%s", str);
-
-  ele = TSPortEleCreate();
-  if (tokens.Initialize(copy, COPY_TOKS) > 2) {
-    goto Lerror;
-  }
-  if (tokens.count() == 1) { // Not a Range of ports
-    if (!isNumber(str)) {
-      goto Lerror;
-    }
-    ele->port_a = ink_atoi(str);
-  } else {
-    if (!isNumber(tokens[0]) || !isNumber(tokens[1])) {
-      goto Lerror;
-    }
-    ele->port_a = ink_atoi(tokens[0]);
-    ele->port_b = ink_atoi(tokens[1]);
-  }
-
-  if (!ccu_checkPortEle(ele)) {
-    goto Lerror;
-  }
-
-  return ele;
-
-Lerror:
-  TSPortEleDestroy(ele);
-  return nullptr;
-}
-
-/*----------------------------------------------------------------------------
- * string_list_to_string
- *----------------------------------------------------------------------------
- * Converts str list to delimited string. Does not alter the
- * StringList passed in.
- * eg. str1<delim>str2<delim>str3...
- */
-char *
-string_list_to_string(TSStringList str_list, const char *delimiter)
-{
-  char buf[MAX_BUF_SIZE];
-  size_t buf_pos = 0;
-  int i, numElems, psize;
-  char *str_ele, *list_str;
-
-  // ink_assert(str_list != TS_INVALID_LIST && delimiter);
-  if (str_list == TS_INVALID_LIST || !delimiter) {
-    return nullptr;
-  }
-
-  memset(buf, 0, MAX_BUF_SIZE);
-  numElems = queue_len((LLQ *)str_list);
-  for (i = 0; i < numElems; i++) {
-    str_ele = (char *)dequeue((LLQ *)str_list);
-
-    if (i == numElems - 1) { // the last element shouldn't print comma
-      if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%s", str_ele)) > 0) {
-        buf_pos += psize;
-      }
-    } else {
-      if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%s%s", str_ele, delimiter)) > 0) {
-        buf_pos += psize;
-      }
-    }
-
-    enqueue((LLQ *)str_list, str_ele);
-  }
-
-  list_str = ats_strdup(buf);
-  return list_str;
-}
-
-/* ---------------------------------------------------------------
- * string_to_string_list
- * ---------------------------------------------------------------
- * Converts port1<delim>port2<delim>port3, ...==> TSStringList
- * Does checking to make sure that each ip_addr is valid; if encounter
- * an invalid ip addr, then returns INVALID_HANDLE
- */
-TSStringList
-string_to_string_list(const char *str, const char *delimiter)
-{
-  Tokenizer tokens(delimiter);
-  tokens.Initialize(str);
-
-  // ink_assert(str && delimiter);
-  if (!str || !delimiter) {
-    return TS_INVALID_LIST;
-  }
-
-  TSStringList str_list = TSStringListCreate();
-  for (unsigned i = 0; i < tokens.count(); i++) {
-    TSStringListEnqueue(str_list, ats_strdup(tokens[i]));
-  }
-
-  return str_list;
-}
-
-/*----------------------------------------------------------------------------
- * int_list_to_string
- *----------------------------------------------------------------------------
- * TSList(of char*'s only)==> elem1<delimiter>elem2<delimiter>elem3<delimiter>
- * Note: the string always ends with the delimiter
- * The list and its elements are not changed in any way.
- * Returns NULL if error.
- */
-char *
-int_list_to_string(TSIntList list, const char *delimiter)
-{
-  char buf[MAX_BUF_SIZE];
-  size_t buf_pos = 0;
-  int numElems, i, psize;
-  int *elem;
-
-  // ink_assert(list != TS_INVALID_LIST && delimiter);
-  if (list == TS_INVALID_LIST || !delimiter) {
-    return nullptr;
-  }
-
-  numElems = queue_len((LLQ *)list);
-
-  memset(buf, 0, MAX_BUF_SIZE);
-  for (i = 0; i < numElems; i++) {
-    elem = (int *)dequeue((LLQ *)list);
-    if (i == numElems - 1) {
-      if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%d", *elem)) > 0) {
-        buf_pos += psize;
-      }
-    } else {
-      if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%d%s", *elem, delimiter)) > 0) {
-        buf_pos += psize;
-      }
-    }
-    enqueue((LLQ *)list, elem);
-  }
-  return ats_strdup(buf);
-}
-
-/* ---------------------------------------------------------------
- * string_to_int_list
- * ---------------------------------------------------------------
- * converts domain1<delim>domain2<delim>domain3, ... ==> TSList
- * Does checking to make sure that each integer is valid; if encounter
- * an invalid int, then returns TS_INVALID_LIST
- */
-TSIntList
-string_to_int_list(const char *str_list, const char *delimiter)
-{
-  Tokenizer tokens(delimiter);
-  int numToks, i;
-  TSList list;
-  int *ele;
-
-  // ink_assert (str_list  && delimiter);
-  if (!str_list || !delimiter) {
-    return TS_INVALID_LIST;
-  }
-
-  tokens.Initialize(str_list);
-
-  numToks = tokens.count();
-  list    = TSIntListCreate();
-
-  for (i = 0; i < numToks; i++) {
-    if (!isNumber(tokens[i])) {
-      goto Lerror;
-    }
-    ele  = (int *)ats_malloc(sizeof(int));
-    *ele = ink_atoi(tokens[i]); // What about we can't convert? ERROR?
-    TSIntListEnqueue(list, ele);
-  }
-
-  return list;
-
-Lerror:
-  TSIntListDestroy(list);
-  return TS_INVALID_LIST;
-}
-
-/* ---------------------------------------------------------------
- * string_to_domain_list
- * ---------------------------------------------------------------
- * Converts domain1<delim>domain2<delim>domain3, ... ==> TSDomainList
- * Returns TS_INVALID_LIST if encounter an invalid Domain.
- */
-TSDomainList
-string_to_domain_list(const char *str_list, const char *delimiter)
-{
-  Tokenizer tokens(delimiter);
-  int numToks, i;
-  TSDomainList list;
-  TSDomain *ele;
-
-  // ink_assert(str_list && delimiter);
-  if (!str_list || !delimiter) {
-    return TS_INVALID_LIST;
-  }
-
-  tokens.Initialize(str_list);
-
-  numToks = tokens.count();
-
-  list = TSDomainListCreate();
-
-  for (i = 0; i < numToks; i++) {
-    ele = string_to_domain(tokens[i]);
-    if (ele) {
-      TSDomainListEnqueue(list, ele);
-    } else { // Error: invalid domain
-      TSDomainListDestroy(list);
-      return TS_INVALID_LIST;
-    }
-  }
-
-  return list;
-}
-
-/*----------------------------------------------------------------------------
- * domain_list_to_string
- *----------------------------------------------------------------------------
- * TSList(of char*'s only)==> elem1<delimiter>elem2<delimiter>elem3<delimiter>
- * Note: the string always ends with the delimiter
- * The list and its elements are not changed in any way.
- * Returns NULL if encounter an invalid TSDomain.
- */
-char *
-domain_list_to_string(TSDomainList list, const char *delimiter)
-{
-  char buf[MAX_BUF_SIZE];
-  size_t buf_pos = 0;
-  int numElems, i, psize;
-  char *list_str, *dom_str;
-  TSDomain *domain;
-
-  // ink_assert(list != TS_INVALID_LIST && delimiter);
-  if (list == TS_INVALID_LIST || !delimiter) {
-    return nullptr;
-  }
-
-  numElems = queue_len((LLQ *)list);
-
-  memset(buf, 0, MAX_BUF_SIZE);
-
-  for (i = 0; i < numElems; i++) {
-    domain = (TSDomain *)dequeue((LLQ *)list);
-
-    dom_str = domain_to_string(domain);
-    if (!dom_str) {
-      return nullptr;
-    }
-    if (i == numElems - 1) { // the last element shouldn't print comma
-      if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%s", dom_str)) > 0) {
-        buf_pos += psize;
-      }
-    } else {
-      if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%s%s", dom_str, delimiter)) > 0) {
-        buf_pos += psize;
-      }
-    }
-
-    ats_free(dom_str);
-    enqueue((LLQ *)list, domain);
-  }
-
-  list_str = ats_strdup(buf);
-  return list_str;
-}
-
-/*----------------------------------------------------------------------------
- * domain_to_string
- *----------------------------------------------------------------------------
- * Converts an TSDomain into string format, eg. www.host.com:8080
- * Return NULL if invalid TSDomain (eg. missing domain value).
- */
-char *
-domain_to_string(TSDomain *domain)
-{
-  char buf[MAX_BUF_SIZE];
-  char *dom_str;
-
-  // ink_assert(domain);
-  if (!domain) {
-    return nullptr;
-  }
-
-  if (domain->domain_val) {
-    if (domain->port != TS_INVALID_PORT) { // host:port
-      snprintf(buf, sizeof(buf), "%s:%d", domain->domain_val, domain->port);
-    } else { // host
-      snprintf(buf, sizeof(buf), "%s", domain->domain_val);
-    }
-  } else {
-    return nullptr; // invalid TSDomain
-  }
-
-  dom_str = ats_strdup(buf);
-
-  return dom_str;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_domain
- *----------------------------------------------------------------------------
- * Converts string format, eg. www.host.com:8080, into TSDomain.
- * The string can consist of just the host (which can be a name or an IP)
- * or of the host and port.
- * Return NULL if invalid TSDomain (eg. missing domain value).
- */
-TSDomain *
-string_to_domain(const char *str)
-{
-  TSDomain *dom;
-  char *token, *remain, *token_pos;
-  char buf[MAX_BUF_SIZE];
-
-  // ink_assert(str);
-  if (!str) {
-    return nullptr;
-  }
-
-  dom = TSDomainCreate();
-
-  // get hostname
-  ink_strlcpy(buf, str, sizeof(buf));
-  token  = strtok_r(buf, ":", &token_pos);
-  remain = token_pos;
-  if (token) {
-    dom->domain_val = ats_strdup(token);
-  } else {
-    goto Lerror;
-  }
-
-  // get port, if exists
-  if (remain) {
-    // check if the "remain" consist of all integers
-    if (!isNumber(remain)) {
-      goto Lerror;
-    }
-    dom->port = ink_atoi(remain);
-  } else {
-    dom->port = TS_INVALID_PORT;
-  }
-
-  return dom;
-
-Lerror:
-  TSDomainDestroy(dom);
-  return nullptr;
-}
-
-/* ---------------------------------------------------------------
- * pdest_sspec_to_string
- * ---------------------------------------------------------------
- * Converts the TSPrimeDest, primary dest, secondary spec struct
- * into string format: <pdT>:pdst_val:sspec1:sspec2:...:
- * <pdT> - dest_domain, dest_host, dest_ip, url_regex
- * even if sspec is missing the delimter is included; so if no
- * sspecs, then : ::: ::: will appear
- */
-char *
-pdest_sspec_to_string(TSPrimeDestT pd, char *pd_val, TSSspec *sspec)
-{
-  char buf[MAX_BUF_SIZE];
-  size_t buf_pos = 0;
-  int psize;
-  char hour_a[3], hour_b[3], min_a[3], min_b[3];
-  char *src_ip, *str;
-
-  // ink_assert(pd != TS_PD_UNDEFINED && pd_val && sspec);
-  if (pd == TS_PD_UNDEFINED || !pd_val || !sspec) {
-    return nullptr;
-  }
-
-  memset(buf, 0, MAX_BUF_SIZE);
-
-  do {
-    // push in primary destination
-    switch (pd) {
-    case TS_PD_DOMAIN:
-      psize = snprintf(buf, sizeof(buf), "dest_domain=%s ", pd_val);
-      break;
-    case TS_PD_HOST:
-      psize = snprintf(buf, sizeof(buf), "dest_host=%s ", pd_val);
-      break;
-    case TS_PD_IP:
-      psize = snprintf(buf, sizeof(buf), "dest_ip=%s ", pd_val);
-      break;
-    case TS_PD_URL_REGEX:
-      psize = snprintf(buf, sizeof(buf), "url_regex=%s ", pd_val);
-      break;
-    case TS_PD_URL:
-      psize = snprintf(buf, sizeof(buf), "url=%s ", pd_val);
-      break;
-    default:
-      psize = 0;
-      // Handled here:
-      // TS_PD_UNDEFINED
-      break;
-    }
-    if (psize > 0) {
-      buf_pos += psize;
-    }
-    if (buf_pos + 1 >= sizeof(buf)) {
-      break;
-    }
-
-    // if there are secondary specifiers
-    if (sspec) {
-      // convert the time into a string, eg. 8 to "08"
-      if (sspec->time.hour_a == 0) {
-        snprintf(hour_a, sizeof(hour_a), "00");
-      } else {
-        if (sspec->time.hour_a < 10) {
-          snprintf(hour_a, sizeof(hour_a), "0%d", sspec->time.hour_a);
-        } else {
-          snprintf(hour_a, sizeof(hour_a), "%d", sspec->time.hour_a);
-        }
-      }
-      if (sspec->time.min_a == 0) {
-        snprintf(min_a, sizeof(min_a), "00");
-      } else {
-        if (sspec->time.min_a < 10) {
-          snprintf(min_a, sizeof(min_a), "0%d", sspec->time.min_a);
-        } else {
-          snprintf(min_a, sizeof(min_a), "%d", sspec->time.min_a);
-        }
-      }
-      if (sspec->time.hour_b == 0) {
-        snprintf(hour_b, sizeof(hour_b), "00");
-      } else {
-        if (sspec->time.hour_b < 10) {
-          snprintf(hour_b, sizeof(hour_b), "0%d", sspec->time.hour_b);
-        } else {
-          snprintf(hour_b, sizeof(hour_b), "%d", sspec->time.hour_b);
-        }
-      }
-      if (sspec->time.min_b == 0) {
-        snprintf(min_b, sizeof(min_b), "00");
-      } else {
-        if (sspec->time.min_b < 10) {
-          snprintf(min_b, sizeof(min_b), "0%d", sspec->time.min_b);
-        } else {
-          snprintf(min_b, sizeof(min_b), "%d", sspec->time.min_b);
-        }
-      }
-
-      if (!(sspec->time.hour_a == 0 && sspec->time.min_a == 0 && sspec->time.hour_b == 0 && sspec->time.min_b == 0)) {
-        // time is specified
-        if (buf_pos < sizeof(buf) &&
-            (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "time=%s:%s-%s:%s ", hour_a, min_a, hour_b, min_b)) > 0) {
-          buf_pos += psize;
-        }
-      }
-      // src_ip
-      if (sspec->src_ip != TS_INVALID_IP_ADDR) {
-        src_ip = ip_addr_to_string(sspec->src_ip);
-        if (!src_ip) {
-          return nullptr;
-        }
-        if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "src_ip=%s ", src_ip)) > 0) {
-          buf_pos += psize;
-        }
-        ats_free(src_ip);
-      }
-      // prefix?
-      if (sspec->prefix) {
-        if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "prefix=%s ", sspec->prefix)) > 0) {
-          buf_pos += psize;
-        }
-      }
-      // suffix?
-      if (sspec->suffix) {
-        if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "suffix=%s ", sspec->suffix)) > 0) {
-          buf_pos += psize;
-        }
-      }
-      // port?
-      if (sspec->port) {
-        char *portStr = port_ele_to_string(sspec->port);
-        if (portStr) {
-          if (buf_pos < sizeof(buf) && (psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "port=%s ", portStr)) > 0) {
-            buf_pos += psize;
-          }
-          ats_free(portStr);
-        }
-      }
-      // method
-      if (buf_pos < sizeof(buf)) {
-        switch (sspec->method) {
-        case TS_METHOD_GET:
-          psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "method=get ");
-          break;
-        case TS_METHOD_POST:
-          psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "method=post ");
-          break;
-        case TS_METHOD_PUT:
-          psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "method=put ");
-          break;
-        case TS_METHOD_TRACE:
-          psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "method=trace ");
-          break;
-        case TS_METHOD_PUSH:
-          psize = snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "method=PUSH ");
-          break;
-        default:
-          psize = 0;
-          break;
-        }
-        if (psize > 0) {
-          buf_pos += psize;
-        }
-      } else {
-        break;
-      }
-
-      // scheme
-      if (buf_pos < sizeof(buf)) {
-        switch (sspec->scheme) {
-        case TS_SCHEME_NONE:
-          snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "%c", DELIMITER);
-          break;
-        case TS_SCHEME_HTTP:
-          snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "scheme=http ");
-          break;
-        case TS_SCHEME_HTTPS:
-          snprintf(buf + buf_pos, sizeof(buf) - buf_pos, "scheme=https ");
-          break;
-        default:
-          break;
-        }
-      }
-    }
-  } while (false);
-
-  str = ats_strdup(buf);
-  return str;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_pdss_format
- *----------------------------------------------------------------------------
- * <pd_type>#<pd_value>#<sspecs> --> TSPdSsFormat
- * NOTE that the entire data line, including the action type is being passed in
- */
-TSMgmtError
-string_to_pdss_format(const char *str, TSPdSsFormat *pdss)
-{
-  Tokenizer tokens(DELIMITER_STR);
-  Tokenizer time_tokens(":-");
-  char copy[MAX_BUF_SIZE];
-
-  // ink_assert(str && pdss);
-  if (!str || !pdss) {
-    return TS_ERR_PARAMS;
-  }
-
-  memset(copy, 0, MAX_BUF_SIZE);
-  snprintf(copy, sizeof(copy), "%s", str);
-
-  tokens.Initialize(copy, ALLOW_EMPTY_TOKS);
-
-  // pd type
-  if (strcmp(tokens[1], "dest_domain") == 0) {
-    pdss->pd_type = TS_PD_DOMAIN;
-  } else if (strcmp(tokens[1], "dest_host") == 0) {
-    pdss->pd_type = TS_PD_HOST;
-  } else if (strcmp(tokens[1], "dest_ip") == 0) {
-    pdss->pd_type = TS_PD_IP;
-  } else if (strcmp(tokens[1], "url_regex") == 0) {
-    pdss->pd_type = TS_PD_URL_REGEX;
-  } else if (strcmp(tokens[1], "url") == 0) {
-    pdss->pd_type = TS_PD_URL;
-  } else {
-    goto Lerror;
-  }
-
-  // pd_value
-  if (!tokens[2]) {
-    goto Lerror;
-  }
-  pdss->pd_val = ats_strdup(tokens[2]);
-
-  // check secondary specifiers; exists only if not empty string
-  // time
-  if (strlen(tokens[3]) > 0) {
-    if (string_to_time_struct(tokens[3], &(pdss->sec_spec)) != TS_ERR_OKAY) {
-      goto Lerror;
-    }
-  }
-  // src_ip
-  if (strlen(tokens[4]) > 0) {
-    pdss->sec_spec.src_ip = ats_strdup(tokens[4]);
-  }
-  // prefix
-  if (strlen(tokens[5]) > 0) {
-    pdss->sec_spec.prefix = ats_strdup(tokens[5]);
-  }
-  // suffix
-  if (strlen(tokens[6]) > 0) {
-    pdss->sec_spec.suffix = ats_strdup(tokens[6]);
-  }
-  // port
-  if (strlen(tokens[7]) > 0) { // no port
-    pdss->sec_spec.port = string_to_port_ele(tokens[7]);
-  }
-  // method
-  if (strlen(tokens[8]) > 0) {
-    pdss->sec_spec.method = string_to_method_type(tokens[8]);
-  }
-  // scheme
-  if (strlen(tokens[9]) > 0) {
-    pdss->sec_spec.scheme = string_to_scheme_type(tokens[9]);
-  }
-  return TS_ERR_OKAY;
-
-Lerror:
-  return TS_ERR_FAIL;
-}
-
-/*----------------------------------------------------------------------------
- * hms_time_to_string
- *----------------------------------------------------------------------------
- * Converts an TSHmsTime structure to string format: eg. 5h15m20s
- */
-char *
-hms_time_to_string(TSHmsTime time)
-{
-  char buf[MAX_BUF_SIZE];
-  size_t s;
-
-  s = snprintf(buf, sizeof(buf), "%dd%dh%dm%ds", time.d, time.h, time.m, time.s);
-
-  if ((s > 0) && (s < sizeof(buf))) {
-    return ats_strdup(buf);
-  } else {
-    return nullptr;
-  }
-}
-
-/*----------------------------------------------------------------------------
- * string_to_hms_time
- *----------------------------------------------------------------------------
- * Convert ?d?h?m?s ==> TSHmsTime
- * Returns TS_ERR_FAIL if invalid hms format, eg. if there are invalid
- * characters, eg. "10xh", "10h15m30s34", or repeated values, eg. "10h15h"
- */
-TSMgmtError
-string_to_hms_time(const char *str, TSHmsTime *time)
-{
-  int i, pos = 0;
-  int len;
-  char unit[10];
-  bool valid = false;
-
-  // ink_assert(str && time);
-  if (!str || !time) {
-    return TS_ERR_PARAMS;
-  }
-
-  memset(unit, 0, 10);
-  len     = strlen(str);
-  time->d = time->h = time->m = time->s = 0;
-  for (i = 0; i < len; i++) {
-    valid = false;
-    if ((*str) == 'd') {
-      if (time->d > 0 || !isNumber(unit)) {
-        goto Lerror;
-      }
-      time->d = ink_atoi(unit);
-      memset(unit, 0, 10);
-      pos   = 0;
-      valid = true;
-    } else if ((*str) == 'h') {
-      if (time->h > 0 || !isNumber(unit)) {
-        goto Lerror;
-      }
-      time->h = ink_atoi(unit);
-      memset(unit, 0, 10);
-      pos   = 0;
-      valid = true;
-    } else if ((*str) == 'm') {
-      if (time->m > 0 || !isNumber(unit)) {
-        goto Lerror;
-      }
-      time->m = ink_atoi(unit);
-      memset(unit, 0, 10);
-      pos   = 0;
-      valid = true;
-    } else if ((*str) == 's') {
-      if (time->s > 0 || !isNumber(unit)) {
-        goto Lerror;
-      }
-      time->s = ink_atoi(unit);
-      memset(unit, 0, 10);
-      pos   = 0;
-      valid = true;
-    } else {
-      unit[pos] = *str;
-      pos++;
-    }
-
-    ++str;
-  }
-
-  if (!valid) {
-    goto Lerror;
-  }
-  return TS_ERR_OKAY;
-
-Lerror:
-  return TS_ERR_FAIL;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_time_struct
- *----------------------------------------------------------------------------
- * convert string "09:00-23:00" to time struct
- *  struct {
- *   int hour_a;
- *   int min_a;
- *   int hour_b;
- *   int min_b;
- *  } time
- * Returns TS_ERR_FAIL if invalid time string.
- */
-TSMgmtError
-string_to_time_struct(const char *str, TSSspec *sspec)
-{
-  Tokenizer time_tokens(":-");
-
-  if (time_tokens.Initialize(str) != 4) {
-    return TS_ERR_FAIL;
-  }
-
-  if (strcmp(time_tokens[0], "00") == 0) {
-    sspec->time.hour_a = 0;
-  } else {
-    if (!isNumber(time_tokens[0])) {
-      goto Lerror;
-    }
-    sspec->time.hour_a = ink_atoi(time_tokens[0]);
-  }
-  if (strcmp(time_tokens[1], "00") == 0) {
-    sspec->time.min_a = 0;
-  } else {
-    if (!isNumber(time_tokens[1])) {
-      goto Lerror;
-    }
-    sspec->time.min_a = ink_atoi(time_tokens[1]);
-  }
-  if (strcmp(time_tokens[2], "00") == 0) {
-    sspec->time.hour_b = 0;
-  } else {
-    if (!isNumber(time_tokens[2])) {
-      goto Lerror;
-    }
-    sspec->time.hour_b = ink_atoi(time_tokens[2]);
-  }
-  if (strcmp(time_tokens[3], "00") == 0) {
-    sspec->time.min_b = 0;
-  } else {
-    if (!isNumber(time_tokens[3])) {
-      goto Lerror;
-    }
-    sspec->time.min_b = ink_atoi(time_tokens[3]);
-  }
-
-  // check valid time values
-  if (!ccu_checkTimePeriod(sspec)) {
-    goto Lerror;
-  }
-
-  return TS_ERR_OKAY;
-
-Lerror:
-  return TS_ERR_FAIL;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_header_type
- *----------------------------------------------------------------------------
- * string ==> TSHdrT
- */
-TSHdrT
-string_to_header_type(const char *str)
-{
-  // ink_assert(str);
-  if (!str) {
-    return TS_HDR_UNDEFINED;
-  }
-
-  if (strcmp(str, "date") == 0) {
-    return TS_HDR_DATE;
-  } else if (strcmp(str, "host") == 0) {
-    return TS_HDR_HOST;
-  } else if (strcmp(str, "cookie") == 0) {
-    return TS_HDR_COOKIE;
-  } else if (strcmp(str, "client_ip") == 0) {
-    return TS_HDR_CLIENT_IP;
-  }
-
-  return TS_HDR_UNDEFINED;
-}
-
-char *
-header_type_to_string(TSHdrT hdr)
-{
-  // header type
-  switch (hdr) {
-  case TS_HDR_DATE:
-    return ats_strdup("date");
-  case TS_HDR_HOST:
-    return ats_strdup("host");
-  case TS_HDR_COOKIE:
-    return ats_strdup("cookie");
-  case TS_HDR_CLIENT_IP:
-    return ats_strdup("client_ip");
-  default:
-    break;
-  }
-
-  return nullptr;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_scheme_type
- *----------------------------------------------------------------------------
- * converts scheme string into a TSSchemeT type
- */
-TSSchemeT
-string_to_scheme_type(const char *scheme)
-{
-  if (strcasecmp(scheme, "http") == 0) {
-    return TS_SCHEME_HTTP;
-  } else if (strcasecmp(scheme, "https") == 0) {
-    return TS_SCHEME_HTTPS;
-  }
-  return TS_SCHEME_UNDEFINED;
-}
-
-char *
-scheme_type_to_string(TSSchemeT scheme)
-{
-  switch (scheme) {
-  case TS_SCHEME_HTTP:
-    return ats_strdup("http");
-  case TS_SCHEME_HTTPS:
-    return ats_strdup("https");
-  default:
-    break;
-  }
-
-  return nullptr;
-}
-
-/*----------------------------------------------------------------------------
- * string_to_method_type
- *----------------------------------------------------------------------------
- * converts scheme string into a TSSchemeT type
- */
-TSMethodT
-string_to_method_type(const char *method)
-{
-  if (strcasecmp(method, "get") == 0) {
-    return TS_METHOD_GET;
-  } else if (strcasecmp(method, "post") == 0) {
-    return TS_METHOD_POST;
-  } else if (strcasecmp(method, "put") == 0) {
-    return TS_METHOD_PUT;
-  } else if (strcasecmp(method, "trace") == 0) {
-    return TS_METHOD_TRACE;
-  } else if (strcasecmp(method, "push") == 0) { // could be "push" or "PUSH"
-    return TS_METHOD_PUSH;
-  }
-
-  return TS_METHOD_UNDEFINED;
-}
-
-char *
-method_type_to_string(TSMethodT method)
-{
-  switch (method) {
-  case TS_METHOD_GET:
-    return ats_strdup("get");
-  case TS_METHOD_POST:
-    return ats_strdup("post");
-  case TS_METHOD_PUT:
-    return ats_strdup("put");
-  case TS_METHOD_TRACE:
-    return ats_strdup("trace");
-  case TS_METHOD_PUSH:
-    return ats_strdup("push");
-  default:
-    break;
-  }
-
-  return nullptr;
-}
-
-/*----------------------------------------------------------------------------
- * connect_type_to_string
- *----------------------------------------------------------------------------
- */
-char *
-connect_type_to_string(TSConnectT conn)
-{
-  switch (conn) {
-  case TS_CON_UDP:
-    return ats_strdup("udp");
-  case TS_CON_TCP:
-    return ats_strdup("tcp");
-  default:
-    break;
-  }
-  return nullptr;
-}
-
-TSConnectT
-string_to_connect_type(const char *conn)
-{
-  if (strcmp(conn, "tcp") == 0) {
-    return TS_CON_TCP;
-  } else {
-    return TS_CON_UDP;
-  }
-
-  return TS_CON_UNDEFINED;
-}
-
-/*----------------------------------------------------------------------------
- * multicast_type_to_string
- *----------------------------------------------------------------------------
- */
-char *
-multicast_type_to_string(TSMcTtlT mc)
-{
-  switch (mc) {
-  case TS_MC_TTL_SINGLE_SUBNET:
-    return ats_strdup("single_subnet");
-  case TS_MC_TTL_MULT_SUBNET:
-    return ats_strdup("multiple_subnet");
-  default:
-    break;
-  }
-  return nullptr;
-}
-
-/* -------------------------------------------------------------------------
- * string_to_round_robin_type
- * -------------------------------------------------------------------------
- */
-TSRrT
-string_to_round_robin_type(const char *rr)
-{
-  if (strcmp(rr, "true") == 0) {
-    return TS_RR_TRUE;
-  } else if (strcmp(rr, "false") == 0) {
-    return TS_RR_FALSE;
-  } else if (strcmp(rr, "strict") == 0) {
-    return TS_RR_STRICT;
-  }
-
-  return TS_RR_UNDEFINED;
-}
-
-char *
-round_robin_type_to_string(TSRrT rr)
-{
-  switch (rr) {
-  case TS_RR_TRUE:
-    return ats_strdup("true");
-  case TS_RR_FALSE:
-    return ats_strdup("false");
-  case TS_RR_STRICT:
-    return ats_strdup("strict");
-  default:
-    break;
-  }
-
-  return nullptr;
-}
-
-/*----------------------------------------------------------------------------
- * filename_to_string
- *----------------------------------------------------------------------------
- * TSFileNameT ==> string
- */
-const char *
-filename_to_string(TSFileNameT file)
-{
-  switch (file) {
-  case TS_FNAME_CACHE_OBJ:
-    return "cache.config";
-  case TS_FNAME_CONGESTION:
-    return "congestion.config";
-  case TS_FNAME_HOSTING:
-    return "hosting.config";
-  case TS_FNAME_IP_ALLOW:
-    return "ip_allow.config";
-  case TS_FNAME_PARENT_PROXY:
-    return "parent.config";
-  case TS_FNAME_VOLUME:
-    return "volume.config";
-  case TS_FNAME_PLUGIN:
-    return "plugin.config";
-  case TS_FNAME_REMAP:
-    return "remap.config";
-  case TS_FNAME_SOCKS:
-    return "socks.config";
-  case TS_FNAME_SPLIT_DNS:
-    return "splitdns.config";
-  case TS_FNAME_STORAGE:
-    return "storage.config";
-  default: /* no such config file */
-    return nullptr;
-  }
-}
-
-/* -------------------------------------------------------------------------
- * string_to_congest_scheme_type
- * -------------------------------------------------------------------------
- */
-TSCongestionSchemeT
-string_to_congest_scheme_type(const char *scheme)
-{
-  if (strcmp(scheme, "per_ip") == 0) {
-    return TS_HTTP_CONGEST_PER_IP;
-  } else if (strcmp(scheme, "per_host") == 0) {
-    return TS_HTTP_CONGEST_PER_HOST;
-  }
-
-  return TS_HTTP_CONGEST_UNDEFINED;
-}
-
-/* -------------------------------------------------------------------------
- * string_to_admin_acc_type
- * -------------------------------------------------------------------------
- */
-TSAccessT
-string_to_admin_acc_type(const char *access)
-{
-  if (strcmp(access, "none") == 0) {
-    return TS_ACCESS_NONE;
-  } else if (strcmp(access, "monitor_only") == 0) {
-    return TS_ACCESS_MONITOR;
-  } else if (strcmp(access, "monitor_config_view") == 0) {
-    return TS_ACCESS_MONITOR_VIEW;
-  } else if (strcmp(access, "monitor_config_change") == 0) {
-    return TS_ACCESS_MONITOR_CHANGE;
-  }
-
-  return TS_ACCESS_UNDEFINED;
-}
-
-char *
-admin_acc_type_to_string(TSAccessT access)
-{
-  switch (access) {
-  case TS_ACCESS_NONE:
-    return ats_strdup("none");
-  case TS_ACCESS_MONITOR:
-    return ats_strdup("monitor_only");
-  case TS_ACCESS_MONITOR_VIEW:
-    return ats_strdup("monitor_config_view");
-  case TS_ACCESS_MONITOR_CHANGE:
-    return ats_strdup("monitor_config_change");
-  default:
-    break;
-  }
-
-  return nullptr;
-}
-
-/***************************************************************************
- * Tokens-to-Struct Converstion Functions
- ***************************************************************************/
-/* -------------------------------------------------------------------------
- * tokens_to_pdss_format
- * -------------------------------------------------------------------------
- * Pass in the TokenList and a pointer to first Token to start iterating from.
- * Iterates through the tokens, checking
- * for tokens that are either primary destination specifiers and secondary
- * specfiers. Returns pointer to the last valid pointer; eg. the last sec
- * spec that was in the list. If there are no primary dest or sec specs,
- * then just returns same pointer originally passed in.
- *
- * Returns NULL, if the first token IS NOT a  Primary Dest Specifier
- */
-Token *
-tokens_to_pdss_format(TokenList *tokens, Token *first_tok, TSPdSsFormat *pdss)
-{
-  Token *tok, *last_tok;
-  int i                             = 0;
-  const char *sspecs[NUM_SEC_SPECS] = {"time", "src_ip", "prefix", "suffix", "port", "method", "scheme", "tag"};
-
-  // ink_assert(tokens && first_tok && pdss);
-  if (!tokens || !first_tok || !pdss) {
-    return nullptr;
-  }
-
-  // tokens->Print();
-
-  // first token must be primary destination specifier
-  if (strcmp(first_tok->name, "dest_domain") == 0) {
-    pdss->pd_type = TS_PD_DOMAIN;
-  } else if (strcmp(first_tok->name, "dest_host") == 0) {
-    pdss->pd_type = TS_PD_HOST;
-  } else if (strcmp(first_tok->name, "dest_ip") == 0) {
-    pdss->pd_type = TS_PD_IP;
-  } else if (strcmp(first_tok->name, "url_regex") == 0) {
-    pdss->pd_type = TS_PD_URL_REGEX;
-  } else if (strcmp(first_tok->name, "url") == 0) {
-    pdss->pd_type = TS_PD_URL;
-  } else {
-    return nullptr; // INVALID primary destination specifier
-  }
-  pdss->pd_val = ats_strdup(first_tok->value);
-
-  // iterate through tokens checking for sec specifiers
-  // state determines which sec specifier being checked
-  // the state is only set if there's a sec spec match
-  last_tok = first_tok;
-  tok      = tokens->next(first_tok);
-  while (tok) {
-    bool matchFound = false;
-    for (i = 0; i < NUM_SEC_SPECS; i++) {
-      if (strcmp(tok->name, sspecs[i]) == 0) { // sec spec
-        matchFound = true;
-        switch (i) {
-        case 0: // time
-          // convert the time value
-          string_to_time_struct(tok->value, &(pdss->sec_spec));
-          goto next_token;
-        case 1: // src_ip
-          pdss->sec_spec.src_ip = ats_strdup(tok->value);
-          goto next_token;
-        case 2: // prefix
-          pdss->sec_spec.prefix = ats_strdup(tok->value);
-          goto next_token;
-        case 3: // suffix
-          pdss->sec_spec.suffix = ats_strdup(tok->value);
-          goto next_token;
-        case 4: // port
-          pdss->sec_spec.port = string_to_port_ele(tok->value);
-          goto next_token;
-        case 5: // method
-          pdss->sec_spec.method = string_to_method_type(tok->value);
-          goto next_token;
-        case 6: // scheme
-          pdss->sec_spec.scheme = string_to_scheme_type(tok->value);
-          goto next_token;
-        default:
-          // This should never happen
-          break;
-        }
-      } // end if statement
-    }   // end for loop
-
-    // No longer in the secondary specifer region,
-    // return the last valid secondary specifer
-    if (!matchFound) {
-      return last_tok;
-    }
-
-  next_token: // Get the next token
-    last_tok = tok;
-    tok      = tokens->next(tok);
-
-  } // end while loop
-
-  return nullptr;
-}
-
-/***************************************************************************
- * Validation Functions
- ***************************************************************************/
-
-/* -------------------------------------------------------------------------
- * isNumber
- * -------------------------------------------------------------------------
- * Returns true if the entire string is numerical
- */
-bool
-isNumber(const char *strNum)
-{
-  for (int i = 0; strNum[i] != '\0'; i++) {
-    if (!isdigit(strNum[i])) {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-/* -------------------------------------------------------------------------
- * ccu_checkIpAddr (from WebFileEdit.cc)
- * -------------------------------------------------------------------------
- *   Checks to see if the passed in string represents a valid
- *     ip address in dot notation (ie 209.1.33.20)
- *   If the min_addr and max_addr are specified, then it checks
- *   that the ip address falls within the range; Otherwise
- *   the min_addr = 0.0.0.0 and max_addr = 255.255.255.255
- *
- *   Returns true if it does and false if it does not
- */
-bool
-ccu_checkIpAddr(const char *addr, const char *min_addr, const char *max_addr)
-{
-  Tokenizer addrToks(".");
-  Tokenizer minToks(".");
-  Tokenizer maxToks(".");
-  int len, addrQ, minQ, maxQ;
-
-  if (!addr || !min_addr || !max_addr) {
-    return false;
-  }
-  // BZ47440
-  // truncate any leading or trailing white spaces from addr,
-  // which can occur if IP is from a list of IP addresses
-  char *new_addr = chopWhiteSpaces_alloc((char *)addr);
-  if (new_addr == nullptr) {
-    return false;
-  }
-
-  if ((addrToks.Initialize(new_addr, ALLOW_EMPTY_TOKS)) != 4 || (minToks.Initialize((char *)min_addr, ALLOW_EMPTY_TOKS)) != 4 ||
-      (maxToks.Initialize((char *)max_addr, ALLOW_EMPTY_TOKS)) != 4) {
-    ats_free(new_addr);
-    return false; // Wrong number of parts
-  }
-  // IP can't end in a "." either
-  len = strlen(new_addr);
-  if (new_addr[len - 1] == '.') {
-    ats_free(new_addr);
-    return false;
-  }
-  // Check all four parts of the ip address to make
-  //  sure that they are valid
-  for (int i = 0; i < 4; i++) {
-    if (!isNumber(addrToks[i])) {
-      ats_free(new_addr);
-      return false;
-    }
-    // coverity[secure_coding]
-    if (sscanf(addrToks[i], "%d", &addrQ) != 1 || sscanf(minToks[i], "%d", &minQ) != 1 || sscanf(maxToks[i], "%d", &maxQ) != 1) {
-      ats_free(new_addr);
-      return false;
-    }
-
-    if (addrQ < minQ || addrQ > maxQ) {
-      ats_free(new_addr);
-      return false;
-    }
-  }
-
-  ats_free(new_addr);
-  return true;
-}
-
-/* ----------------------------------------------------------------------------
- * ccu_checkIpAddrEle
- * ---------------------------------------------------------------------------
- * very similar to the ip_addr_ele_to_string function
- */
-bool
-ccu_checkIpAddrEle(TSIpAddrEle *ele)
-{
-  if (!ele || ele->ip_a == TS_INVALID_IP_ADDR) {
-    return false;
-  }
-
-  if (ele->type == TS_IP_SINGLE) { // SINGLE TYPE
-    return (ccu_checkIpAddr(ele->ip_a));
-  } else if (ele->type == TS_IP_RANGE) { // RANGE TYPE
-    return (ccu_checkIpAddr(ele->ip_a) && ccu_checkIpAddr(ele->ip_b));
-  } else {
-    return false;
-  }
-}
-
-bool
-ccu_checkPortNum(int port)
-{
-  return ((port > 0) && (port < 65535)); // What is max. port number?
-}
-
-// port_b can be "unspecified"; however if port_b is specified, it must
-// be greater than port_a
-bool
-ccu_checkPortEle(TSPortEle *ele)
-{
-  if (!ele) {
-    return false;
-  }
-
-  if (ele->port_b == 0) { // single port
-    return (ccu_checkPortNum(ele->port_a));
-  } else { // range of ports
-    if (ele->port_a >= ele->port_b) {
-      return false;
-    }
-    return (ccu_checkPortNum(ele->port_a) && ccu_checkPortNum(ele->port_b));
-  }
-}
-
-/* ---------------------------------------------------------------
- * checkPdSspec
- * ---------------------------------------------------------------
- * must have a prim dest value spsecified and have valid prim dest type
- */
-bool
-ccu_checkPdSspec(TSPdSsFormat pdss)
-{
-  if (pdss.pd_type != TS_PD_DOMAIN && pdss.pd_type != TS_PD_HOST && pdss.pd_type != TS_PD_IP && pdss.pd_type != TS_PD_URL_REGEX) {
-    goto Lerror;
-  }
-
-  if (!pdss.pd_val) {
-    goto Lerror;
-  }
-  // primary destination cannot have spaces
-  if (strstr(pdss.pd_val, " ")) {
-    goto Lerror;
-  }
-  // if pdest is IP type, check if valid IP (could be single or range)
-  if (pdss.pd_type == TS_PD_IP) {
-    TSIpAddrEle *ip = string_to_ip_addr_ele(pdss.pd_val);
-    if (!ip) {
-      goto Lerror;
-    } else {
-      TSIpAddrEleDestroy(ip);
-    }
-  }
-  // if src_ip specified, check if valid IP address
-  if (pdss.sec_spec.src_ip) {
-    if (!ccu_checkIpAddr(pdss.sec_spec.src_ip)) {
-      goto Lerror;
-    }
-  }
-
-  if (!ccu_checkTimePeriod(&(pdss.sec_spec))) {
-    goto Lerror;
-  }
-
-  return true;
-
-Lerror:
-  return false;
-}
-
-/* ---------------------------------------------------------------
- * ccu_checkUrl
- * ---------------------------------------------------------------
- * Checks that there is not more than one instance of  ":/" in
- * the url.
- */
-bool
-ccu_checkUrl(char *url)
-{
-  // Chop the protocol part, if it exists
-  char *slashStr = strstr(url, "://");
-  if (!slashStr) {
-    return false; // missing protocol
-  } else {
-    url = slashStr + 3; // advance two positions to get rid of leading '://'
-  }
-
-  // check if there's a second occurrence
-  slashStr = strstr(url, ":/");
-  if (slashStr) {
-    return false;
-  }
-
-  // make sure that after the first solo "/", there are no more ":"
-  // to specify ports
-  slashStr = strstr(url, "/"); // begin path prefix
-  if (slashStr) {
-    url = slashStr++;
-    if (strstr(url, ":")) {
-      return false; // the port must be specified before the prefix
-    }
-  }
-
-  return true;
-}
-
-/* ---------------------------------------------------------------
- * ccu_checkTimePeriod
- * ---------------------------------------------------------------
- * Checks that the time struct used to specify the time period in the
- * TSSspec has valid time values (eg. 0-23 hr, 0-59 min) and that
- * time A <= time B
- */
-bool
-ccu_checkTimePeriod(TSSspec *sspec)
-{
-  // check valid time values
-  if (sspec->time.hour_a < 0 || sspec->time.hour_a > 23 || sspec->time.hour_b < 0 || sspec->time.hour_b > 23 ||
-      sspec->time.min_a < 0 || sspec->time.min_a > 59 || sspec->time.min_b < 0 || sspec->time.min_b > 59) {
-    return false;
-  }
-
-  // check time_a < time_b
-  if (sspec->time.hour_a > sspec->time.hour_b) {
-    return false;
-  } else if (sspec->time.hour_a == sspec->time.hour_b) {
-    if (sspec->time.min_a > sspec->time.min_b) {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-/* ----------------------------------------------------------------------------
- * chopWhiteSpaces_alloc
- * ---------------------------------------------------------------------------
- * eliminates any leading and trailing white spaces from str; returns
- * the new allocated string
- */
-char *
-chopWhiteSpaces_alloc(char *str)
-{
-  int len;
-
-  if (!str) {
-    return nullptr;
-  }
-
-  // skip any leading white spaces
-  while (*str != '\0') {
-    if ((*str) == ' ') {
-      ++str;
-      continue;
-    }
-    break;
-  }
-
-  // eliminate trailing white spaces
-  len = strcspn(str, " ");
-
-  return ats_strndup(str, len + 1);
-}
-
-/***************************************************************
- * General Helper Functions
- ***************************************************************/
-/*--------------------------------------------------------------
- * create_ele_obj_from_rule_node
- *--------------------------------------------------------------
- * Calls the appropriate subclasses' constructor using TokenList.
- * Returns NULL if invalid Ele.
- */
-CfgEleObj *
-create_ele_obj_from_rule_node(Rule *rule)
-{
-  TSRuleTypeT rule_type;
-  TokenList *token_list;
-  CfgEleObj *ele = nullptr;
-
-  // sanity check
-  // ink_assert(rule != NULL);
-  if (!rule) {
-    return nullptr;
-  }
-
-  // first check if the rule node is a comment
-  if (rule->getComment()) {
-    ele = (CfgEleObj *)new CommentObj(rule->getComment());
-    return ele;
-  }
-
-  token_list = rule->tokenList;
-  // determine what rule type the TokenList refers to
-  rule_type = get_rule_type(token_list, rule->getFiletype());
-
-  // convert TokenList into an Ele
-  // need switch statement to determine which Ele constructor to call
-  switch (rule_type) {
-  case TS_CACHE_NEVER: /* all cache rules use same constructor */
-  case TS_CACHE_IGNORE_NO_CACHE:
-  case TS_CACHE_IGNORE_CLIENT_NO_CACHE:
-  case TS_CACHE_IGNORE_SERVER_NO_CACHE:
-  case TS_CACHE_PIN_IN_CACHE:
-  case TS_CACHE_TTL_IN_CACHE:
-  case TS_CACHE_REVALIDATE:
-  case TS_CACHE_AUTH_CONTENT:
-    ele = (CfgEleObj *)new CacheObj(token_list);
-    break;
-  case TS_CONGESTION:
-    ele = (CfgEleObj *)new CongestionObj(token_list);
-    break;
-  case TS_HOSTING: /* hosting.config */
-    ele = (CfgEleObj *)new HostingObj(token_list);
-    break;
-  case TS_IP_ALLOW: /* ip_allow.config */
-    ele = (CfgEleObj *)new IpAllowObj(token_list);
-    break;
-
-  case TS_PP_PARENT: /* parent.config */
-  case TS_PP_GO_DIRECT:
-    ele = (CfgEleObj *)new ParentProxyObj(token_list);
-    break;
-  case TS_VOLUME: /* volume.config */
-    ele = (CfgEleObj *)new VolumeObj(token_list);
-    break;
-  case TS_PLUGIN:
-    ele = (CfgEleObj *)new PluginObj(token_list);
-    break;
-  case TS_REMAP_MAP: /* remap.config */
-  case TS_REMAP_REVERSE_MAP:
-  case TS_REMAP_REDIRECT:
-  case TS_REMAP_REDIRECT_TEMP:
-    ele = (CfgEleObj *)new RemapObj(token_list);
-    break;
-  case TS_SOCKS_BYPASS: /* socks.config */
-  case TS_SOCKS_AUTH:
-  case TS_SOCKS_MULTIPLE:
-    ele = (CfgEleObj *)new SocksObj(token_list);
-    break;
-  case TS_SPLIT_DNS: /* splitdns.config */
-    ele = (CfgEleObj *)new SplitDnsObj(token_list);
-    break;
-  case TS_STORAGE:
-    ele = (CfgEleObj *)new StorageObj(token_list);
-    break;
-  default:
-    return nullptr; // invalid rule type
-  }
-  if (!ele || !ele->isValid()) {
-    return nullptr;
-  }
-  return ele;
-}
-
-/*--------------------------------------------------------------
- * create_ele_obj_from_ele
- *--------------------------------------------------------------
- * calls the appropriate subclasses' constructor using actual TSEle
- * need to convert the ele into appropriate Ele object type
- * Note: the ele is not copied, it is actually used, so caller
- * shouldn't free it!
- */
-CfgEleObj *
-create_ele_obj_from_ele(TSCfgEle *ele)
-{
-  CfgEleObj *ele_obj = nullptr;
-
-  if (!ele) {
-    return nullptr;
-  }
-
-  switch (ele->type) {
-  case TS_CACHE_NEVER:                  /* cache.config */
-  case TS_CACHE_IGNORE_NO_CACHE:        // fall-through
-  case TS_CACHE_IGNORE_CLIENT_NO_CACHE: // fall-through
-  case TS_CACHE_IGNORE_SERVER_NO_CACHE: // fall-through
-  case TS_CACHE_PIN_IN_CACHE:           // fall-through
-  case TS_CACHE_REVALIDATE:             // fall-through
-  case TS_CACHE_TTL_IN_CACHE:
-  case TS_CACHE_AUTH_CONTENT:
-    ele_obj = (CfgEleObj *)new CacheObj((TSCacheEle *)ele);
-    break;
-
-  case TS_CONGESTION:
-    ele_obj = (CfgEleObj *)new CongestionObj((TSCongestionEle *)ele);
-    break;
-
-  case TS_HOSTING: /* hosting.config */
-    ele_obj = (CfgEleObj *)new HostingObj((TSHostingEle *)ele);
-    break;
-
-  case TS_IP_ALLOW: /* ip_allow.config */
-    ele_obj = (CfgEleObj *)new IpAllowObj((TSIpAllowEle *)ele);
-    break;
-
-  case TS_PP_PARENT:    /* parent.config */
-  case TS_PP_GO_DIRECT: // fall-through
-    ele_obj = (CfgEleObj *)new ParentProxyObj((TSParentProxyEle *)ele);
-    break;
-
-  case TS_VOLUME: /* volume.config */
-    ele_obj = (CfgEleObj *)new VolumeObj((TSVolumeEle *)ele);
-    break;
-
-  case TS_PLUGIN:
-    ele_obj = (CfgEleObj *)new PluginObj((TSPluginEle *)ele);
-    break;
-
-  case TS_REMAP_MAP:           /* remap.config */
-  case TS_REMAP_REVERSE_MAP:   // fall-through
-  case TS_REMAP_REDIRECT:      // fall-through
-  case TS_REMAP_REDIRECT_TEMP: // fall-through
-    ele_obj = (CfgEleObj *)new RemapObj((TSRemapEle *)ele);
-    break;
-
-  case TS_SOCKS_BYPASS: /* socks.config */
-  case TS_SOCKS_AUTH:
-  case TS_SOCKS_MULTIPLE:
-    ele_obj = (CfgEleObj *)new SocksObj((TSSocksEle *)ele);
-    break;
-
-  case TS_SPLIT_DNS: /* splitdns.config */
-    ele_obj = (CfgEleObj *)new SplitDnsObj((TSSplitDnsEle *)ele);
-    break;
-
-  case TS_STORAGE: /* storage.config */
-    ele_obj = (CfgEleObj *)new StorageObj((TSStorageEle *)ele);
-    break;
-
-  case TS_TYPE_UNDEFINED:
-  default:
-    return nullptr; // error
-  }
-
-  return ele_obj;
-}
-
-/*--------------------------------------------------------------
- * get_rule_type
- *--------------------------------------------------------------
- * determine what rule type the TokenList refers to by examining
- * the appropriate token-value pair in the TokenList
- */
-TSRuleTypeT
-get_rule_type(TokenList *token_list, TSFileNameT file)
-{
-  Token *tok;
-
-  // ink_asser(ttoken_list);
-  if (!token_list) {
-    return TS_TYPE_UNDEFINED;
-  }
-
-  /* Depending on the file and rule type, need to find out which
-     token specifies which type of rule it is */
-  switch (file) {
-  case TS_FNAME_CACHE_OBJ: /* cache.config */
-    tok = token_list->first();
-    while (tok != nullptr) {
-      if (strcmp(tok->name, "action") == 0) {
-        if (strcmp(tok->value, "never-cache") == 0) {
-          return TS_CACHE_NEVER;
-        } else if (strcmp(tok->value, "ignore-no-cache") == 0) {
-          return TS_CACHE_IGNORE_NO_CACHE;
-        } else if (strcmp(tok->value, "ignore-client-no-cache") == 0) {
-          return TS_CACHE_IGNORE_CLIENT_NO_CACHE;
-        } else if (strcmp(tok->value, "ignore-server-no-cache") == 0) {
-          return TS_CACHE_IGNORE_SERVER_NO_CACHE;
-        } else if (strcmp(tok->value, "cache-auth-content") == 0) {
-          return TS_CACHE_AUTH_CONTENT;
-        } else {
-          return TS_TYPE_UNDEFINED;
-        }
-      } else if (strcmp(tok->name, "pin-in-cache") == 0) {
-        return TS_CACHE_PIN_IN_CACHE;
-      } else if (strcmp(tok->name, "revalidate") == 0) {
-        return TS_CACHE_REVALIDATE;
-      } else if (strcmp(tok->name, "ttl-in-cache") == 0) {
-        return TS_CACHE_TTL_IN_CACHE;
-      } else { // try next token
-        tok = token_list->next(tok);
-      }
-    }
-    // if reached this point, there is no action specified
-    return TS_TYPE_UNDEFINED;
-
-  case TS_FNAME_CONGESTION: /* congestion.config */
-    return TS_CONGESTION;
-
-  case TS_FNAME_HOSTING: /* hosting.config */
-    return TS_HOSTING;
-
-  case TS_FNAME_IP_ALLOW: /* ip_allow.config */
-    return TS_IP_ALLOW;
-
-  case TS_FNAME_PARENT_PROXY: /* parent.config */
-    // search fro go_direct action name and recongize the value-> ture or false
-    for (tok = token_list->first(); tok; tok = token_list->next(tok)) {
-      if ((strcmp(tok->name, "go_direct") == 0) && (strcmp(tok->value, "true") == 0)) {
-        return TS_PP_GO_DIRECT;
-      }
-    }
-    return TS_PP_PARENT;
-
-  case TS_FNAME_VOLUME: /* volume.config */
-    return TS_VOLUME;
-
-  case TS_FNAME_PLUGIN: /* plugin.config */
-    return TS_PLUGIN;
-
-  case TS_FNAME_REMAP: /* remap.config */
-    tok = token_list->first();
-    if (strcmp(tok->name, "map") == 0) {
-      return TS_REMAP_MAP;
-    } else if (strcmp(tok->name, "reverse_map") == 0) {
-      return TS_REMAP_REVERSE_MAP;
-    } else if (strcmp(tok->name, "redirect") == 0) {
-      return TS_REMAP_REDIRECT;
-    } else if (strcmp(tok->name, "redirect_temporary") == 0) {
-      return TS_REMAP_REDIRECT_TEMP;
-    } else {
-      return TS_TYPE_UNDEFINED;
-    }
-  case TS_FNAME_SOCKS: /* socks.config */
-    tok = token_list->first();
-    if (strcmp(tok->name, "no_socks") == 0) {
-      return TS_SOCKS_BYPASS;
-    } else if (strcmp(tok->name, "auth") == 0) {
-      return TS_SOCKS_AUTH;
-    } else if (strcmp(tok->name, "dest_ip") == 0) {
-      return TS_SOCKS_MULTIPLE;
-    } else {
-      return TS_TYPE_UNDEFINED;
-    }
-  case TS_FNAME_SPLIT_DNS: /* splitdns.config */
-    return TS_SPLIT_DNS;
-
-  case TS_FNAME_STORAGE: /* storage.config */
-    return TS_STORAGE;
-
-  case TS_FNAME_UNDEFINED:
-  default:
-    return TS_TYPE_UNDEFINED;
-  }
-
-  return TS_TYPE_UNDEFINED; // Should not reach here
-}
-
-///////////////////////////////////////////////////////////////////
-// Since we are using the ele's as C structures wrapped in C++ classes
-// we need to write copy function that "copy" the C structures
-// 1) need copy functions for each helper information struct which
-//    are typically embedded in the Ele's (eg. any lists, TSSspec)
-// 2) need copy functions for each Ele; these functiosn will actually
-// be called by teh copy constructors and overloaded assignment
-// operators in each CfgEleObj subclass!!
-///////////////////////////////////////////////////////////////////
-void
-copy_cfg_ele(TSCfgEle *src_ele, TSCfgEle *dst_ele)
-{
-  // ink_assert (src_ele && dst_ele);
-  if (!src_ele || !dst_ele) {
-    return;
-  }
-
-  dst_ele->type  = src_ele->type;
-  dst_ele->error = src_ele->error;
-}
-
-void
-copy_sspec(TSSspec *src, TSSspec *dst)
-{
-  // ink_assert(src && dst);
-  if (!src || !dst) {
-    return;
-  }
-
-  dst->active      = src->active;
-  dst->time.hour_a = src->time.hour_a;
-  dst->time.min_a  = src->time.min_a;
-  dst->time.hour_b = src->time.hour_b;
-  dst->time.min_b  = src->time.min_b;
-  if (src->src_ip) {
-    dst->src_ip = ats_strdup(src->src_ip);
-  }
-  if (src->prefix) {
-    dst->prefix = ats_strdup(src->prefix);
-  }
-  if (src->suffix) {
-    dst->suffix = ats_strdup(src->suffix);
-  }
-  dst->port   = copy_port_ele(src->port);
-  dst->method = src->method;
-  dst->scheme = src->scheme;
-}
-
-void
-copy_pdss_format(TSPdSsFormat *src_pdss, TSPdSsFormat *dst_pdss)
-{
-  // ink_assert (src_pdss && dst_pdss);
-  if (!src_pdss || !dst_pdss) {
-    return;
-  }
-
-  dst_pdss->pd_type = src_pdss->pd_type;
-  if (src_pdss->pd_val) {
-    dst_pdss->pd_val = ats_strdup(src_pdss->pd_val);
-  }
-  copy_sspec(&(src_pdss->sec_spec), &(dst_pdss->sec_spec));
-}
-
-void
-copy_hms_time(TSHmsTime *src, TSHmsTime *dst)
-{
-  if (!src || !dst) {
-    return;
-  }
-
-  dst->d = src->d;
-  dst->h = src->h;
-  dst->m = src->m;
-  dst->s = src->s;
-}
-
-TSIpAddrEle *
-copy_ip_addr_ele(TSIpAddrEle *src_ele)
-{
-  TSIpAddrEle *dst_ele;
-
-  if (!src_ele) {
-    return nullptr;
-  }
-
-  dst_ele       = TSIpAddrEleCreate();
-  dst_ele->type = src_ele->type;
-  if (src_ele->ip_a) {
-    dst_ele->ip_a = ats_strdup(src_ele->ip_a);
-  }
-  dst_ele->cidr_a = src_ele->cidr_a;
-  dst_ele->port_a = src_ele->port_a;
-  if (src_ele->ip_b) {
-    dst_ele->ip_b = ats_strdup(src_ele->ip_b);
-  }
-  dst_ele->cidr_b = src_ele->cidr_b;
-  dst_ele->port_b = src_ele->port_b;
-
-  return dst_ele;
-}
-
-TSPortEle *
-copy_port_ele(TSPortEle *src_ele)
-{
-  TSPortEle *dst_ele;
-
-  if (!src_ele) {
-    return nullptr;
-  }
-
-  dst_ele         = TSPortEleCreate();
-  dst_ele->port_a = src_ele->port_a;
-  dst_ele->port_b = src_ele->port_b;
-
-  return dst_ele;
-}
-
-TSDomain *
-copy_domain(TSDomain *src_dom)
-{
-  TSDomain *dst_dom;
-
-  if (!src_dom) {
-    return nullptr;
-  }
-
-  dst_dom = TSDomainCreate();
-  if (src_dom->domain_val) {
-    dst_dom->domain_val = ats_strdup(src_dom->domain_val);
-  }
-  dst_dom->port = src_dom->port;
-
-  return dst_dom;
-}
-
-TSIpAddrList
-copy_ip_addr_list(TSIpAddrList list)
-{
-  TSIpAddrList nlist;
-  TSIpAddrEle *ele, *nele;
-  int count, i;
-
-  if (list == TS_INVALID_LIST) {
-    return TS_INVALID_LIST;
-  }
-
-  nlist = TSIpAddrListCreate();
-  count = TSIpAddrListLen(list);
-  for (i = 0; i < count; i++) {
-    ele  = TSIpAddrListDequeue(list);
-    nele = copy_ip_addr_ele(ele);
-    TSIpAddrListEnqueue(list, ele);
-    TSIpAddrListEnqueue(nlist, nele);
-  }
-
-  return nlist;
-}
-
-TSPortList
-copy_port_list(TSPortList list)
-{
-  TSPortList nlist;
-  TSPortEle *ele, *nele;
-  int count, i;
-
-  if (list == TS_INVALID_LIST) {
-    return TS_INVALID_LIST;
-  }
-
-  nlist = TSPortListCreate();
-  count = TSPortListLen(list);
-  for (i = 0; i < count; i++) {
-    ele  = TSPortListDequeue(list);
-    nele = copy_port_ele(ele);
-    TSPortListEnqueue(list, ele);
-    TSPortListEnqueue(nlist, nele);
-  }
-
-  return nlist;
-}
-
-TSDomainList
-copy_domain_list(TSDomainList list)
-{
-  TSDomainList nlist;
-  TSDomain *ele, *nele;
-  int count, i;
-
-  if (list == TS_INVALID_LIST) {
-    return TS_INVALID_LIST;
-  }
-
-  nlist = TSDomainListCreate();
-  count = TSDomainListLen(list);
-  for (i = 0; i < count; i++) {
-    ele  = TSDomainListDequeue(list);
-    nele = copy_domain(ele);
-    TSDomainListEnqueue(list, ele);
-    TSDomainListEnqueue(nlist, nele);
-  }
-
-  return nlist;
-}
-
-TSStringList
-copy_string_list(TSStringList list)
-{
-  TSStringList nlist;
-  char *ele, *nele;
-  int count, i;
-
-  if (list == TS_INVALID_LIST) {
-    return TS_INVALID_LIST;
-  }
-
-  nlist = TSStringListCreate();
-  count = TSStringListLen(list);
-  for (i = 0; i < count; i++) {
-    ele  = TSStringListDequeue(list);
-    nele = ats_strdup(ele);
-    TSStringListEnqueue(list, ele);
-    TSStringListEnqueue(nlist, nele);
-  }
-
-  return nlist;
-}
-
-TSIntList
-copy_int_list(TSIntList list)
-{
-  TSIntList nlist;
-  int *elem, *nelem;
-  int count, i;
-
-  if (list == TS_INVALID_LIST) {
-    return TS_INVALID_LIST;
-  }
-
-  nlist = TSIntListCreate();
-  count = TSIntListLen(list);
-  for (i = 0; i < count; i++) {
-    elem   = TSIntListDequeue(list);
-    nelem  = (int *)ats_malloc(sizeof(int));
-    *nelem = *elem;
-    TSIntListEnqueue(list, elem);
-    TSIntListEnqueue(nlist, nelem);
-  }
-
-  return nlist;
-}
-
-TSCacheEle *
-copy_cache_ele(TSCacheEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSCacheEle *nele = TSCacheEleCreate(ele->cfg_ele.type);
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  copy_pdss_format(&(ele->cache_info), &(nele->cache_info));
-  copy_hms_time(&(ele->time_period), &(nele->time_period));
-
-  return nele;
-}
-
-TSCongestionEle *
-copy_congestion_ele(TSCongestionEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSCongestionEle *nele = TSCongestionEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  // copy_pdss_format(&(ele->congestion_info), &(nele->congestion_info));
-  nele->pd_type = ele->pd_type;
-  nele->pd_val  = ats_strdup(ele->pd_val);
-  if (ele->prefix) {
-    nele->prefix = ats_strdup(ele->prefix);
-  }
-  nele->port                    = ele->port;
-  nele->scheme                  = ele->scheme;
-  nele->max_connection_failures = ele->max_connection_failures;
-  nele->fail_window             = ele->fail_window;
-  nele->proxy_retry_interval    = ele->proxy_retry_interval;
-  nele->client_wait_interval    = ele->client_wait_interval;
-  nele->wait_interval_alpha     = ele->wait_interval_alpha;
-  nele->live_os_conn_timeout    = ele->live_os_conn_timeout;
-  nele->live_os_conn_retries    = ele->live_os_conn_retries;
-  nele->dead_os_conn_timeout    = ele->dead_os_conn_timeout;
-  nele->dead_os_conn_retries    = ele->dead_os_conn_retries;
-  nele->max_connection          = ele->max_connection;
-  if (ele->error_page_uri) {
-    nele->error_page_uri = ats_strdup(ele->error_page_uri);
-  }
-
-  return nele;
-}
-
-TSHostingEle *
-copy_hosting_ele(TSHostingEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSHostingEle *nele = TSHostingEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  nele->pd_type = ele->pd_type;
-  if (ele->pd_val) {
-    nele->pd_val = ats_strdup(ele->pd_val);
-  }
-  ele->volumes = copy_int_list(ele->volumes);
-
-  return nele;
-}
-
-TSIpAllowEle *
-copy_ip_allow_ele(TSIpAllowEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSIpAllowEle *nele = TSIpAllowEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-  if (ele->src_ip_addr) {
-    nele->src_ip_addr = copy_ip_addr_ele(ele->src_ip_addr);
-  }
-  nele->action = ele->action;
-  return nele;
-}
-
-TSParentProxyEle *
-copy_parent_proxy_ele(TSParentProxyEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSParentProxyEle *nele = TSParentProxyEleCreate(TS_TYPE_UNDEFINED);
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  copy_pdss_format(&(ele->parent_info), &(nele->parent_info));
-  nele->rr         = ele->rr;
-  nele->proxy_list = copy_domain_list(ele->proxy_list);
-  nele->direct     = ele->direct;
-
-  return nele;
-}
-
-TSVolumeEle *
-copy_volume_ele(TSVolumeEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSVolumeEle *nele = TSVolumeEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  nele->volume_num  = ele->volume_num;
-  nele->scheme      = ele->scheme;
-  nele->volume_size = ele->volume_size;
-  nele->size_format = ele->size_format;
-
-  return nele;
-}
-
-TSPluginEle *
-copy_plugin_ele(TSPluginEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSPluginEle *nele = TSPluginEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  if (ele->name) {
-    nele->name = ats_strdup(ele->name);
-  }
-  nele->args = copy_string_list(ele->args);
-
-  return nele;
-}
-
-TSRemapEle *
-copy_remap_ele(TSRemapEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSRemapEle *nele = TSRemapEleCreate(TS_TYPE_UNDEFINED);
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  nele->map         = ele->map;
-  nele->from_scheme = ele->from_scheme;
-  if (ele->from_host) {
-    nele->from_host = ats_strdup(ele->from_host);
-  }
-  nele->from_port = ele->from_port;
-  if (ele->from_path_prefix) {
-    nele->from_path_prefix = ats_strdup(ele->from_path_prefix);
-  }
-  nele->to_scheme = ele->to_scheme;
-  if (ele->to_host) {
-    nele->to_host = ats_strdup(ele->to_host);
-  }
-  nele->to_port = ele->to_port;
-  if (ele->to_path_prefix) {
-    nele->to_path_prefix = ats_strdup(ele->to_path_prefix);
-  }
-
-  return nele;
-}
-
-TSSocksEle *
-copy_socks_ele(TSSocksEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSSocksEle *nele = TSSocksEleCreate(TS_TYPE_UNDEFINED);
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  nele->ip_addrs      = copy_ip_addr_list(ele->ip_addrs);
-  nele->dest_ip_addr  = copy_ip_addr_ele(ele->dest_ip_addr);
-  nele->socks_servers = copy_domain_list(ele->socks_servers);
-  nele->rr            = ele->rr;
-  if (ele->username) {
-    nele->username = ats_strdup(ele->username);
-  }
-  if (ele->password) {
-    nele->password = ats_strdup(ele->password);
-  }
-
-  return nele;
-}
-
-TSSplitDnsEle *
-copy_split_dns_ele(TSSplitDnsEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSSplitDnsEle *nele = TSSplitDnsEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  nele->pd_type = ele->pd_type;
-  if (ele->pd_val) {
-    nele->pd_val = ats_strdup(ele->pd_val);
-  }
-  nele->dns_servers_addrs = copy_domain_list(ele->dns_servers_addrs);
-  if (ele->def_domain) {
-    nele->def_domain = ats_strdup(ele->def_domain);
-  }
-  nele->search_list = copy_domain_list(ele->search_list);
-
-  return nele;
-}
-
-TSStorageEle *
-copy_storage_ele(TSStorageEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  TSStorageEle *nele = TSStorageEleCreate();
-  if (!nele) {
-    return nullptr;
-  }
-
-  copy_cfg_ele(&(ele->cfg_ele), &(nele->cfg_ele));
-  if (ele->pathname) {
-    nele->pathname = ats_strdup(ele->pathname);
-  }
-  nele->size = ele->size;
-
-  return nele;
-}
-
-INKCommentEle *
-copy_comment_ele(INKCommentEle *ele)
-{
-  if (!ele) {
-    return nullptr;
-  }
-
-  INKCommentEle *nele = comment_ele_create(ele->comment);
-  return nele;
-}
-
-/***************************************************************************
- * Functions needed by implementation but must be hidden from user
- ***************************************************************************/
-INKCommentEle *
-comment_ele_create(char *comment)
-{
-  INKCommentEle *ele;
-
-  ele = (INKCommentEle *)ats_malloc(sizeof(INKCommentEle));
-
-  ele->cfg_ele.type  = TS_TYPE_COMMENT;
-  ele->cfg_ele.error = TS_ERR_OKAY;
-  if (comment) {
-    ele->comment = ats_strdup(comment);
-  } else { // comment is NULL
-    ele->comment = nullptr;
-  }
-
-  return ele;
-}
-
-void
-comment_ele_destroy(INKCommentEle *ele)
-{
-  if (ele) {
-    ats_free(ele->comment);
-    ats_free(ele);
-  }
-
-  return;
-}
diff --git a/mgmt/api/CfgContextUtils.h b/mgmt/api/CfgContextUtils.h
deleted file mode 100644
index a19ca18..0000000
--- a/mgmt/api/CfgContextUtils.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/*****************************************************************************
- * Filename: CfgContextUtils.h (based on FileOp.h)
- * ------------------------------------------------------------------------
- * Purpose:
- * 1) Contains helper functions to convert "values" from TokenList to Ele
- * format and from Ele Format to file Rule Format
- * 2) contains helper functions to check for valid info
- *
- ***************************************************************************/
-
-#ifndef _CONTEXT_UTILS_H_
-#define _CONTEXT_UTILS_H_
-
-#include "CfgContextDefs.h"
-#include "mgmtapi.h"
-#include "GenericParser.h"
-#include "CfgContextImpl.h"
-
-/***************************************************************************
- * Conversion Functions
- ***************************************************************************/
-/* INKIpAddrEle <==> (single type)  ip_a/cidr_a
- *                   (range type)   ip_a/cidr_a-ip_b/cidr_b */
-TSIpAddrEle *string_to_ip_addr_ele(const char *str);
-char *ip_addr_ele_to_string(TSIpAddrEle *ele);
-
-/* INKIpAddr <==> ip_addr_string */
-char *ip_addr_to_string(TSIpAddr ip);
-TSIpAddr string_to_ip_addr(const char *str);
-
-/* IpAddrList <==> ip_addr1, ip_addr2, ip_addr3, ... */
-char *ip_addr_list_to_string(IpAddrList *list, const char *delimiter);
-TSIpAddrList string_to_ip_addr_list(const char *str_list, const char *delimiter);
-
-/* PortList <==> port_1<delim>port_2<delim>port_3<delim>...<delim>port_n
- * (Note: each port can be a port range */
-char *port_list_to_string(PortList *ports, const char *delimiter);
-TSPortList string_to_port_list(const char *str_list, const char *delimiter);
-
-/* TSPortEle <==> port_a / port_a#port_b */
-char *port_ele_to_string(TSPortEle *ele);
-TSPortEle *string_to_port_ele(const char *str);
-
-/* TSProxyList <==> proxy_1, proxy_2,... */
-// char* proxy_list_to_string(ProxyList *list);
-
-/* TSStringList(of char*'s)==> elem1<delimiter>elem2<delimiter>elem3 */
-char *string_list_to_string(TSStringList list, const char *delimiter);
-TSStringList string_to_string_list(const char *str, const char *delimiter);
-
-/* TSIntList(of char*'s)==> elem1<delimiter>elem2<delimiter>elem3 */
-char *int_list_to_string(TSIntList list, const char *delimiter);
-TSIntList string_to_int_list(const char *str, const char *delimiter);
-
-/* TSDomain */
-TSDomain *string_to_domain(const char *str);
-char *domain_to_string(TSDomain *domain);
-
-/* TSDomainList */
-TSDomainList string_to_domain_list(const char *str_list, const char *delimiter);
-char *domain_list_to_string(TSDomainList list, const char *delimiter);
-
-/* pd, pd_val, TSSspec ==> <pd_type>#<pd_value>#<sspecs> */
-char *pdest_sspec_to_string(TSPrimeDestT pd, char *prim_dest_val, TSSspec *sspec);
-/* <pd_type>#<pd_value>#<sspecs> ==> TSPdSsFormat */
-TSMgmtError string_to_pdss_format(const char *str, TSPdSsFormat *pdss);
-
-/* ?h?m?s <==> TSHmsTime */
-char *hms_time_to_string(TSHmsTime time);
-TSMgmtError string_to_hms_time(const char *str, TSHmsTime *time);
-
-/* string ==> time struct */
-TSMgmtError string_to_time_struct(const char *str, TSSspec *sspec);
-
-/* string ==> TSHdrT */
-TSHdrT string_to_header_type(const char *str);
-char *header_type_to_string(TSHdrT hdr);
-
-/* TSSchemeT <==> string */
-TSSchemeT string_to_scheme_type(const char *scheme);
-char *scheme_type_to_string(TSSchemeT scheme);
-
-/* TSMethodT <==> string */
-TSMethodT string_to_method_type(const char *method);
-char *method_type_to_string(TSMethodT method);
-
-/* TSConnectT <==> string */
-char *connect_type_to_string(TSConnectT conn);
-TSConnectT string_to_connect_type(const char *conn);
-
-/* TSMcTtlt <==> string */
-char *multicast_type_to_string(TSMcTtlT mc);
-
-/* TSRrT <==> string */
-TSRrT string_to_round_robin_type(const char *rr);
-char *round_robin_type_to_string(TSRrT rr);
-
-/* TSFileNameT <==> string */
-const char *filename_to_string(TSFileNameT file);
-
-TSCongestionSchemeT string_to_congest_scheme_type(const char *scheme);
-
-TSAccessT string_to_admin_acc_type(const char *access);
-char *admin_acc_type_to_string(TSAccessT access);
-
-/***************************************************************************
- * Tokens-to-Struct Conversion Functions
- ***************************************************************************/
-Token *tokens_to_pdss_format(TokenList *tokens, Token *first_tok, TSPdSsFormat *pdss);
-
-/***************************************************************************
- * Validation Functions
- ***************************************************************************/
-bool isNumber(const char *strNum);
-bool ccu_checkIpAddr(const char *addr, const char *min_addr = "0.0.0.0", const char *max_addr = "255.255.255.255");
-bool ccu_checkIpAddrEle(TSIpAddrEle *ele);
-bool ccu_checkPortNum(int port);
-bool ccu_checkPortEle(TSPortEle *ele);
-bool ccu_checkPdSspec(TSPdSsFormat pdss);
-bool ccu_checkUrl(char *url);
-bool ccu_checkTimePeriod(TSSspec *sspec);
-
-char *chopWhiteSpaces_alloc(char *str);
-
-/***************************************************************************
- * General Helper Functions
- ***************************************************************************/
-CfgEleObj *create_ele_obj_from_rule_node(Rule *rule);
-CfgEleObj *create_ele_obj_from_ele(TSCfgEle *ele);
-TSRuleTypeT get_rule_type(TokenList *token_list, TSFileNameT file);
-
-/***************************************************************************
- * Copy Helper Functions
- ***************************************************************************/
-// these are mainly used by the C++ CfgEleObj subclasses when they need
-// to make copies of their m_ele data class member
-
-void copy_cfg_ele(TSCfgEle *src_ele, TSCfgEle *dst_ele);
-void copy_sspec(TSSspec *src, TSSspec *dst);
-void copy_pdss_format(TSPdSsFormat *src_pdss, TSPdSsFormat *dst_pdss);
-void copy_hms_time(TSHmsTime *src, TSHmsTime *dst);
-TSIpAddrEle *copy_ip_addr_ele(TSIpAddrEle *src_ele);
-TSPortEle *copy_port_ele(TSPortEle *src_ele);
-TSDomain *copy_domain(TSDomain *src_dom);
-
-TSIpAddrList copy_ip_addr_list(TSIpAddrList list);
-TSPortList copy_port_list(TSPortList list);
-TSDomainList copy_domain_list(TSDomainList list);
-TSStringList copy_string_list(TSStringList list);
-TSIntList copy_int_list(TSIntList list);
-
-TSCacheEle *copy_cache_ele(TSCacheEle *ele);
-TSCongestionEle *copy_congestion_ele(TSCongestionEle *ele);
-TSHostingEle *copy_hosting_ele(TSHostingEle *ele);
-TSIpAllowEle *copy_ip_allow_ele(TSIpAllowEle *ele);
-TSParentProxyEle *copy_parent_proxy_ele(TSParentProxyEle *ele);
-TSVolumeEle *copy_volume_ele(TSVolumeEle *ele);
-TSPluginEle *copy_plugin_ele(TSPluginEle *ele);
-TSRemapEle *copy_remap_ele(TSRemapEle *ele);
-TSSocksEle *copy_socks_ele(TSSocksEle *ele);
-TSSplitDnsEle *copy_split_dns_ele(TSSplitDnsEle *ele);
-TSStorageEle *copy_storage_ele(TSStorageEle *ele);
-INKCommentEle *copy_comment_ele(INKCommentEle *ele);
-
-/***************************************************************************
- * Functions needed by implementation but must be hidden from user
- ***************************************************************************/
-INKCommentEle *comment_ele_create(char *comment);
-void comment_ele_destroy(INKCommentEle *ele);
-
-#endif
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index a76c9d6..868898c 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -44,7 +44,6 @@
 
 #include "CoreAPI.h"
 #include "CoreAPIShared.h"
-#include "CfgContextUtils.h"
 #include "EventCallback.h"
 #include "ts/I_Layout.h"
 #include "ts/ink_cap.h"
@@ -695,58 +694,6 @@ MgmtRecordSetString(const char *rec_name, const char *string_val, TSActionNeedT
 }
 
 /**************************************************************************
- * FILE OPERATIONS
- *************************************************************************/
-
-/*-------------------------------------------------------------------------
- * ReadFile (MgmtAPILocal::get_lines_from_file)
- *-------------------------------------------------------------------------
- * Purpose: returns copy of the most recent version of the file
- * Input:   file - the config file to read
- *          text - a buffer is allocated on the text char* pointer
- *          size - the size of the buffer is returned
- *          ver  - the version number of file being read
- * Note: CALLEE must DEALLOCATE text memory returned
- */
-TSMgmtError
-ReadFile(TSFileNameT file, char **text, int *size, int *version)
-{
-  const char *fname;
-  Rollback *file_rb;
-  int ret, old_file_len;
-  TextBuffer *old_file_content;
-  char *old_file_lines;
-  version_t ver;
-
-  Debug("FileOp", "[get_lines_from_file] START");
-
-  fname = filename_to_string(file);
-  if (!fname) {
-    return TS_ERR_READ_FILE;
-  }
-
-  ret = configFiles->getRollbackObj(fname, &file_rb);
-  if (ret != true) {
-    Debug("FileOp", "[get_lines_from_file] Can't get Rollback for file: %s", fname);
-    return TS_ERR_READ_FILE;
-  }
-  ver = file_rb->getCurrentVersion();
-  file_rb->getVersion(ver, &old_file_content);
-  *version = ver;
-
-  // don't need to allocate memory b/c "getVersion" allocates memory
-  old_file_lines = old_file_content->bufPtr();
-  old_file_len   = strlen(old_file_lines);
-
-  *text = ats_strdup(old_file_lines); // make copy before deleting TextBuffer
-  *size = old_file_len;
-
-  delete old_file_content; // delete TextBuffer
-
-  return TS_ERR_OKAY;
-}
-
-/**************************************************************************
  * EVENTS
  *************************************************************************/
 /*-------------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.h b/mgmt/api/CoreAPI.h
index 9e19b11..7a20b10 100644
--- a/mgmt/api/CoreAPI.h
+++ b/mgmt/api/CoreAPI.h
@@ -30,9 +30,13 @@
 #include "MgmtDefs.h" // MgmtInt, MgmtFloat, etc
 
 #include "mgmtapi.h"
-#include "CfgContextDefs.h"
 #include "ts/Tokenizer.h"
 
+// for buffer used temporarily to parse incoming commands.
+#ifndef MAX_BUF_SIZE
+#define MAX_BUF_SIZE 4098
+#endif
+
 TSMgmtError Init(const char *socket_path = NULL, TSInitOptionT options = TS_MGMT_OPT_DEFAULTS);
 TSMgmtError Terminate();
 
@@ -67,11 +71,6 @@ TSMgmtError MgmtConfigRecordDescribe(const char *rec_name, unsigned flags, TSCon
 TSMgmtError MgmtConfigRecordDescribeMatching(const char *regex, unsigned flags, TSList rec_vals);
 
 /***************************************************************************
- * File Operations
- ***************************************************************************/
-TSMgmtError ReadFile(TSFileNameT file, char **text, int *size, int *version);
-
-/***************************************************************************
  * Events
  ***************************************************************************/
 
diff --git a/mgmt/api/CoreAPIRemote.cc b/mgmt/api/CoreAPIRemote.cc
index 962b02c..fb3d540 100644
--- a/mgmt/api/CoreAPIRemote.cc
+++ b/mgmt/api/CoreAPIRemote.cc
@@ -42,10 +42,11 @@
 #include "ts/ink_string.h"
 #include "ts/I_Layout.h"
 #include "ts/ParseRules.h"
+#include "ts/ink_memory.h"
 #include "CoreAPI.h"
 #include "CoreAPIShared.h"
-#include "CfgContextUtils.h"
 #include "NetworkUtilsRemote.h"
+
 #include "EventCallback.h"
 #include "MgmtMarshall.h"
 
@@ -814,64 +815,6 @@ MgmtRecordSetString(const char *rec_name, const char *string_val, TSActionNeedT
 }
 
 /***************************************************************************
- * File Operations
- ***************************************************************************/
-/*-------------------------------------------------------------------------
- * ReadFile
- *-------------------------------------------------------------------------
- * Purpose: returns copy of the most recent version of the file
- * Input:   file - the config file to read
- *          text - a buffer is allocated on the text char* pointer
- *          size - the size of the buffer is returned
- * Output:
- *
- * Marshals a read file request that can be sent over the unix domain socket.
- * Connects to the socket and sends request over. Parses the response from
- * Traffic Manager.
- */
-TSMgmtError
-ReadFile(TSFileNameT file, char **text, int *size, int *version)
-{
-  TSMgmtError ret;
-  OpType optype       = OpType::FILE_READ;
-  MgmtMarshallInt fid = file;
-
-  MgmtMarshallData reply = {nullptr, 0};
-  MgmtMarshallInt err;
-  MgmtMarshallInt vers;
-  MgmtMarshallData data = {nullptr, 0};
-
-  *text = nullptr;
-  *size = *version = 0;
-
-  ret = MGMTAPI_SEND_MESSAGE(main_socket_fd, OpType::FILE_READ, &optype, &fid);
-  if (ret != TS_ERR_OKAY) {
-    return ret;
-  }
-
-  ret = recv_mgmt_message(main_socket_fd, reply);
-  if (ret != TS_ERR_OKAY) {
-    return ret;
-  }
-
-  ret = recv_mgmt_response(reply.ptr, reply.len, OpType::FILE_READ, &err, &vers, &data);
-  ats_free(reply.ptr);
-
-  if (ret != TS_ERR_OKAY) {
-    return ret;
-  }
-
-  if (err != TS_ERR_OKAY) {
-    return (TSMgmtError)err;
-  }
-
-  *version = vers;
-  *text    = (char *)data.ptr;
-  *size    = (int)data.len;
-  return TS_ERR_OKAY;
-}
-
-/***************************************************************************
  * Events
  ***************************************************************************/
 /*-------------------------------------------------------------------------
diff --git a/mgmt/api/EventControlMain.cc b/mgmt/api/EventControlMain.cc
index ccf2bcc..ba76d10 100644
--- a/mgmt/api/EventControlMain.cc
+++ b/mgmt/api/EventControlMain.cc
@@ -519,7 +519,6 @@ done:
 using event_message_handler = TSMgmtError (*)(EventClientT *, void *, size_t);
 
 static const event_message_handler handlers[] = {
-  nullptr,                     // FILE_READ
   nullptr,                     // RECORD_SET
   nullptr,                     // RECORD_GET
   nullptr,                     // PROXY_STATE_GET
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index d044dac..50ab43b 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -31,13 +31,12 @@
  ***************************************************************************/
 #include "ts/ink_platform.h"
 #include "ts/ink_code.h"
+#include "ts/ink_memory.h"
 #include "ts/ParseRules.h"
 #include <climits>
 #include "ts/I_Layout.h"
 
 #include "mgmtapi.h"
-#include "CfgContextImpl.h"
-#include "CfgContextUtils.h"
 #include "CoreAPI.h"
 #include "CoreAPIShared.h"
 
@@ -254,31 +253,6 @@ TSIpAddrListIsEmpty(TSIpAddrList ip_addrl)
   return queue_is_empty((LLQ *)ip_addrl);
 }
 
-// returns false if any of the IpAddrEle is not an valid IP address by making
-// use of ccu_checkIpAddrEle; if return false, the ip's may be reordered
-// from the original list
-tsapi bool
-TSIpAddrListIsValid(TSIpAddrList ip_addrl)
-{
-  int i, len;
-  TSIpAddrEle *ele;
-
-  if (!ip_addrl) {
-    return false;
-  }
-
-  len = queue_len((LLQ *)ip_addrl);
-  for (i = 0; i < len; i++) {
-    ele = (TSIpAddrEle *)dequeue((LLQ *)ip_addrl);
-    if (!ccu_checkIpAddrEle(ele)) {
-      enqueue((LLQ *)ip_addrl, ele);
-      return false;
-    }
-    enqueue((LLQ *)ip_addrl, ele);
-  }
-  return true;
-}
-
 /*--- TSPortList operations ----------------------------------------------*/
 tsapi TSPortList
 TSPortListCreate()
@@ -361,31 +335,6 @@ TSPortListIsEmpty(TSPortList portl)
   return queue_is_empty((LLQ *)portl);
 }
 
-// returns false if any of the PortEle's has a port_a <= 0;
-// if returns false, then will return the entire port list
-// intact, although the ports may not be ordered in the same way
-tsapi bool
-TSPortListIsValid(TSPortList portl)
-{
-  int i, len;
-  TSPortEle *ele;
-
-  if (!portl) {
-    return false;
-  }
-
-  len = queue_len((LLQ *)portl);
-  for (i = 0; i < len; i++) {
-    ele = (TSPortEle *)dequeue((LLQ *)portl);
-    if (!ccu_checkPortEle(ele)) {
-      enqueue((LLQ *)portl, ele);
-      return false;
-    }
-    enqueue((LLQ *)portl, ele);
-  }
-  return true;
-}
-
 /*--- TSDomainList operations -----------------------------------------*/
 tsapi TSDomainList
 TSDomainListCreate()
@@ -1747,13 +1696,6 @@ TSGetErrorMessage(TSMgmtError err_id)
   return err_msg;
 }
 
-/*--- direct file operations ----------------------------------------------*/
-tsapi TSMgmtError
-TSConfigFileRead(TSFileNameT file, char **text, int *size, int *version)
-{
-  return ReadFile(file, text, size, version);
-}
-
 /* ReadFromUrl: reads a remotely located config file into a buffer
  * Input:  url        - remote location of the file
  *         header     - a buffer is allocated on the header char* pointer
@@ -2115,20 +2057,6 @@ TSEventSignalCbUnregister(char *event_name, TSEventSignalFunc func)
   return EventSignalCbUnregister(event_name, func);
 }
 
-/* checks if the fields in the ele are all valid */
-bool
-TSIsValid(TSCfgEle *ele)
-{
-  CfgEleObj *ele_obj;
-
-  if (!ele) {
-    return false;
-  }
-
-  ele_obj = create_ele_obj_from_ele(ele);
-  return (ele_obj->isValid());
-}
-
 TSConfigRecordDescription *
 TSConfigRecordDescriptionCreate(void)
 {
diff --git a/mgmt/api/Makefile.am b/mgmt/api/Makefile.am
index d5385e5..e9c8357 100644
--- a/mgmt/api/Makefile.am
+++ b/mgmt/api/Makefile.am
@@ -34,10 +34,6 @@ noinst_LTLIBRARIES = libmgmtapilocal.la libmgmtapi.la
 lib_LTLIBRARIES = libtsmgmt.la
 
 libmgmtapi_la_SOURCES = \
-  CfgContextImpl.cc \
-  CfgContextImpl.h \
-  CfgContextUtils.cc \
-  CfgContextUtils.h \
   CoreAPI.h \
   CoreAPIShared.cc \
   CoreAPIShared.h \
@@ -55,7 +51,6 @@ if BUILD_TESTS
 endif
 
 libmgmtapilocal_la_SOURCES = \
-  CfgContextDefs.h \
   CoreAPI.cc \
   EventControlMain.cc \
   EventControlMain.h \
diff --git a/mgmt/api/NetworkMessage.cc b/mgmt/api/NetworkMessage.cc
index 808e9ed..c7b244b 100644
--- a/mgmt/api/NetworkMessage.cc
+++ b/mgmt/api/NetworkMessage.cc
@@ -38,7 +38,6 @@ struct NetCmdOperation {
 
 // Requests always begin with a OpType, followed by aditional fields.
 static const struct NetCmdOperation requests[] = {
-  /* FILE_READ                  */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_INT}},
   /* RECORD_SET                 */ {3, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING, MGMT_MARSHALL_STRING}},
   /* RECORD_GET                 */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
   /* PROXY_STATE_GET            */ {1, {MGMT_MARSHALL_INT}},
@@ -64,7 +63,6 @@ static const struct NetCmdOperation requests[] = {
 
 // Responses always begin with a TSMgmtError code, followed by additional fields.
 static const struct NetCmdOperation responses[] = {
-  /* FILE_READ                  */ {3, {MGMT_MARSHALL_INT, MGMT_MARSHALL_INT, MGMT_MARSHALL_DATA}},
   /* RECORD_SET                 */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_INT}},
   /* RECORD_GET                 */
   {5, {MGMT_MARSHALL_INT, MGMT_MARSHALL_INT, MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING, MGMT_MARSHALL_DATA}},
@@ -213,10 +211,6 @@ send_mgmt_error(int fd, OpType optype, TSMgmtError error)
     ink_release_assert(responses[static_cast<unsigned>(optype)].nfields == 2);
     return send_mgmt_response(fd, optype, &ecode, &strval);
 
-  case OpType::FILE_READ:
-    ink_release_assert(responses[static_cast<unsigned>(optype)].nfields == 3);
-    return send_mgmt_response(fd, optype, &ecode, &intval, &dataval);
-
   case OpType::RECORD_GET:
   case OpType::RECORD_MATCH_GET:
     ink_release_assert(responses[static_cast<unsigned>(optype)].nfields == 5);
diff --git a/mgmt/api/NetworkMessage.h b/mgmt/api/NetworkMessage.h
index a133882..45b5213 100644
--- a/mgmt/api/NetworkMessage.h
+++ b/mgmt/api/NetworkMessage.h
@@ -33,7 +33,6 @@
 
 // the possible operations or msg types sent from remote client to TM
 enum class OpType : MgmtMarshallInt {
-  FILE_READ,
   RECORD_SET,
   RECORD_GET,
   PROXY_STATE_GET,
diff --git a/mgmt/api/TSControlMain.cc b/mgmt/api/TSControlMain.cc
index a499ad8..841947d 100644
--- a/mgmt/api/TSControlMain.cc
+++ b/mgmt/api/TSControlMain.cc
@@ -500,45 +500,6 @@ fail:
 }
 
 /**************************************************************************
- * handle_file_read
- *
- * purpose: handles request to read a file
- * output: SUCC or ERR
- * note: None
- *************************************************************************/
-static TSMgmtError
-handle_file_read(int fd, void *req, size_t reqlen)
-{
-  int size, version;
-  char *text;
-
-  MgmtMarshallInt optype;
-  MgmtMarshallInt fid;
-
-  MgmtMarshallInt err;
-  MgmtMarshallInt vers  = 0;
-  MgmtMarshallData data = {nullptr, 0};
-
-  err = recv_mgmt_request(req, reqlen, OpType::FILE_READ, &optype, &fid);
-  if (err != TS_ERR_OKAY) {
-    return (TSMgmtError)err;
-  }
-
-  // make CoreAPI call on Traffic Manager side
-  err = ReadFile((TSFileNameT)fid, &text, &size, &version);
-  if (err == TS_ERR_OKAY) {
-    vers     = version;
-    data.ptr = text;
-    data.len = size;
-  }
-
-  err = send_mgmt_response(fd, OpType::FILE_READ, &err, &vers, &data);
-
-  ats_free(text); // free memory allocated by ReadFile
-  return (TSMgmtError)err;
-}
-
-/**************************************************************************
  * handle_proxy_state_get
  *
  * purpose: handles request to get the state of the proxy (TS)
@@ -988,7 +949,6 @@ struct control_message_handler {
 };
 
 static const control_message_handler handlers[] = {
-  /* FILE_READ                  */ {MGMT_API_PRIVILEGED, handle_file_read},
   /* RECORD_SET                 */ {MGMT_API_PRIVILEGED, handle_record_set},
   /* RECORD_GET                 */ {0, handle_record_get},
   /* PROXY_STATE_GET            */ {0, handle_proxy_state_get},
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index f3b7f1c..6dbea26 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -124,9 +124,6 @@ typedef TSHandle TSDomainList; /* contains TSDomain *'s    */
 typedef TSHandle TSStringList; /* contains char* 's         */
 typedef TSHandle TSIntList;    /* contains int* 's          */
 
-typedef TSHandle TSCfgContext;
-typedef TSHandle TSCfgIterState;
-
 /*--- basic control operations --------------------------------------------*/
 
 typedef enum {
@@ -641,7 +638,6 @@ tsapi TSIpAddrEle *TSIpAddrListDequeue(TSIpAddrList ip_addrl);
 tsapi int TSIpAddrListLen(TSIpAddrList ip_addrl);
 tsapi bool TSIpAddrListIsEmpty(TSIpAddrList ip_addrl);
 tsapi int TSIpAddrListLen(TSIpAddrList ip_addrl);
-tsapi bool TSIpAddrListIsValid(TSIpAddrList ip_addrl);
 
 /*--- TSPortList operations ----------------------------------------------*/
 tsapi TSPortList TSPortListCreate();
@@ -650,7 +646,6 @@ tsapi TSMgmtError TSPortListEnqueue(TSPortList portl, TSPortEle *port);
 tsapi TSPortEle *TSPortListDequeue(TSPortList portl);
 tsapi bool TSPortListIsEmpty(TSPortList portl);
 tsapi int TSPortListLen(TSPortList portl);
-tsapi bool TSPortListIsValid(TSPortList portl);
 
 /*--- TSStringList operations --------------------------------------------*/
 tsapi TSStringList TSStringListCreate();
@@ -735,13 +730,6 @@ tsapi TSSplitDnsEle *TSSplitDnsEleCreate();
 tsapi void TSSplitDnsEleDestroy(TSSplitDnsEle *ele);
 tsapi TSStorageEle *TSStorageEleCreate();
 tsapi void TSStorageEleDestroy(TSStorageEle *ele);
-/*--- Ele helper operations -------------------------------------*/
-
-/* TSIsValid: checks if the fields in the ele are all valid
- * Input:  ele - the ele to check (typecast any of the TSxxxEle's to an TSCfgEle)
- * Output: true if ele has valid fields for its rule type, false otherwise
- */
-bool TSIsValid(TSCfgEle *ele);
 
 /***************************************************************************
  * API Core
@@ -847,15 +835,6 @@ tsapi TSMgmtError TSLifecycleMessage(const char *tag, void const *data, size_t d
  */
 char *TSGetErrorMessage(TSMgmtError error_id);
 
-/*--- direct file operations ----------------------------------------------*/
-/* TSConfigFileRead: reads a config file into a buffer
- * Input:  file - the config file to read
- *         text - a buffer is allocated on the text char* pointer
- *         size - the size of the buffer is returned
- * Output: TSMgmtError
- */
-tsapi TSMgmtError TSConfigFileRead(TSFileNameT file, char **text, int *size, int *version);
-
 /* TSReadFromUrl: reads a remotely located config file into a buffer
  * Input:  url        - remote location of the file
  *         header     - a buffer is allocated on the header char* pointer
@@ -1022,12 +1001,6 @@ tsapi TSMgmtError TSEventSignalCbRegister(char *event_name, TSEventSignalFunc fu
  */
 tsapi TSMgmtError TSEventSignalCbUnregister(char *event_name, TSEventSignalFunc func);
 
-/*--- TSCfgContext Operations --------------------------------------------*/
-/*
- * These operations are used to manipulate the opaque TSCfgContext type,
- * eg. when want to modify a file
- */
-
 /*--- TS Cache Inspector Operations --------------------------------------------*/
 
 /* TSLookupFromCacheUrl

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.