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 2013/07/15 21:43:41 UTC
[6/7] TS-1820 Remove more NOWARN usages.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/lib/ts/ink_defs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index c42a23d..b5e8122 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -115,9 +115,6 @@ countof(const T (&)[N]) {
#define ATS_WARN_IF_UNUSED __attribute__ ((warn_unused_result))
#define ATS_UNUSED_RETURN(x) if (x) {}
-#define NOWARN_UNUSED(x) (void)(x)
-
-
#ifndef likely
#define likely(x) __builtin_expect (!!(x), 1)
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index be83768..3081555 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -35,11 +35,8 @@
#endif
bool
-LocalManager::SetForDup(void *hIOCPort, long lTProcId, void *hTh)
+LocalManager::SetForDup(void * /* hIOCPort ATS_UNUSED */, long /* lTProcId ATS_UNUSED */, void * /* hTh ATS_UNUSED */)
{
- NOWARN_UNUSED(hIOCPort);
- NOWARN_UNUSED(lTProcId);
- NOWARN_UNUSED(hTh);
return true;
}
@@ -202,10 +199,9 @@ LocalManager::processRunning()
}
}
-LocalManager::LocalManager(char *mpath, bool proxy_on)
+LocalManager::LocalManager(char * /* mpath ATS_UNUSED */, bool proxy_on)
: BaseManager(), run_proxy(proxy_on)
{
- NOWARN_UNUSED(mpath);
bool found;
#ifdef MGMT_USE_SYSLOG
syslog_facility = 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 776838c..4cf5b27 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -825,13 +825,12 @@ main(int argc, char **argv)
#if !defined(linux) && !defined(freebsd) && !defined(darwin)
static void
-SignalAlrmHandler(int sig, siginfo_t * t, void *c)
+SignalAlrmHandler(int /* sig ATS_UNUSED */, siginfo_t * t, void * /* c ATS_UNUSED */)
#else
static void
-SignalAlrmHandler(int sig)
+SignalAlrmHandler(int /* sig ATS_UNUSED */)
#endif
{
- NOWARN_UNUSED(sig);
/*
fprintf(stderr,"[TrafficManager] ==> SIGALRM received\n");
mgmt_elog(stderr,"[TrafficManager] ==> SIGALRM received\n");
@@ -942,9 +941,8 @@ SignalHandler(int sig)
// zombies which is bad for us
//
static void
-SigChldHandler(int sig)
+SigChldHandler(int /* sig ATS_UNUSED */)
{
- NOWARN_UNUSED(sig);
}
void
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/Makefile.am
----------------------------------------------------------------------
diff --git a/mgmt/Makefile.am b/mgmt/Makefile.am
index b33003c..45309a2 100644
--- a/mgmt/Makefile.am
+++ b/mgmt/Makefile.am
@@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SUBDIRS = cluster preparse tools utils web2 stats api cli
+SUBDIRS = cluster preparse utils web2 stats api cli
# This is for traffic_manager only (local manager)
AM_CPPFLAGS = $(ink_with_modules_local) \
@@ -99,8 +99,6 @@ traffic_manager_LDADD = \
utils/libutils_lm.a \
$(top_builddir)/proxy/hdrs/libhdrs.a \
$(top_builddir)/lib/records/libreclocal.a \
- $(top_builddir)/mgmt/tools/libinksysapi.a \
- $(top_builddir)/mgmt/tools/libinkconfigapi.a \
$(top_builddir)/lib/ts/libtsutil.la \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
@LIBRESOLV@ @LIBEXPAT@ @LIBPCRE@ @LIBTCL@ @LIBCAP@ \
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/ProcessManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/ProcessManager.cc b/mgmt/ProcessManager.cc
index afd29f3..4f55d59 100644
--- a/mgmt/ProcessManager.cc
+++ b/mgmt/ProcessManager.cc
@@ -66,10 +66,9 @@ startProcessManager(void *arg)
return ret;
} /* End startProcessManager */
-ProcessManager::ProcessManager(bool rlm, char *mpath):
+ProcessManager::ProcessManager(bool rlm, char * /* mpath ATS_UNUSED */):
BaseManager(), require_lm(rlm), mgmt_sync_key(0), local_manager_sockfd(0), cbtable(NULL)
{
- NOWARN_UNUSED(mpath);
ink_strlcpy(pserver_path, Layout::get()->runtimedir, sizeof(pserver_path));
mgmt_signal_queue = create_queue();
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/ProxyConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/ProxyConfig.cc b/mgmt/ProxyConfig.cc
index 593b0ae..e236897 100644
--- a/mgmt/ProxyConfig.cc
+++ b/mgmt/ProxyConfig.cc
@@ -100,10 +100,8 @@ public:
SET_HANDLER(&ConfigInfoReleaser::handle_event);
}
- int handle_event(int event, void *edata)
+ int handle_event(int /* event ATS_UNUSED */, void * /* edata ATS_UNUSED */)
{
- NOWARN_UNUSED(event);
- NOWARN_UNUSED(edata);
configProcessor.release(m_id, m_info);
delete this;
return 0;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/CoreAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index d2d24d6..b97b9f7 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -59,9 +59,8 @@ CallbackTable *local_event_callbacks;
* eg. set up global structures; called by the TSMgmtAPI::TSInit()
*/
TSError
-Init(const char *socket_path, TSInitOptionT options)
+Init(const char * /* socket_path ATS_UNUSED */, TSInitOptionT options)
{
- NOWARN_UNUSED(socket_path);
// socket_path should be null; only applies to remote clients
if (0 == (options & TS_MGMT_OPT_NO_EVENTS)) {
local_event_callbacks = create_callback_table("local_callbacks");
@@ -641,10 +640,8 @@ WriteFile(TSFileNameT file, char *text, int size, int version)
* of alarms in the current alarm processor
*/
TSError
-EventSignal(char *event_name, va_list ap)
+EventSignal(char * /* event_name ATS_UNUSED */, va_list /* ap ATS_UNUSED */)
{
- NOWARN_UNUSED(event_name);
- NOWARN_UNUSED(ap);
//char *text;
//int id;
@@ -905,10 +902,8 @@ StatsReset(bool cluster, const char *name)
* location specified by "filepath"
*/
TSError
-EncryptToFile(const char *passwd, const char *filepath)
+EncryptToFile(const char * /* passwd ATS_UNUSED */, const char * /* filepath ATS_UNUSED */)
{
- NOWARN_UNUSED(passwd);
- NOWARN_UNUSED(filepath);
//AuthString fileAuthStr(filepath);
//AuthString passwdAuthStr(passwd);
/*if (!AccCrypto::encryptToFile(fileAuthStr, passwdAuthStr)) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/CoreAPIShared.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPIShared.cc b/mgmt/api/CoreAPIShared.cc
index 6c7c222..647c713 100644
--- a/mgmt/api/CoreAPIShared.cc
+++ b/mgmt/api/CoreAPIShared.cc
@@ -179,9 +179,8 @@ error: /* "Houston, we have a problem!" (Apollo 13) */
/* Modified from TrafficCop.cc (open_socket) */
int
-connectDirect(const char *host, int port, uint64_t timeout)
+connectDirect(const char *host, int port, uint64_t /* timeout ATS_UNUSED */)
{
- NOWARN_UNUSED(timeout);
int sock;
// Create a socket
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/EventControlMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/EventControlMain.cc b/mgmt/api/EventControlMain.cc
index b47a3ef..3b500c2 100644
--- a/mgmt/api/EventControlMain.cc
+++ b/mgmt/api/EventControlMain.cc
@@ -200,9 +200,8 @@ delete_event_queue(LLQ * q)
* note: None
*********************************************************************/
void
-apiEventCallback(alarm_t newAlarm, char *ip, char *desc)
+apiEventCallback(alarm_t newAlarm, char * /* ip ATS_UNUSED */, char *desc)
{
- NOWARN_UNUSED(ip);
// create an TSEvent
// addEvent(new_alarm, ip, desc) // adds event to mgmt_events
TSEvent *newEvent;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/GenericParser.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/GenericParser.cc b/mgmt/api/GenericParser.cc
index c2a7f46..151b771 100644
--- a/mgmt/api/GenericParser.cc
+++ b/mgmt/api/GenericParser.cc
@@ -446,9 +446,8 @@ Rule::ip_allowParse(char *rule)
* logsParse
**/
TokenList *
-Rule::logsParse(char *rule)
+Rule::logsParse(char * /* rule ATS_UNUSED */)
{
- NOWARN_UNUSED(rule);
return NULL;
}
@@ -476,9 +475,8 @@ Rule::log_hostsParse(char *rule)
* logs_xmlParse
**/
TokenList *
-Rule::logs_xmlParse(char *rule)
+Rule::logs_xmlParse(char * /* rule ATS_UNUSED */)
{
- NOWARN_UNUSED(rule);
return NULL;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/INKMgmtAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index 29597e7..7313e02 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -1696,32 +1696,24 @@ TSTerminate()
/*--- plugin initialization -----------------------------------------------*/
inkexp extern void
-TSPluginInit(int argc, const char *argv[])
+TSPluginInit(int /* argc ATS_UNUSED */, const char */* argv ATS_UNUSED */[])
{
- NOWARN_UNUSED(argc);
- NOWARN_UNUSED(argv);
}
/*--- network operations --------------------------------------------------*/
tsapi TSError
-TSConnect(TSIpAddr ip_addr, int port)
+TSConnect(TSIpAddr /* ip_addr ATS_UNUSED */, int /* port ATS_UNUSED */)
{
- NOWARN_UNUSED(ip_addr);
- NOWARN_UNUSED(port);
return TS_ERR_OKAY;
}
tsapi TSError
-TSDisconnectCbRegister(TSDisconnectFunc * func, void *data)
+TSDisconnectCbRegister(TSDisconnectFunc * /* func ATS_UNUSED */, void * /* data ATS_UNUSED */)
{
- NOWARN_UNUSED(func);
- NOWARN_UNUSED(data);
return TS_ERR_OKAY;
}
tsapi TSError
-TSDisconnectRetrySet(int retries, int retry_sleep_msec)
+TSDisconnectRetrySet(int /* retries ATS_UNUSED */, int /* retry_sleep_msec ATS_UNUSED */)
{
- NOWARN_UNUSED(retries);
- NOWARN_UNUSED(retry_sleep_msec);
return TS_ERR_OKAY;
}
tsapi TSError
@@ -2331,9 +2323,8 @@ TSCfgContextDestroy(TSCfgContext ctx)
}
tsapi TSError
-TSCfgContextCommit(TSCfgContext ctx, TSActionNeedT * action_need, TSIntList errRules)
+TSCfgContextCommit(TSCfgContext ctx, TSActionNeedT * /* action_need ATS_UNUSED */, TSIntList errRules)
{
- NOWARN_UNUSED(action_need);
return (CfgContextCommit((CfgContext *) ctx, (LLQ *) errRules));
}
@@ -2497,113 +2488,3 @@ tsapi TSError rm_start_proxy()
#endif
return TS_ERR_OKAY;
}
-
-
-/*****************************************************************
-* Traffic server changes necessary when network config is changed
-*****************************************************************/
-
-tsapi TSError
-TSSetHostname(TSString hostname)
-{
- TSActionNeedT action_need = TS_ACTION_UNDEFINED, top_action_req = TS_ACTION_UNDEFINED;
- TSInt val = 0;
-
- /* Here we should handle these cases:
- * rmserver.cfg - different API currently, records.config, and hostname_FQ
- */
-
- if (TSRecordGetInt("proxy.local.cluster.type", &val) == TS_ERR_OKAY) { //If error??
- if (val == 3) {
- if (MgmtRecordSet("proxy.config.proxy_name", hostname, &action_need) != TS_ERR_OKAY)
- return TS_ERR_FAIL;
- }
- }
-
- if (action_need < top_action_req) // a more severe action
- top_action_req = action_need;
-
- if (MgmtRecordSet("proxy.node.hostname_FQ", hostname, &action_need) != TS_ERR_OKAY)
- return TS_ERR_FAIL;
-
- //carry out the appropriate action
- if (action_need < top_action_req) // a more severe action
- top_action_req = action_need;
-
- if (top_action_req != TS_ACTION_UNDEFINED) {
- return TS_ERR_OKAY;
- } else {
- return TS_ERR_OKAY;
- }
-}
-
-tsapi TSError
-TSSetGateway(TSString gateway_ip)
-{
- NOWARN_UNUSED(gateway_ip);
- //Nothing to be done for now
- return TS_ERR_OKAY;
-
-}
-
-tsapi TSError
-TSSetDNSServers(TSString dns_ips)
-{
- NOWARN_UNUSED(dns_ips);
- //Nothing to be done for now
- return TS_ERR_OKAY;
-
-}
-
-tsapi TSError
-TSSetNICUp(TSString nic_name, bool static_ip, TSString ip, TSString old_ip, TSString netmask, bool onboot,
- TSString gateway_ip)
-{
- NOWARN_UNUSED(nic_name);
- NOWARN_UNUSED(static_ip);
- NOWARN_UNUSED(ip);
- NOWARN_UNUSED(old_ip);
- NOWARN_UNUSED(netmask);
- NOWARN_UNUSED(onboot);
- NOWARN_UNUSED(gateway_ip);
- /* there is no ipnat conf file anymore */
- return TS_ERR_READ_FILE;
-}
-
-tsapi TSError
-TSSetProxyPort(TSString proxy_port)
-{
- NOWARN_UNUSED(proxy_port);
- /* there is no ipnat.conf file anymore */
- return TS_ERR_READ_FILE;
-}
-
-tsapi TSError
-TSSetNICDown(TSString nic_name, TSString ip_addrr)
-{
- NOWARN_UNUSED(nic_name);
- NOWARN_UNUSED(ip_addrr);
- /* there is no ipnat.conf file anymore */
- return TS_ERR_READ_FILE;
-}
-
-
-tsapi TSError
-TSSetSearchDomain(const char *search_name)
-{
- NOWARN_UNUSED(search_name);
- //Nothing to be done for now
- return TS_ERR_OKAY;
-}
-
-/* The following 2 functions set the Realm field in rmserver.cfg file. */
-void
-resetHostName(TSRmServerEle * ele, const char *hostname, const char *tail)
-{
- char buff[MAX_RULE_SIZE];
-
- ats_free(ele->str_val);
- snprintf(buff, sizeof(buff), "%s.%s", hostname, tail);
- ele->str_val = ats_strdup(buff);
- return;
-}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/TSControlMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/TSControlMain.cc b/mgmt/api/TSControlMain.cc
index b30aee6..e8e9677 100644
--- a/mgmt/api/TSControlMain.cc
+++ b/mgmt/api/TSControlMain.cc
@@ -935,10 +935,8 @@ handle_snapshot_get_mlt(struct SocketInfo sock_info)
* output: TS_ERR_xx
*************************************************************************/
void
-handle_diags(struct SocketInfo sock_info, char *req)
+handle_diags(struct SocketInfo /* sock_info ATS_UNUSED */, char *req)
{
- NOWARN_UNUSED(sock_info);
- NOWARN_UNUSED(req);
TSError ret;
TSDiagsT mode;
char *diag_msg = NULL;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/include/mgmtapi.h
----------------------------------------------------------------------
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index 9e38380..9af5ce6 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -1419,38 +1419,6 @@ extern "C"
tsapi TSError TSInvalidateFromCacheUrlRegex(TSString url_regex, TSString * list);
-/* These functions support the network configuration functionality
- * For each change of hostname, gateway, dns servers, and nick configurations
- * we should use these APIs to accomodate for it in TS, TM
- ******************************************************************/
- /* rmserver.cfg */
-
- tsapi TSError rm_change_ip(int, char **);
-
- tsapi TSError rm_change_hostname(char *);
-
- tsapi TSError rm_start_proxy();
-
- tsapi TSError rm_remove_ip(int, char **);
-
-
-/* Net config functions */
-
- tsapi TSError TSSetHostname(TSString hostname);
-
- tsapi TSError TSSetGateway(TSString gateway_ip);
-
- tsapi TSError TSSetDNSServers(TSString dns_ips);
-
- tsapi TSError TSSetNICUp(TSString nic_name, bool static_ip, TSString ip, TSString old_ip, TSString netmask,
- bool onboot, TSString gateway_ip);
-
- tsapi TSError TSSetProxyPort(TSString proxy_port);
-
- tsapi TSError TSSetNICDown(TSString nic_name, TSString ip_addrr);
-
- tsapi TSError TSSetSearchDomain(const char *search_name);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/remote/APITestCliRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/remote/APITestCliRemote.cc b/mgmt/api/remote/APITestCliRemote.cc
index a1b438a..8797772 100644
--- a/mgmt/api/remote/APITestCliRemote.cc
+++ b/mgmt/api/remote/APITestCliRemote.cc
@@ -2017,10 +2017,8 @@ try_resolve(char *event_name)
* of the event that was signalled
*/
void
-eventCallbackFn(char *name, char *msg, int pri, void *data)
+eventCallbackFn(char *name, char *msg, int /* pri ATS_UNUSED */, void * /* data ATS_UNUSED */)
{
- NOWARN_UNUSED(pri);
- NOWARN_UNUSED(data);
printf("[eventCallbackFn] EVENT: %s, %s\n", name, msg);
return;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/remote/CoreAPIRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/remote/CoreAPIRemote.cc b/mgmt/api/remote/CoreAPIRemote.cc
index b2c5881..ac952a2 100644
--- a/mgmt/api/remote/CoreAPIRemote.cc
+++ b/mgmt/api/remote/CoreAPIRemote.cc
@@ -649,10 +649,8 @@ WriteFile(TSFileNameT file, char *text, int size, int version)
* LAN - need to implement
*/
TSError
-EventSignal(char *event_name, va_list ap)
+EventSignal(char */* event_name ATS_UNUSED */, va_list /* ap ATS_UNUSED */)
{
- NOWARN_UNUSED(event_name);
- NOWARN_UNUSED(ap);
return TS_ERR_FAIL;
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/api/remote/NetworkUtilsRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/remote/NetworkUtilsRemote.cc b/mgmt/api/remote/NetworkUtilsRemote.cc
index 80506ab..bcf794a 100644
--- a/mgmt/api/remote/NetworkUtilsRemote.cc
+++ b/mgmt/api/remote/NetworkUtilsRemote.cc
@@ -455,9 +455,8 @@ socket_write_conn(int fd, const char *msg_buf, int bytes)
* will try to reconnect to TM if it is not already connected
**********************************************************************/
void *
-socket_test_thread(void *arg)
+socket_test_thread(void *)
{
- NOWARN_UNUSED(arg);
// loop until client process dies
while (1) {
if (socket_test(main_socket_fd) <= 0) {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/CliCreateCommands.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/CliCreateCommands.cc b/mgmt/cli/CliCreateCommands.cc
index a63be68..3d35a67 100644
--- a/mgmt/cli/CliCreateCommands.cc
+++ b/mgmt/cli/CliCreateCommands.cc
@@ -120,8 +120,6 @@ CliCreateCommands()
createCommand("show:alarms", Cmd_ShowAlarms, NULL, CLI_COMMAND_EXTERNAL, "show:alarms", "Show active alarms");
- createCommand("show:network", Cmd_ShowNetwork, NULL, CLI_COMMAND_EXTERNAL, "show:network", "Show Network Settings");
-
createCommand("show:cluster", Cmd_ShowCluster, NULL, CLI_COMMAND_EXTERNAL,
"show:cluster", "Show Cluster Ports Settings");
@@ -240,21 +238,6 @@ CliCreateCommands()
"config:virtual-ip add <x.x.x.x> device <string> sub-intf <int>\n"
"config:virtual-ip delete <virtual ip number>", "Configure virtual-ip");
- createCommand("config:network", Cmd_ConfigNetwork, CmdArgs_ConfigNetwork, CLI_COMMAND_EXTERNAL,
- "config:network hostname <string>\n"
- "config:network defaultrouter <x.x.x.x>\n"
- "config:network search-domain <string>\n"
- "config:network dns \"a.a.a.a b.b.b.b c.c.c.c\"\n"
- "config:network int <interface>\n"
- "config:network int <interface> down\n"
- "config:network int <interface> up <onboot | not-onboot>\n"
- " <static | dhcp> <ip> <netmask> <gateway>\n"
- "config:network int <interface> <onboot | not-onboot>\n"
- "config:network int <interface> <static | dhcp>\n"
- "config:network int <interface> ip <x.x.x.x>\n"
- "config:network int <interface> netmask <x.x.x.x>\n"
- "config:network int <interface> gateway <x.x.x.x | default>\n", "Configure Network Settings");
-
createCommand("config:alarms", Cmd_ConfigAlarm, CmdArgs_ConfigAlarm, CLI_COMMAND_EXTERNAL,
"config:alarms resolve-name <string>\n"
"config:alarms resolve-number <int>\n"
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/ConfigCmd.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/ConfigCmd.cc b/mgmt/cli/ConfigCmd.cc
index 749954e..bdd4502 100644
--- a/mgmt/cli/ConfigCmd.cc
+++ b/mgmt/cli/ConfigCmd.cc
@@ -53,8 +53,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include "ConfigAPI.h"
-#include "SysAPI.h"
bool enable_restricted_commands = false;
@@ -165,9 +163,8 @@ CmdArgs_Enable()
// argv -- the command arguments
//
int
-Cmd_Disable(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_Disable(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -201,9 +198,8 @@ Cmd_Disable(ClientData clientData, Tcl_Interp * interp, int argc, const char *ar
// argv -- the command arguments
//
int
-Cmd_Config(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_Config(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -3591,238 +3587,6 @@ ConfigVirtualipDelete(int ip_no, int setvar)
}
}
-////////////////////////////////////////////////////////////////
-// Cmd_ConfigNetwork
-//
-// This is the callback function for the "config:network" command.
-//
-// Parameters:
-// clientData -- information about parsed arguments
-// interp -- the Tcl interpreter
-// argc -- number of command arguments
-// argv -- the command arguments
-//
-int
-Cmd_ConfigNetwork(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
-{
- /* call to processArgForCommand must appear at the beginning
- * of each command's callback function
- */
- if (processArgForCommand(interp, argc, argv) != CLI_OK) {
- return CMD_ERROR;
- }
-
- if (processHelpCommand(argc, argv) == CLI_OK)
- return CMD_OK;
-
- if (cliCheckIfEnabled("config:network") == CLI_ERROR) {
- return CMD_ERROR;
- }
- Cli_Debug("Cmd_ConfigNetwork argc %d\n", argc);
-
- cli_cmdCallbackInfo *cmdCallbackInfo;
- cli_parsedArgInfo *argtable;
-
- cmdCallbackInfo = (cli_cmdCallbackInfo *) clientData;
- argtable = cmdCallbackInfo->parsedArgTable;
-
-
- if (argc == 1) {
- Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
- return CMD_ERROR;
- }
-
- char value[256];
- char *interface;
-
- switch (argtable->parsed_args) {
- case CMD_CONFIG_HOSTNAME:
- Cli_Debug("CMD_CONFIG_HOSTNAME\n");
- if (argc == 2) {
- Config_GetHostname(value, sizeof(value));
- Cli_Printf("%s\n", strlen(value) ? value : "not set");
- return CLI_OK;
- } else {
- if (Config_SetHostname(argtable->arg_string)) {
- Cli_Error("ERROR while setting fully qualified hostname.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- }
- break;
- case CMD_CONFIG_DEFAULT_ROUTER:
- Cli_Debug("CMD_CONFIG_DEFAULT_ROUTER\n");
- if (argc == 2) {
- Config_GetDefaultRouter(value, sizeof(value));
- Cli_Printf("%s\n", strlen(value) ? value : "none");
- return CLI_OK;
- } else {
- if (Config_SetDefaultRouter(argtable->arg_string)) {
- Cli_Error("ERROR while setting default router.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- }
- break;
- case CMD_CONFIG_DOMAIN:
- Cli_Debug("CMD_CONFIG_DOMAIN\n");
- if (argc == 2) {
- Config_GetDomain(value, sizeof(value));
- Cli_Printf("%s\n", strlen(value) ? value : "none");
- return CLI_OK;
- } else {
- if (Config_SetDomain(argtable->arg_string)) {
- Cli_Error("ERROR while setting search-domain.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- }
- case CMD_CONFIG_DNS_IP:
- Cli_Debug("CMD_CONFIG_DNS_IP\n");
- if (argc == 2) {
- Config_GetDNS_Servers(value, sizeof(value));
- Cli_Printf("%s\n", strlen(value) ? value : "none");
- return CLI_OK;
- } else {
- if (Config_SetDNS_Servers(argtable->arg_string)) {
- Cli_Error("ERROR while setting DNS Servers.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- }
- break;
- case CMD_CONFIG_NETWORK_INT:
- Cli_Debug("CMD_CONFIG_NETWORK_INT argc %d\n", argc);
- if (argc == 2) { // display all network interfaces
- int count = Config_GetNetworkIntCount();
- for (int i = 0; i < count; i++) {
- Config_GetNetworkInt(i, value, sizeof(value));
- Cli_Printf("%s\n", value);
- }
- return CLI_OK;
- }
- interface = argtable[0].arg_string;
-
- if (!Net_IsValid_Interface(interface)) {
- Cli_Printf("Invalid NIC %s\n", interface);
- return CLI_ERROR;
- }
-
- if (argc == 3) { // display setting for interface
- char nic_status[80], nic_boot[80], nic_protocol[80], nic_ip[80], nic_netmask[80], nic_gateway[80];
-
- Config_GetNIC_Status(interface, nic_status, sizeof(nic_status));
- Config_GetNIC_Start(interface, nic_boot, sizeof(nic_boot));
- Config_GetNIC_Protocol(interface, nic_protocol, sizeof(nic_protocol));
- Config_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
- Config_GetNIC_Netmask(interface, nic_netmask, sizeof(nic_netmask));
- Config_GetNIC_Gateway(interface, nic_gateway, sizeof(nic_gateway));
-
- Cli_Printf("\nNIC %s\n", interface);
- Cli_Printf(" Status -------------- %s\n", nic_status);
- Cli_Printf(" Start on Boot ------- %s\n", nic_boot);
- Cli_Printf(" Start Protocol ------ %s\n", nic_protocol);
- Cli_Printf(" IP Address ---------- %s\n", nic_ip);
- Cli_Printf(" Netmask ------------- %s\n", nic_netmask);
- Cli_Printf(" Gateway ------------- %s\n", nic_gateway);
- Cli_Printf("\n");
-
- return CLI_OK;
- } else if (argc == 4) {
- if (strcmp(argv[3], "down") == 0) {
- if (Config_SetNIC_Down(interface)) {
- Cli_Error("ERROR while setting NIC down.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- } else {
- if ((strcmp(argv[3], "onboot") != 0)
- && (strcmp(argv[3], "not-onboot") != 0)
- && (strcmp(argv[3], "static") != 0)
- && (strcmp(argv[3], "dhcp") != 0)) {
- if (strcmp(argv[3], "up") == 0) {
- Cli_Printf("Error: Invalid syntax\n");
- Cli_Printf
- ("config:network int <interface> up <onboot | not-onboot> <static | dhcp> <ip> <netmask> <gateway>\n");
- } else {
- Cli_Printf("Invalid parameter \"%s\"\n", argv[3]);
- }
- return CLI_ERROR;
- }
- char nic_status[80];
- Config_GetNIC_Status(interface, nic_status, sizeof(nic_status));
-
- if (strcmp(nic_status, "down") == 0) {
- Cli_Error("ERROR: Interface must be \"up\" to make this change.\n");
- return CLI_ERROR;
- }
- if (strcmp(argv[3], "onboot") == 0 || strcmp(argv[3], "not-onboot") == 0) {
- if (Config_SetNIC_StartOnBoot(interface, (char *) argv[3])) {
- Cli_Error("ERROR: Unable to modify NIC status.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- } else if (strcmp(argv[3], "static") == 0 || strcmp(argv[3], "dhcp") == 0) {
- if (Config_SetNIC_BootProtocol(interface, (char *) argv[3])) {
- Cli_Error("ERROR: Unable to modify NIC status.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- }
- }
- } else if (argc == 5) {
- if ((strcmp(argv[3], "ip") != 0)
- && (strcmp(argv[3], "netmask") != 0)
- && (strcmp(argv[3], "gateway") != 0)) {
- Cli_Printf("Invalid parameter \"%s\"\n", argv[3]);
- return CLI_ERROR;
- }
- char nic_status[80];
- Config_GetNIC_Status(interface, nic_status, sizeof(nic_status));
-
- if (strcmp(nic_status, "down") == 0) {
- Cli_Error("ERROR: Interface must be \"up\" to make this change.\n");
- return CLI_ERROR;
- }
- if (strcmp(argv[3], "ip") == 0) {
- if (Config_SetNIC_IP(interface, (char *) argv[4])) {
- Cli_Error("ERROR while changing IP address.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- } else if (strcmp(argv[3], "netmask") == 0) {
- if (Config_SetNIC_Netmask(interface, (char *) argv[4])) {
- Cli_Error("ERROR while changing netmask.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- } else if (strcmp(argv[3], "gateway") == 0) {
- if (Config_SetNIC_Gateway(interface, (char *) argv[4])) {
- Cli_Error("ERROR while changing gateway.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- }
- } else if (argc == 9) { // change setting for interface
- if (strcmp(argv[3], "up") == 0) {
- if (Config_SetNIC_Up
- (interface, (char *) argv[4], (char *) argv[5], (char *) argv[6], (char *) argv[7], (char *) argv[8])) {
- Cli_Printf("Error while changing NIC settings.\n");
- return CLI_ERROR;
- }
- return CLI_OK;
- } else {
- Cli_Printf("Invalid parameter \"%s\"\n", argv[3]);
- }
- } else {
- Cli_Printf("Invalid syntax\n");
- }
- break;
- }
- Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
- return CMD_ERROR;
-}
-
int
IsValidIpAddress(char *str)
{
@@ -3957,27 +3721,6 @@ done:
return ret_value;
}
-////////////////////////////////////////////////////////////////
-// CmdArgs_ConfigNetwork
-//
-// Register "config:network" arguments with the Tcl interpreter.
-//
-int
-CmdArgs_ConfigNetwork()
-{
- createArgument("hostname", CLI_ARGV_NO_POS, CLI_ARGV_OPTION_NAME_VALUE,
- (char *) NULL, CMD_CONFIG_HOSTNAME, "Hostname <string>", (char *) NULL);
- createArgument("defaultrouter", CLI_ARGV_NO_POS, CLI_ARGV_OPTION_NAME_VALUE,
- (char *) NULL, CMD_CONFIG_DEFAULT_ROUTER, "Default Router IP Address <x.x.x.x>", (char *) NULL);
- createArgument("search-domain", CLI_ARGV_NO_POS, CLI_ARGV_OPTION_NAME_VALUE,
- (char *) NULL, CMD_CONFIG_DOMAIN, "Domain-name <string>", (char *) NULL);
- createArgument("dns", CLI_ARGV_NO_POS, CLI_ARGV_OPTION_NAME_VALUE,
- (char *) NULL, CMD_CONFIG_DNS_IP, "Specify up to 3 DNS IP Addresses", (char *) NULL);
- createArgument("int", CLI_ARGV_NO_POS, CLI_ARGV_OPTION_NAME_VALUE,
- (char *) NULL, CMD_CONFIG_NETWORK_INT, "Network Interface", (char *) NULL);
- return CLI_OK;
-}
-
// config Logging Event sub-command
int
ConfigLoggingEvent(int arg_ref, int setvar)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/ConfigCmd.h
----------------------------------------------------------------------
diff --git a/mgmt/cli/ConfigCmd.h b/mgmt/cli/ConfigCmd.h
index e38b62c..6494f4b 100644
--- a/mgmt/cli/ConfigCmd.h
+++ b/mgmt/cli/ConfigCmd.h
@@ -672,27 +672,6 @@ int Cmd_ConfigSsl(ClientData clientData, Tcl_Interp * interp, int argc, const ch
//
int CmdArgs_ConfigSsl();
-
-////////////////////////////////////////////////////////////////
-// Cmd_ConfigNetwork
-//
-// This is the callback function for the "config:network" command.
-//
-// Parameters:
-// clientData -- information about parsed arguments
-// interp -- the Tcl interpreter
-// argc -- number of command arguments
-// argv -- the command arguments
-//
-int Cmd_ConfigNetwork(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-
-////////////////////////////////////////////////////////////////
-// CmdArgs_ConfigNetwork
-//
-// Register "config:network" arguments with the Tcl interpreter.
-//
-int CmdArgs_ConfigNetwork();
-
////////////////////////////////////////////////////////////////
// Functions to implement network settings
//
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/Makefile.am
----------------------------------------------------------------------
diff --git a/mgmt/cli/Makefile.am b/mgmt/cli/Makefile.am
index d081967..314ba1c 100644
--- a/mgmt/cli/Makefile.am
+++ b/mgmt/cli/Makefile.am
@@ -23,8 +23,7 @@ AM_CPPFLAGS = \
$(iocore_include_dirs) \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/ts \
- -I$(top_srcdir)/mgmt/api/include \
- -I$(top_srcdir)/mgmt/tools
+ -I$(top_srcdir)/mgmt/api/include
bin_PROGRAMS = traffic_shell traffic_line
@@ -76,7 +75,6 @@ traffic_shell_LDFLAGS = @EXTRA_CXX_LDFLAGS@ @LIBTOOL_LINK_FLAGS@
traffic_shell_LDADD = \
libtrafficshell.a \
$(top_builddir)/mgmt/api/remote/libtsmgmt.la \
- $(top_builddir)/mgmt/tools/libinkconfigapi.a \
$(top_builddir)/mgmt/utils/libutils_lm.a \
$(top_builddir)/lib/ts/libtsutil.la \
$(LIBTCL) $(LIBREADLINE) \
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/ShowCmd.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/ShowCmd.cc b/mgmt/cli/ShowCmd.cc
index 4a6571b..3024dd5 100644
--- a/mgmt/cli/ShowCmd.cc
+++ b/mgmt/cli/ShowCmd.cc
@@ -32,7 +32,6 @@
#include "CliDisplay.h"
#include "ink_defs.h"
#include "ink_string.h"
-#include <SysAPI.h>
////////////////////////////////////////////////////////////////
// Cmd_Show
@@ -46,9 +45,8 @@
// argv -- the command arguments
//
int
-Cmd_Show(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_Show(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -103,9 +101,8 @@ Cmd_Show(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[
// argv -- the command arguments
//
int
-Cmd_ShowStatus(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowStatus(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -133,9 +130,8 @@ Cmd_ShowStatus(ClientData clientData, Tcl_Interp * interp, int argc, const char
// argv -- the command arguments
//
int
-Cmd_ShowVersion(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowVersion(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -163,9 +159,8 @@ Cmd_ShowVersion(ClientData clientData, Tcl_Interp * interp, int argc, const char
// argv -- the command arguments
//
int
-Cmd_ShowPorts(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowPorts(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -194,9 +189,8 @@ Cmd_ShowPorts(ClientData clientData, Tcl_Interp * interp, int argc, const char *
// argv -- the command arguments
//
int
-Cmd_ShowCluster(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowCluster(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -224,9 +218,8 @@ Cmd_ShowCluster(ClientData clientData, Tcl_Interp * interp, int argc, const char
// argv -- the command arguments
//
int
-Cmd_ShowSecurity(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowSecurity(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -254,9 +247,8 @@ Cmd_ShowSecurity(ClientData clientData, Tcl_Interp * interp, int argc, const cha
// argv -- the command arguments
//
int
-Cmd_ShowHttp(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowHttp(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -340,9 +332,8 @@ CmdArgs_ShowIcp()
// argv -- the command arguments
//
int
-Cmd_ShowProxy(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowProxy(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -431,9 +422,8 @@ CmdArgs_ShowCache()
// argv -- the command arguments
//
int
-Cmd_ShowVirtualIp(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowVirtualIp(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -461,9 +451,8 @@ Cmd_ShowVirtualIp(ClientData clientData, Tcl_Interp * interp, int argc, const ch
// argv -- the command arguments
//
int
-Cmd_ShowHostDb(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowHostDb(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -491,9 +480,8 @@ Cmd_ShowHostDb(ClientData clientData, Tcl_Interp * interp, int argc, const char
// argv -- the command arguments
//
int
-Cmd_ShowDnsResolver(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowDnsResolver(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -521,9 +509,8 @@ Cmd_ShowDnsResolver(ClientData clientData, Tcl_Interp * interp, int argc, const
// argv -- the command arguments
//
int
-Cmd_ShowLogging(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowLogging(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -551,9 +538,8 @@ Cmd_ShowLogging(ClientData clientData, Tcl_Interp * interp, int argc, const char
// argv -- the command arguments
//
int
-Cmd_ShowSsl(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowSsl(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -639,9 +625,8 @@ CmdArgs_ShowParents()
// argv -- the command arguments
//
int
-Cmd_ShowRemap(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowRemap(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -727,9 +712,8 @@ CmdArgs_ShowSocks()
// argv -- the command arguments
//
int
-Cmd_ShowPortTunnels(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowPortTunnels(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -814,9 +798,8 @@ CmdArgs_ShowScheduledUpdate()
// argv -- the command arguments
//
int
-Cmd_ShowProxyStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowProxyStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -844,9 +827,8 @@ Cmd_ShowProxyStats(ClientData clientData, Tcl_Interp * interp, int argc, const c
// argv -- the command arguments
//
int
-Cmd_ShowHttpTransStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowHttpTransStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -874,9 +856,8 @@ Cmd_ShowHttpTransStats(ClientData clientData, Tcl_Interp * interp, int argc, con
// argv -- the command arguments
//
int
-Cmd_ShowHttpStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowHttpStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -904,9 +885,8 @@ Cmd_ShowHttpStats(ClientData clientData, Tcl_Interp * interp, int argc, const ch
// argv -- the command arguments
//
int
-Cmd_ShowIcpStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowIcpStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -934,9 +914,8 @@ Cmd_ShowIcpStats(ClientData clientData, Tcl_Interp * interp, int argc, const cha
// argv -- the command arguments
//
int
-Cmd_ShowCacheStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowCacheStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -964,9 +943,8 @@ Cmd_ShowCacheStats(ClientData clientData, Tcl_Interp * interp, int argc, const c
// argv -- the command arguments
//
int
-Cmd_ShowHostDbStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowHostDbStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -994,9 +972,8 @@ Cmd_ShowHostDbStats(ClientData clientData, Tcl_Interp * interp, int argc, const
// argv -- the command arguments
//
int
-Cmd_ShowDnsStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowDnsStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -1024,9 +1001,8 @@ Cmd_ShowDnsStats(ClientData clientData, Tcl_Interp * interp, int argc, const cha
// argv -- the command arguments
//
int
-Cmd_ShowLoggingStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowLoggingStats(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -1054,9 +1030,8 @@ Cmd_ShowLoggingStats(ClientData clientData, Tcl_Interp * interp, int argc, const
// argv -- the command arguments
//
int
-Cmd_ShowAlarms(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ShowAlarms(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
@@ -1073,87 +1048,6 @@ Cmd_ShowAlarms(ClientData clientData, Tcl_Interp * interp, int argc, const char
}
////////////////////////////////////////////////////////////////
-// Cmd_ShowNetwork
-//
-// This is the callback function for the "show:network" command.
-//
-// Parameters:
-// clientData -- information about parsed arguments
-// interp -- the Tcl interpreter
-// argc -- number of command arguments
-// argv -- the command arguments
-//
-int
-Cmd_ShowNetwork(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
-{
- NOWARN_UNUSED(clientData);
- /* call to processArgForCommand must appear at the beginning
- * of each command's callback function
- */
- if (processArgForCommand(interp, argc, argv) != CLI_OK) {
- return CMD_ERROR;
- }
-
- if (processHelpCommand(argc, argv) == CLI_OK)
- return CMD_OK;
-
- char hostname[256], ipaddr[32], netmask[32], domainname[256], router[32], dns_ip[32];
- char value[80];
-
- Cli_Debug("Cmd_ShowNetwork\n");
-
- memset(hostname, 0, 256);
- memset(ipaddr, 0, 32);
- memset(netmask, 0, 32);
- memset(domainname, 0, 32);
- memset(router, 0, 32);
- memset(dns_ip, 0, 32);
-
- Net_GetHostname(hostname, sizeof(hostname));
- Cli_Printf("\nHostname ---------------- %s\n", strlen(hostname) ? hostname : "not set");
-
- Net_GetDefaultRouter(value, sizeof(value));
- Cli_Printf("Default Gateway --------- %s\n", value);
-
- Net_GetDomain(value, sizeof(value));
- Cli_Printf("Search Domain ----------- %s\n", strlen(value) ? value : "none");
-
- Net_GetDNS_Servers(value, sizeof(value));
- Cli_Printf("DNS IP Addresses--------- %s\n", strlen(value) ? value : "none");
-
- char interface[80];
- int num_interfaces = Net_GetNetworkIntCount();
- for (int i = 0; i < num_interfaces; i++) {
- if (Net_GetNetworkInt(i, interface, sizeof(interface))) {
- Cli_Printf("No information for NIC %d\n", i);
- continue;
- }
- Cli_Printf("\nNIC %s\n", interface);
-
- Net_GetNIC_Status(interface, value, sizeof(value));
- Cli_Printf(" Status ---------------- %s\n", value);
-
- Net_GetNIC_Start(interface, value, sizeof(value));
- Cli_Printf(" Start on Boot --------- %s\n", value);
-
- Net_GetNIC_Protocol(interface, value, sizeof(value));
- Cli_Printf(" Start Protocol -------- %s\n", value);
-
- Net_GetNIC_IP(interface, value, sizeof(value));
- Cli_Printf(" IP Address ------------ %s\n", value);
-
- Net_GetNIC_Netmask(interface, value, sizeof(value));
- Cli_Printf(" Netmask --------------- %s\n", value);
-
- Net_GetNIC_Gateway(interface, value, sizeof(value));
- Cli_Printf(" Gateway --------------- %s\n", value);
- }
- Cli_Printf("\n");
- return CLI_OK;
-}
-
-
-////////////////////////////////////////////////////////////////
// CmdArgs_None
//
// Register a command with no arguments with the Tcl interpreter.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/ShowCmd.h
----------------------------------------------------------------------
diff --git a/mgmt/cli/ShowCmd.h b/mgmt/cli/ShowCmd.h
index 46e5f4f..cbc7cbf 100644
--- a/mgmt/cli/ShowCmd.h
+++ b/mgmt/cli/ShowCmd.h
@@ -131,7 +131,6 @@ int Cmd_ShowAlarms(ClientData clientData, Tcl_Interp * interp, int argc, const c
int Cmd_ShowRadius(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
int Cmd_ShowNtlm(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
int Cmd_ShowNtlmStats(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-int Cmd_ShowNetwork(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
int CmdArgs_None();
int getnameserver(char *nameserver, int len);
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/TrafficLine.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/TrafficLine.cc b/mgmt/cli/TrafficLine.cc
index 4c318ea..7f99f5b 100644
--- a/mgmt/cli/TrafficLine.cc
+++ b/mgmt/cli/TrafficLine.cc
@@ -139,9 +139,8 @@ handleArgInvocation()
}
int
-main(int argc, char **argv)
+main(int /* argc ATS_UNUSED */, char **argv)
{
- NOWARN_UNUSED(argc);
AppVersionInfo appVersionInfo;
TSError status;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/UtilCmds.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/UtilCmds.cc b/mgmt/cli/UtilCmds.cc
index e4d04d2..74ed09e 100644
--- a/mgmt/cli/UtilCmds.cc
+++ b/mgmt/cli/UtilCmds.cc
@@ -148,9 +148,8 @@ DebugOff()
// argv -- the command arguments
//
int
-Cmd_ConfigRoot(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
+Cmd_ConfigRoot(ClientData /* clientData ATS_UNUSED */, Tcl_Interp * interp, int argc, const char *argv[])
{
- NOWARN_UNUSED(clientData);
/* call to processArgForCommand must appear at the beginning
* of each command's callback function
*/
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/cliMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/cliMain.cc b/mgmt/cli/cliMain.cc
index 671eba8..8da720a 100644
--- a/mgmt/cli/cliMain.cc
+++ b/mgmt/cli/cliMain.cc
@@ -64,8 +64,6 @@ main(int argc, char *argv[])
{"version", 'V', "Print Version Id", "T", &version_flag, NULL, NULL}
};
- NOWARN_UNUSED(argc);
-
// Process command line arguments and dump into variables
process_args(argument_descriptions, countof(argument_descriptions), argv);
@@ -97,11 +95,8 @@ main(int argc, char *argv[])
}
void
-eventCallbackFn(char *name, char *msg, int pri, void *data)
+eventCallbackFn(char *name, char * /* msg ATS_UNUSED */, int /* pri ATS_UNUSED */, void * /* data ATS_UNUSED */)
{
- NOWARN_UNUSED(msg);
- NOWARN_UNUSED(pri);
- NOWARN_UNUSED(data);
if (AlarmCallbackPrint == 1) {
printf("\n**********\n" "ALARM SIGNALLED: %s\n" "**********\n", name);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/cliParseArg.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/cliParseArg.cc b/mgmt/cli/cliParseArg.cc
index b2a991a..72e6039 100644
--- a/mgmt/cli/cliParseArg.cc
+++ b/mgmt/cli/cliParseArg.cc
@@ -395,9 +395,8 @@ cliParseArgument(int argc, const char **argv, cli_CommandInfo * commandInfo)
*----------------------------------------------------------------------
*/
static void
-PrintUsage(Tcl_Interp * interp, cli_CommandInfo * commandInfo)
+PrintUsage(Tcl_Interp * /* interp ATS_UNUSED */, cli_CommandInfo * commandInfo)
{
- NOWARN_UNUSED(interp);
cli_ArgvInfo *infoPtr;
cli_ArgvInfo *argTable = commandInfo->argtable;
int width, numSpaces;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/hashtable.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/hashtable.cc b/mgmt/cli/hashtable.cc
index b18d6c7..183ebf0 100644
--- a/mgmt/cli/hashtable.cc
+++ b/mgmt/cli/hashtable.cc
@@ -170,11 +170,10 @@ cliGetCommandArgsfromHashtable(char *name)
static void
-DestroyOptionHashTable(ClientData clientData, Tcl_Interp * interp)
+DestroyOptionHashTable(ClientData clientData, Tcl_Interp * /* interp ATS_UNUSED */)
/* The hash table we are destroying */
/* The interpreter we are destroying */
{
- NOWARN_UNUSED(interp);
Tcl_HashTable *hashTablePtr = (Tcl_HashTable *) clientData;
Tcl_HashSearch search;
Tcl_HashEntry *hashEntryPtr;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cli/processArgument.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/processArgument.cc b/mgmt/cli/processArgument.cc
index 185ad43..24f0810 100644
--- a/mgmt/cli/processArgument.cc
+++ b/mgmt/cli/processArgument.cc
@@ -30,9 +30,8 @@
// processArgForCommand
int
-processArgForCommand(Tcl_Interp * interp, int argc, const char *argv[])
+processArgForCommand(Tcl_Interp * /* interp ATS_UNUSED */, int argc, const char *argv[])
{
- NOWARN_UNUSED(interp);
cli_CommandInfo *commandinfo = cliGetCommandArgsfromHashtable((char *) argv[0]);
if (commandinfo == NULL)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cluster/ClusterCom.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/ClusterCom.cc b/mgmt/cluster/ClusterCom.cc
index 5e55b46..db75541 100644
--- a/mgmt/cluster/ClusterCom.cc
+++ b/mgmt/cluster/ClusterCom.cc
@@ -314,11 +314,9 @@ drainIncomingChannel(void *arg)
* the manager.
*/
int
-cluster_com_port_watcher(const char *name, RecDataT data_type, RecData data, void *cookie)
+cluster_com_port_watcher(const char *name, RecDataT /* data_type ATS_UNUSED */, RecData data,
+ void * /* cookie ATS_UNUSED */)
{
- NOWARN_UNUSED(data_type);
- NOWARN_UNUSED(cookie);
-
ink_assert(!name);
ink_mutex_acquire(&(lmgmt->ccom->mutex)); /* Grab cluster lock */
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/cluster/VMap.cc
----------------------------------------------------------------------
diff --git a/mgmt/cluster/VMap.cc b/mgmt/cluster/VMap.cc
index 55e558e..51fa525 100644
--- a/mgmt/cluster/VMap.cc
+++ b/mgmt/cluster/VMap.cc
@@ -42,10 +42,8 @@
#endif
int
-vmapEnableHandler(const char *tok, RecDataT data_type, RecData data, void *cookie)
+vmapEnableHandler(const char *tok, RecDataT /* data_type ATS_UNUSED */, RecData data, void * /* cookie ATS_UNUSED */)
{
- NOWARN_UNUSED(data_type);
- NOWARN_UNUSED(cookie);
bool before = true;
ink_assert(!tok);
if (!lmgmt->virt_map->enabled)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/preparse/IPRange.cc
----------------------------------------------------------------------
diff --git a/mgmt/preparse/IPRange.cc b/mgmt/preparse/IPRange.cc
index a3ac03f..58bb2ad 100644
--- a/mgmt/preparse/IPRange.cc
+++ b/mgmt/preparse/IPRange.cc
@@ -81,7 +81,6 @@ read_an_ip(char *line, unsigned int *ip, int *i, int n)
char *
IPRange::read_table_from_file(int fd, const char *identifier_str, bool localip)
{
- NOWARN_UNUSED(localip);
int i, j, n, rc, s, line_no;
char c, line[MAXLINESIZE];
bool end_of_file;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cf21050a/mgmt/stats/StatProcessor.cc
----------------------------------------------------------------------
diff --git a/mgmt/stats/StatProcessor.cc b/mgmt/stats/StatProcessor.cc
index 96df01b..268dc29 100644
--- a/mgmt/stats/StatProcessor.cc
+++ b/mgmt/stats/StatProcessor.cc
@@ -45,10 +45,8 @@ bool sumClusterVar;
void
-startElement(void *userData, const char *name, const char **atts)
+startElement(void * /* userData ATS_UNUSED */, const char *name, const char **atts)
{
- NOWARN_UNUSED(userData);
- NOWARN_UNUSED(name);
int i = 0;
if (!strcmp(name, "ink:statistics"))
@@ -119,10 +117,8 @@ startElement(void *userData, const char *name, const char **atts)
void
-endElement(void *userData, const char *name)
+endElement(void * /* userData ATS_UNUSED */, const char */* name ATS_UNUSED */)
{
- NOWARN_UNUSED(userData);
- NOWARN_UNUSED(name);
switch (currentTag) {
case STAT_TAG:
statObjectList.enqueue(statObject);
@@ -141,10 +137,8 @@ endElement(void *userData, const char *name)
void
-charDataHandler(void *userData, const XML_Char * name, int len)
+charDataHandler(void * /* userData ATS_UNUSED */, const XML_Char * name, int /* len ATS_UNUSED */)
{
- NOWARN_UNUSED(userData);
- NOWARN_UNUSED(len);
if (currentTag != EXPR_TAG && currentTag != DST_TAG) {
return;
}