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 2011/01/21 01:36:53 UTC
svn commit: r1061587 [10/13] - in /trafficserver/traffic/trunk: ./ cop/
mgmt/api/ mgmt/api/include/ mgmt/api/remote/ mgmt/cli/ mgmt/tools/ mgmt/web2/
Modified: trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.cc?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.cc Fri Jan 21 00:36:51 2011
@@ -24,7 +24,7 @@
/****************************************************************
* Filename: CliMgmtUtils.cc
* Purpose: This file contains various utility functions which
- * call the INKMgmtAPI.
+ * call the TSMgmtAPI.
*
*
****************************************************************/
@@ -40,14 +40,14 @@
#include "ConfigCmd.h"
-void Cli_DisplayMgmtAPI_Error(INKError status);
+void Cli_DisplayMgmtAPI_Error(TSError status);
// Get a records.config variable by name
-INKError
-Cli_RecordGet(const char *rec_name, INKRecordEle * rec_val)
+TSError
+Cli_RecordGet(const char *rec_name, TSRecordEle * rec_val)
{
- INKError status;
- if ((status = INKRecordGet((char *) rec_name, rec_val))) {
+ TSError status;
+ if ((status = TSRecordGet((char *) rec_name, rec_val))) {
Cli_Debug(ERR_RECORD_GET, rec_name);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -55,11 +55,11 @@ Cli_RecordGet(const char *rec_name, INKR
}
// Get an integer type records.config variable
-INKError
-Cli_RecordGetInt(const char *rec_name, INKInt * int_val)
+TSError
+Cli_RecordGetInt(const char *rec_name, TSInt * int_val)
{
- INKError status;
- if ((status = INKRecordGetInt(rec_name, int_val))) {
+ TSError status;
+ if ((status = TSRecordGetInt(rec_name, int_val))) {
Cli_Debug(ERR_RECORD_GET_INT, rec_name);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -67,11 +67,11 @@ Cli_RecordGetInt(const char *rec_name, I
}
// Get an counter type records.config variable
-INKError
-Cli_RecordGetCounter(const char *rec_name, INKCounter * ctr_val)
+TSError
+Cli_RecordGetCounter(const char *rec_name, TSCounter * ctr_val)
{
- INKError status;
- if ((status = INKRecordGetCounter(rec_name, ctr_val))) {
+ TSError status;
+ if ((status = TSRecordGetCounter(rec_name, ctr_val))) {
Cli_Debug(ERR_RECORD_GET_COUNTER, rec_name);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -79,11 +79,11 @@ Cli_RecordGetCounter(const char *rec_nam
}
// Get a float type records.config variable
-INKError
-Cli_RecordGetFloat(const char *rec_name, INKFloat * float_val)
+TSError
+Cli_RecordGetFloat(const char *rec_name, TSFloat * float_val)
{
- INKError status;
- if ((status = INKRecordGetFloat(rec_name, float_val))) {
+ TSError status;
+ if ((status = TSRecordGetFloat(rec_name, float_val))) {
Cli_Debug(ERR_RECORD_GET_FLOAT, rec_name);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -91,11 +91,11 @@ Cli_RecordGetFloat(const char *rec_name,
}
// Get a string type records.config variable
-INKError
+TSError
Cli_RecordGetString(const char *rec_name, char **string_val)
{
- INKError status;
- if ((status = INKRecordGetString(rec_name, string_val))) {
+ TSError status;
+ if ((status = TSRecordGetString(rec_name, string_val))) {
Cli_Debug(ERR_RECORD_GET_STRING, rec_name);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -103,11 +103,11 @@ Cli_RecordGetString(const char *rec_name
}
// Use a string to set a records.config variable
-INKError
-Cli_RecordSet(const char *rec_name, const char *rec_value, INKActionNeedT * action_need)
+TSError
+Cli_RecordSet(const char *rec_name, const char *rec_value, TSActionNeedT * action_need)
{
- INKError status;
- if ((status = INKRecordSet((char *) rec_name, (INKString) rec_value, action_need))) {
+ TSError status;
+ if ((status = TSRecordSet((char *) rec_name, (TSString) rec_value, action_need))) {
Cli_Debug(ERR_RECORD_SET, rec_name, rec_value);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -115,11 +115,11 @@ Cli_RecordSet(const char *rec_name, cons
}
// Set an integer type records.config variable
-INKError
-Cli_RecordSetInt(const char *rec_name, INKInt int_val, INKActionNeedT * action_need)
+TSError
+Cli_RecordSetInt(const char *rec_name, TSInt int_val, TSActionNeedT * action_need)
{
- INKError status;
- if ((status = INKRecordSetInt(rec_name, int_val, action_need))) {
+ TSError status;
+ if ((status = TSRecordSetInt(rec_name, int_val, action_need))) {
Cli_Debug(ERR_RECORD_SET_INT, rec_name, int_val);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -127,11 +127,11 @@ Cli_RecordSetInt(const char *rec_name, I
}
// Set a float type records.config variable
-INKError
-Cli_RecordSetFloat(const char *rec_name, INKFloat float_val, INKActionNeedT * action_need)
+TSError
+Cli_RecordSetFloat(const char *rec_name, TSFloat float_val, TSActionNeedT * action_need)
{
- INKError status;
- if ((status = INKRecordSetFloat(rec_name, float_val, action_need))) {
+ TSError status;
+ if ((status = TSRecordSetFloat(rec_name, float_val, action_need))) {
Cli_Debug(ERR_RECORD_SET_FLOAT, rec_name, float_val);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -140,11 +140,11 @@ Cli_RecordSetFloat(const char *rec_name,
// Set a string type records.config variable
-INKError
-Cli_RecordSetString(const char *rec_name, INKString str_val, INKActionNeedT * action_need)
+TSError
+Cli_RecordSetString(const char *rec_name, TSString str_val, TSActionNeedT * action_need)
{
- INKError status;
- if ((status = INKRecordSetString(rec_name, str_val, action_need))) {
+ TSError status;
+ if ((status = TSRecordSetString(rec_name, str_val, action_need))) {
Cli_Debug(ERR_RECORD_SET_STRING, rec_name, str_val);
Cli_DisplayMgmtAPI_Error(status);
}
@@ -152,50 +152,50 @@ Cli_RecordSetString(const char *rec_name
}
void
-Cli_DisplayMgmtAPI_Error(INKError status)
+Cli_DisplayMgmtAPI_Error(TSError status)
{
switch (status) {
- case INK_ERR_OKAY: // do nothing
+ case TS_ERR_OKAY: // do nothing
break;
- case INK_ERR_READ_FILE:
+ case TS_ERR_READ_FILE:
Cli_Printf("\nERROR: Unable to read config file.\n\n");
break;
- case INK_ERR_WRITE_FILE:
+ case TS_ERR_WRITE_FILE:
Cli_Printf("\nERROR: Unable to write config file.\n\n");
break;
- case INK_ERR_PARSE_CONFIG_RULE:
+ case TS_ERR_PARSE_CONFIG_RULE:
Cli_Printf("\nERROR: Unable to parse config file.\n\n");
break;
- case INK_ERR_INVALID_CONFIG_RULE:
+ case TS_ERR_INVALID_CONFIG_RULE:
Cli_Printf("\nERROR: Invalid Configuration Rule in config file.\n\n");
break;
- case INK_ERR_NET_ESTABLISH:
+ case TS_ERR_NET_ESTABLISH:
Cli_Printf("\nERROR: Unable to establish connection to traffic_manager.\n"
" Ability to make configuration changes depends on traffic_manager.\n");
break;
- case INK_ERR_NET_READ:
+ case TS_ERR_NET_READ:
Cli_Printf("\nERROR: Unable to read data from traffic_manager.\n"
" Ability to monitor the system changes depends on traffic_manager.\n");
break;
- case INK_ERR_NET_WRITE:
+ case TS_ERR_NET_WRITE:
Cli_Printf("\nERROR: Unable to write configuration data to traffic_manager.\n"
" Ability to make configuration changes depends on traffic_manager.\n");
break;
- case INK_ERR_NET_EOF:
+ case TS_ERR_NET_EOF:
Cli_Printf("\nERROR: Unexpected EOF while communicating with traffic_manager.\n"
" Ability to make configuration changes depends on traffic_manager.\n");
break;
- case INK_ERR_NET_TIMEOUT:
+ case TS_ERR_NET_TIMEOUT:
Cli_Printf("\nERROR: Timed-out while communicating with traffic_manager.\n"
" Ability to make configuration changes depends on traffic_manager.\n");
break;
- case INK_ERR_SYS_CALL:
+ case TS_ERR_SYS_CALL:
Cli_Printf("\nERROR: Internal System Call failed.\n\n");
break;
- case INK_ERR_PARAMS:
+ case TS_ERR_PARAMS:
Cli_Printf("\nERROR: Invalid parameters passed to a function.\n\n");
break;
- case INK_ERR_FAIL:
+ case TS_ERR_FAIL:
Cli_Printf("\nERROR: Invalid parameter specified.\n" " Check parameters for correct syntax and type.\n\n");
break;
default:
@@ -205,19 +205,19 @@ Cli_DisplayMgmtAPI_Error(INKError status
}
// Retrieve and display contents of a rules file
-INKError
-Cli_DisplayRules(INKFileNameT fname)
+TSError
+Cli_DisplayRules(TSFileNameT fname)
{
- INKError status;
+ TSError status;
char *text;
int size = 0, version = 0;
- if ((status = INKConfigFileRead(fname, &text, &size, &version))) {
+ if ((status = TSConfigFileRead(fname, &text, &size, &version))) {
Cli_Debug(ERR_CONFIG_FILE_READ, fname);
Cli_DisplayMgmtAPI_Error(status);
} else {
if (size) {
- // Fix INKqa12220: use printf directly since Cli_Printf may
+ // Fix TSqa12220: use printf directly since Cli_Printf may
// not allocate enough buffer space to display the file contents
puts(text);
xfree(text);
@@ -230,18 +230,18 @@ Cli_DisplayRules(INKFileNameT fname)
}
// Retrieve and use config file from remote URL
-INKError
-Cli_SetConfigFileFromUrl(INKFileNameT file, const char *url)
+TSError
+Cli_SetConfigFileFromUrl(TSFileNameT file, const char *url)
{
char *buf;
int size = 0;
int version = -1;
- INKError status;
+ TSError status;
Cli_Debug("Cli_SetConfigFileFromUrl: file %d url %s\n", file, url);
// read config file from Url
- if ((status = INKReadFromUrl((char *) url, NULL, NULL, &buf, &size))) {
+ if ((status = TSReadFromUrl((char *) url, NULL, NULL, &buf, &size))) {
Cli_Debug(ERR_READ_FROM_URL, url);
Cli_DisplayMgmtAPI_Error(status);
return status;
@@ -252,7 +252,7 @@ Cli_SetConfigFileFromUrl(INKFileNameT fi
Cli_Debug("Cli_SetConfigFileFromUrl: buf\n%s\n", buf);
// write config file
- if ((status = INKConfigFileWrite(file, buf, size, version))) {
+ if ((status = TSConfigFileWrite(file, buf, size, version))) {
Cli_Debug(ERR_CONFIG_FILE_WRITE, file);
Cli_DisplayMgmtAPI_Error(status);
if (size) {
@@ -272,49 +272,49 @@ Cli_SetConfigFileFromUrl(INKFileNameT fi
// enable recent configuration changes by performing the action specified
// by the action_need value
-INKError
-Cli_ConfigEnactChanges(INKActionNeedT action_need)
+TSError
+Cli_ConfigEnactChanges(TSActionNeedT action_need)
{
- INKError status;
+ TSError status;
Cli_Debug("Cli_ConfigEnactChanges: action_need %d\n", action_need);
switch (action_need) {
- case INK_ACTION_SHUTDOWN:
- Cli_Debug("Cli_ConfigEnactChanges: INK_ACTION_SHUTDOWN\n");
+ case TS_ACTION_SHUTDOWN:
+ Cli_Debug("Cli_ConfigEnactChanges: TS_ACTION_SHUTDOWN\n");
Cli_Printf("\nHard Restart required.\n"
" Change will take effect after next Hard Restart.\n"
" Use the \"config:hard-restart\" command to restart now.\n\n");
break;
- case INK_ACTION_RESTART:
- Cli_Debug("Cli_ConfigEnactChanges: INK_ACTION_RESTART\n");
+ case TS_ACTION_RESTART:
+ Cli_Debug("Cli_ConfigEnactChanges: TS_ACTION_RESTART\n");
Cli_Printf("\nRestart required.\n"
" Change will take effect after next Restart.\n"
" Use the \"config:restart\" command to restart now.\n\n");
break;
- case INK_ACTION_DYNAMIC:
- Cli_Debug("Cli_ConfigEnactChanges: INK_ACTION_DYNAMIC\n");
+ case TS_ACTION_DYNAMIC:
+ Cli_Debug("Cli_ConfigEnactChanges: TS_ACTION_DYNAMIC\n");
// no additional action required
break;
- case INK_ACTION_RECONFIGURE:
- Cli_Debug("Cli_ConfigEnactChanges: INK_ACTION_RECONFIGURE\n");
- status = INKActionDo(INK_ACTION_RECONFIGURE);
+ case TS_ACTION_RECONFIGURE:
+ Cli_Debug("Cli_ConfigEnactChanges: TS_ACTION_RECONFIGURE\n");
+ status = TSActionDo(TS_ACTION_RECONFIGURE);
if (status) {
Cli_Error("\nERROR %d: Failed to reread configuration files.\n\n", status);
- return INK_ERR_FAIL;
+ return TS_ERR_FAIL;
}
break;
default:
Cli_Debug(" Status Message #%d\n", action_need);
Cli_Error("\nYou may need to use the \"config:hard-restart\" command\n" "to enable this configuration change.\n\n");
- return INK_ERR_OKAY;
+ return TS_ERR_OKAY;
}
- return INK_ERR_OKAY;
+ return TS_ERR_OKAY;
}
// evaluate "stringval" and return 1 if "on", otherwise 0
@@ -346,9 +346,9 @@ Cli_EvalOnOffString(char *stringval)
int
Cli_RecordOnOff_Action(int action, const char *record, const char *on_off)
{
- INKActionNeedT action_need;
- INKError status;
- INKInt int_val;
+ TSActionNeedT action_need;
+ TSError status;
+ TSInt int_val;
switch (action) {
case RECORD_SET:
@@ -366,7 +366,7 @@ Cli_RecordOnOff_Action(int action, const
return CLI_ERROR;
}
status = Cli_RecordSetInt(record, int_val, &action_need);
- if (status != INK_ERR_OKAY) {
+ if (status != TS_ERR_OKAY) {
return status;
}
return (Cli_ConfigEnactChanges(action_need));
@@ -398,8 +398,8 @@ Cli_RecordInt_Action(int action, const c
switch (action) {
case RECORD_SET:
{
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = Cli_RecordSetInt(record, value, &action_need);
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = Cli_RecordSetInt(record, value, &action_need);
if (status) {
return status;
@@ -408,8 +408,8 @@ Cli_RecordInt_Action(int action, const c
}
case RECORD_GET:
{
- INKInt value_in = -1;
- INKError status = Cli_RecordGetInt(record, &value_in);
+ TSInt value_in = -1;
+ TSError status = Cli_RecordGetInt(record, &value_in);
if (status) {
return status;
@@ -437,14 +437,14 @@ Cli_RecordInt_Action(int action, const c
int
Cli_RecordHostname_Action(int action, char *record, char *hostname)
{
- INKError status;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKString str_val = NULL;
+ TSError status;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSString str_val = NULL;
switch (action) {
case RECORD_SET:
if (IsValidFQHostname(hostname) == CLI_OK) {
- status = Cli_RecordSetString(record, (INKString) hostname, &action_need);
+ status = Cli_RecordSetString(record, (TSString) hostname, &action_need);
if (status) {
return status;
@@ -483,13 +483,13 @@ Cli_RecordHostname_Action(int action, ch
int
Cli_RecordString_Action(int action, const char *record, char *string_val)
{
- INKError status;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKString str_val = NULL;
+ TSError status;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSString str_val = NULL;
switch (action) {
case RECORD_SET:
- status = Cli_RecordSetString(record, (INKString) string_val, &action_need);
+ status = Cli_RecordSetString(record, (TSString) string_val, &action_need);
if (status) {
return status;
@@ -522,9 +522,9 @@ Cli_RecordString_Action(int action, cons
// url = if non-NULL, update the file using contents of URL
//
int
-Cli_ConfigFileURL_Action(INKFileNameT file, const char *filename, const char *url)
+Cli_ConfigFileURL_Action(TSFileNameT file, const char *filename, const char *url)
{
- INKError status;
+ TSError status;
// Retrieve file from url
if (url == NULL) {
@@ -603,26 +603,26 @@ StartTrafficServer()
}
int
-Cli_CheckPluginStatus(INKString plugin)
+Cli_CheckPluginStatus(TSString plugin)
{
int match = 0;
- INKCfgContext ctx;
- INKCfgIterState ctx_state;
- INKPluginEle *ele;
+ TSCfgContext ctx;
+ TSCfgIterState ctx_state;
+ TSPluginEle *ele;
- ctx = INKCfgContextCreate(INK_FNAME_PLUGIN);
- if (INKCfgContextGet(ctx) != INK_ERR_OKAY) {
+ ctx = TSCfgContextCreate(TS_FNAME_PLUGIN);
+ if (TSCfgContextGet(ctx) != TS_ERR_OKAY) {
printf("ERROR READING FILE\n");
}
- ele = (INKPluginEle *) INKCfgContextGetFirst(ctx, &ctx_state);
+ ele = (TSPluginEle *) TSCfgContextGetFirst(ctx, &ctx_state);
while (ele) {
if (!strcasecmp(plugin, ele->name)) {
match = 1;
break;
}
- ele = (INKPluginEle *) INKCfgContextGetNext(ctx, &ctx_state);
+ ele = (TSPluginEle *) TSCfgContextGetNext(ctx, &ctx_state);
}
if (match) {
Modified: trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h (original)
+++ trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.h Fri Jan 21 00:36:51 2011
@@ -24,7 +24,7 @@
/****************************************************************
* Filename: CliMgmtUtils.h
* Purpose: This file declares various utility functions which
- * call the INKMgmtAPI.
+ * call the TSMgmtAPI.
*
*
****************************************************************/
@@ -39,41 +39,41 @@
#define RECORD_SET 1
// Get a records.config variable by name
-INKError Cli_RecordGet(const char *rec_name, INKRecordEle * rec_val);
+TSError Cli_RecordGet(const char *rec_name, TSRecordEle * rec_val);
// Get an integer type records.config variable
-INKError Cli_RecordGetInt(const char *rec_name, INKInt * int_val);
+TSError Cli_RecordGetInt(const char *rec_name, TSInt * int_val);
// Get an counter type records.config variable
-INKError Cli_RecordGetCounter(const char *rec_name, INKCounter * ctr_val);
+TSError Cli_RecordGetCounter(const char *rec_name, TSCounter * ctr_val);
// Get a float type records.config variable
-INKError Cli_RecordGetFloat(const char *rec_name, INKFloat * float_val);
+TSError Cli_RecordGetFloat(const char *rec_name, TSFloat * float_val);
// Get a string type records.config variable
-INKError Cli_RecordGetString(const char *rec_name, char **string_val);
+TSError Cli_RecordGetString(const char *rec_name, char **string_val);
// Use a string to set a records.config variable
-INKError Cli_RecordSet(const char *rec_name, const char *rec_value, INKActionNeedT * action_need);
+TSError Cli_RecordSet(const char *rec_name, const char *rec_value, TSActionNeedT * action_need);
// Set an integer type records.config variable
-INKError Cli_RecordSetInt(const char *rec_name, INKInt int_val, INKActionNeedT * action_need);
+TSError Cli_RecordSetInt(const char *rec_name, TSInt int_val, TSActionNeedT * action_need);
//Set a float type records.config variable
-INKError Cli_RecordSetFloat(const char *rec_name, INKFloat float_val, INKActionNeedT * action_need);
+TSError Cli_RecordSetFloat(const char *rec_name, TSFloat float_val, TSActionNeedT * action_need);
// Set a string type records.config variable
-INKError Cli_RecordSetString(const char *rec_name, INKString str_val, INKActionNeedT * action_need);
+TSError Cli_RecordSetString(const char *rec_name, TSString str_val, TSActionNeedT * action_need);
// Retrieve and display contents of a rules file
-INKError Cli_DisplayRules(INKFileNameT fname);
+TSError Cli_DisplayRules(TSFileNameT fname);
// Retrieve and use config file from remote URL
-INKError Cli_SetConfigFileFromUrl(INKFileNameT file, const char *url);
+TSError Cli_SetConfigFileFromUrl(TSFileNameT file, const char *url);
// enable recent configuration changes by performing the action specified
// by the action_need value
-INKError Cli_ConfigEnactChanges(INKActionNeedT action_need);
+TSError Cli_ConfigEnactChanges(TSActionNeedT action_need);
// evaluate "stringval" and return 1 if "on", otherwise 0
int Cli_EvalOnOffString(char *stringval);
@@ -151,7 +151,7 @@ int Cli_RecordString_Action(int action,
//
// url = if non-NULL, update the file using contents of URL
//
-int Cli_ConfigFileURL_Action(INKFileNameT file, const char *filename, const char *url);
+int Cli_ConfigFileURL_Action(TSFileNameT file, const char *filename, const char *url);
extern int enable_restricted_commands;
@@ -161,4 +161,4 @@ int GetTSDirectory(char *ts_path, size_t
int StopTrafficServer();
int StartTrafficServer();
-int Cli_CheckPluginStatus(INKString plugin);
+int Cli_CheckPluginStatus(TSString plugin);
Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc Fri Jan 21 00:36:51 2011
@@ -84,13 +84,13 @@ int
cliVerifyPasswd(char *passwd)
{
char *e_passwd = NULL;
- INKError status = INK_ERR_OKAY;
- INKString old_passwd = NULL;
+ TSError status = TS_ERR_OKAY;
+ TSString old_passwd = NULL;
- INKEncryptPassword(passwd, &e_passwd);
+ TSEncryptPassword(passwd, &e_passwd);
status = Cli_RecordGetString("proxy.config.admin.admin_password", &old_passwd);
- if (status != INK_ERR_OKAY) {
+ if (status != TS_ERR_OKAY) {
if (e_passwd)
xfree(e_passwd);
return CLI_ERROR;
@@ -546,7 +546,7 @@ Cmd_ConfigHardRestart(ClientData clientD
Cli_Debug("Cmd_ConfigHardRestart argc %d\n", argc);
if (argc == 1) {
- return (INKHardRestart());
+ return (TSHardRestart());
}
Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
return CMD_ERROR;
@@ -587,10 +587,10 @@ Cmd_ConfigRestart(ClientData clientData,
Cli_Debug("Cmd_ConfigRestart argc %d\n", argc);
if (argc == 1) {
- return (INKRestart(false));
+ return (TSRestart(false));
} else if (argc == 2) {
if (argtable[0].parsed_args == CMD_CONFIG_RESTART_CLUSTER) {
- return (INKRestart(true));
+ return (TSRestart(true));
}
}
Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
@@ -663,7 +663,7 @@ Cmd_ConfigParents(ClientData clientData,
return (Cli_RecordString_Action((argc == 3), "proxy.config.http.parent_proxies", argtable->arg_string));
case CMD_CONFIG_PARENTS_CONFIG_FILE:
- return (Cli_ConfigFileURL_Action(INK_FNAME_PARENT_PROXY, "parent.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_PARENT_PROXY, "parent.config", argtable->arg_string));
}
}
Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
@@ -945,13 +945,13 @@ Cmd_ConfigSecurity(ClientData clientData
if (argtable[0].parsed_args != CLI_PARSED_ARGV_END) {
switch (argtable[0].parsed_args) {
case CMD_CONFIG_SECURITY_IP:
- return (Cli_ConfigFileURL_Action(INK_FNAME_IP_ALLOW, "ip_allow.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_IP_ALLOW, "ip_allow.config", argtable->arg_string));
case CMD_CONFIG_SECURITY_MGMT:
- return (Cli_ConfigFileURL_Action(INK_FNAME_MGMT_ALLOW, "mgmt_allow.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_MGMT_ALLOW, "mgmt_allow.config", argtable->arg_string));
case CMD_CONFIG_SECURITY_ADMIN:
- return (Cli_ConfigFileURL_Action(INK_FNAME_ADMIN_ACCESS, "admin_access.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_ADMIN_ACCESS, "admin_access.config", argtable->arg_string));
case CMD_CONFIG_SECURITY_PASSWORD:
return (ConfigSecurityPasswd());
@@ -1199,7 +1199,7 @@ Cmd_ConfigIcp(ClientData clientData, Tcl
return (Cli_RecordInt_Action(action, "proxy.config.icp.query_timeout", argtable->arg_int));
case CMD_CONFIG_ICP_PEERS:
- return (Cli_ConfigFileURL_Action(INK_FNAME_ICP_PEER, "icp.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_ICP_PEER, "icp.config", argtable->arg_string));
}
}
Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
@@ -1360,7 +1360,7 @@ Cmd_ConfigScheduledUpdate(ClientData cli
return (Cli_RecordOnOff_Action(action, "proxy.config.update.force", argtable->arg_string));
case CMD_CONFIG_SCHEDULED_UPDATE_RULES:
- return (Cli_ConfigFileURL_Action(INK_FNAME_UPDATE_URL, "update.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_UPDATE_URL, "update.config", argtable->arg_string));
}
}
Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
@@ -1534,7 +1534,7 @@ Cmd_ConfigCache(ClientData clientData, T
return (Cli_RecordInt_Action((argc == 3), "proxy.config.cache.limits.http.max_alts", argtable->arg_int));
case CMD_CONFIG_CACHE_FILE:
- return (Cli_ConfigFileURL_Action(INK_FNAME_CACHE_OBJ, "cache.config", argtable->arg_string));
+ return (Cli_ConfigFileURL_Action(TS_FNAME_CACHE_OBJ, "cache.config", argtable->arg_string));
case CMD_CONFIG_CACHE_FRESHNESS:
if (argtable[1].parsed_args != CLI_PARSED_ARGV_END) {
@@ -2356,16 +2356,16 @@ CmdArgs_ConfigAlarm()
int
ConfigStart()
{
- INKProxyStateT state = INKProxyStateGet();
+ TSProxyStateT state = TSProxyStateGet();
switch (state) {
- case INK_PROXY_ON:
+ case TS_PROXY_ON:
// do nothing, proxy is already on
Cli_Error(ERR_PROXY_STATE_ALREADY, "on");
break;
- case INK_PROXY_OFF:
- case INK_PROXY_UNDEFINED:
- if (INKProxyStateSet(INK_PROXY_ON, INK_CACHE_CLEAR_OFF)) {
+ case TS_PROXY_OFF:
+ case TS_PROXY_UNDEFINED:
+ if (TSProxyStateSet(TS_PROXY_ON, TS_CACHE_CLEAR_OFF)) {
Cli_Error(ERR_PROXY_STATE_SET, "on");
return CLI_ERROR;
}
@@ -2378,16 +2378,16 @@ ConfigStart()
int
ConfigStop()
{
- INKProxyStateT state = INKProxyStateGet();
+ TSProxyStateT state = TSProxyStateGet();
switch (state) {
- case INK_PROXY_OFF:
+ case TS_PROXY_OFF:
// do nothing, proxy is already off
Cli_Error(ERR_PROXY_STATE_ALREADY, "off");
break;
- case INK_PROXY_ON:
- case INK_PROXY_UNDEFINED:
- if (INKProxyStateSet(INK_PROXY_OFF, INK_CACHE_CLEAR_OFF)) {
+ case TS_PROXY_ON:
+ case TS_PROXY_UNDEFINED:
+ if (TSProxyStateSet(TS_PROXY_OFF, TS_CACHE_CLEAR_OFF)) {
Cli_Error(ERR_PROXY_STATE_SET, "off");
return CLI_ERROR;
}
@@ -2403,8 +2403,8 @@ ConfigGet(const char *rec_name)
{
Cli_Debug("ConfigGet: rec_name %s\n", rec_name);
- INKError status;
- INKRecordEle rec_val;
+ TSError status;
+ TSRecordEle rec_val;
status = Cli_RecordGet(rec_name, &rec_val);
@@ -2414,19 +2414,19 @@ ConfigGet(const char *rec_name)
// display the result
switch (rec_val.rec_type) {
- case INK_REC_INT: // INK64 aka "long long"
+ case TS_REC_INT: // TS64 aka "long long"
Cli_Printf("%s = %d\n", rec_name, (int) rec_val.int_val);
break;
- case INK_REC_COUNTER: // INK64 aka "long long"
+ case TS_REC_COUNTER: // TS64 aka "long long"
Cli_Printf("%s = %d\n", rec_name, (int) rec_val.counter_val);
break;
- case INK_REC_FLOAT: // float
+ case TS_REC_FLOAT: // float
Cli_Printf("%s = %f\n", rec_name, rec_val.float_val);
break;
- case INK_REC_STRING: // char*
+ case TS_REC_STRING: // char*
Cli_Printf("%s = \"%s\"\n", rec_name, rec_val.string_val);
break;
- case INK_REC_UNDEFINED: // what's this???
+ case TS_REC_UNDEFINED: // what's this???
Cli_Printf("%s = UNDEFINED\n", rec_name);
break;
}
@@ -2442,8 +2442,8 @@ ConfigSet(const char *rec_name, const ch
{
Cli_Debug("ConfigSet: rec_name %s value %s\n", rec_name, value);
- INKError status;
- INKActionNeedT action_need;
+ TSError status;
+ TSActionNeedT action_need;
status = Cli_RecordSet(rec_name, value, &action_need);
if (status) {
@@ -2459,15 +2459,15 @@ ConfigSet(const char *rec_name, const ch
int
ConfigName(const char *proxy_name)
{
- INKError status = INK_ERR_OKAY;
- INKString str_val = NULL;
- INKActionNeedT action_need;
+ TSError status = TS_ERR_OKAY;
+ TSString str_val = NULL;
+ TSActionNeedT action_need;
if (proxy_name) { // set the name
Cli_Debug("ConfigName: set name proxy_name %s\n", proxy_name);
- status = Cli_RecordSetString("proxy.config.proxy_name", (INKString) proxy_name, &action_need);
+ status = Cli_RecordSetString("proxy.config.proxy_name", (TSString) proxy_name, &action_need);
if (status) {
return status;
@@ -2509,40 +2509,40 @@ ConfigPortsSet(int arg_ref, void *valueP
Cli_Debug("ConfigPortsSet: arg_ref %d value %s\n", arg_ref, (char *) valuePtr);
break;
default:
- Cli_Debug("ConfigPortsSet: arg_ref %d value %d\n", arg_ref, *(INKInt *) valuePtr);
+ Cli_Debug("ConfigPortsSet: arg_ref %d value %d\n", arg_ref, *(TSInt *) valuePtr);
}
- INKError status = INK_ERR_OKAY;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
Cli_Debug("ConfigPorts: set\n");
switch (arg_ref) {
case CMD_CONFIG_PORTS_HTTP_SERVER:
- status = Cli_RecordSetInt("proxy.config.http.server_port", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.http.server_port", *(TSInt *) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_HTTP_OTHER:
- status = Cli_RecordSetString("proxy.config.http.server_other_ports", (INKString) valuePtr, &action_need);
+ status = Cli_RecordSetString("proxy.config.http.server_other_ports", (TSString) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_WEBUI:
- status = Cli_RecordSetInt("proxy.config.admin.web_interface_port", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.admin.web_interface_port", *(TSInt *) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_CLUSTER:
- status = Cli_RecordSetInt("proxy.config.cluster.cluster_port", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.cluster.cluster_port", *(TSInt *) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_CLUSTER_RS:
- status = Cli_RecordSetInt("proxy.config.cluster.rsport", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.cluster.rsport", *(TSInt *) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_CLUSTER_MC:
- status = Cli_RecordSetInt("proxy.config.cluster.mcport", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.cluster.mcport", *(TSInt *) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_CONNECT:
- status = Cli_RecordSetString("proxy.config.http.connect_ports", (INKString) valuePtr, &action_need);
+ status = Cli_RecordSetString("proxy.config.http.connect_ports", (TSString) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_SOCKS_SERVER:
- status = Cli_RecordSetInt("proxy.config.socks.socks_server_port", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.socks.socks_server_port", *(TSInt *) valuePtr, &action_need);
break;
case CMD_CONFIG_PORTS_ICP:
- status = Cli_RecordSetInt("proxy.config.icp.icp_port", *(INKInt *) valuePtr, &action_need);
+ status = Cli_RecordSetInt("proxy.config.icp.icp_port", *(TSInt *) valuePtr, &action_need);
break;
}
@@ -2560,9 +2560,9 @@ ConfigPortsSet(int arg_ref, void *valueP
int
ConfigPortsGet(int arg_ref)
{
- INKError status = INK_ERR_OKAY;
- INKInt int_val = -1;
- INKString str_val = NULL;
+ TSError status = TS_ERR_OKAY;
+ TSInt int_val = -1;
+ TSString str_val = NULL;
Cli_Debug("ConfigPortsGet: get\n");
@@ -2653,8 +2653,8 @@ ConfigSecurityPasswd()
char org_passwd[256], new_passwd1[256], new_passwd2[256], ch = 'p';
int i = 0;
char *e_passwd = NULL;
- INKError status = INK_ERR_OKAY;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
Cli_Debug("ConfigSecurityPasswd\n");
@@ -2703,10 +2703,10 @@ ConfigSecurityPasswd()
return CLI_ERROR;
}
- INKEncryptPassword(new_passwd1, &e_passwd);
- status = Cli_RecordSetString("proxy.config.admin.admin_password", (INKString) e_passwd, &action_need);
+ TSEncryptPassword(new_passwd1, &e_passwd);
+ status = Cli_RecordSetString("proxy.config.admin.admin_password", (TSString) e_passwd, &action_need);
- if (status != INK_ERR_OKAY) {
+ if (status != TS_ERR_OKAY) {
Cli_Printf("\nCannot Set The Password\n");
Cli_ConfigEnactChanges(action_need);
if (e_passwd)
@@ -2727,7 +2727,7 @@ ConfigRemap(const char *url)
{
Cli_Debug("ConfigRemap: url %s\n", url);
- return (Cli_SetConfigFileFromUrl(INK_FNAME_REMAP, url));
+ return (Cli_SetConfigFileFromUrl(TS_FNAME_REMAP, url));
}
// config date sub-command
@@ -3090,10 +3090,10 @@ ConfigHttpProxy(int arg_ref, int setvar)
{
Cli_Debug("ConfigHttpProxy: proxy %d\n", arg_ref);
- INKInt rmp_val = 0;
- INKInt rev_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt rmp_val = 0;
+ TSInt rev_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -3121,28 +3121,28 @@ ConfigHttpProxy(int arg_ref, int setvar)
{
switch (arg_ref) {
case CMD_CONFIG_HTTP_FWD:
- status = Cli_RecordSetInt("proxy.config.reverse_proxy.enabled", (INKInt) 0, &action_need);
+ status = Cli_RecordSetInt("proxy.config.reverse_proxy.enabled", (TSInt) 0, &action_need);
if (status) {
return status;
}
return (Cli_ConfigEnactChanges(action_need));
case CMD_CONFIG_HTTP_REV:
- status = Cli_RecordSetInt("proxy.config.reverse_proxy.enabled", (INKInt) 1, &action_need);
+ status = Cli_RecordSetInt("proxy.config.reverse_proxy.enabled", (TSInt) 1, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetInt("proxy.config.url_remap.remap_required", (INKInt) 1, &action_need);
+ status = Cli_RecordSetInt("proxy.config.url_remap.remap_required", (TSInt) 1, &action_need);
if (status) {
return status;
}
return (Cli_ConfigEnactChanges(action_need));
case CMD_CONFIG_HTTP_FWD_REV:
- status = Cli_RecordSetInt("proxy.config.reverse_proxy.enabled", (INKInt) 1, &action_need);
+ status = Cli_RecordSetInt("proxy.config.reverse_proxy.enabled", (TSInt) 1, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetInt("proxy.config.url_remap.remap_required", (INKInt) 0, &action_need);
+ status = Cli_RecordSetInt("proxy.config.url_remap.remap_required", (TSInt) 0, &action_need);
if (status) {
return status;
}
@@ -3180,8 +3180,8 @@ ConfigIcpMode(int arg_ref, int setvar)
return CLI_ERROR;
}
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = Cli_RecordSetInt("proxy.config.icp.enabled",
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = Cli_RecordSetInt("proxy.config.icp.enabled",
mode_num, &action_need);
if (status) {
return status;
@@ -3190,8 +3190,8 @@ ConfigIcpMode(int arg_ref, int setvar)
return (Cli_ConfigEnactChanges(action_need));
} else {
- INKInt value_in = -1;
- INKError status = Cli_RecordGetInt("proxy.config.icp.enabled", &value_in);
+ TSInt value_in = -1;
+ TSError status = Cli_RecordGetInt("proxy.config.icp.enabled", &value_in);
if (status) {
return status;
@@ -3224,9 +3224,9 @@ ConfigCacheFreshnessVerify(int arg_ref,
Cli_Debug(" ConfigCacheFreshnessVerify: %d set?%d\n", arg_ref, setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -3269,7 +3269,7 @@ ConfigCacheFreshnessVerify(int arg_ref,
default:
Cli_Printf("ERROR in Argument\n");
}
- status = Cli_RecordSetInt("proxy.config.http.cache.when_to_revalidate", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.http.cache.when_to_revalidate", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -3288,9 +3288,9 @@ ConfigCacheFreshnessMinimum(int arg_ref,
Cli_Debug("ConfigCacheFreshnessMinimum: %d set?%d\n", arg_ref, setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -3327,7 +3327,7 @@ ConfigCacheFreshnessMinimum(int arg_ref,
default:
Cli_Printf("ERROR in arg\n");
}
- status = Cli_RecordSetInt("proxy.config.http.cache.required_headers", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.http.cache.required_headers", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -3340,16 +3340,16 @@ ConfigCacheFreshnessMinimum(int arg_ref,
// config Cache FreshnessNoExpireLimit
int
-ConfigCacheFreshnessNoExpireLimit(INKInt min, INKInt max, int setvar)
+ConfigCacheFreshnessNoExpireLimit(TSInt min, TSInt max, int setvar)
{
Cli_Debug(" ConfigCacheFreshnessNoExpireLimit: greater than %d \n", min);
Cli_Debug(" ConfigCacheFreshnessNoExpireLimit: less than %d\n", max);
Cli_Debug(" set?%d\n", setvar);
- INKInt min_val = 0;
- INKInt max_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt min_val = 0;
+ TSInt max_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -3366,11 +3366,11 @@ ConfigCacheFreshnessNoExpireLimit(INKInt
Cli_Printf("less than ----- %d\n", max_val);
return CLI_OK;
case 1:
- status = Cli_RecordSetInt("proxy.config.http.cache.heuristic_min_lifetime", (INKInt) min, &action_need);
+ status = Cli_RecordSetInt("proxy.config.http.cache.heuristic_min_lifetime", (TSInt) min, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetInt("proxy.config.http.cache.heuristic_max_lifetime", (INKInt) max, &action_need);
+ status = Cli_RecordSetInt("proxy.config.http.cache.heuristic_max_lifetime", (TSInt) max, &action_need);
if (status) {
return status;
}
@@ -3388,9 +3388,9 @@ ConfigCacheVary(int arg_ref, char *field
Cli_Debug(" ConfigCacheVary: %d set?%d\n", arg_ref, setvar);
Cli_Debug(" field: %s\n", field);
- INKString str_val = NULL;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSString str_val = NULL;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -3425,15 +3425,15 @@ ConfigCacheVary(int arg_ref, char *field
{
switch (arg_ref) {
case CMD_CONFIG_CACHE_VARY_TEXT:
- status = Cli_RecordSetString("proxy.config.http.cache.vary_default_text", (INKString) field, &action_need);
+ status = Cli_RecordSetString("proxy.config.http.cache.vary_default_text", (TSString) field, &action_need);
break;
case CMD_CONFIG_CACHE_VARY_COOKIES_IMAGES:
- status = Cli_RecordSetString("proxy.config.http.cache.vary_default_images", (INKString) field, &action_need);
+ status = Cli_RecordSetString("proxy.config.http.cache.vary_default_images", (TSString) field, &action_need);
break;
case CMD_CONFIG_CACHE_VARY_OTHER:
- status = Cli_RecordSetString("proxy.config.http.cache.vary_default_other", (INKString) field, &action_need);
+ status = Cli_RecordSetString("proxy.config.http.cache.vary_default_other", (TSString) field, &action_need);
break;
default:
Cli_Printf("ERROR in arg\n");
@@ -3457,9 +3457,9 @@ ConfigCacheCookies(int arg_ref, int setv
Cli_Debug("ConfigCacheCookies: %d set?%d\n", arg_ref, setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -3510,7 +3510,7 @@ ConfigCacheCookies(int arg_ref, int setv
default:
Cli_Printf("ERROR in arg\n");
}
- status = Cli_RecordSetInt("proxy.config.http.cache.cache_responses_to_cookies", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.http.cache.cache_responses_to_cookies", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -3529,22 +3529,22 @@ ConfigCacheClear()
Cli_Debug("ConfigCacheClear");
- INKProxyStateT state;
- INKError status = INK_ERR_OKAY;
+ TSProxyStateT state;
+ TSError status = TS_ERR_OKAY;
- state = INKProxyStateGet();
+ state = TSProxyStateGet();
switch (state) {
- case INK_PROXY_ON:
+ case TS_PROXY_ON:
Cli_Printf("Traffic Server is running.\nClear Cache failed.\n");
return CLI_ERROR;
- case INK_PROXY_OFF:
- status = INKProxyStateSet(INK_PROXY_ON, INK_CACHE_CLEAR_ON);
+ case TS_PROXY_OFF:
+ status = TSProxyStateSet(TS_PROXY_ON, TS_CACHE_CLEAR_ON);
if (status) {
return status;
}
return status;
- case INK_PROXY_UNDEFINED:
+ case TS_PROXY_UNDEFINED:
Cli_Printf("Error %d: Problem clearing Cache.\n", state);
return CLI_ERROR;
default:
@@ -3562,23 +3562,23 @@ ConfigHostdbClear()
Cli_Debug("ConfigHostDBClear\n");
- INKProxyStateT state = INK_PROXY_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSProxyStateT state = TS_PROXY_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
- state = INKProxyStateGet();
+ state = TSProxyStateGet();
Cli_Debug("Proxy State %d\n", state);
switch (state) {
- case INK_PROXY_ON:
+ case TS_PROXY_ON:
Cli_Printf("Traffic Server is running.\nClear HostDB failed.\n");
return CLI_ERROR;
- case INK_PROXY_OFF:
- status = INKProxyStateSet(INK_PROXY_ON, INK_CACHE_CLEAR_HOSTDB);
+ case TS_PROXY_OFF:
+ status = TSProxyStateSet(TS_PROXY_ON, TS_CACHE_CLEAR_HOSTDB);
if (status) {
return status;
}
return status;
- case INK_PROXY_UNDEFINED:
+ case TS_PROXY_UNDEFINED:
Cli_Printf("Error %d: Problem clearing HostDB.\n", state);
return CLI_ERROR;
default:
@@ -3595,27 +3595,27 @@ ConfigVirtualIpList()
Cli_Debug("ConfigVirtualIpList\n");
- INKCfgContext VipCtx;
+ TSCfgContext VipCtx;
int EleCount, i;
- INKVirtIpAddrEle *VipElePtr;
+ TSVirtIpAddrEle *VipElePtr;
- VipCtx = INKCfgContextCreate(INK_FNAME_VADDRS);
- if (INKCfgContextGet(VipCtx) != INK_ERR_OKAY) {
+ VipCtx = TSCfgContextCreate(TS_FNAME_VADDRS);
+ if (TSCfgContextGet(VipCtx) != TS_ERR_OKAY) {
Cli_Printf("ERROR READING FILE\n");
return CLI_ERROR;
}
- EleCount = INKCfgContextGetCount(VipCtx);
+ EleCount = TSCfgContextGetCount(VipCtx);
if (EleCount == 0) {
Cli_Printf("\nNo Virtual IP addresses specified\n");
} else {
Cli_Printf("\nVirtual IP addresses specified\n" "------------------------------\n", EleCount);
for (i = 0; i < EleCount; i++) {
- VipElePtr = (INKVirtIpAddrEle *) INKCfgContextGetEleAt(VipCtx, i);
+ VipElePtr = (TSVirtIpAddrEle *) TSCfgContextGetEleAt(VipCtx, i);
Cli_Printf("%d) %s %s %d\n", i, VipElePtr->ip_addr, VipElePtr->intr, VipElePtr->sub_intr);
}
}
Cli_Printf("\n");
- INKCfgContextDestroy(VipCtx);
+ TSCfgContextDestroy(VipCtx);
return CLI_OK;
}
@@ -3627,11 +3627,11 @@ ConfigVirtualipAdd(char *ip, char *devic
Cli_Debug("ConfigVirtualipAdd: %s %s %d set? %d\n", ip, device, subinterface, setvar);
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
- INKCfgContext VipCtx;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
+ TSCfgContext VipCtx;
int size;
- INKVirtIpAddrEle *VipElePtr;
+ TSVirtIpAddrEle *VipElePtr;
switch (setvar) {
case 0: //get
@@ -3639,7 +3639,7 @@ ConfigVirtualipAdd(char *ip, char *devic
case 1: //set
- VipElePtr = INKVirtIpAddrEleCreate();
+ VipElePtr = TSVirtIpAddrEleCreate();
if (!VipElePtr)
return CLI_ERROR;
@@ -3651,16 +3651,16 @@ ConfigVirtualipAdd(char *ip, char *devic
VipElePtr->intr = new char[size + 1];
ink_strncpy(VipElePtr->intr, device, size + 1);
VipElePtr->sub_intr = subinterface;
- VipCtx = INKCfgContextCreate(INK_FNAME_VADDRS);
- if (INKCfgContextGet(VipCtx) != INK_ERR_OKAY)
+ VipCtx = TSCfgContextCreate(TS_FNAME_VADDRS);
+ if (TSCfgContextGet(VipCtx) != TS_ERR_OKAY)
Cli_Printf("ERROR READING FILE\n");
- status = INKCfgContextAppendEle(VipCtx, (INKCfgEle *) VipElePtr);
+ status = TSCfgContextAppendEle(VipCtx, (TSCfgEle *) VipElePtr);
if (status) {
Cli_Printf("ERROR %d: Failed to add entry to config file.\n", status);
return status;
}
- status = INKCfgContextCommit(VipCtx, &action_need, NULL);
+ status = TSCfgContextCommit(VipCtx, &action_need, NULL);
if (status) {
Cli_Printf("\nERROR %d: Failed to commit changes to config file.\n"
@@ -3681,9 +3681,9 @@ ConfigVirtualipDelete(int ip_no, int set
Cli_Debug("ConfigVirtualipDelete: %d set? %d\n", ip_no, setvar);
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
- INKCfgContext VipCtx;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
+ TSCfgContext VipCtx;
int EleCount;
switch (setvar) {
@@ -3692,12 +3692,12 @@ ConfigVirtualipDelete(int ip_no, int set
case 1: //set
- VipCtx = INKCfgContextCreate(INK_FNAME_VADDRS);
- if (INKCfgContextGet(VipCtx) != INK_ERR_OKAY) {
+ VipCtx = TSCfgContextCreate(TS_FNAME_VADDRS);
+ if (TSCfgContextGet(VipCtx) != TS_ERR_OKAY) {
Cli_Printf("ERROR READING FILE\n");
return CLI_ERROR;
}
- EleCount = INKCfgContextGetCount(VipCtx);
+ EleCount = TSCfgContextGetCount(VipCtx);
if (EleCount == 0) {
Cli_Printf("No Virual IP's to delete.\n");
return CLI_ERROR;
@@ -3710,11 +3710,11 @@ ConfigVirtualipDelete(int ip_no, int set
return CLI_ERROR;
}
- status = INKCfgContextRemoveEleAt(VipCtx, ip_no);
+ status = TSCfgContextRemoveEleAt(VipCtx, ip_no);
if (status) {
return status;
}
- status = INKCfgContextCommit(VipCtx, &action_need, NULL);
+ status = TSCfgContextCommit(VipCtx, &action_need, NULL);
if (status) {
Cli_Printf("\nERROR %d: Failed to commit changes to config file.\n"
@@ -4199,9 +4199,9 @@ ConfigLoggingEvent(int arg_ref, int setv
Cli_Debug("ConfigLoggingEvent: %d set?%d\n", arg_ref, setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4246,7 +4246,7 @@ ConfigLoggingEvent(int arg_ref, int setv
default:
Cli_Printf("ERROR in arg\n");
}
- status = Cli_RecordSetInt("proxy.config.log.logging_enabled", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.logging_enabled", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -4267,9 +4267,9 @@ ConfigLoggingCollationStatus(int arg_ref
Cli_Debug("ConfigLoggingCollationStatus: %d set?%d\n", arg_ref, setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4321,7 +4321,7 @@ ConfigLoggingCollationStatus(int arg_ref
Cli_Printf("ERROR in arg\n");
}
Cli_Debug("ConfigLoggingCollationStatus: %d set?%d\n", int_val, setvar);
- status = Cli_RecordSetInt("proxy.local.log.collation_mode", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.local.log.collation_mode", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -4335,16 +4335,16 @@ ConfigLoggingCollationStatus(int arg_ref
// config Logging collation sub-command
int
-ConfigLoggingCollation(INKString secret, int arg_ref, INKInt orphan, int setvar)
+ConfigLoggingCollation(TSString secret, int arg_ref, TSInt orphan, int setvar)
{
Cli_Debug(" LoggingCollation %s %d %d\n", secret, orphan, arg_ref);
Cli_Debug(" set? %d\n", setvar);
- INKString str_val = NULL;
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSString str_val = NULL;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4378,7 +4378,7 @@ ConfigLoggingCollation(INKString secret,
case 1: //set
{
- status = Cli_RecordSetString("proxy.config.log.collation_secret", (INKString) secret, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.collation_secret", (TSString) secret, &action_need);
if (status) {
return status;
}
@@ -4393,12 +4393,12 @@ ConfigLoggingCollation(INKString secret,
Cli_Printf("ERROR in arg\n");
}
- status = Cli_RecordSetInt("proxy.config.log.collation_host_tagged", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.collation_host_tagged", (TSInt) int_val, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetInt("proxy.config.log.collation_port", (INKInt) orphan, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.collation_port", (TSInt) orphan, &action_need);
if (status) {
return status;
}
@@ -4414,16 +4414,16 @@ ConfigLoggingCollation(INKString secret,
// config Logging Format Type File sub-command
int
ConfigLoggingFormatTypeFile(int arg_ref_format, int arg_ref,
- int arg_ref_type, INKString file, INKString header, int setvar)
+ int arg_ref_type, TSString file, TSString header, int setvar)
{
Cli_Debug(" LoggingFormatTypeFile %d %d %d %s %s set?%d\n",
arg_ref_format, arg_ref, arg_ref_type, file, header, setvar);
- INKString str_val = NULL;
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSString str_val = NULL;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4583,7 +4583,7 @@ ConfigLoggingFormatTypeFile(int arg_ref_
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.squid_log_enabled", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.squid_log_enabled", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -4599,18 +4599,18 @@ ConfigLoggingFormatTypeFile(int arg_ref_
Cli_Printf("ERROR in arg\n");
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.squid_log_is_ascii", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.squid_log_is_ascii", (TSInt) int_val, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.squid_log_name", (INKString) file, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.squid_log_name", (TSString) file, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.squid_log_header", (INKString) header, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.squid_log_header", (TSString) header, &action_need);
if (status) {
return status;
}
@@ -4629,7 +4629,7 @@ ConfigLoggingFormatTypeFile(int arg_ref_
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.common_log_enabled", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.common_log_enabled", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -4646,18 +4646,18 @@ ConfigLoggingFormatTypeFile(int arg_ref_
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.common_log_is_ascii", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.common_log_is_ascii", (TSInt) int_val, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.common_log_name", (INKString) file, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.common_log_name", (TSString) file, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.common_log_header", (INKString) header, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.common_log_header", (TSString) header, &action_need);
if (status) {
return status;
}
@@ -4678,7 +4678,7 @@ ConfigLoggingFormatTypeFile(int arg_ref_
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.extended_log_enabled", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.extended_log_enabled", (TSInt) int_val, &action_need);
if (status) {
return status;
@@ -4694,18 +4694,18 @@ ConfigLoggingFormatTypeFile(int arg_ref_
Cli_Printf("ERROR in arg\n");
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.extended_log_is_ascii", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.extended_log_is_ascii", (TSInt) int_val, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.extended_log_name", (INKString) file, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.extended_log_name", (TSString) file, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.extended_log_header", (INKString) header, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.extended_log_header", (TSString) header, &action_need);
if (status) {
return status;
}
@@ -4724,7 +4724,7 @@ ConfigLoggingFormatTypeFile(int arg_ref_
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.extended2_log_enabled", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.extended2_log_enabled", (TSInt) int_val, &action_need);
if (status) {
return status;
}
@@ -4739,18 +4739,18 @@ ConfigLoggingFormatTypeFile(int arg_ref_
Cli_Printf("ERROR in arg\n");
return CLI_ERROR;
}
- status = Cli_RecordSetInt("proxy.config.log.extended2_log_is_ascii", (INKInt) int_val, &action_need);
+ status = Cli_RecordSetInt("proxy.config.log.extended2_log_is_ascii", (TSInt) int_val, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.extended2_log_name", (INKString) file, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.extended2_log_name", (TSString) file, &action_need);
if (status) {
return status;
}
- status = Cli_RecordSetString("proxy.config.log.extended2_log_header", (INKString) header, &action_need);
+ status = Cli_RecordSetString("proxy.config.log.extended2_log_header", (TSString) header, &action_need);
if (status) {
return status;
}
@@ -4769,9 +4769,9 @@ ConfigLoggingSplitting(int arg_ref_proto
Cli_Debug("ConfigLoggingSplitting %d %d set?%d\n", arg_ref_protocol, arg_ref_on_off, setvar);
- INKInt int_val;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4845,9 +4845,9 @@ ConfigLoggingCustomFormat(int arg_ref_on
Cli_Debug("ConfigLoggingSplitting %d %d set?%d\n", arg_ref_on_off, arg_ref_format, setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4891,7 +4891,7 @@ ConfigLoggingCustomFormat(int arg_ref_on
// config Logging rolling offset interval autodelete sub-command
int
ConfigLoggingRollingOffsetIntervalAutodelete(int arg_ref_rolling,
- INKInt offset, INKInt num_hours, int arg_ref_auto_delete, int setvar)
+ TSInt offset, TSInt num_hours, int arg_ref_auto_delete, int setvar)
{
Cli_Debug("ConfigLoggingRollingOffsetIntervalAutodelete %d %d\n", arg_ref_rolling, offset);
@@ -4899,9 +4899,9 @@ ConfigLoggingRollingOffsetIntervalAutode
Cli_Debug("%d\n", arg_ref_auto_delete);
Cli_Debug("set?%d\n", setvar);
- INKInt int_val = 0;
- INKActionNeedT action_need = INK_ACTION_UNDEFINED;
- INKError status = INK_ERR_OKAY;
+ TSInt int_val = 0;
+ TSActionNeedT action_need = TS_ACTION_UNDEFINED;
+ TSError status = TS_ERR_OKAY;
switch (setvar) {
case 0: //get
@@ -4989,11 +4989,11 @@ int
ConfigAlarmResolveName(char *name)
{
bool active;
- INKError status;
+ TSError status;
// determine if the event is active
- status = INKEventIsActive(name, &active);
- if (status != INK_ERR_OKAY) {
+ status = TSEventIsActive(name, &active);
+ if (status != TS_ERR_OKAY) {
// unable to retrieve active/inactive status for alarm
Cli_Error(ERR_ALARM_STATUS, name);
return CLI_ERROR;
@@ -5005,8 +5005,8 @@ ConfigAlarmResolveName(char *name)
return CLI_ERROR;
}
// alarm is active, resolve it
- status = INKEventResolve(name);
- if (status != INK_ERR_OKAY) {
+ status = TSEventResolve(name);
+ if (status != TS_ERR_OKAY) {
Cli_Error(ERR_ALARM_RESOLVE, name);
return CLI_ERROR;
}
@@ -5018,33 +5018,33 @@ ConfigAlarmResolveName(char *name)
int
ConfigAlarmResolveNumber(int number)
{
- INKList events;
- INKError status;
+ TSList events;
+ TSError status;
int count, i;
char *name = 0;
- events = INKListCreate();
- status = INKActiveEventGetMlt(events);
- if (status != INK_ERR_OKAY) {
+ events = TSListCreate();
+ status = TSActiveEventGetMlt(events);
+ if (status != TS_ERR_OKAY) {
Cli_Error(ERR_ALARM_LIST);
- INKListDestroy(events);
+ TSListDestroy(events);
return CLI_ERROR;
}
- count = INKListLen(events);
+ count = TSListLen(events);
if (number > count) {
// number is too high
Cli_Error(ERR_ALARM_RESOLVE_NUMBER, number);
- INKListDestroy(events);
+ TSListDestroy(events);
return CLI_ERROR;
}
for (i = 0; i < number; i++) {
- name = (char *) INKListDequeue(events);
+ name = (char *) TSListDequeue(events);
}
// try to resolve the alarm
- INKListDestroy(events);
+ TSListDestroy(events);
return (ConfigAlarmResolveName(name));
}
@@ -5052,36 +5052,36 @@ ConfigAlarmResolveNumber(int number)
int
ConfigAlarmResolveAll()
{
- INKList events;
- INKError status;
+ TSList events;
+ TSError status;
int count, i;
char *name;
- events = INKListCreate();
- status = INKActiveEventGetMlt(events);
- if (status != INK_ERR_OKAY) {
+ events = TSListCreate();
+ status = TSActiveEventGetMlt(events);
+ if (status != TS_ERR_OKAY) {
Cli_Error(ERR_ALARM_LIST);
- INKListDestroy(events);
+ TSListDestroy(events);
return CLI_ERROR;
}
- count = INKListLen(events);
+ count = TSListLen(events);
if (count == 0) {
// no alarms to resolve
Cli_Printf("No Alarms to resolve\n");
- INKListDestroy(events);
+ TSListDestroy(events);
return CLI_ERROR;
}
for (i = 0; i < count; i++) {
- name = (char *) INKListDequeue(events);
- status = INKEventResolve(name);
- if (status != INK_ERR_OKAY) {
+ name = (char *) TSListDequeue(events);
+ status = TSEventResolve(name);
+ if (status != TS_ERR_OKAY) {
Cli_Error(ERR_ALARM_RESOLVE, name);
}
}
- INKListDestroy(events);
+ TSListDestroy(events);
return CLI_OK;
}
Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h Fri Jan 21 00:36:51 2011
@@ -826,7 +826,7 @@ int ConfigCacheFreshnessVerify(int arg_r
int ConfigCacheFreshnessMinimum(int arg_ref, int setvar);
// config Cache FreshnessNoExpireLimit
-int ConfigCacheFreshnessNoExpireLimit(INKInt min, INKInt max, int setvar);
+int ConfigCacheFreshnessNoExpireLimit(TSInt min, TSInt max, int setvar);
// config Cache Vary sub-command
int ConfigCacheVary(int arg_ref, char *field, int setvar);
@@ -856,11 +856,11 @@ int ConfigLoggingEvent(int arg_ref, int
int ConfigLoggingCollationStatus(int arg_ref, int setvar);
// config Logging collation sub-command
-int ConfigLoggingCollation(INKString secret, int arg_ref, INKInt orphan, int setvar);
+int ConfigLoggingCollation(TSString secret, int arg_ref, TSInt orphan, int setvar);
// config Logging Format Type File sub-command
int ConfigLoggingFormatTypeFile(int arg_ref_format, int arg_ref,
- int arg_ref_type, INKString file, INKString header, int setvar);
+ int arg_ref_type, TSString file, TSString header, int setvar);
// config Logging splitting sub-command
int ConfigLoggingSplitting(int arg_ref_protocol, int arg_ref_on_off, int setvar);
@@ -869,7 +869,7 @@ int ConfigLoggingSplitting(int arg_ref_p
int ConfigLoggingCustomFormat(int arg_ref_on_off, int arg_ref_format, int setvar);
// config Logging rolling offset interval autodelete sub-command
-int ConfigLoggingRollingOffsetIntervalAutodelete(int arg_ref_rolling, INKInt offset, INKInt num_hours,
+int ConfigLoggingRollingOffsetIntervalAutodelete(int arg_ref_rolling, TSInt offset, TSInt num_hours,
int arg_ref_auto_delete, int setvar);
// config icp peers sub-command
Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeCmd.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeCmd.h?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeCmd.h (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeCmd.h Fri Jan 21 00:36:51 2011
@@ -104,9 +104,9 @@ public:
// PrintOut the Element of this Entry
void PrintEle();
- INKError Cli_NewIFCFile();
+ TSError Cli_NewIFCFile();
- static INKError ConfigWriteCheckIFCEnv();
+ static TSError ConfigWriteCheckIFCEnv();
int ConfigWriteIFCHead(char *ts_version, char *build_date, char *platform, int nodes);
@@ -182,7 +182,7 @@ public:
CIFCReadEntry();
~CIFCReadEntry();
- static INKError ConfigReadCheckIFCEnv();
+ static TSError ConfigReadCheckIFCEnv();
int ConfigReadIFCHead();
Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeReadCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeReadCmd.cc?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeReadCmd.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeReadCmd.cc Fri Jan 21 00:36:51 2011
@@ -54,63 +54,39 @@ CountOn(0), Count(0)
CIFCReadEntry::~CIFCReadEntry()
{
-
}
// check IFCVERSION IFCPATH and IFCFILENAME setup
-INKError
+TSError
CIFCReadEntry::ConfigReadCheckIFCEnv()
{
-
char *pathPtr;
char *filenamePtr;
char *versionPtr;
-
pathPtr = getenv("IFCPATH");
filenamePtr = getenv("IFCFILENAME");
versionPtr = getenv("IFCVERSION");
if (pathPtr == NULL || filenamePtr == NULL || versionPtr == NULL ||
strlen(pathPtr) == 0 || strlen(filenamePtr) == 0 || strlen(versionPtr) == 0) {
- return INK_ERR_READ_FILE;
+ return TS_ERR_READ_FILE;
}
- return INK_ERR_OKAY;
+ return TS_ERR_OKAY;
}
int
CIFCReadEntry::ConfigReadPrintIFCEle()
{
-
Tcl_AppendResult(interp, Output, (char *) NULL);
return CLI_OK;
-
- /*
- char ListEle[CONFIG_UPGRADE_BUF_SIZE];
- char *p = NULL;
- Tcl_Obj* ObjPtr;
-
- p = OutPut;
- While (*p != NULL){
- sprintf(ListEle, "%s\n", p);
- ObjPtr = Tcl_NewStringObj(ListEle, -1);
- p += strlen(ListEle);
- if (Tcl_ListObjAppendElement(interp, ListPtr, ObjPtr) == CLI_ERROR){
- return CLI_ERROR;
- }
- }
- return CLI_OK; */
-
-
}
int
CIFCReadEntry::ConfigReadIFCEle()
{
-
-
FILE *Fptr;
char *filebuffer;
char *p1, *p2;
@@ -187,17 +163,14 @@ CIFCReadEntry::ConfigReadIFCEle()
int
CIFCReadEntry::ConfigReadIFCHead()
{
-
ink_strncpy(KeyWord, IFC_HEAD, sizeof(KeyWord));
CountOn = 0;
return (ConfigReadIFCEle());
-
}
int
CIFCReadEntry::ConfigReadIFCFeature()
{
-
ink_strncpy(KeyWord, IFC_FEATURE, sizeof(KeyWord));
CountOn = 0;
return (ConfigReadIFCEle());
@@ -206,7 +179,6 @@ CIFCReadEntry::ConfigReadIFCFeature()
int
CIFCReadEntry::ConfigReadIFCTar()
{
-
ink_strncpy(KeyWord, IFC_TAR, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -215,7 +187,6 @@ CIFCReadEntry::ConfigReadIFCTar()
int
CIFCReadEntry::ConfigReadIFCCommonTar()
{
-
ink_strncpy(KeyWord, IFC_COMMON_TAR, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -224,7 +195,6 @@ CIFCReadEntry::ConfigReadIFCCommonTar()
int
CIFCReadEntry::ConfigReadIFCTarInfo()
{
-
ink_strncpy(KeyWord, IFC_TAR_INFO, sizeof(KeyWord));
CountOn = 0;
return (ConfigReadIFCEle());
@@ -233,7 +203,6 @@ CIFCReadEntry::ConfigReadIFCTarInfo()
int
CIFCReadEntry::ConfigReadIFCBinGroup()
{
-
ink_strncpy(KeyWord, IFC_BIN_GROUP, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -242,7 +211,6 @@ CIFCReadEntry::ConfigReadIFCBinGroup()
int
CIFCReadEntry::ConfigReadIFCBinDir()
{
-
ink_strncpy(KeyWord, IFC_BIN_DIR, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -251,7 +219,6 @@ CIFCReadEntry::ConfigReadIFCBinDir()
int
CIFCReadEntry::ConfigReadIFCBinCommon()
{
-
ink_strncpy(KeyWord, IFC_BIN_COMMON, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -260,7 +227,6 @@ CIFCReadEntry::ConfigReadIFCBinCommon()
int
CIFCReadEntry::ConfigReadIFCLibGroup()
{
-
ink_strncpy(KeyWord, IFC_LIB_GROUP, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -269,7 +235,6 @@ CIFCReadEntry::ConfigReadIFCLibGroup()
int
CIFCReadEntry::ConfigReadIFCLibDir()
{
-
ink_strncpy(KeyWord, IFC_LIB_DIR, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -278,7 +243,6 @@ CIFCReadEntry::ConfigReadIFCLibDir()
int
CIFCReadEntry::ConfigReadIFCLibCommon()
{
-
ink_strncpy(KeyWord, IFC_LIB_COMMON, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -287,7 +251,6 @@ CIFCReadEntry::ConfigReadIFCLibCommon()
int
CIFCReadEntry::ConfigReadIFCConfigGroup()
{
-
ink_strncpy(KeyWord, IFC_CONFIG_GROUP, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -296,7 +259,6 @@ CIFCReadEntry::ConfigReadIFCConfigGroup(
int
CIFCReadEntry::ConfigReadIFCConfigDir()
{
-
ink_strncpy(KeyWord, IFC_CONFIG_DIR, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -305,7 +267,6 @@ CIFCReadEntry::ConfigReadIFCConfigDir()
int
CIFCReadEntry::ConfigReadIFCConfigCommon()
{
-
ink_strncpy(KeyWord, IFC_CONFIG_COMMON, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -315,7 +276,6 @@ CIFCReadEntry::ConfigReadIFCConfigCommon
int
CIFCReadEntry::ConfigReadIFCCommonFile()
{
-
ink_strncpy(KeyWord, IFC_COMMON_FILE, sizeof(KeyWord));
CountOn = 1;
return (ConfigReadIFCEle());
@@ -336,7 +296,6 @@ CIFCReadEntry::ConfigReadIFCCommonFile()
int
Cmd_ConfigRead(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
{
-
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -358,7 +317,7 @@ Cmd_ConfigRead(ClientData clientData, Tc
argtable = cmdCallbackInfo->parsedArgTable;
Cli_Debug("Cmd_ConfigRead argc %d\n", argc);
- if (CIFCWriteEntry::ConfigWriteCheckIFCEnv() == INK_ERR_READ_FILE) {
+ if (CIFCWriteEntry::ConfigWriteCheckIFCEnv() == TS_ERR_READ_FILE) {
Cli_Error("Set $IFCVERSION, $IFCPATH and $IFCFILENAME First\n");
return CLI_ERROR;
}
@@ -429,7 +388,6 @@ Cmd_ConfigRead(ClientData clientData, Tc
int
CmdArgs_ConfigRead()
{
-
createArgument("ifc-head", 1, CLI_ARGV_OPTION_NAME_VALUE,
(char *) NULL, CMD_CONFIG_READ_IFC_HEAD, "Read the head information of ifc file", (char *) NULL);
createArgument("feature", 1, CLI_ARGV_OPTION_NAME_VALUE,
@@ -522,8 +480,7 @@ Cmd_ConfigSaveUrl(ClientData clientData,
if (Url == NULL || outputFile == NULL) {
return CMD_ERROR;
} else {
- if (INKReadFromUrl(Url, header, &headerSize, body, &bodySize)
- == INK_ERR_FAIL) {
+ if (TSReadFromUrl(Url, header, &headerSize, body, &bodySize) == TS_ERR_FAIL) {
return CMD_ERROR;
}
@@ -541,9 +498,7 @@ Cmd_ConfigSaveUrl(ClientData clientData,
int
CmdArgs_ConfigSaveUrl()
{
-
createArgument("url", 1, CLI_ARGV_STRING, (char *) NULL, CMD_CONFIG_UPGRADE_READ_URL, "Read the url", (char *) NULL);
return CMD_OK;
-
}
Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeWriteCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeWriteCmd.cc?rev=1061587&r1=1061586&r2=1061587&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeWriteCmd.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigUpgradeWriteCmd.cc Fri Jan 21 00:36:51 2011
@@ -40,13 +40,9 @@
CIFCWriteEntry::CIFCWriteEntry():CountOn(0)
{
-
- char *
- pathPtr;
- char *
- filenamePtr;
- char *
- versionPtr;
+ char *pathPtr;
+ char *filenamePtr;
+ char *versionPtr;
pathPtr = getenv("IFCPATH");
filenamePtr = getenv("IFCFILENAME");
@@ -61,46 +57,42 @@ CIFCWriteEntry::CIFCWriteEntry():CountOn
CIFCWriteEntry::~CIFCWriteEntry()
{
-
}
// check IFCVERSION IFCPATH and IFCFILENAME setup
-INKError
+TSError
CIFCWriteEntry::ConfigWriteCheckIFCEnv()
{
-
char *pathPtr;
char *filenamePtr;
char *versionPtr;
-
pathPtr = getenv("IFCPATH");
filenamePtr = getenv("IFCFILENAME");
versionPtr = getenv("IFCVERSION");
if (pathPtr == NULL || filenamePtr == NULL || versionPtr == NULL ||
strlen(pathPtr) == 0 || strlen(filenamePtr) == 0 || strlen(versionPtr) == 0) {
- return INK_ERR_READ_FILE;
+ return TS_ERR_READ_FILE;
}
- return INK_ERR_OKAY;
+ return TS_ERR_OKAY;
}
-INKError
+TSError
CIFCWriteEntry::Cli_NewIFCFile()
{
-
FILE *Fptr;
Fptr = fopen(FileName, "r+");
if (Fptr != NULL) {
fclose(Fptr);
- return INK_ERR_OKAY;
+ return TS_ERR_OKAY;
} else { /* need to create new file */
Fptr = fopen(FileName, "w");
if (Fptr == NULL) {
Cli_Error("Error in creating new IFC file\n");
- return INK_ERR_WRITE_FILE;
+ return TS_ERR_WRITE_FILE;
}
fprintf(Fptr, "%s\n\n", IFC_BEGIN);
@@ -123,7 +115,7 @@ CIFCWriteEntry::Cli_NewIFCFile()
fclose(Fptr);
- return INK_ERR_OKAY;
+ return TS_ERR_OKAY;
}
}
@@ -131,7 +123,6 @@ CIFCWriteEntry::Cli_NewIFCFile()
int
CIFCWriteEntry::ConfigWriteIFCEle()
{
-
FILE *Fptr;
char *filebuffer, *in_buffer;
char *p1;
@@ -241,7 +232,6 @@ CIFCWriteEntry::PrintEle()
int
CIFCWriteEntry::ConfigWriteIFCHead(char *ts_version, char *build_date, char *platform, int nodes)
{
-
ink_strncpy(KeyWord, IFC_HEAD, sizeof(KeyWord));
snprintf(Input, sizeof(Input), "%s\n%s\n%s\n%d", ts_version, build_date, platform, nodes);
CountOn = 0;
@@ -251,7 +241,6 @@ CIFCWriteEntry::ConfigWriteIFCHead(char
int
CIFCWriteEntry::ConfigWriteIFCFeature(char *input)
{
-
ink_strncpy(KeyWord, IFC_FEATURE, sizeof(KeyWord));
CountOn = 0;
ink_strncpy(Input, input, sizeof(Input));
@@ -261,7 +250,6 @@ CIFCWriteEntry::ConfigWriteIFCFeature(ch
int
CIFCWriteEntry::ConfigWriteIFCTar(char *input)
{
-
ink_strncpy(KeyWord, IFC_TAR, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -271,7 +259,6 @@ CIFCWriteEntry::ConfigWriteIFCTar(char *
int
CIFCWriteEntry::ConfigWriteIFCCommonTar(char *input)
{
-
ink_strncpy(KeyWord, IFC_COMMON_TAR, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -281,7 +268,6 @@ CIFCWriteEntry::ConfigWriteIFCCommonTar(
int
CIFCWriteEntry::ConfigWriteIFCTarInfo(char *tar, char *filelist)
{
-
ink_strncpy(KeyWord, IFC_TAR_INFO, sizeof(KeyWord));
CountOn = 0;
snprintf(Input, sizeof(Input), "%s:\n%s", tar, filelist);
@@ -291,7 +277,6 @@ CIFCWriteEntry::ConfigWriteIFCTarInfo(ch
int
CIFCWriteEntry::ConfigWriteIFCBinGroup(char *input)
{
-
ink_strncpy(KeyWord, IFC_BIN_GROUP, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -301,7 +286,6 @@ CIFCWriteEntry::ConfigWriteIFCBinGroup(c
int
CIFCWriteEntry::ConfigWriteIFCBinDir(char *subdir, char *filelist)
{
-
ink_strncpy(KeyWord, IFC_BIN_DIR, sizeof(KeyWord));
CountOn = 1;
snprintf(Input, sizeof(Input), "%s:%s", subdir, filelist);
@@ -311,7 +295,6 @@ CIFCWriteEntry::ConfigWriteIFCBinDir(cha
int
CIFCWriteEntry::ConfigWriteIFCBinCommon(char *input)
{
-
ink_strncpy(KeyWord, IFC_BIN_COMMON, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -321,7 +304,6 @@ CIFCWriteEntry::ConfigWriteIFCBinCommon(
int
CIFCWriteEntry::ConfigWriteIFCLibGroup(char *input)
{
-
ink_strncpy(KeyWord, IFC_LIB_GROUP, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -331,7 +313,6 @@ CIFCWriteEntry::ConfigWriteIFCLibGroup(c
int
CIFCWriteEntry::ConfigWriteIFCLibDir(char *subdir, char *filelist)
{
-
ink_strncpy(KeyWord, IFC_LIB_DIR, sizeof(KeyWord));
CountOn = 1;
snprintf(Input, sizeof(Input), "%s:%s", subdir, filelist);
@@ -341,7 +322,6 @@ CIFCWriteEntry::ConfigWriteIFCLibDir(cha
int
CIFCWriteEntry::ConfigWriteIFCLibCommon(char *input)
{
-
ink_strncpy(KeyWord, IFC_LIB_COMMON, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -351,7 +331,6 @@ CIFCWriteEntry::ConfigWriteIFCLibCommon(
int
CIFCWriteEntry::ConfigWriteIFCConfigGroup(char *input)
{
-
ink_strncpy(KeyWord, IFC_CONFIG_GROUP, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -361,7 +340,6 @@ CIFCWriteEntry::ConfigWriteIFCConfigGrou
int
CIFCWriteEntry::ConfigWriteIFCConfigDir(char *subdir, char *filelist)
{
-
ink_strncpy(KeyWord, IFC_CONFIG_DIR, sizeof(KeyWord));
CountOn = 1;
snprintf(Input, sizeof(Input), "%s:%s", subdir, filelist);
@@ -371,7 +349,6 @@ CIFCWriteEntry::ConfigWriteIFCConfigDir(
int
CIFCWriteEntry::ConfigWriteIFCConfigCommon(char *input)
{
-
ink_strncpy(KeyWord, IFC_CONFIG_COMMON, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -382,7 +359,6 @@ CIFCWriteEntry::ConfigWriteIFCConfigComm
int
CIFCWriteEntry::ConfigWriteIFCCommonFile(char *input)
{
-
ink_strncpy(KeyWord, IFC_COMMON_FILE, sizeof(KeyWord));
CountOn = 1;
ink_strncpy(Input, input, sizeof(Input));
@@ -403,7 +379,6 @@ CIFCWriteEntry::ConfigWriteIFCCommonFile
int
Cmd_ConfigWrite(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
{
-
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -426,14 +401,14 @@ Cmd_ConfigWrite(ClientData clientData, T
argtable = cmdCallbackInfo->parsedArgTable;
Cli_Debug("Cmd_ConfigWrite argc %d\n", argc);
- if (CIFCWriteEntry::ConfigWriteCheckIFCEnv() == INK_ERR_READ_FILE) {
+ if (CIFCWriteEntry::ConfigWriteCheckIFCEnv() == TS_ERR_READ_FILE) {
Cli_Error("Set $IFCVERSION, $IFCPATH and $IFCFILENAME First\n");
return CLI_ERROR;
}
CIFCWriteEntry Entry;
- if (Entry.Cli_NewIFCFile() == INK_ERR_WRITE_FILE) {
+ if (Entry.Cli_NewIFCFile() == TS_ERR_WRITE_FILE) {
return CLI_ERROR;
}
@@ -499,7 +474,6 @@ Cmd_ConfigWrite(ClientData clientData, T
int
CmdArgs_ConfigWrite()
{
-
createArgument("ifc-head", 1, CLI_ARGV_CONST_OPTION,
(char *) NULL, CMD_CONFIG_WRITE_IFC_HEAD, "Specify the head information of ifc file", (char *) NULL);
createArgument("ts-version", CMD_CONFIG_WRITE_IFC_HEAD, CLI_ARGV_STRING,