trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1215546 - in /trafficserver/traffic/trunk/mgmt/cli: ConfigCmd.cc ConfigCmd.h ShowCmd.h
Date Sat, 17 Dec 2011 18:29:27 GMT
Author: zwoop
Date: Sat Dec 17 18:29:27 2011
New Revision: 1215546

URL: http://svn.apache.org/viewvc?rev=1215546&view=rev
Log:
TS-992 Drop getnetparms(), it's not used.

Author: Piotr Sikora
Review: Leif

Modified:
    trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc
    trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h
    trafficserver/traffic/trunk/mgmt/cli/ShowCmd.h

Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc?rev=1215546&r1=1215545&r2=1215546&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.cc Sat Dec 17 18:29:27 2011
@@ -3913,82 +3913,6 @@ pos_after_string(char *haystack, const c
   return retval;
 }
 
-int
-getnetparms(char *ipnum, char *mask)
-{
-  // TODO: Use detected values from configure
-#define BUFFLEN 256
-#if defined(linux)
-#define interface_name "eth0"
-#elif defined(darwin)
-#define interface_name "en0"
-#elif defined(freebsd)
-#define interface_name "eth0"
-#elif defined(solaris)
-#define interface_name "e1000g0" // FIXME: better way to get interface names
-#endif
-
-  FILE *ifconfig_data;
-  char buff[BUFFLEN];
-  char *p = NULL;
-
-  ifconfig_data = popen("/sbin/ifconfig -a" interface_name, "r");
-  if (ifconfig_data == NULL)
-    return -1;
-
-
-  /* We want to junk the first line. If there's no first line, then
-   * the named interface doesn't exist. */
-  if (fgets(buff, BUFFLEN, ifconfig_data) == NULL)
-    goto err;                   /* No such interface, no data on stream */
-
-  /* Flush to the end of the line. Should never be necessary. */
-  while (buff[0] != 0 && buff[strlen(buff) - 1] != '\n')
-    NOWARN_UNUSED_RETURN(fgets(buff, BUFFLEN, ifconfig_data));
-
-  /* Get the second line. */
-  if (fgets(buff, BUFFLEN, ifconfig_data) == NULL)
-    goto err;                   /* Mystery, shouldn't happen. */
-  if (buff[0] != 0 && buff[strlen(buff) - 1] != '\n') {
-    fprintf(stderr, "Error. I can't read the output of \"ifconfig\", it's giving\n");
-    fprintf(stderr, "me lines over %d characters long.\n", BUFFLEN);
-    goto err;
-  }
-#if defined(linux) || defined(darwin) || defined(freebsd)
-  p = pos_after_string(buff, "inet addr:");
-#endif
-
-  if (p != NULL) {
-
-    while (*p && !isspace(*p)) {
-      *(ipnum++) = *(p++);
-    }
-  } else {
-    fprintf(stderr, "Error. I don't understand the output format of \"ifconfig\"\n");
-    goto err;
-  }
-  *ipnum = 0;
-
-  p = pos_after_string(buff, "Mask:");
-
-  if (p != NULL) {
-
-    while (*p && !isspace(*p)) {
-      *(mask++) = *(p++);
-    }
-  } else {
-    fprintf(stderr, "Error. I don't understand the output format of \"ifconfig\"\n");
-    goto err;
-  }
-
-  *mask = 0;
-  pclose(ifconfig_data);
-  return CLI_OK;
-
-err:
-  pclose(ifconfig_data);
-  return CLI_ERROR;
-}
 
 int
 StartBinary(char *abs_bin_path, char *bin_options, int isScript)

Modified: trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h?rev=1215546&r1=1215545&r2=1215546&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ConfigCmd.h Sat Dec 17 18:29:27 2011
@@ -699,7 +699,6 @@ int IsValidHostname(char *str);
 int IsValidFQHostname(char *str);
 int IsValidDomainname(char *str);
 int IsValidIpAddress(char *str);
-int getnetparms(char *ipaddr, char *netmask);
 #if defined(solaris)
 int getnetmask(char *mask);
 #endif

Modified: trafficserver/traffic/trunk/mgmt/cli/ShowCmd.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/cli/ShowCmd.h?rev=1215546&r1=1215545&r2=1215546&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/cli/ShowCmd.h (original)
+++ trafficserver/traffic/trunk/mgmt/cli/ShowCmd.h Sat Dec 17 18:29:27 2011
@@ -134,7 +134,6 @@ int Cmd_ShowNtlmStats(ClientData clientD
 int Cmd_ShowNetwork(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
 int CmdArgs_None();
 
-int getnetparms(char *ipaddr, char *netmask);
 int getnameserver(char *nameserver, int len);
 int getrouter(char *router, int len);
 



Mime
View raw message