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 2010/04/28 15:54:20 UTC
svn commit: r938979 [4/5] - in /incubator/trafficserver/traffic/trunk:
doc/man/ iocore/cache/ iocore/cluster/ iocore/eventsystem/ libinktomi++/
librecords/ proxy/ proxy/api/include/ proxy/config/ proxy/congest/
proxy/http2/ proxy/logging/ proxy/mgmt2/ ...
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/uistats
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/uistats?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/uistats (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/uistats Wed Apr 28 13:54:17 2010
@@ -61,23 +61,17 @@
# 1->1. The values of all statistics in atomic update group take on
# their new values at same time.
#
-#---these are missing from UI...
-proxy.node.nntp.upstream_total_bytes M
-proxy.node.nntp.downstream_total_bytes M
-proxy.cluster.nntp.upstream_total_bytes M
-proxy.cluster.nntp.downstream_total_bytes M
-#----
#
# html/everything.ink
proxy.node.cache_total_hits
-# derived: sum of proxy.process.http.cache_hit_fresh, proxy.process.http.cache_hit_revalidated, proxy.process.ftp.cache_hits, proxy.process.nntp.cache_hit_fresh
+# derived: sum of proxy.process.http.cache_hit_fresh, proxy.process.http.cache_hit_revalidated, proxy.process.ftp.cache_hits
# usage: counter
# units: objects
# scale: 1000
# doc: # of objects served from cache
# perfmonvar: cache_total_hits
proxy.node.cache_total_misses
-# derived: sum of proxy.process.http.cache_miss_cold, proxy.process.http.cache_miss_changed, proxy.process.http.cache_miss_not_cacheable, proxy.process.http.cache_miss_client_no_cache, proxy.process.ftp.cache_misses, proxy.process.nntp.cache_miss_cold
+# derived: sum of proxy.process.http.cache_miss_cold, proxy.process.http.cache_miss_changed, proxy.process.http.cache_miss_not_cacheable, proxy.process.http.cache_miss_client_no_cache, proxy.process.ftp.cache_misses
# usage: counter
# units: objects
# scale: 1000
@@ -109,22 +103,6 @@ proxy.node.http.current_parent_proxy_con
# shortdoc: # open conn to HTTP parent proxies
# perfmonvar: cur_parent_proxy_conn
#
-proxy.node.nntp.current_client_connections
-# usage: gauge
-# units: connections
-# scale: 100
-# doc: # of open connections to NNTP clients
-# shortdoc: # open conn to NNTP clients
-# perfmonvar: cur_nntp_client_conn
-#
-proxy.node.nntp.current_server_connections
-# usage: gauge
-# units: connections
-# scale: 100
-# doc: # of open connections to NNTP servers
-# shortdoc: # open conn to NNTP servers
-# perfmonvar: cur_nntp_server_conn
-#
proxy.node.current_cache_connections
# usage: gauge
# units: connections
@@ -155,24 +133,6 @@ proxy.cluster.http.current_parent_proxy_
# shortdoc: # open con to HTTP prnt prxies (cluster)
# perfmonvar: cluster_cur_parent_proxy_conn
#
-proxy.cluster.nntp.current_client_connections
-# derived: cluster aggregate of proxy.node.nntp.current_client_connections
-# usage: gauge
-# units: connections
-# scale: 100
-# doc: # of open connections to NNTP clients (cluster)
-# shortdoc: # open conn to NNTP clnts (cluster)
-# perfmonvar: cluster_cur_nntp_client_conn
-#
-proxy.cluster.nntp.current_server_connections
-# derived: cluster aggregate of proxy.node.nntp.current_server_connections
-# usage: gauge
-# units: connections
-# scale: 100
-# doc: # of open connections to NNTP servers
-# shortdoc: # open conn to NNTP srvrs (cluster)
-# perfmonvar: cluster_cur_nntp_server_conn
-#
proxy.cluster.current_cache_connections
# derived: cluster aggregate of proxy.node.current_cache_connections
# usage: gauge
@@ -204,12 +164,10 @@ proxy.node.bandwidth_hit_ratio CH
# doc: The ratio of bytes served from the cache to total requested bytes (HTTP and FTP) since installation).
# proxy.node.http.user_agent_total_request_bytes = proxy.process.http.user_agent_request_document_total_size + proxy.process.http.user_agent_request_header_total_size
# proxy.node.http.user_agent_total_response_bytes = proxy.process.http.user_agent_response_document_total_size + proxy.process.http.user_agent_response_header_total_size
-# proxy.node.nntp.upstream_total_bytes = proxy.process.nntp.upstream.request_bytes + proxy.process.nntp.upstream.response_bytes
# proxy.node.http.origin_server_total_request_bytes = proxy.process.http.origin_server_request_document_total_size + proxy.process.http.origin_server_request_header_total_size
# proxy.node.http.origin_server_total_response_bytes = proxy.process.http.origin_server_response_document_total_size + proxy.process.http.origin_server_response_header_total_size
-# proxy.node.nntp.downstream_total_bytes = proxy.process.nntp.downstream.request_bytes + proxy.process.nntp.downstream.response_bytes
-# UA_bytes = proxy.node.http.user_agent_total_request_bytes + proxy.node.http.user_agent_total_response_bytes + proxy.node.nntp.upstream_total_bytes
-# OS_bytes = proxy.node.http.origin_server_total_request_bytes + proxy.node.http.origin_server_total_response_bytes + proxy.node.nntp.downstream_total_bytes
+# UA_bytes = proxy.node.http.user_agent_total_request_bytes + proxy.node.http.user_agent_total_response_bytes
+# OS_bytes = proxy.node.http.origin_server_total_request_bytes + proxy.node.http.origin_server_total_response_bytes
# PP_bytes = 0
# result = (UA_bytes - (OS_bytes + PP_bytes)) / UA_bytes
proxy.cluster.bandwidth_hit_ratio CH
@@ -575,114 +533,6 @@ proxy.process.icp.total_udp_send_queries
# scale: 10000
# perfmonvar: total_icp_udp_send_queries
#
-proxy.process.nntp.article_hits
-# doc: # of NNTP article hits
-# units: documents
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_article_hits
-#
-proxy.process.nntp.article_misses
-# doc: # of NNTP articles misses
-# units: documents
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_article_misses
-#
-proxy.process.nntp.client_bytes_read
-# doc: # of bytes read from NNTP clients
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_client_bytes_read
-#
-proxy.process.nntp.client_bytes_written
-# doc: # of bytes written to NNTP clients
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_client_bytes_written
-#
-proxy.process.nntp.client_connections_currently_open CH
-proxy.process.nntp.feed_bytes
-# doc: # of bytes received through NNTP feeds
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_feed_bytes
-#
-proxy.process.nntp.group_hits
-# doc: # of NNTP group hits
-# units: NNTP group hits
-# usage: counter
-# scale: 100
-# perfmonvar: total_nntp_group_hits
-#
-proxy.process.nntp.group_refreshes
-# doc: # of NNTP group refreshes
-# units: NNTP group refreshes
-# usage: counter
-# scale: 100
-# perfmonvar: total_nntp_group_refreshes
-#
-proxy.process.nntp.overview_hits
-# doc: # of NNTP overview hits
-# units: NNTP overview hits
-# usage: counter
-# scale: 100
-# perfmonvar: total_nntp_overview_hits
-#
-proxy.process.nntp.overview_refreshes
-# doc: Number of NNTP overview refreshes. An overview refresh occurs when the Traffic Server caches a group overview on demand (as opposed to an overview pull).
-# shortdoc: # of NNTP overview refreshes
-# units: NNTP overview refreshes
-# usage: counter
-# scale: 100
-# perfmonvar: total_nntp_overview_refreshes
-#
-proxy.process.nntp.post_bytes
-# doc: # of bytes posted through NNTP
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_post_bytes
-#
-proxy.process.nntp.posts
-# doc: # of articles posted through NNTP
-# units: articles
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_posts
-#
-proxy.process.nntp.pull_bytes
-# doc: # of bytes of article/overview pulled through NNTP
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_pull_bytes
-#
-proxy.process.nntp.server_bytes_read
-# doc: # of bytes read from parent NNTP servers
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_server_bytes_read
-#
-proxy.process.nntp.server_bytes_written
-# doc: # of bytes written to cache for NNTP
-# units: bytes
-# usage: counter
-# scale: 10000
-# perfmonvar: total_nntp_server_bytes_written
-#
-proxy.process.nntp.server_connections_currently_open CH
-proxy.process.rni.block_hit_count
-# doc: total # of rni block hits
-# units: blocks
-# usage: counter
-# scale: 10000000
-# perfmonvar: total_rni_block_hit_count
-#
proxy.process.rni.block_miss_count
# doc: total # of rni block misses
# units: blocks
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc Wed Apr 28 13:54:17 2010
@@ -41,7 +41,6 @@
FileInfo file_info_entries[] = {
{"proxy.config.cache.control.filename", INK_FNAME_CACHE_OBJ, &convertCacheRule_ts, &convertCacheRule_xml},
{"proxy.config.icp.icp_configuration", INK_FNAME_ICP_PEER, &convertIcpRule_ts, &convertIcpRule_xml},
- {"proxy.config.nntp.access_filename", INK_FNAME_NNTP_ACCESS, &convertNntpAccessRule_ts, &convertNntpAccessRule_xml},
{"proxy.config.url_remap.filename", INK_FNAME_REMAP, &convertRemapRule_ts, &convertRemapRule_xml},
{"proxy.config.dns.splitdns.filename", INK_FNAME_SPLIT_DNS, &convertSplitDnsRule_ts, &convertSplitDnsRule_xml},
{"proxy.config.ftp.reverse_ftp_remap_file_name", INK_FNAME_FTP_REMAP, &convertFtpRemapRule_ts,
@@ -49,7 +48,6 @@ FileInfo file_info_entries[] = {
{"proxy.config.cache.hosting_filename", INK_FNAME_HOSTING, &convertHostingRule_ts, &convertHostingRule_xml},
{"proxy.config.cache.ip_allow.filename", INK_FNAME_IP_ALLOW, &convertIpAllowRule_ts, &convertIpAllowRule_xml},
{"proxy.config.admin.ip_allow.filename", INK_FNAME_MGMT_ALLOW, &convertMgmtAllowRule_ts, &convertMgmtAllowRule_xml},
- {"proxy.config.nntp.servers_filename", INK_FNAME_NNTP_SERVERS, &convertNntpServerRule_ts, &convertNntpServerRule_xml},
{"proxy.config.http.parent_proxy.file", INK_FNAME_PARENT_PROXY, &convertParentRule_ts, &convertParentRule_xml},
{"proxy.config.cache.partition_filename", INK_FNAME_PARTITION, &convertPartitionRule_ts, &convertPartitionRule_xml},
{"proxy.config.socks.socks_config_file", INK_FNAME_SOCKS, &convertSocksRule_ts, &convertSocksRule_xml},
@@ -78,8 +76,6 @@ const char *config_files[] = {
"ip_allow.config",
"ipnat.conf",
"mgmt_allow.config",
- "nntp_servers.config",
- "nntp_access.config",
"parent.config",
"partition.config",
"remap.config",
@@ -581,120 +577,6 @@ convertMgmtAllowRule_xml(XMLNode * rule_
}
// ---------------------------------------------------------------------
-// convertNntpAccessRule_xml
-// ---------------------------------------------------------------------
-char *
-convertNntpAccessRule_xml(XMLNode * rule_node)
-{
- XMLNode *child;
- INKNntpAccessEle *ele = NULL;
- char *name = NULL, *val, *type = NULL;
-
- if (!rule_node)
- return NULL;
-
- type = rule_node->getNodeName();
- ele = INKNntpAccessEleCreate();
- if (strcmp(type, "allow") == 0) {
- ele->access = INK_NNTP_ACC_ALLOW;
- } else if (strcmp(type, "deny") == 0) {
- ele->access = INK_NNTP_ACC_DENY;
- } else if (strcmp(type, "basic") == 0) {
- ele->access = INK_NNTP_ACC_BASIC;
- } else if (strcmp(type, "generic") == 0) {
- ele->access = INK_NNTP_ACC_GENERIC;
- } else if (strcmp(type, "custom") == 0) {
- ele->access = INK_NNTP_ACC_CUSTOM;
- } else {
- INKNntpAccessEleDestroy(ele);
- return NULL;
- }
-
- // process any specified attributes
- val = rule_node->getAttributeValueByName("user");
- if (val)
- ele->user = xstrdup(val);
- val = rule_node->getAttributeValueByName("password");
- if (val)
- ele->pass = xstrdup(val);
- val = rule_node->getAttributeValueByName("authenticator");
- if (val)
- ele->authenticator = xstrdup(val);
-
- // iterate through each subelement of a rule node
- for (int i = 0; i < rule_node->getChildCount(); i++) {
- child = rule_node->getChildNode(i);
- name = child->getNodeName();
- val = child->getNodeValue();
- if (strcmp(name, "ip") == 0) {
- ele->client_t = INK_CLIENT_GRP_IP;
- INKIpAddrEle *ip_ele = INKIpAddrEleCreate();
- convertIpAddrEle_xml(child, ip_ele);
- ele->clients = ip_addr_ele_to_string(ip_ele);
- INKIpAddrEleDestroy(ip_ele);
- } else if (strcmp(name, "domain") == 0) {
- ele->client_t = INK_CLIENT_GRP_DOMAIN;
- ele->clients = xstrdup(val);
- } else if (strcmp(name, "hostname") == 0) {
- ele->client_t = INK_CLIENT_GRP_HOSTNAME;
- ele->clients = xstrdup(val);
- } else if (strcmp(name, "deny") == 0) {
- ele->deny_posting = true;
- ele->group_wildmat = string_to_string_list(val, " ");
- }
- }
-
- // convert Ele into "one-liner" text format
- NntpAccessObj ele_obj(ele);
- char *rule = ele_obj.formatEleToRule();
-
- return rule;
-}
-
-// ---------------------------------------------------------------------
-// convertNntpServerRule_xml
-// ---------------------------------------------------------------------
-char *
-convertNntpServerRule_xml(XMLNode * rule_node)
-{
- XMLNode *child;
- INKNntpSrvrEle *ele = NULL;
- char *name, *val;
-
- if (!rule_node)
- return NULL;
-
- ele = INKNntpSrvrEleCreate();
-
- // process any specified attributes
- val = rule_node->getAttributeValueByName("interface");
- if (val)
- ele->interface = xstrdup(val);
-
- // iterate through each subelement of a rule node
- for (int i = 0; i < rule_node->getChildCount(); i++) {
- child = rule_node->getChildNode(i);
- name = child->getNodeName();
- val = child->getNodeValue();
- if (strcmp(name, "host") == 0 || strcmp(name, "host_auth") == 0) {
- ele->hostname = xstrdup(val);
- } else if (strcmp(name, "groups") == 0) {
- ele->group_wildmat = string_to_string_list(val, " ");
- } else if (strcmp(name, "treatment") == 0) {
- ele->treatment = string_to_nntp_treat_type(val);
- } else if (strcmp(name, "priority") == 0) {
- ele->priority = ink_atoi(val);
- }
- }
-
- // convert Ele into "one-liner" text format
- NntpSrvrObj ele_obj(ele);
- char *rule = ele_obj.formatEleToRule();
-
- return rule;
-}
-
-// ---------------------------------------------------------------------
// convertParentRule_xml
// ---------------------------------------------------------------------
char *
@@ -1755,153 +1637,6 @@ Lerror:
}
// ---------------------------------------------------------------------
-// convertNntpAccessRule_ts
-// ---------------------------------------------------------------------
-int
-convertNntpAccessRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file)
-{
- char *strPtr;
- INKIpAddrEle *ip_ele;
- INKNntpAccessEle *ele = (INKNntpAccessEle *) cfg_ele;
-
- strPtr = nntp_acc_type_to_string(ele->access);
- if (!strPtr)
- goto Lerror;
-
- if (!ele->authenticator && !ele->user && !ele->pass) { // no attrs
- writeXmlStartTag(xml_file, strPtr);
- } else {
- writeXmlAttrStartTag(xml_file, strPtr);
-
- if (ele->authenticator)
- writeXmlAttribute(xml_file, "authenticator", ele->authenticator);
- if (ele->user)
- writeXmlAttribute(xml_file, "user", ele->user);
- if (ele->pass)
- writeXmlAttribute(xml_file, "password", ele->pass);
-
- xml_file->copyFrom(">", 1);
- }
- xfree(strPtr);
-
- switch (ele->client_t) {
- case INK_CLIENT_GRP_IP:
- // convert into INKIpAddrEle first
- ip_ele = string_to_ip_addr_ele(ele->clients);
- if (ip_ele)
- convertIpAddrEle_ts(ip_ele, xml_file, "ip");
- else
- goto Lerror;
- break;
- case INK_CLIENT_GRP_DOMAIN:
- writeXmlElement(xml_file, "domain", ele->clients);
- break;
- case INK_CLIENT_GRP_HOSTNAME:
- writeXmlElement(xml_file, "hostname", ele->clients);
- break;
- default:
- goto Lerror;
- }
-
- // deny list?
- if (ele->deny_posting) {
- strPtr = string_list_to_string(ele->group_wildmat, " ");
- if (!strPtr)
- goto Lerror;
- writeXmlElement(xml_file, "deny", strPtr);
- xfree(strPtr);
- }
-
- switch (ele->access) {
- case INK_NNTP_ACC_ALLOW:
- writeXmlEndTag(xml_file, "allow");
- break;
- case INK_NNTP_ACC_DENY:
- writeXmlEndTag(xml_file, "deny");
- break;
- case INK_NNTP_ACC_BASIC:
- writeXmlEndTag(xml_file, "basic");
- break;
- case INK_NNTP_ACC_GENERIC:
- writeXmlEndTag(xml_file, "generic");
- break;
- case INK_NNTP_ACC_CUSTOM:
- writeXmlEndTag(xml_file, "custom");
- break;
- default:
- goto Lerror;
- }
-
- return INK_ERR_OKAY;
-
-Lerror:
- return INK_ERR_FAIL;
-}
-
-// ---------------------------------------------------------------------
-// convertNntpServerRule_ts
-// ---------------------------------------------------------------------
-int
-convertNntpServerRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file)
-{
- char *strPtr;
- INKNntpSrvrEle *ele = (INKNntpSrvrEle *) cfg_ele;
-
- if (ele->interface) { // has attribute
- writeXmlAttrStartTag(xml_file, "rule");
- writeXmlAttribute(xml_file, "interface", ele->interface);
- xml_file->copyFrom(">", 1);
- } else {
- writeXmlStartTag(xml_file, "rule");
- }
-
- if (strcasecmp(ele->hostname, ".block") == 0) {
- writeXmlElement(xml_file, "host_auth", ele->hostname);
- } else {
- writeXmlElement(xml_file, "host", ele->hostname);
- }
-
- if (ele->group_wildmat) {
- strPtr = string_list_to_string(ele->group_wildmat, " ");
- if (!strPtr)
- goto Lerror;
- writeXmlElement(xml_file, "groups", strPtr);
- xfree(strPtr);
- }
-
- switch (ele->treatment) {
- case INK_NNTP_TRMT_FEED:
- writeXmlElement(xml_file, "treatment", "feed");
- break;
- case INK_NNTP_TRMT_PUSH:
- writeXmlElement(xml_file, "treatment", "push");
- break;
- case INK_NNTP_TRMT_PULL:
- writeXmlElement(xml_file, "treatment", "pull");
- break;
- case INK_NNTP_TRMT_PULLOVER:
- writeXmlElement(xml_file, "treatment", "pullover");
- break;
- case INK_NNTP_TRMT_DYNAMIC:
- writeXmlElement(xml_file, "treatment", "dynamic");
- break;
- case INK_NNTP_TRMT_POST:
- writeXmlElement(xml_file, "treatment", "post");
- break;
- default:
- writeXmlElement_int(xml_file, "priority", ele->priority);
- break;
- }
-
- writeXmlEndTag(xml_file, "rule");
-
- return INK_ERR_OKAY;
-
-Lerror:
- return INK_ERR_FAIL;
-}
-
-// ---------------------------------------------------------------------
// convertParentRule_ts
// ---------------------------------------------------------------------
int
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.h?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.h Wed Apr 28 13:54:17 2010
@@ -63,8 +63,6 @@ char *convertIcpRule_xml(XMLNode * rule_
char *convertIpAllowRule_xml(XMLNode * rule_node);
char *convertIpnatRule_xml(XMLNode * rule_node);
char *convertMgmtAllowRule_xml(XMLNode * rule_node);
-char *convertNntpAccessRule_xml(XMLNode * rule_node);
-char *convertNntpServerRule_xml(XMLNode * rule_node);
char *convertParentRule_xml(XMLNode * rule_node);
char *convertPartitionRule_xml(XMLNode * rule_node);
char *convertRemapRule_xml(XMLNode * rule_node);
@@ -100,8 +98,6 @@ int convertIcpRule_ts(INKCfgEle * cfg_el
int convertIpAllowRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
int convertIpnatRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
int convertMgmtAllowRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
-int convertNntpAccessRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
-int convertNntpServerRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
int convertParentRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
int convertPartitionRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
int convertRemapRule_ts(INKCfgEle * cfg_ele, textBuffer * xml_file);
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc Wed Apr 28 13:54:17 2010
@@ -90,12 +90,6 @@ convertRules(INKFileNameT file, INKIntLi
case INK_FNAME_MGMT_ALLOW:
rule = formatMgmtAllowRule(rules[*index]);
break;
- case INK_FNAME_NNTP_ACCESS:
- rule = formatNntpAccessRule(rules[*index]);
- break;
- case INK_FNAME_NNTP_SERVERS:
- rule = formatNntpServersRule(rules[*index]);
- break;
case INK_FNAME_PARENT_PROXY:
rule = formatParentRule(rules[*index]);
break;
@@ -557,86 +551,6 @@ formatMgmtAllowRule(char *rule)
}
//-------------------------------------------------------------------------
-// formatNntpAccessRule
-//-------------------------------------------------------------------------
-//
-char *
-formatNntpAccessRule(char *rule)
-{
- Tokenizer tokens(CFG_RULE_DELIMITER);
- tokens.Initialize(rule, ALLOW_EMPTY_TOKS);
- char buf[MAX_RULE_LENGTH];
-
- if (!rule)
- return NULL;
- memset(buf, 0, MAX_RULE_LENGTH);
-
- if (strlen(tokens[0]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "%s=", tokens[0], HTML_DELIM);
- }
- if (strlen(tokens[1]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "%s%s", tokens[1], HTML_DELIM);
- } else {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "%s", HTML_DELIM);
- }
- if (strlen(tokens[2]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Access Type=%s%s", tokens[2], HTML_DELIM);
- }
- if (strlen(tokens[3]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Authenticator=%s%s", tokens[3], HTML_DELIM);
- }
- if (strlen(tokens[4]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Username=%s%s", tokens[4], HTML_DELIM);
- }
- if (strlen(tokens[5]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Password=%s%s", tokens[5], HTML_DELIM);
- }
- if (strlen(tokens[6]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Newsgroups=%s%s", tokens[6], HTML_DELIM);
- }
- if (strlen(tokens[7]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Posting=%s", tokens[7]);
- }
-
- return xstrdup(buf);
-}
-
-//-------------------------------------------------------------------------
-// formatNntpServersRule
-//-------------------------------------------------------------------------
-//
-char *
-formatNntpServersRule(char *rule)
-{
- Tokenizer tokens(CFG_RULE_DELIMITER);
- tokens.Initialize(rule, ALLOW_EMPTY_TOKS);
- char buf[MAX_RULE_LENGTH];
-
- if (!rule)
- return NULL;
- memset(buf, 0, MAX_RULE_LENGTH);
-
-
- if (strlen(tokens[0]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Hostname=%s%s", tokens[0], HTML_DELIM);
- }
- if (strlen(tokens[1]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Newsgroups=%s%s", tokens[1], HTML_DELIM);
- }
- if (strlen(tokens[2]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Treatment=%s%s", tokens[2], HTML_DELIM);
- }
- if (strlen(tokens[3]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Priority=%s%s", tokens[3], HTML_DELIM);
- }
- if (strlen(tokens[4]) > 0) {
- ink_snprintf(buf + strlen(buf), MAX_RULE_LENGTH - strlen(buf), "Interface=%s", tokens[4]);
- }
-
- return xstrdup(buf);
-}
-
-//-------------------------------------------------------------------------
// formatParentRule
//-------------------------------------------------------------------------
//
@@ -2002,225 +1916,6 @@ Lerror:
}
//-------------------------------------------------------------------------
-// updateNntpAccessConfig
-//-------------------------------------------------------------------------
-int
-updateNntpAccessConfig(char *rules[], int numRules, char **errBuff)
-{
- INKCfgContext ctx = NULL;
- INKNntpAccessEle *ele;
- Tokenizer tokens(CFG_RULE_DELIMITER);
- INKActionNeedT action_need;
- INKError response;
- int i, err = WEB_HTTP_ERR_OKAY;
- INKIntList errRules = NULL;
-
- ctx = INKCfgContextCreate(INK_FNAME_NNTP_ACCESS);
- if (!ctx) {
- Debug("config", "[updateNntpAccessConfig] can't allocate ctx memory");
- err = WEB_HTTP_ERR_FAIL;
- goto Lerror;
- }
- // since we want to preserve comments, we need to read in the
- // file using INKCfgContextGet and remove all the rules; starting from scratch
- if (INKCfgContextGet(ctx) != INK_ERR_OKAY || INKCfgContextRemoveAll(ctx) != INK_ERR_OKAY) {
- Debug("config", "[updateNntpAccessConfig] Failed to Get and Clear CfgContext");
- err = WEB_HTTP_ERR_FAIL;
- goto Lerror;
- }
- // create Ele's by parsing the rules in the rules array
- // insert the Ele's into a Cfg Context; if get invalid formatted rule, just skip it
- for (i = 0; i < numRules; i++) {
- tokens.Initialize(rules[i], ALLOW_EMPTY_TOKS);
- ele = INKNntpAccessEleCreate();
-
- // group type
- if (strcmp(tokens[0], "ip") == 0) {
- ele->client_t = INK_CLIENT_GRP_IP;
- } else if (strcmp(tokens[0], "domain") == 0) {
- ele->client_t = INK_CLIENT_GRP_DOMAIN;
- } else if (strcmp(tokens[0], "hostname") == 0) {
- ele->client_t = INK_CLIENT_GRP_HOSTNAME;
- } else {
- ele->cfg_ele.error = INK_ERR_INVALID_CONFIG_RULE;
- Debug("config", "[updateNntpAccessConfig] invalid group type %s - SKIP", tokens[0]);
- }
-
- // clients
- if (strlen(tokens[1]) > 0) {
- ele->clients = xstrdup(tokens[1]);
- } else {
- ele->cfg_ele.error = INK_ERR_INVALID_CONFIG_RULE;
- Debug("config", "[updateNntpAccesConfig] invalid clients - SKIP");
- }
-
- // access type
- if (strcmp(tokens[2], "allow") == 0) {
- ele->access = INK_NNTP_ACC_ALLOW;
- } else if (strcmp(tokens[2], "deny") == 0) {
- ele->access = INK_NNTP_ACC_DENY;
- } else if (strcmp(tokens[2], "basic") == 0) {
- ele->access = INK_NNTP_ACC_BASIC;
- } else if (strcmp(tokens[2], "generic") == 0) {
- ele->access = INK_NNTP_ACC_GENERIC;
- } else if (strcmp(tokens[2], "custom") == 0) {
- ele->access = INK_NNTP_ACC_CUSTOM;
- } else { // a required field
- ele->cfg_ele.error = INK_ERR_INVALID_CONFIG_RULE;
- Debug("config", "[updateNntpAccessConfig] invalid access type %s - SKIP", tokens[2]);
- }
-
- // authenticator
- if (strlen(tokens[3]) > 0) {
- ele->authenticator = xstrdup(tokens[3]);
- }
- // user
- if (strlen(tokens[4]) > 0) {
- ele->user = xstrdup(tokens[4]);
- }
- // pass
- if (strlen(tokens[5]) > 0) {
- ele->pass = xstrdup(tokens[5]);
- }
- // group wildmat list
- if (strlen(tokens[6]) > 0) {
- ele->group_wildmat = string_to_string_list(tokens[6], ",");
- }
- // deny posting
- if (strlen(tokens[7]) > 0) {
- ele->deny_posting = true;
- } else {
- ele->deny_posting = false;
- }
-
- INKCfgContextAppendEle(ctx, (INKCfgEle *) ele); // add new ele to end of list
- }
-
- // commit the CfgContext to write a new version of the file
- errRules = INKIntListCreate();
- response = INKCfgContextCommit(ctx, &action_need, errRules);
- if (response == INK_ERR_INVALID_CONFIG_RULE) {
- err = WEB_HTTP_ERR_INVALID_CFG_RULE;
- *errBuff = convertRules(INK_FNAME_NNTP_ACCESS, errRules, rules);
- } else if (response != INK_ERR_OKAY) {
- err = WEB_HTTP_ERR_FAIL;
- goto Lerror;
- }
-
-Lerror:
- if (errRules)
- INKIntListDestroy(errRules);
- if (ctx)
- INKCfgContextDestroy(ctx);
- return err;
-}
-
-//-------------------------------------------------------------------------
-// updateNntpServersConfig
-//-------------------------------------------------------------------------
-int
-updateNntpServersConfig(char *rules[], int numRules, char **errBuff)
-{
- INKCfgContext ctx = NULL;
- INKNntpSrvrEle *ele;
- Tokenizer tokens(CFG_RULE_DELIMITER);
- INKActionNeedT action_need;
- INKError response;
- int i, err = WEB_HTTP_ERR_OKAY;
- INKIntList errRules = NULL;
-
- ctx = INKCfgContextCreate(INK_FNAME_NNTP_SERVERS);
- if (!ctx) {
- Debug("config", "[updateNntpServersConfig] can't allocate ctx memory");
- err = WEB_HTTP_ERR_FAIL;
- goto Lerror;
- }
- // since we want to preserve comments, we need to read in the
- // file using INKCfgContextGet and remove all the rules; starting from scratch
- if (INKCfgContextGet(ctx) != INK_ERR_OKAY || INKCfgContextRemoveAll(ctx) != INK_ERR_OKAY) {
- Debug("config", "[updateNntpServersConfig] Failed to Get and Clear CfgContext");
- err = WEB_HTTP_ERR_FAIL;
- goto Lerror;
- }
- // create Ele's by parsing the rules in the rules array
- // insert the Ele's into a Cfg Context; if get invalid formatted rule, just skip it
- for (i = 0; i < numRules; i++) {
- tokens.Initialize(rules[i], ALLOW_EMPTY_TOKS);
- ele = INKNntpSrvrEleCreate();
-
- // hostname
- if (strlen(tokens[0]) > 0) {
- ele->hostname = xstrdup(tokens[0]);
- } else {
- ele->cfg_ele.error = INK_ERR_INVALID_CONFIG_RULE;
- Debug("config", "[updateNntpAccessConfig] invalid hostname - SKIP");
- }
-
- // group wildmat list
- if (strlen(tokens[1]) > 0) {
- ele->group_wildmat = string_to_string_list(tokens[1], ",");
- }
- // treatment type
- if (strcmp(tokens[2], "feed") == 0) {
- ele->treatment = INK_NNTP_TRMT_FEED;
- } else if (strcmp(tokens[2], "push") == 0) {
- ele->treatment = INK_NNTP_TRMT_PUSH;
- } else if (strcmp(tokens[2], "pull") == 0) {
- ele->treatment = INK_NNTP_TRMT_PULL;
- } else if (strcmp(tokens[2], "pullover") == 0) {
- ele->treatment = INK_NNTP_TRMT_PULLOVER;
- } else if (strcmp(tokens[2], "dynamic") == 0) {
- ele->treatment = INK_NNTP_TRMT_DYNAMIC;
- } else if (strcmp(tokens[2], "post") == 0) {
- ele->treatment = INK_NNTP_TRMT_POST;
- } else {
- ele->treatment = INK_NNTP_TRMT_UNDEFINED;
- }
-
- // priority
- if (strlen(tokens[3]) > 0) {
- if (isNumber(tokens[3])) {
- ele->priority = ink_atoi(tokens[3]);
- } else {
- ele->cfg_ele.error = INK_ERR_INVALID_CONFIG_RULE;
- Debug("config", "[updateNntpServersConfig] invalid treatment/priority - SKIP");
- }
- if (ele->treatment != INK_NNTP_TRMT_UNDEFINED && ele->priority > 0) {
- ele->cfg_ele.error = INK_ERR_INVALID_CONFIG_RULE;
- Debug("config", "[updateNntpServersConfig] invalid treatment/priority - SKIP");
- }
- } else {
- ele->priority = 0;
- }
-
- // interface
- if (strlen(tokens[4]) > 0) {
- ele->interface = xstrdup(tokens[4]);
- }
-
- INKCfgContextAppendEle(ctx, (INKCfgEle *) ele); // add new ele to end of list
- }
-
- // commit the CfgContext to write a new version of the file
- errRules = INKIntListCreate();
- response = INKCfgContextCommit(ctx, &action_need, errRules);
- if (response == INK_ERR_INVALID_CONFIG_RULE) {
- err = WEB_HTTP_ERR_INVALID_CFG_RULE;
- *errBuff = convertRules(INK_FNAME_NNTP_SERVERS, errRules, rules);
- } else if (response != INK_ERR_OKAY) {
- err = WEB_HTTP_ERR_FAIL;
- goto Lerror;
- }
-
-Lerror:
- if (errRules)
- INKIntListDestroy(errRules);
- if (ctx)
- INKCfgContextDestroy(ctx);
- return err;
-}
-
-//-------------------------------------------------------------------------
// updateParentConfig
//-------------------------------------------------------------------------
int
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.h?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.h Wed Apr 28 13:54:17 2010
@@ -43,8 +43,6 @@ char *formatHostingRule(char *rule);
char *formatIcpRule(char *rule);
char *formatIpAllowRule(char *rule);
char *formatMgmtAllowRule(char *rule);
-char *formatNntpAccessRule(char *rule);
-char *formatNntpServersRule(char *rule);
char *formatParentRule(char *rule);
char *formatPartitionRule(char *rule);
char *formatRemapRule(char *rule);
@@ -61,8 +59,6 @@ int updateHostingConfig(char *rules[], i
int updateIcpConfig(char *rules[], int numRules, char **errBuff);
int updateIpAllowConfig(char *rules[], int numRules, char **errBuff);
int updateMgmtAllowConfig(char *rules[], int numRules, char **errBuff);
-int updateNntpAccessConfig(char *rules[], int numRules, char **errBuff);
-int updateNntpServersConfig(char *rules[], int numRules, char **errBuff);
int updateParentConfig(char *rules[], int numRules, char **errBuff);
int updatePartitionConfig(char *rules[], int numRules, char **errBuff);
int updateRemapConfig(char *rules[], int numRules, char **errBuff);
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc Wed Apr 28 13:54:17 2010
@@ -887,256 +887,6 @@ writeMgmtAllowConfigTable(WebHttpContext
}
//-------------------------------------------------------------------------
-// writeNntpAccessConfigTable
-//-------------------------------------------------------------------------
-int
-writeNntpAccessConfigTable(WebHttpContext * whc)
-{
- INKNntpAccessEle *ele;
- char grp_type[MAX_RULE_PART_SIZE];
- char access[MAX_RULE_PART_SIZE];
- char auth[MAX_RULE_PART_SIZE];
- char user[MAX_RULE_PART_SIZE];
- char pass[MAX_RULE_PART_SIZE];
- char groups[MAX_RULE_PART_SIZE];
- char post[MAX_RULE_PART_SIZE];
- int count;
-
- textBuffer *output = whc->response_bdy;
- INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_NNTP_ACCESS);
- INKError err = INKCfgContextGet(ctx);
- if (err != INK_ERR_OKAY) {
- mgmt_log(stderr, "[writeNntpAccessConfigTable] 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_GROUP_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_GROUP_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_ACCESS_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_AUTHENTICATOR);
- 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_GROUP_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_DENY_POSTING);
- HtmlRndrTdClose(output);
-
- HtmlRndrTrClose(output);
-
- count = INKCfgContextGetCount(ctx);
- for (int i = 0; i < count; i++) {
- ele = (INKNntpAccessEle *) INKCfgContextGetEleAt(ctx, i);
-
- memset(grp_type, 0, MAX_RULE_PART_SIZE);
- memset(access, 0, MAX_RULE_PART_SIZE);
- memset(auth, 0, MAX_RULE_PART_SIZE);
- memset(user, 0, MAX_RULE_PART_SIZE);
- memset(pass, 0, MAX_RULE_PART_SIZE);
- memset(groups, 0, MAX_RULE_PART_SIZE);
- memset(post, 0, MAX_RULE_PART_SIZE);
- if (convert_nntp_access_ele_to_html_format(ele, grp_type, access, auth, user, pass, groups, post) !=
- WEB_HTTP_ERR_OKAY) {
- Debug("config", "[writeNntpAccessConfigTable] 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(grp_type, strlen(grp_type));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(ele->clients, strlen(ele->clients));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(access, strlen(access));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(auth, strlen(auth));
- HtmlRndrTdClose(output);
-
- 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);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(pass, strlen(pass));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(groups, strlen(groups));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(post, strlen(post));
- 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;
-}
-
-//-------------------------------------------------------------------------
-// writeNntpServersConfigTable
-//-------------------------------------------------------------------------
-int
-writeNntpServersConfigTable(WebHttpContext * whc)
-{
- INKNntpSrvrEle *ele;
- char groups[MAX_RULE_PART_SIZE];
- char treatment[MAX_RULE_PART_SIZE];
- char priority[MAX_RULE_PART_SIZE];
- char intr[MAX_RULE_PART_SIZE];
- int count;
-
- textBuffer *output = whc->response_bdy;
- INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_NNTP_SERVERS);
- INKError err = INKCfgContextGet(ctx);
- if (err != INK_ERR_OKAY) {
- mgmt_log(stderr, "[writeNntpServersConfigTable] 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_NNTP_HOSTNAME);
- 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_NEWSGROUP_NAMES);
- 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_TREATMENT_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_PRIORITY);
- 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_2);
- HtmlRndrTdClose(output);
-
- HtmlRndrTrClose(output);
-
- count = INKCfgContextGetCount(ctx);
- for (int i = 0; i < count; i++) {
- ele = (INKNntpSrvrEle *) INKCfgContextGetEleAt(ctx, i);
-
- memset(groups, 0, MAX_RULE_PART_SIZE);
- memset(treatment, 0, MAX_RULE_PART_SIZE);
- memset(priority, 0, MAX_RULE_PART_SIZE);
- memset(intr, 0, MAX_RULE_PART_SIZE);
- if (convert_nntp_srvr_ele_to_html_format(ele, groups, treatment, priority, intr) != WEB_HTTP_ERR_OKAY) {
- Debug("config", "[writeNntpServersConfigTable] 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->hostname, strlen(ele->hostname));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(groups, strlen(groups));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(treatment, strlen(treatment));
- HtmlRndrTdClose(output);
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- output->copyFrom(priority, strlen(priority));
- HtmlRndrTdClose(output);
-
-
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrSpace(output, 2);
- if (ele->interface)
- output->copyFrom(ele->interface, strlen(ele->interface));
- 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;
-}
-
-//-------------------------------------------------------------------------
// writeParentConfigTable
//-------------------------------------------------------------------------
int
@@ -2385,114 +2135,6 @@ writeMgmtAllowRuleList(textBuffer * outp
//-------------------------------------------------------------------------
-// writeNntpAccessRuleList
-//-------------------------------------------------------------------------
-int
-writeNntpAccessRuleList(textBuffer * output)
-{
- INKNntpAccessEle *ele;
- int count, i;
- const char ruleList[] = "var ruleList = new Object();\n";
-
- INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_NNTP_ACCESS);
- INKError err = INKCfgContextGet(ctx);
- if (err != INK_ERR_OKAY) {
- mgmt_log(stderr, "[writeNntpAccessRuleList] Error INKCfgContextGet");
- return WEB_HTTP_ERR_FAIL;
- }
-
- output->copyFrom(ruleList, strlen(ruleList));
-
- char rule[MAX_RULE_SIZE];
-
- char grp_type[MAX_RULE_PART_SIZE];
- char access[MAX_RULE_PART_SIZE];
- char auth[MAX_RULE_PART_SIZE];
- char user[MAX_RULE_PART_SIZE];
- char pass[MAX_RULE_PART_SIZE];
- char groups[MAX_RULE_PART_SIZE];
- char post[MAX_RULE_PART_SIZE];
-
- count = INKCfgContextGetCount(ctx);
- for (i = 0; i < count; i++) {
- ele = (INKNntpAccessEle *) INKCfgContextGetEleAt(ctx, i);
-
- memset(grp_type, 0, MAX_RULE_PART_SIZE);
- memset(access, 0, MAX_RULE_PART_SIZE);
- memset(auth, 0, MAX_RULE_PART_SIZE);
- memset(user, 0, MAX_RULE_PART_SIZE);
- memset(pass, 0, MAX_RULE_PART_SIZE);
- memset(groups, 0, MAX_RULE_PART_SIZE);
- memset(post, 0, MAX_RULE_PART_SIZE);
- if (convert_nntp_access_ele_to_html_format(ele, grp_type, access, auth, user, pass, groups, post) !=
- WEB_HTTP_ERR_OKAY) {
- Debug("config", "[writeNntpAccessRuleList] invalid Ele, can't format - SKIP");
- continue; // invalid ele, so skip to next one
- }
-
- memset(rule, 0, MAX_RULE_SIZE);
- ink_snprintf(rule, MAX_RULE_SIZE,
- "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n", i,
- grp_type, ele->clients, access, auth, user, pass, groups, post);
-
- output->copyFrom(rule, strlen(rule));
- }
-
- INKCfgContextDestroy(ctx);
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeNntpServersRuleList
-//-------------------------------------------------------------------------
-int
-writeNntpServersRuleList(textBuffer * output)
-{
- INKNntpSrvrEle *ele;
- int count, i;
- const char ruleList[] = "var ruleList = new Object();\n";
-
- INKCfgContext ctx = INKCfgContextCreate(INK_FNAME_NNTP_SERVERS);
- INKError err = INKCfgContextGet(ctx);
- if (err != INK_ERR_OKAY) {
- mgmt_log(stderr, "[writeNntpServerRuleList] Error INKCfgContextGet");
- return WEB_HTTP_ERR_FAIL;
- }
-
- output->copyFrom(ruleList, strlen(ruleList));
-
- char rule[MAX_RULE_SIZE];
-
- char groups[MAX_RULE_PART_SIZE];
- char treatment[MAX_RULE_PART_SIZE];
- char priority[MAX_RULE_PART_SIZE];
- char intr[MAX_RULE_PART_SIZE];
-
- count = INKCfgContextGetCount(ctx);
- for (i = 0; i < count; i++) {
- ele = (INKNntpSrvrEle *) INKCfgContextGetEleAt(ctx, i);
-
- memset(groups, 0, MAX_RULE_PART_SIZE);
- memset(treatment, 0, MAX_RULE_PART_SIZE);
- memset(priority, 0, MAX_RULE_PART_SIZE);
- memset(intr, 0, MAX_RULE_PART_SIZE);
- if (convert_nntp_srvr_ele_to_html_format(ele, groups, treatment, priority, intr) != WEB_HTTP_ERR_OKAY) {
- Debug("config", "[writeNntpServerRuleList] invalid Ele, can't format - SKIP");
- continue; // invalid ele, so skip to next one
- }
-
- memset(rule, 0, MAX_RULE_SIZE);
- ink_snprintf(rule, MAX_RULE_SIZE, "ruleList[%d] = new Rule(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\");\n",
- i, ele->hostname, groups, treatment, priority, intr);
-
- output->copyFrom(rule, strlen(rule));
- }
-
- INKCfgContextDestroy(ctx);
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
// writeParentRuleList
//-------------------------------------------------------------------------
int
@@ -3657,292 +3299,87 @@ writeIcpConfigForm(WebHttpContext * whc)
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_TYPE_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // peer proxy port
- 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_PEER_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", "proxy_port", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_PORT_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // peer icp port
- 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_ICP_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", "icp_port", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ICP_PORT_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // multicast enable/disabled?
- 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_MCAST_STATE);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeOnOffSelect(output, "mc_state");
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_STATE_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // multicast IP
- 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_MCAST_IP);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "mc_ip", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_IP_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_MCAST_TTL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeMcTtlSelect(output, "mc_ttl");
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_TTL_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- return WEB_HTTP_ERR_OKAY;
-}
-
-
-//-------------------------------------------------------------------------
-// writeIpAllowConfigForm
-//-------------------------------------------------------------------------
-// Form contains:
-// Source IP Address (single or range) src_ip
-// IP action type ip_action
-//
-int
-writeIpAllowConfigForm(WebHttpContext * whc)
-{
- textBuffer *output = whc->response_bdy;
-
- // write the hidden "filename" tag
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_IP_ALLOW_CONFIG, NULL, NULL);
-
- // ip action
- 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_IP_ACTION);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeIpActionSelect(output, "ip_action");
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION_HELP_2);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // source ip
- 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);
- 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_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_HELP_6);
- HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_EG_6);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- return WEB_HTTP_ERR_OKAY;
-}
-
-//-------------------------------------------------------------------------
-// writeIpnatConfigForm
-//-------------------------------------------------------------------------
-// Form contains:
-// Ethernet Interface interface
-// Traffic Server IP Address from_ip
-// Traffic Server Port from_port
-// FTP IP Address to_ip
-// FTP Port to_port
-// Connection TYpe conn_type
-// Protocol Type protocol
-int
-writeIpnatConfigForm(WebHttpContext * whc)
-{
- textBuffer *output = whc->response_bdy;
-
- // write the hidden "filename" tag
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_IPNAT_CONFIG, NULL, NULL);
-
- // ethernet Interface
- 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_ETH_INTERFACE);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "intr", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ETH_INTERFACE_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // connection type
- 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_CONN_TYPE);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeConnTypeSelect(output, "conn_type");
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_CONN_TYPE_HELP_2);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // from IP
- 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);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "from_ip", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_HELP_3);
- HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_EG_3);
+ HtmlRndrLi(output);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_TYPE_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // source cidr (optional)
+ // peer proxy port
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_CIDR);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_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", "from_cidr", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "proxy_port", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_CIDR_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PEER_PORT_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // source port
+ // peer icp port
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_PORT);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ICP_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", "from_port", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "icp_port", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_PORT_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ICP_PORT_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // destination IP
+ // multicast enable/disabled?
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_DEST_IP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_STATE);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "to_ip", NULL, NULL, NULL);
+ writeOnOffSelect(output, "mc_state");
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_IP_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_STATE_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // to Port
+ // multicast IP
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_DEST_PORT);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_IP);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "to_port", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "mc_ip", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_PORT_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_IP_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // Protocol
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_USER_PROTOCOL);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_TTL);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeProtocolSelect(output, "protocol");
+ writeMcTtlSelect(output, "mc_ttl");
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_USER_PROTOCOL_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_MCAST_TTL_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
@@ -3950,21 +3387,23 @@ writeIpnatConfigForm(WebHttpContext * wh
return WEB_HTTP_ERR_OKAY;
}
+
//-------------------------------------------------------------------------
-// writeMgmtAllowConfigForm
+// writeIpAllowConfigForm
//-------------------------------------------------------------------------
// Form contains:
// Source IP Address (single or range) src_ip
// IP action type ip_action
//
int
-writeMgmtAllowConfigForm(WebHttpContext * whc)
+writeIpAllowConfigForm(WebHttpContext * whc)
{
textBuffer *output = whc->response_bdy;
// write the hidden "filename" tag
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_MGMT_ALLOW_CONFIG, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_IP_ALLOW_CONFIG, NULL, NULL);
+ // ip action
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_IP_ACTION);
@@ -3975,11 +3414,12 @@ writeMgmtAllowConfigForm(WebHttpContext
HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION_HELP_2);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
+ // source ip
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);
@@ -3990,9 +3430,9 @@ writeMgmtAllowConfigForm(WebHttpContext
HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_HELP_6);
HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_EG);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_EG_6);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
@@ -4001,154 +3441,150 @@ writeMgmtAllowConfigForm(WebHttpContext
}
//-------------------------------------------------------------------------
-// writeNntpAccessConfigForm
+// writeIpnatConfigForm
//-------------------------------------------------------------------------
// Form contains:
-// Client Group Type (ip, domain, hostname) grp_type
-// Client Group Value grp_val
-// Access Type access
-// Authenticator auth
-// User user
-// Password pass
-// Groups groups
-// Deny Posting? post
+// Ethernet Interface interface
+// Traffic Server IP Address from_ip
+// Traffic Server Port from_port
+// FTP IP Address to_ip
+// FTP Port to_port
+// Connection TYpe conn_type
+// Protocol Type protocol
int
-writeNntpAccessConfigForm(WebHttpContext * whc)
+writeIpnatConfigForm(WebHttpContext * whc)
{
textBuffer *output = whc->response_bdy;
// write the hidden "filename" tag
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_NNTP_ACCESS_CONFIG, NULL,
- NULL);
+ HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_IPNAT_CONFIG, NULL, NULL);
- // group type
+ // ethernet Interface
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_GROUP_TYPE);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ETH_INTERFACE);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeClientGroupTypeSelect(output, "grp_type");
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "intr", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_GROUP_TYPE_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ETH_INTERFACE_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // group value
+ // connection type
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_GROUP_VALUE);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_CONN_TYPE);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "grp_val", NULL, NULL, NULL);
+ writeConnTypeSelect(output, "conn_type");
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_GROUP_VALUE_HELP);
- HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_GROUP_VALUE_EG);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_CONN_TYPE_HELP_2);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // access type
+ // from IP
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_ACCESS_TYPE);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeAccessTypeSelect(output, "access");
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "from_ip", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ACCESS_TYPE_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_HELP_3);
+ HtmlRndrBr(output);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_EG_3);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // authenticator
+ // source cidr (optional)
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_AUTHENTICATOR);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_CIDR);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "auth", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "from_cidr", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_AUTHENTICATOR_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_CIDR_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // user directive
+ // source port
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_USER);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_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", "user", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "from_port", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_USER_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_PORT_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // password directive
+ // destination IP
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_PASSWORD);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_IP);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "pass", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "to_ip", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PASSWORD_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_IP_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // client group
+ // to Port
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_GROUP_NAME);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_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", "groups", NULL, NULL, NULL);
+ HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "to_port", NULL, NULL, NULL);
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_GROUP_NAME_HELP);
- HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_GROUP_NAME_EG);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DEST_PORT_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // deny posting
+ // Protocol
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_DENY_POSTING);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_USER_PROTOCOL);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeDenySelect(output, "post");
+ writeProtocolSelect(output, "protocol");
HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
+ HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_DENY_POSTING_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_USER_PROTOCOL_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
@@ -4157,103 +3593,48 @@ writeNntpAccessConfigForm(WebHttpContext
}
//-------------------------------------------------------------------------
-// writeNntpServersConfigForm
+// writeMgmtAllowConfigForm
//-------------------------------------------------------------------------
// Form contains:
-// Hostname hostname
-// Groups groups
-// Treatment Type treatment
-// Priority # priority
-// Interface interface
+// Source IP Address (single or range) src_ip
+// IP action type ip_action
+//
int
-writeNntpServersConfigForm(WebHttpContext * whc)
+writeMgmtAllowConfigForm(WebHttpContext * whc)
{
textBuffer *output = whc->response_bdy;
// write the hidden "filename" tag
- HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_NNTP_SERVERS_CONFIG, NULL,
- NULL);
+ HtmlRndrInput(output, HTML_CSS_NONE, HTML_TYPE_HIDDEN, HTML_CONFIG_FILE_TAG, HTML_FILE_MGMT_ALLOW_CONFIG, NULL, NULL);
- // nntp server hostname
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_NNTP_HOSTNAME);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "hostname", NULL, NULL, NULL);
+ writeIpActionSelect(output, "ip_action");
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_NNTP_HOSTNAME_HELP);
- HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_NNTP_HOSTNAME_EG);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_IP_ACTION_HELP);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
- // newsgroups
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_NEWSGROUP_NAMES);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP);
HtmlRndrTdClose(output);
HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "groups", NULL, NULL, NULL);
+ 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_TOP, NULL, NULL, 0);
HtmlRndrUlOpen(output);
HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_NEWSGROUP_NAMES_HELP);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_HELP);
HtmlRndrBr(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_NEWSGROUP_NAMES_EG);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // treatment type
- 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_TREATMENT_TYPE);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- writeTreatmentTypeSelect(output, "treatment");
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_TREATMENT_TYPE_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // priority
- 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_PRIORITY);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_BODY_TEXT, HTML_ALIGN_LEFT, HTML_VALIGN_NONE, NULL, NULL, 0);
- HtmlRndrInput(output, HTML_CSS_BODY_TEXT, "text", "priority", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_PRIORITY_HELP);
- HtmlRndrUlClose(output);
- HtmlRndrTdClose(output);
- HtmlRndrTrClose(output);
-
- // ethernet interface
- 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_ETH_INTERFACE_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", "intr", NULL, NULL, NULL);
- HtmlRndrTdClose(output);
- HtmlRndrTdOpen(output, HTML_CSS_CONFIGURE_HELP, HTML_ALIGN_LEFT, HTML_VALIGN_TOP, NULL, NULL, 0);
- HtmlRndrUlOpen(output);
- HtmlRndrLi(output);
- HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_ETH_INTERFACE_HELP_2);
+ HtmlRndrText(output, whc->lang_dict_ht, HTML_ID_CFG_EDIT_SOURCE_IP_EG);
HtmlRndrUlClose(output);
HtmlRndrTdClose(output);
HtmlRndrTrClose(output);
@@ -5680,153 +5061,6 @@ Lerror:
}
//-------------------------------------------------------------------------
-// convert_nntp_access_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_nntp_access_ele_to_html_format(INKNntpAccessEle * ele,
- char *grp_type,
- char *access, char *auth, char *user, char *pass, char *groups, char *post)
-{
- char *list;
-
- // group type
- switch (ele->client_t) {
- case INK_CLIENT_GRP_IP:
- ink_snprintf(grp_type, MAX_RULE_PART_SIZE, "ip");
- break;
- case INK_CLIENT_GRP_DOMAIN:
- ink_snprintf(grp_type, MAX_RULE_PART_SIZE, "domain");
- break;
- case INK_CLIENT_GRP_HOSTNAME:
- ink_snprintf(grp_type, MAX_RULE_PART_SIZE, "hostname");
- break;
- default:
- goto Lerror;
- }
-
- // clients
- if (!ele->clients)
- goto Lerror;
-
- // access type
- switch (ele->access) {
- case INK_NNTP_ACC_ALLOW:
- ink_snprintf(access, MAX_RULE_PART_SIZE, "allow");
- break;
- case INK_NNTP_ACC_DENY:
- ink_snprintf(access, MAX_RULE_PART_SIZE, "deny");
- break;
- case INK_NNTP_ACC_BASIC:
- ink_snprintf(access, MAX_RULE_PART_SIZE, "basic");
- break;
- case INK_NNTP_ACC_GENERIC:
- ink_snprintf(access, MAX_RULE_PART_SIZE, "generic");
- break;
- case INK_NNTP_ACC_CUSTOM:
- ink_snprintf(access, MAX_RULE_PART_SIZE, "custom");
- break;
- default:
- goto Lerror;
- }
-
- // authenticator
- if (ele->authenticator) {
- ink_snprintf(auth, MAX_RULE_PART_SIZE, ele->authenticator);
- }
- // user
- if (ele->user) {
- ink_snprintf(user, MAX_RULE_PART_SIZE, ele->user);
- }
- // password
- if (ele->pass) {
- ink_snprintf(pass, MAX_RULE_PART_SIZE, ele->pass);
- }
- // groups list
- if (ele->group_wildmat != INK_INVALID_LIST) {
- list = string_list_to_string((StringList *) (ele->group_wildmat), ",");
- if (list) {
- ink_snprintf(groups, MAX_RULE_PART_SIZE, list);
- xfree(list);
- } else {
- goto Lerror;
- }
- }
- // posting deny?
- if (ele->deny_posting) {
- ink_snprintf(post, MAX_RULE_PART_SIZE, "deny");
- }
-
- return WEB_HTTP_ERR_OKAY;
-
-Lerror:
- Debug("config", "[convert_nntp_access_ele_to_html_format] ERROR - invalid Ele");
- return WEB_HTTP_ERR_FAIL;
-}
-
-//-------------------------------------------------------------------------
-// convert_nntp_srvr_ele_to_html_format
-//-------------------------------------------------------------------------
-int
-convert_nntp_srvr_ele_to_html_format(INKNntpSrvrEle * ele, char *groups, char *treatment, char *priority, char *intr)
-{
- char *list;
-
- //hostname
- if (!ele->hostname)
- goto Lerror;
-
- // groups list
- if (ele->group_wildmat != INK_INVALID_LIST) {
- list = string_list_to_string((StringList *) (ele->group_wildmat), ",");
- if (list) {
- ink_snprintf(groups, MAX_RULE_PART_SIZE, list);
- xfree(list);
- } else {
- goto Lerror;
- }
- }
- // treatment type
- switch (ele->treatment) {
- case INK_NNTP_TRMT_FEED:
- ink_snprintf(treatment, MAX_RULE_PART_SIZE, "feed");
- break;
- case INK_NNTP_TRMT_PUSH:
- ink_snprintf(treatment, MAX_RULE_PART_SIZE, "push");
- break;
- case INK_NNTP_TRMT_PULL:
- ink_snprintf(treatment, MAX_RULE_PART_SIZE, "pull");
- break;
- case INK_NNTP_TRMT_PULLOVER:
- ink_snprintf(treatment, MAX_RULE_PART_SIZE, "pullover");
- break;
- case INK_NNTP_TRMT_DYNAMIC:
- ink_snprintf(treatment, MAX_RULE_PART_SIZE, "dynamic");
- break;
- case INK_NNTP_TRMT_POST:
- ink_snprintf(treatment, MAX_RULE_PART_SIZE, "post");
- break;
- default:
- // Handled here:
- // INK_NNTP_TRMT_UNDEFINED
- break;
- }
-
- // priority
- if (ele->priority != 0)
- ink_snprintf(priority, MAX_RULE_PART_SIZE, "%d", ele->priority);
-
- // optional interface
- if (ele->interface)
- ink_snprintf(intr, MAX_RULE_PART_SIZE, "%s", ele->interface);
-
- return WEB_HTTP_ERR_OKAY;
-
-Lerror:
- Debug("config", "[convert_nntp_srvr_ele_to_html_format] ERROR - invalid Ele");
- return WEB_HTTP_ERR_FAIL;
-}
-
-//-------------------------------------------------------------------------
// convert_parent_ele_to_html_format
//-------------------------------------------------------------------------
int
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.h?rev=938979&r1=938978&r2=938979&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.h Wed Apr 28 13:54:17 2010
@@ -65,14 +65,6 @@ int writeMgmtAllowConfigTable(WebHttpCon
int writeMgmtAllowRuleList(textBuffer * output);
int writeMgmtAllowConfigForm(WebHttpContext * whc);
-int writeNntpAccessConfigTable(WebHttpContext * whc);
-int writeNntpAccessRuleList(textBuffer * output);
-int writeNntpAccessConfigForm(WebHttpContext * whc);
-
-int writeNntpServersConfigTable(WebHttpContext * whc);
-int writeNntpServersRuleList(textBuffer * output);
-int writeNntpServersConfigForm(WebHttpContext * whc);
-
int writeParentConfigTable(WebHttpContext * whc);
int writeParentRuleList(textBuffer * output);
int writeParentConfigForm(WebHttpContext * whc);
@@ -145,13 +137,6 @@ int convert_ip_allow_ele_to_html_format(
int convert_mgmt_allow_ele_to_html_format(INKMgmtAllowEle * ele, char *src_ip, char *action);
-int convert_nntp_access_ele_to_html_format(INKNntpAccessEle * ele,
- char *grp_type,
- char *access, char *auth, char *user, char *pass, char *groups, char *post);
-
-int convert_nntp_srvr_ele_to_html_format(INKNntpSrvrEle * ele,
- char *groups, char *treatment, char *priority, char *intr);
-
int convert_parent_ele_to_html_format(INKParentProxyEle * ele,
char *pdType,
char *time,