trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject svn commit: r1059430 [2/5] - in /trafficserver/traffic/trunk/proxy/mgmt: cli/ html2/ html2/images/ web2/
Date Sun, 16 Jan 2011 01:16:40 GMT
Modified: trafficserver/traffic/trunk/proxy/mgmt/web2/WebConfigRender.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt/web2/WebConfigRender.cc?rev=1059430&r1=1059429&r2=1059430&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt/web2/WebConfigRender.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt/web2/WebConfigRender.cc Sun Jan 16 01:16:39 2011
@@ -54,2130 +54,7 @@
 #define MAX_RULE_PART_SIZE    64
 #define BORDER_COLOR          "#cccccc"
 
-//---------------------- TABLE FUNCTIONS ----------------------------------
-
-
-
-
-//-------------------------------------------------------------------------
-// writeCacheConfigTable
-//-------------------------------------------------------------------------
-int
-writeCacheConfigTable(WebHttpContext * whc)
-{
-  INKCacheEle *ele;
-  char ruleType[MAX_RULE_PART_SIZE];
-  char pdType[MAX_RULE_PART_SIZE];
-  char time[MAX_RULE_PART_SIZE];
-  char src_ip[MAX_RULE_PART_SIZE];
-  char prefix[MAX_RULE_PART_SIZE];
-  char suffix[MAX_RULE_PART_SIZE];
-  char port[MAX_RULE_PART_SIZE];
-  char method[MAX_RULE_PART_SIZE];
-  char scheme[MAX_RULE_PART_SIZE];
-  char time_period[MAX_RULE_PART_SIZE];
-  char mixt[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_CACHE_OBJ);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeCacheConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_RULE_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_VALUE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TIME_PERIOD);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SECONDARY_SPEC);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKCacheEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(ruleType, 0, MAX_RULE_PART_SIZE);
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(time, 0, MAX_RULE_PART_SIZE);
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(prefix, 0, MAX_RULE_PART_SIZE);
-    memset(suffix, 0, MAX_RULE_PART_SIZE);
-    memset(port, 0, MAX_RULE_PART_SIZE);
-    memset(method, 0, MAX_RULE_PART_SIZE);
-    memset(scheme, 0, MAX_RULE_PART_SIZE);
-    memset(time_period, 0, MAX_RULE_PART_SIZE);
-    memset(mixt, 0, MAX_RULE_PART_SIZE);
-    if (convert_cache_ele_to_html_format(ele, ruleType, pdType, time, src_ip,
-                                         prefix, suffix, port, method, scheme,
-                                         time_period, mixt) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeCacheConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ruleType, strlen(ruleType));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(pdType, strlen(pdType));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->cache_info.pd_val, strlen(ele->cache_info.pd_val));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(time_period) > 0)
-      output->copyFrom(time_period, strlen(time_period));
-    HtmlRndrTdClose(output);
-
-    writeSecondarySpecsTableElem(output, time, src_ip, prefix, suffix, port, method, scheme, mixt);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 5);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeHostingConfigTable
-//-------------------------------------------------------------------------
-int
-writeHostingConfigTable(WebHttpContext * whc)
-{
-  INKHostingEle *ele;
-  char pdType[MAX_RULE_PART_SIZE];
-  char partitions[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_HOSTING);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    Debug("config", "[writeHostingConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_VALUE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PARTITIONS);
-  HtmlRndrTdClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKHostingEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(partitions, 0, MAX_RULE_PART_SIZE);
-    if (convert_hosting_ele_to_html_format(ele, pdType, partitions) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeHostingConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(pdType, strlen(pdType));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->pd_val, strlen(ele->pd_val));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(partitions) > 0)
-      output->copyFrom(partitions, strlen(partitions));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 3);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeIcpConfigTable
-//-------------------------------------------------------------------------
-int
-writeIcpConfigTable(WebHttpContext * whc)
-{
-  INKIcpEle *ele;
-  char name[MAX_RULE_PART_SIZE];
-  char host_ip[MAX_RULE_PART_SIZE];
-  char peer_type[MAX_RULE_PART_SIZE];
-  char proxy_port[MAX_RULE_PART_SIZE];
-  char icp_port[MAX_RULE_PART_SIZE];
-  char mc_state[MAX_RULE_PART_SIZE];
-  char mc_ip[MAX_RULE_PART_SIZE];
-  char mc_ttl[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_ICP_PEER);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    Debug("config", "[writeICPConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_HOST);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_PORT);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ICP_PORT);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_STATE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_TTL);
-  HtmlRndrTdClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKIcpEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(name, 0, MAX_RULE_PART_SIZE);
-    memset(host_ip, 0, MAX_RULE_PART_SIZE);
-    memset(peer_type, 0, MAX_RULE_PART_SIZE);
-    memset(proxy_port, 0, MAX_RULE_PART_SIZE);
-    memset(icp_port, 0, MAX_RULE_PART_SIZE);
-    memset(mc_state, 0, MAX_RULE_PART_SIZE);
-    memset(mc_ip, 0, MAX_RULE_PART_SIZE);
-    memset(mc_ttl, 0, MAX_RULE_PART_SIZE);
-    if (convert_icp_ele_to_html_format(ele, name, host_ip, peer_type, proxy_port, icp_port, mc_state, mc_ip, mc_ttl) !=
-        WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeIcpConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(name, strlen(name));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(host_ip, strlen(host_ip));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(peer_type, strlen(peer_type));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(proxy_port, strlen(proxy_port));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(icp_port, strlen(icp_port));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(mc_state, strlen(mc_state));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(mc_ip) > 0)
-      output->copyFrom(mc_ip, strlen(mc_ip));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(mc_ttl) > 0)
-      output->copyFrom(mc_ttl, strlen(mc_ttl));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 8);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeIpAllowConfigTable
-//-------------------------------------------------------------------------
-int
-writeIpAllowConfigTable(WebHttpContext * whc)
-{
-  INKIpAllowEle *ele;
-  char src_ip[MAX_RULE_PART_SIZE];
-  char action[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_IP_ALLOW);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeIpAllowConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKIpAllowEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(action, 0, MAX_RULE_PART_SIZE);
-
-    if (convert_ip_allow_ele_to_html_format(ele, src_ip, action) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeIpAllowConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(action, strlen(action));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(src_ip, strlen(src_ip));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 2);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-
-//-------------------------------------------------------------------------
-// writeMgmtAllowConfigTable
-//-------------------------------------------------------------------------
-int
-writeMgmtAllowConfigTable(WebHttpContext * whc)
-{
-  INKMgmtAllowEle *ele;
-  char src_ip[MAX_RULE_PART_SIZE];
-  char action[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_MGMT_ALLOW);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeMgmtAllowConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKMgmtAllowEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(action, 0, MAX_RULE_PART_SIZE);
-    if (convert_mgmt_allow_ele_to_html_format(ele, src_ip, action) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeMgmtAllowConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(action, strlen(action));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(src_ip, strlen(src_ip));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 2);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeParentConfigTable
-//-------------------------------------------------------------------------
-int
-writeParentConfigTable(WebHttpContext * whc)
-{
-  INKParentProxyEle *ele;
-  char pdType[MAX_RULE_PART_SIZE];
-  char time[MAX_RULE_PART_SIZE];
-  char src_ip[MAX_RULE_PART_SIZE];
-  char prefix[MAX_RULE_PART_SIZE];
-  char suffix[MAX_RULE_PART_SIZE];
-  char port[MAX_RULE_PART_SIZE];
-  char method[MAX_RULE_PART_SIZE];
-  char scheme[MAX_RULE_PART_SIZE];
-  char mixt[MAX_RULE_PART_SIZE];
-  char parents[MAX_RULE_PART_SIZE];
-  char round_robin[MAX_RULE_PART_SIZE];
-  char direct[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_PARENT_PROXY);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeParentConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_VALUE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PARENTS);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ROUND_ROBIN);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_GO_DIRECT);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SECONDARY_SPEC);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKParentProxyEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(time, 0, MAX_RULE_PART_SIZE);
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(prefix, 0, MAX_RULE_PART_SIZE);
-    memset(suffix, 0, MAX_RULE_PART_SIZE);
-    memset(port, 0, MAX_RULE_PART_SIZE);
-    memset(method, 0, MAX_RULE_PART_SIZE);
-    memset(scheme, 0, MAX_RULE_PART_SIZE);
-    memset(mixt, 0, MAX_RULE_PART_SIZE);
-    memset(parents, 0, MAX_RULE_PART_SIZE);
-    memset(round_robin, 0, MAX_RULE_PART_SIZE);
-    memset(direct, 0, MAX_RULE_PART_SIZE);
-    if (convert_parent_ele_to_html_format
-        (ele, pdType, time, src_ip, prefix, suffix, port, method, scheme, mixt, parents, round_robin,
-         direct) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeParentConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(pdType, strlen(pdType));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->parent_info.pd_val, strlen(ele->parent_info.pd_val));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(parents) > 0)
-      output->copyFrom(parents, strlen(parents));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(round_robin) > 0)
-      output->copyFrom(round_robin, strlen(round_robin));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(direct) > 0)
-      output->copyFrom(direct, strlen(direct));
-    HtmlRndrTdClose(output);
-
-    writeSecondarySpecsTableElem(output, time, src_ip, prefix, suffix, port, method, scheme, mixt);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 6);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writePartionConfigTable
-//-------------------------------------------------------------------------
-int
-writePartitionConfigTable(WebHttpContext * whc)
-{
-  // now write each rule as a row in the table
-  INKPartitionEle *ele;
-  char part_num[MAX_RULE_PART_SIZE];
-  char scheme[MAX_RULE_PART_SIZE];
-  char size[MAX_RULE_PART_SIZE];
-  char size_fmt[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_PARTITION);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    Debug("config", "[writePartitionConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PARTITION_NUM);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SCHEME);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PSIZE);
-  HtmlRndrTdClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKPartitionEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(part_num, 0, MAX_RULE_PART_SIZE);
-    memset(scheme, 0, MAX_RULE_PART_SIZE);
-    memset(size, 0, MAX_RULE_PART_SIZE);
-    memset(size_fmt, 0, MAX_RULE_PART_SIZE);
-    if (convert_partition_ele_to_html_format(ele, part_num, scheme, size, size_fmt) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writePartitionConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(part_num, strlen(part_num));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(scheme, strlen(scheme));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(size, strlen(size));
-    switch (ele->size_format) {
-    case INK_SIZE_FMT_PERCENT:
-      output->copyFrom("%", strlen("%"));
-      break;
-    case INK_SIZE_FMT_ABSOLUTE:
-      output->copyFrom(" MB", strlen(" MB"));
-      break;
-    default:
-      // Handled here:
-      // INK_SIZE_FMT_UNDEFINED
-      break;
-    }
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 3);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeRemapConfigTable
-//-------------------------------------------------------------------------
-int
-writeRemapConfigTable(WebHttpContext * whc)
-{
-  INKRemapEle *ele;
-  char rule_type[MAX_RULE_PART_SIZE];
-  char from_scheme[MAX_RULE_PART_SIZE];
-  char from_port[MAX_RULE_PART_SIZE];
-  char from_path[MAX_RULE_PART_SIZE];
-  char to_scheme[MAX_RULE_PART_SIZE];
-  char to_port[MAX_RULE_PART_SIZE];
-  char to_path[MAX_RULE_PART_SIZE];
-  char mixt[MAX_RULE_PART_SIZE];
-
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_REMAP);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeRemapConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_RULE_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_FROM_SCHEME);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_FROM_HOST);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_FROM_PORT);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_FROM_PATH);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TO_SCHEME);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TO_HOST);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TO_PORT);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TO_PATH);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKRemapEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(rule_type, 0, MAX_RULE_PART_SIZE);
-    memset(from_scheme, 0, MAX_RULE_PART_SIZE);
-    memset(from_port, 0, MAX_RULE_PART_SIZE);
-    memset(from_path, 0, MAX_RULE_PART_SIZE);
-    memset(to_scheme, 0, MAX_RULE_PART_SIZE);
-    memset(to_port, 0, MAX_RULE_PART_SIZE);
-    memset(to_path, 0, MAX_RULE_PART_SIZE);
-    memset(mixt, 0, MAX_RULE_PART_SIZE);
-    if (convert_remap_ele_to_html_format
-        (ele, rule_type, from_scheme, from_port, from_path, to_scheme, to_port, to_path, mixt) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeRemapConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(rule_type, strlen(rule_type));
-    HtmlRndrTdClose(output);
-
-    // from url
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(from_scheme, strlen(from_scheme));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->from_host, strlen(ele->from_host));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(from_port, strlen(from_port));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(from_path, strlen(from_path));
-    HtmlRndrTdClose(output);
-
-    // to url
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(to_scheme, strlen(to_scheme));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->to_host, strlen(ele->to_host));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(to_port, strlen(to_port));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(to_path, strlen(to_path));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(mixt, strlen(mixt));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 10);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeSocksConfigTable
-//-------------------------------------------------------------------------
-int
-writeSocksConfigTable(WebHttpContext * whc)
-{
-  INKSocksEle *ele;
-  char rule_type[MAX_RULE_PART_SIZE];
-  char user[MAX_RULE_PART_SIZE];
-  char passwd[MAX_RULE_PART_SIZE];
-  char servers[MAX_RULE_PART_SIZE];
-  char dest_ip[MAX_RULE_PART_SIZE];
-  char rr[MAX_RULE_PART_SIZE];
-
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_SOCKS);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeSocksConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_RULE_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_USER);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PASSWORD);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOCKS_SERVER);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ROUND_ROBIN);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKSocksEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(rule_type, 0, MAX_RULE_PART_SIZE);
-    memset(user, 0, MAX_RULE_PART_SIZE);
-    memset(passwd, 0, MAX_RULE_PART_SIZE);
-    memset(dest_ip, 0, MAX_RULE_PART_SIZE);
-    memset(servers, 0, MAX_RULE_PART_SIZE);
-    memset(rr, 0, MAX_RULE_PART_SIZE);
-    if (convert_socks_ele_to_html_format(ele, rule_type, dest_ip, user, passwd, servers, rr) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeSocksConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(rule_type, strlen(rule_type));
-    HtmlRndrTdClose(output);
-
-    // username
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(user, strlen(user));
-    HtmlRndrTdClose(output);
-
-    // password
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(passwd, strlen(passwd));
-    HtmlRndrTdClose(output);
-
-    // dest ips
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(dest_ip, strlen(dest_ip));
-    HtmlRndrTdClose(output);
-
-    // socks servers
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(servers, strlen(servers));
-    HtmlRndrTdClose(output);
-
-    // round robin
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(rr, strlen(rr));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 7);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeSplitDnsConfigTable
-//-------------------------------------------------------------------------
-int
-writeSplitDnsConfigTable(WebHttpContext * whc)
-{
-  // now write each rule as a row in the table
-  INKSplitDnsEle *ele;
-  char pdType[MAX_RULE_PART_SIZE];
-  char dns_server[MAX_RULE_PART_SIZE];
-  char def_domain[MAX_RULE_PART_SIZE];
-  char search_list[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_SPLIT_DNS);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    Debug("config", "[writeSplitDnsConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_TYPE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PDEST_VALUE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DNS_SERVER_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DOMAIN_NAME);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SEARCH_LIST);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKSplitDnsEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(dns_server, 0, MAX_RULE_PART_SIZE);
-    memset(def_domain, 0, MAX_RULE_PART_SIZE);
-    memset(search_list, 0, MAX_RULE_PART_SIZE);
-    if (convert_split_dns_ele_to_html_format(ele, pdType, dns_server, def_domain, search_list) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeSplitDnsConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(pdType, strlen(pdType));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->pd_val, strlen(ele->pd_val));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(dns_server) > 0)
-      output->copyFrom(dns_server, strlen(dns_server));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(def_domain) > 0)
-      output->copyFrom(def_domain, strlen(def_domain));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(search_list) > 0)
-      output->copyFrom(search_list, strlen(search_list));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 5);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeUpdateConfigTable
-//-------------------------------------------------------------------------
-int
-writeUpdateConfigTable(WebHttpContext * whc)
-{
-  // now write each rule as a row in the table
-  INKUpdateEle *ele;
-  char hdrs[MAX_RULE_PART_SIZE];
-  char offset[MAX_RULE_PART_SIZE];
-  char interval[MAX_RULE_PART_SIZE];
-  char depth[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_UPDATE_URL);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    Debug("config", "[writeUpdateConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_URL);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_REQUEST_HDR);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_OFFSET_HOUR);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_INTERVAL);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_RECUR_DEPTH);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKUpdateEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(hdrs, 0, MAX_RULE_PART_SIZE);
-    memset(offset, 0, MAX_RULE_PART_SIZE);
-    memset(interval, 0, MAX_RULE_PART_SIZE);
-    memset(depth, 0, MAX_RULE_PART_SIZE);
-    if (convert_update_ele_to_html_format(ele, hdrs, offset, interval, depth) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeUpdateConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->url, strlen(ele->url));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(hdrs) > 0)
-      output->copyFrom(hdrs, strlen(hdrs));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(offset, strlen(offset));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(interval, strlen(interval));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    if (strlen(depth) > 0)
-      output->copyFrom(depth, strlen(depth));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 5);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeVaddrsConfigTable
-//-------------------------------------------------------------------------
-int
-writeVaddrsConfigTable(WebHttpContext * whc)
-{
-  // now write each rule as a row in the table
-  INKVirtIpAddrEle *ele;
-  char ip[MAX_RULE_PART_SIZE];
-  char sub_intr[MAX_RULE_PART_SIZE];
-  int count;
-
-  textBuffer *output = whc->response_bdy;
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_VADDRS);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    Debug("config", "[writeVaddrsConfigTable] Error: INKCfgContextGet failed");
-    INKCfgContextDestroy(ctx);
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  HtmlRndrTableOpen(output, "100%", 1, 0, 0, BORDER_COLOR);
-
-  // write the table headings
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_VIRTUAL_IP);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ETH_INTERFACE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_CENTER, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SUB_INTERFACE);
-  HtmlRndrTdClose(output);
-
-  HtmlRndrTrClose(output);
-
-  count = INKCfgContextGetCount(ctx);
-  for (int i = 0; i < count; i++) {
-    ele = (INKVirtIpAddrEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(ip, 0, MAX_RULE_PART_SIZE);
-    memset(sub_intr, 0, MAX_RULE_PART_SIZE);
-    if (convert_virt_ip_addr_ele_to_html_format(ele, ip, sub_intr) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeVaddrsConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-    // write the rule info into the table row
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_CENTER);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ip, strlen(ip));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(ele->intr, strlen(ele->intr));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
-    HtmlRndrSpace(output, 2);
-    output->copyFrom(sub_intr, strlen(sub_intr));
-    HtmlRndrTdClose(output);
-
-    HtmlRndrTrClose(output);
-  }                             // end for loop
-
-  // no rules
-  if (count == 0) {
-    HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-    HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_NONE, HTML_VALIGN_NONE, NULL, NULL, 3);
-    HtmlRndrSpace(output, 2);
-    HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_NO_RULES);
-    HtmlRndrTdClose(output);
-    HtmlRndrTrClose(output);
-  }
-
-  HtmlRndrTableClose(output);
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------- RULE LIST FUNCTIONS --------------------------------
-
-
-
-
-
-//-------------------------------------------------------------------------
-// writeCacheRuleList
-//-------------------------------------------------------------------------
-int
-writeCacheRuleList(textBuffer * output)
-{
-  INKCacheEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_CACHE_OBJ);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeCacheRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char ruleType[MAX_RULE_PART_SIZE];
-  char pdType[MAX_RULE_PART_SIZE];
-  char time[MAX_RULE_PART_SIZE];
-  char src_ip[MAX_RULE_PART_SIZE];
-  char prefix[MAX_RULE_PART_SIZE];
-  char suffix[MAX_RULE_PART_SIZE];
-  char port[MAX_RULE_PART_SIZE];
-  char method[MAX_RULE_PART_SIZE];
-  char scheme[MAX_RULE_PART_SIZE];
-  char time_period[MAX_RULE_PART_SIZE];
-  char mixt[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKCacheEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(ruleType, 0, MAX_RULE_PART_SIZE);
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(time, 0, MAX_RULE_PART_SIZE);
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(prefix, 0, MAX_RULE_PART_SIZE);
-    memset(suffix, 0, MAX_RULE_PART_SIZE);
-    memset(port, 0, MAX_RULE_PART_SIZE);
-    memset(method, 0, MAX_RULE_PART_SIZE);
-    memset(scheme, 0, MAX_RULE_PART_SIZE);
-    memset(time_period, 0, MAX_RULE_PART_SIZE);
-    memset(mixt, 0, MAX_RULE_PART_SIZE);
-    if (convert_cache_ele_to_html_format(ele, ruleType, pdType, time, src_ip,
-                                         prefix, suffix, port, method, scheme,
-                                         time_period, mixt) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeCacheRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE,
-                 "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n",
-                 i, ruleType, pdType, ele->cache_info.pd_val, time, src_ip, prefix, suffix, port, method, scheme,
-                 time_period, mixt);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeHostingRuleList
-//-------------------------------------------------------------------------
-int
-writeHostingRuleList(textBuffer * output)
-{
-  INKHostingEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_HOSTING);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeHostingRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-
-  char pdType[MAX_RULE_PART_SIZE];
-  char partitions[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKHostingEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(partitions, 0, MAX_RULE_PART_SIZE);
-
-    if (convert_hosting_ele_to_html_format(ele, pdType, partitions) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeHostingRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\");\n",
-                 i, pdType, ele->pd_val, partitions);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-
-//-------------------------------------------------------------------------
-// writeIcpRuleList
-//-------------------------------------------------------------------------
-int
-writeIcpRuleList(textBuffer * output)
-{
-  INKIcpEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_ICP_PEER);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeIcpRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;   //goto Lerror;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char name[MAX_RULE_PART_SIZE];
-  char host_ip[MAX_RULE_PART_SIZE];
-  char peer_type[MAX_RULE_PART_SIZE];
-  char proxy_port[MAX_RULE_PART_SIZE];
-  char icp_port[MAX_RULE_PART_SIZE];
-  char mc_state[MAX_RULE_PART_SIZE];
-  char mc_ip[MAX_RULE_PART_SIZE];
-  char mc_ttl[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKIcpEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(name, 0, MAX_RULE_PART_SIZE);
-    memset(host_ip, 0, MAX_RULE_PART_SIZE);
-    memset(peer_type, 0, MAX_RULE_PART_SIZE);
-    memset(proxy_port, 0, MAX_RULE_PART_SIZE);
-    memset(icp_port, 0, MAX_RULE_PART_SIZE);
-    memset(mc_state, 0, MAX_RULE_PART_SIZE);
-    memset(mc_ip, 0, MAX_RULE_PART_SIZE);
-    memset(mc_ttl, 0, MAX_RULE_PART_SIZE);
-    if (convert_icp_ele_to_html_format(ele, name, host_ip, peer_type, proxy_port, icp_port, mc_state, mc_ip, mc_ttl) !=
-        WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeIcpRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE,
-                 "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n", i, name,
-                 host_ip, peer_type, proxy_port, icp_port, mc_state, mc_ip, mc_ttl);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-
-//-------------------------------------------------------------------------
-// writeIpAllowRuleList
-//-------------------------------------------------------------------------
-int
-writeIpAllowRuleList(textBuffer * output)
-{
-  INKIpAllowEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_IP_ALLOW);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeIpAllowRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char src_ip[MAX_RULE_PART_SIZE];
-  char action[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKIpAllowEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(action, 0, MAX_RULE_PART_SIZE);
-
-    if (convert_ip_allow_ele_to_html_format(ele, src_ip, action) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeIpAllowRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\");\n", i, src_ip, action);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-
-//-------------------------------------------------------------------------
-// writeMgmtAllowRuleList
-//-------------------------------------------------------------------------
-int
-writeMgmtAllowRuleList(textBuffer * output)
-{
-  INKMgmtAllowEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_MGMT_ALLOW);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeMgmtAllowRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char src_ip[MAX_RULE_PART_SIZE];
-  char action[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKMgmtAllowEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(action, 0, MAX_RULE_PART_SIZE);
-
-    if (convert_mgmt_allow_ele_to_html_format(ele, src_ip, action) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeMgmtAllowRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\");\n", i, src_ip, action);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeParentRuleList
-//-------------------------------------------------------------------------
-int
-writeParentRuleList(textBuffer * output)
-{
-  INKParentProxyEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_PARENT_PROXY);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeParentRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-  char rule[MAX_RULE_SIZE];
-  char pdType[MAX_RULE_PART_SIZE];
-  char time[MAX_RULE_PART_SIZE];
-  char src_ip[MAX_RULE_PART_SIZE];
-  char prefix[MAX_RULE_PART_SIZE];
-  char suffix[MAX_RULE_PART_SIZE];
-  char port[MAX_RULE_PART_SIZE];
-  char method[MAX_RULE_PART_SIZE];
-  char scheme[MAX_RULE_PART_SIZE];
-  char mixt[MAX_RULE_PART_SIZE];
-  char parents[MAX_RULE_PART_SIZE];
-  char round_robin[MAX_RULE_PART_SIZE];
-  char direct[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKParentProxyEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(time, 0, MAX_RULE_PART_SIZE);
-    memset(src_ip, 0, MAX_RULE_PART_SIZE);
-    memset(prefix, 0, MAX_RULE_PART_SIZE);
-    memset(suffix, 0, MAX_RULE_PART_SIZE);
-    memset(port, 0, MAX_RULE_PART_SIZE);
-    memset(method, 0, MAX_RULE_PART_SIZE);
-    memset(scheme, 0, MAX_RULE_PART_SIZE);
-    memset(mixt, 0, MAX_RULE_PART_SIZE);
-    memset(parents, 0, MAX_RULE_PART_SIZE);
-    memset(round_robin, 0, MAX_RULE_PART_SIZE);
-    memset(direct, 0, MAX_RULE_PART_SIZE);
-    if (convert_parent_ele_to_html_format
-        (ele, pdType, time, src_ip, prefix, suffix, port, method, scheme, mixt, parents, round_robin,
-         direct) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeParentConfigTable] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE,
-                 "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n",
-                 i, pdType, ele->parent_info.pd_val, time, src_ip, prefix, suffix, port, method, scheme, mixt, parents,
-                 round_robin, direct);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writePartitionRuleList
-//-------------------------------------------------------------------------
-int
-writePartitionRuleList(textBuffer * output)
-{
-  INKPartitionEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_PARTITION);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writePartitionRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-
-  char part_num[MAX_RULE_PART_SIZE];
-  char scheme[MAX_RULE_PART_SIZE];
-  char size[MAX_RULE_PART_SIZE];
-  char size_fmt[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKPartitionEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(part_num, 0, MAX_RULE_PART_SIZE);
-    memset(scheme, 0, MAX_RULE_PART_SIZE);
-    memset(size, 0, MAX_RULE_PART_SIZE);
-    memset(size_fmt, 0, MAX_RULE_PART_SIZE);
-    if (convert_partition_ele_to_html_format(ele, part_num, scheme, size, size_fmt) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writePartitionRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\");\n",
-                 i, part_num, scheme, size, size_fmt);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeRemapRuleList
-//-------------------------------------------------------------------------
-int
-writeRemapRuleList(textBuffer * output)
-{
-  INKRemapEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_REMAP);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeRemapRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char rule_type[MAX_RULE_PART_SIZE];
-  char from_scheme[MAX_RULE_PART_SIZE];
-  char from_port[MAX_RULE_PART_SIZE];
-  char from_path[MAX_RULE_PART_SIZE];
-  char to_scheme[MAX_RULE_PART_SIZE];
-  char to_port[MAX_RULE_PART_SIZE];
-  char to_path[MAX_RULE_PART_SIZE];
-  char mixt[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKRemapEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(rule_type, 0, MAX_RULE_PART_SIZE);
-    memset(from_scheme, 0, MAX_RULE_PART_SIZE);
-    memset(from_port, 0, MAX_RULE_PART_SIZE);
-    memset(from_path, 0, MAX_RULE_PART_SIZE);
-    memset(to_scheme, 0, MAX_RULE_PART_SIZE);
-    memset(to_port, 0, MAX_RULE_PART_SIZE);
-    memset(to_path, 0, MAX_RULE_PART_SIZE);
-    memset(mixt, 0, MAX_RULE_PART_SIZE);
-    if (convert_remap_ele_to_html_format
-        (ele, rule_type, from_scheme, from_port, from_path, to_scheme, to_port, to_path, mixt) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeRemapRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE,
-                 "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\",\"%s\",\"%s\" );\n",
-                 i, rule_type, from_scheme, ele->from_host, from_port, from_path, to_scheme, ele->to_host, to_port,
-                 to_path, mixt);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeSocksRuleList
-//-------------------------------------------------------------------------
-int
-writeSocksRuleList(textBuffer * output)
-{
-  INKSocksEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_SOCKS);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeSocksRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char rule_type[MAX_RULE_PART_SIZE];
-  char user[MAX_RULE_PART_SIZE];
-  char passwd[MAX_RULE_PART_SIZE];
-  char servers[MAX_RULE_PART_SIZE];
-  char dest_ip[MAX_RULE_PART_SIZE];
-  char rr[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKSocksEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(rule_type, 0, MAX_RULE_PART_SIZE);
-    memset(user, 0, MAX_RULE_PART_SIZE);
-    memset(passwd, 0, MAX_RULE_PART_SIZE);
-    memset(dest_ip, 0, MAX_RULE_PART_SIZE);
-    memset(servers, 0, MAX_RULE_PART_SIZE);
-    memset(rr, 0, MAX_RULE_PART_SIZE);
-    if (convert_socks_ele_to_html_format(ele, rule_type, dest_ip, user, passwd, servers, rr) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeSocksRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n",
-                 i, rule_type, dest_ip, user, passwd, servers, rr);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeSplitDnsRuleList
-//-------------------------------------------------------------------------
-int
-writeSplitDnsRuleList(textBuffer * output)
-{
-  INKSplitDnsEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_SPLIT_DNS);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeSplitDnsRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-
-  char pdType[MAX_RULE_PART_SIZE];
-  char dns_server[MAX_RULE_PART_SIZE];
-  char def_domain[MAX_RULE_PART_SIZE];
-  char search_list[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKSplitDnsEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(pdType, 0, MAX_RULE_PART_SIZE);
-    memset(dns_server, 0, MAX_RULE_PART_SIZE);
-    memset(def_domain, 0, MAX_RULE_PART_SIZE);
-    memset(search_list, 0, MAX_RULE_PART_SIZE);
-
-    if (convert_split_dns_ele_to_html_format(ele, pdType, dns_server, def_domain, search_list) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeSplitDnsRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n",
-                 i, pdType, ele->pd_val, dns_server, def_domain, search_list);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeUpdateRuleList
-//-------------------------------------------------------------------------
-int
-writeUpdateRuleList(textBuffer * output)
-{
-  INKUpdateEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_UPDATE_URL);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeUpdateRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-
-  char hdrs[MAX_RULE_PART_SIZE];
-  char offset[MAX_RULE_PART_SIZE];
-  char interval[MAX_RULE_PART_SIZE];
-  char depth[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKUpdateEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(hdrs, 0, MAX_RULE_PART_SIZE);
-    memset(offset, 0, MAX_RULE_PART_SIZE);
-    memset(interval, 0, MAX_RULE_PART_SIZE);
-    memset(depth, 0, MAX_RULE_PART_SIZE);
-    if (convert_update_ele_to_html_format(ele, hdrs, offset, interval, depth) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeUpdateList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n",
-                 i, ele->url, hdrs, offset, interval, depth);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeVaddrsRuleList
-//-------------------------------------------------------------------------
-int
-writeVaddrsRuleList(textBuffer * output)
-{
-  INKVirtIpAddrEle *ele;
-  int count, i;
-  const char ruleList[] = "var ruleList = new Object();\n";
-
-  INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_VADDRS);
-  INKError err = INKCfgContextGet(ctx);
-  if (err != INK_ERR_OKAY) {
-    mgmt_log(stderr, "[writeVaddrsRuleList] Error INKCfgContextGet");
-    return WEB_HTTP_ERR_FAIL;
-  }
-
-  output->copyFrom(ruleList, strlen(ruleList));
-
-  char rule[MAX_RULE_SIZE];
-  char ip[MAX_RULE_PART_SIZE];
-  char sub_intr[MAX_RULE_PART_SIZE];
-
-  count = INKCfgContextGetCount(ctx);
-  for (i = 0; i < count; i++) {
-    ele = (INKVirtIpAddrEle *) INKCfgContextGetEleAt(ctx, i);
-
-    memset(ip, 0, MAX_RULE_PART_SIZE);
-    memset(sub_intr, 0, MAX_RULE_PART_SIZE);
-    if (convert_virt_ip_addr_ele_to_html_format(ele, ip, sub_intr) != WEB_HTTP_ERR_OKAY) {
-      Debug("config", "[writeVaddrsRuleList] invalid Ele, can't format - SKIP");
-      continue;                 // invalid ele, so skip to next one
-    }
-
-    memset(rule, 0, MAX_RULE_SIZE);
-    snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\");\n", i, ip, ele->intr, sub_intr);
-
-    output->copyFrom(rule, strlen(rule));
-  }
-
-  INKCfgContextDestroy(ctx);
-  return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeSecondarySpecsForm
-//-------------------------------------------------------------------------
-// Helper function - writes the specific editable data fields for secondary
-// specifiers. Assumes that the html for a table are already created. This
-// function will only write the a sec spec field per row, and the
-// header for Secondary Specifiers
-// INKFileNameT parameter is needed because there might be some special
-// handling of sec. specs for different files
-int
-writeSecondarySpecsForm(WebHttpContext * whc, INKFileNameT file)
-{
-  NOWARN_UNUSED(file);
-  textBuffer *output = whc->response_bdy;
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_LABEL_SMALL, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 3);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SECONDARY_SPEC);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TIME);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "time", NULL, NULL, NULL);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TIME_HELP);
-  HtmlRndrBr(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TIME_EG);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PREFIX);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "prefix", NULL, NULL, NULL);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PREFIX_HELP);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SUFFIX);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "suffix", NULL, NULL, NULL);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SUFFIX_HELP);
-  HtmlRndrBr(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SUFFIX_EG);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_2);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "src_ip", NULL, NULL, NULL);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_2_HELP);
-  HtmlRndrBr(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_2_EG);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PORT);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "port", NULL, NULL, NULL);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PORT_HELP);
-  //HtmlRndrBr(output);
-  //HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PORT_EG);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_METHOD);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  writeMethodSelect(output, "method");
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_METHOD_HELP);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  HtmlRndrTrOpen(output, HTML_CSS_NONE, HTML_ALIGN_NONE);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_RIGHT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SCHEME);
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  writeSchemeSelect(output, "scheme");
-  HtmlRndrTdClose(output);
-  HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
-  HtmlRndrUlOpen(output);
-  HtmlRndrLi(output);
-  HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SCHEME_HELP);
-  HtmlRndrUlClose(output);
-  HtmlRndrTdClose(output);
-  HtmlRndrTrClose(output);
-
-  return WEB_HTTP_ERR_OKAY;
-}
+//-------------------- RULE LIST FUNCTIONS --------------------------------
 
 //-------------------------------------------------------------------------
 // writeSecondarySpecsTableElem
