trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject svn commit: r1058195 - in /trafficserver/traffic/trunk/proxy/mgmt2/cli2: ConfigCmd.cc cliMain.cc cli_scriptpaths.h cli_setdomain.sh cli_setdomain.tcl cli_sethostname.sh cli_sethostname.tcl cli_setrouter.sh cli_setrouter.tcl script_configs.tcl
Date Wed, 12 Jan 2011 15:38:04 GMT
Author: igalic
Date: Wed Jan 12 15:38:03 2011
New Revision: 1058195

URL: http://svn.apache.org/viewvc?rev=1058195&view=rev
Log:
Removing unused code from traffic_shell along with unused, outdated and ugly tcl code.

Removed:
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_scriptpaths.h
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_setdomain.sh
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_setdomain.tcl
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_sethostname.sh
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_sethostname.tcl
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_setrouter.sh
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_setrouter.tcl
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.tcl
Modified:
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc?rev=1058195&r1=1058194&r2=1058195&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc Wed Jan 12 15:38:03 2011
@@ -57,7 +57,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include "cli_scriptpaths.h"
 #include "ConfigAPI.h"
 #include "SysAPI.h"
 
@@ -4055,117 +4054,6 @@ IsValidDomainname(char *str)
 }
 
 
-int
-getnameserver(char *nameserver, int len)
-{
-#if defined(linux)
-  char buff[256];
-  FILE *fstr;
-  if ((fstr = fopen(NAMESERVER_PATH, "r")) == NULL)
-    return CLI_ERROR;
-
-  do {
-    NOWARN_UNUSED_RETURN(fgets(buff, sizeof(buff), fstr));
-  } while (!feof(fstr) && strncmp(buff, NAMESERVER_MARKER, strlen(NAMESERVER_MARKER))
!= 0);
-
-  if (feof(fstr)) {
-    fclose(fstr);
-    return CLI_ERROR;
-  }
-
-  fclose(fstr);
-
-  strncpy(nameserver, buff + strlen(NAMESERVER_MARKER), len);
-
-  /* Strip off any trailing newline, tabs, or blanks */
-  *(nameserver + strcspn(nameserver, " \t\n")) = 0;
-
-#endif
-
-  return CLI_OK;
-
-}
-
-#if defined(solaris)
-/*
- * NOTE: This routine is found in libnsl (-lnsl). No prototype was found in
- * any of the header files in /usr/include. Define a prototype here to keep the
- * compiler happy.
- */
-extern int getdomainname(char *, int);
-#endif
-
-int
-setnameserver(char *nameserver)
-{
-  FILE *fstr;
-  if ((fstr = fopen(NAMESERVER_PATH, "wb")) == NULL) {
-    return -1;
-  } else {
-#if defined(linux) || defined(darwin) || defined(freebsd) //FIXME: solaris
-    char domain[256];
-    char resolventry[256];
-
-    if (getdomainname(domain, 256) == -1)
-      return CLI_ERROR;
-    snprintf((char *) &resolventry, sizeof(resolventry), "domain %s\nnameserver %s\n",
domain, nameserver);
-
-    fputs((char *) &resolventry, fstr);
-    fputs("\n", fstr);
-    fclose(fstr);
-#endif
-    return CLI_OK;
-  }
-  return CLI_OK;
-
-}
-
-int
-setrouter(char *router, int len)
-{
-  NOWARN_UNUSED(len);
-  FILE *fstr;
-  if ((fstr = fopen(DEFAULTROUTER_PATH, "wb")) == NULL) {
-    return -1;
-  } else {
-    fprintf(fstr, "%s", router);
-    fclose(fstr);
-    return CLI_OK;
-  }
-}
-
-int
-getrouter(char *router, int len)
-{
-  FILE *fstr;
-#if defined(linux) || defined(darwin) || defined(freebsd) || defined(solaris)
-  char buff[256];
-  char *p;
-
-  if ((fstr = fopen(DEFAULTROUTER_PATH, "r")) == NULL)
-    return CLI_ERROR;
-
-  do {
-    NOWARN_UNUSED_RETURN(fgets(buff, sizeof(buff), fstr));
-  } while (!feof(fstr) && strncmp(buff, GATEWAY_MARKER, strlen(GATEWAY_MARKER)) !=
0);
-
-  if (feof(fstr)) {
-    fclose(fstr);
-    return CLI_ERROR;
-  }
-
-  fclose(fstr);
-
-  strncpy(router, buff + strlen(GATEWAY_MARKER), len);
-
-  /* Strip off the trailing newline, if present */
-  if ((p = strchr(router, '\n')) != NULL)
-    *p = 0;
-#endif
-  return CLI_OK;
-
-}
-
 char *
 pos_after_string(char *haystack, const char *needle)
 {

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc?rev=1058195&r1=1058194&r2=1058195&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc Wed Jan 12 15:38:03 2011
@@ -23,7 +23,6 @@
 
 #include "ink_config.h"
 #include <stdlib.h>
-//#include "tclExtend.h"
 #include "tcl.h"
 #include <string.h>
 #include "ink_args.h"



Mime
View raw message