@@ -2266,793 +143,6 @@ writeSecondarySpecsTableElem(textBuffer 
   return WEB_HTTP_ERR_OKAY;
 }
 
-// -------------------- CONVERSION FUNCTIONS ------------------------------
-
-
-//-------------------------------------------------------------------------
-// convert_cache_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_cache_ele_to_html_format(INKCacheEle * ele,
-                                 char *ruleType,
-                                 char *pdType,
-                                 char *time,
-                                 char *src_ip,
-                                 char *prefix,
-                                 char *suffix, char *port, char *method, char *scheme, char *time_period, char *mixt)
-{
-  char *hms_time;
-
-  // rule type
-  switch (ele->cfg_ele.type) {
-  case INK_CACHE_NEVER:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "never-cache");
-    break;
-  case INK_CACHE_IGNORE_NO_CACHE:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "ignore-no-cache");
-    break;
-  case INK_CACHE_IGNORE_CLIENT_NO_CACHE:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "ignore-client-no-cache");
-    break;
-  case INK_CACHE_IGNORE_SERVER_NO_CACHE:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "ignore-server-no-cache");
-    break;
-  case INK_CACHE_PIN_IN_CACHE:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "pin-in-cache");
-    break;
-  case INK_CACHE_REVALIDATE:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "revalidate");
-    break;
-  case INK_CACHE_TTL_IN_CACHE:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "ttl-in-cache");
-    break;
-  case INK_CACHE_AUTH_CONTENT:
-    snprintf(ruleType, MAX_RULE_PART_SIZE, "cache-auth-content");
-    break;
-  default:
-    goto Lerror;
-  }
-
-  if (convert_pdss_to_html_format(ele->cache_info, pdType, time, src_ip, prefix, suffix, port, method, scheme, mixt) !=
-      WEB_HTTP_ERR_OKAY)
-    goto Lerror;
-
-  // time period (for pin_in_cache, ttl_in_cache, and revalidate only)
-  hms_time = hms_time_to_string(ele->time_period);
-  if (hms_time) {
-    snprintf(time_period, MAX_RULE_PART_SIZE, "%s", hms_time);
-    xfree(hms_time);
-  }
-  return WEB_HTTP_ERR_OKAY;
-
-Lerror:
-  Debug("config", "[convert_cache_ele_to_html_format] ERROR - invalid Ele");
-  return WEB_HTTP_ERR_FAIL;
-}
-
-
-//-------------------------------------------------------------------------
-// convert_hosting_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_hosting_ele_to_html_format(INKHostingEle * ele, char *pdType, char *partitions)
-{
-  char *list;
-
-  // pd type
-  switch (ele->pd_type) {
-  case INK_PD_DOMAIN:
-    snprintf(pdType, MAX_RULE_PART_SIZE, "domain");
-    break;
-  case INK_PD_HOST:
-    snprintf(pdType, MAX_RULE_PART_SIZE, "hostname");
-    break;
-  default:
-    goto Lerror;
-  }
-
-  // pd value
-  if (!ele->pd_val)
-    goto Lerror;
-
-  // partitions list
-  if (ele->partitions) {
-    list = int_list_to_string(ele->partitions, ",");
-    ink_strncpy(partitions, list, MAX_RULE_PART_SIZE);
-    xfree(list);
-  } else {
-    goto Lerror;
-  }
-
-  return WEB_HTTP_ERR_OKAY;
-
-Lerror:
-  Debug("config", "[convert_hosting_ele_to_html_format] ERROR - invalid Ele");
-  return WEB_HTTP_ERR_FAIL;
-}
-
-//-------------------------------------------------------------------------
-// convert_icp_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_icp_ele_to_html_format(INKIcpEle * ele,
-                               char *name,
-                               char *host_ip,
-                               char *peer_type,
-                               char *proxy_port, char *icp_port, char *mc_state, char *mc_ip, char *mc_ttl)
-{
-  char *tmpStr;
-
-  if (!ele->peer_hostname && !ele->peer_host_ip_addr)
-    goto Lerror;
-
-  // check hostname
-  if (ele->peer_hostname)
-    snprintf(name, MAX_RULE_PART_SIZE, "%s", ele->peer_hostname);
-
-  // host_ip
-  if (ele->peer_host_ip_addr) {
-    tmpStr = ip_addr_to_string(ele->peer_host_ip_addr);
-    ink_strncpy(host_ip, tmpStr, MAX_RULE_PART_SIZE);
-    xfree(tmpStr);
-  }
-  // cache type
-  switch (ele->peer_type) {
-  case INK_ICP_PARENT:
-    snprintf(peer_type, MAX_RULE_PART_SIZE, "parent");
-    break;
-  case INK_ICP_SIBLING:
-    snprintf(peer_type, MAX_RULE_PART_SIZE, "sibling");
-    break;
-  default:
-    goto Lerror;
-  }
-
-  // proxy_port
-  snprintf(proxy_port, MAX_RULE_PART_SIZE, "%d", ele->peer_proxy_port);
-
-  // icp_port
-  snprintf(icp_port, MAX_RULE_PART_SIZE, "%d", ele->peer_icp_port);
-
-  // mc on/off?
-  if (ele->is_multicast) {
-    snprintf(mc_state, MAX_RULE_PART_SIZE, "on");
-  } else {
-    snprintf(mc_state, MAX_RULE_PART_SIZE, "off");
-  }
-
-  // mc ip
-  if (ele->mc_ip_addr != INK_INVALID_IP_ADDR) {
-    tmpStr = ip_addr_to_string(ele->mc_ip_addr);
-    ink_strncpy(mc_ip, tmpStr, MAX_RULE_PART_SIZE);
-    xfree(tmpStr);
-  }
-  // mc ttl
-  switch (ele->mc_ttl) {
-  case INK_MC_TTL_SINGLE_SUBNET:
-    snprintf(mc_ttl, MAX_RULE_PART_SIZE, "single subnet");
-    break;
-  case INK_MC_TTL_MULT_SUBNET:
-    snprintf(mc_ttl, MAX_RULE_PART_SIZE, "multiple subnets");
-    break;
-  default:
-    // Handled here:
-    //INK_MC_TTL_UNDEFINED
-    break;
-  }
-
-  return WEB_HTTP_ERR_OKAY;
-
-Lerror:
-  Debug("config", "[convert_icp_ele_to_html_format] ERROR - invalid Ele");
-  return WEB_HTTP_ERR_FAIL;
-}
-
-//-------------------------------------------------------------------------
-// convert_ip_allow_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_ip_allow_ele_to_html_format(INKIpAllowEle * ele, char *src_ip, char *action)
-{
-  char *ip = NULL;
-
-  // src_ip
-  if (ele->src_ip_addr) {
-    ip = ip_addr_ele_to_string(ele->src_ip_addr);
-    snprintf(src_ip, MAX_RULE_PART_SIZE, "%s", ip);
-    xfree(ip);
-  }
-  // action
-  switch (ele->action) {
-  case INK_IP_ALLOW_ALLOW:
-    snprintf(action, MAX_RULE_PART_SIZE, "ip_allow");
-    break;
-  case INK_IP_ALLOW_DENY:
-    snprintf(action, MAX_RULE_PART_SIZE, "ip_deny");
-    break;
-  default:
-    goto Lerror;
-  }
-
-  return WEB_HTTP_ERR_OKAY;
-
-Lerror:
-  Debug("config", "[convert_ip_allow_ele_to_html_format] ERROR - invalid Ele");
-  return WEB_HTTP_ERR_FAIL;
-}
-
-//-------------------------------------------------------------------------
-// convert_mgmt_allow_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_mgmt_allow_ele_to_html_format(INKMgmtAllowEle * ele, char *src_ip, char *action)
-{
-  char *ip = NULL;
-
-  // src_ip
-  if (ele->src_ip_addr) {
-    ip = ip_addr_ele_to_string(ele->src_ip_addr);
-    snprintf(src_ip, MAX_RULE_PART_SIZE, "%s", ip);
-    xfree(ip);
-  }
-  // action
-  switch (ele->action) {
-  case INK_MGMT_ALLOW_ALLOW:

[... 559 lines stripped ...]


Mime
View raw message