trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geor...@apache.org
Subject svn commit: r915922 [13/14] - in /incubator/trafficserver/traffic/trunk: ./ install/ iocore/aio/ iocore/block-cache/ iocore/cache/ iocore/cluster/ iocore/dns/ iocore/eventsystem/ iocore/hostdb/ iocore/net/ iocore/utils/ libev/ libev/CVS/ libinktomi++/ ...
Date Wed, 24 Feb 2010 18:48:52 GMT
Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliDisplay.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliDisplay.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliDisplay.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliDisplay.cc Wed Feb 24 18:48:42 2010
@@ -29,10 +29,11 @@
  * 
  ****************************************************************/
 
+#include "inktomi++.h"
 #include "CliDisplay.h"
 #include "definitions.h"
 #include <string.h>
-#include <inktomi++.h>
+
 
 #define BUF_SIZE 1024
 

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliMgmtUtils.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliMgmtUtils.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliMgmtUtils.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliMgmtUtils.cc Wed Feb 24 18:48:42 2010
@@ -29,6 +29,7 @@
  * 
  ****************************************************************/
 
+#include "inktomi++.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include "CliMgmtUtils.h"
@@ -36,7 +37,7 @@
 #include "ink_resource.h"
 #include "definitions.h"
 #include "ConfigCmd.h"
-#include <inktomi++.h>
+
 
 void Cli_DisplayMgmtAPI_Error(INKError status);
 

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc Wed Feb 24 18:48:42 2010
@@ -30,6 +30,7 @@
                   (char*)NULL);
  ****************************************************************/
 
+#include "inktomi++.h"
 #include "../api2/include/INKMgmtAPI.h"
 #include "ShowCmd.h"
 #include "ConfigCmd.h"
@@ -54,7 +55,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include "cli_scriptpaths.h"
-#include "inktomi++.h"
 #include <ConfigAPI.h>
 #include <SysAPI.h>
 
@@ -5139,6 +5139,15 @@
 
 }
 
+#if (HOST_OS == 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)
 {
@@ -5146,18 +5155,18 @@
   if ((fstr = fopen(NAMESERVER_PATH, "wb")) == NULL) {
     return -1;
   } else {
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd) //FIXME: solaris
     char domain[256];
     char resolventry[256];
 
-#if (HOST_OS == linux)
     if (getdomainname(domain, 256) == -1)
       return CLI_ERROR;
     snprintf((char *) &resolventry, sizeof(resolventry), "domain %s\nnameserver %s\n", domain, nameserver);
-#endif
 
     fputs((char *) &resolventry, fstr);
     fputs("\n", fstr);
     fclose(fstr);
+#endif
     return CLI_OK;
   }
   return CLI_OK;
@@ -5181,7 +5190,7 @@
 getrouter(char *router, int len)
 {
   FILE *fstr;
-#if (HOST_OS == linux)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd) || (HOST_OS == solaris)
   char buff[256];
   char *p;
 
@@ -5228,11 +5237,17 @@
 #define BUFFLEN 256
 #if (HOST_OS == linux)
 #define interface_name "eth0"
+#elif (HOST_OS == darwin)
+#define interface_name "en0"
+#elif (HOST_OS == freebsd)
+#define interface_name "eth0"
+#elif (HOST_OS == solaris)
+#define interface_name "e1000g0" // FIXME: better way to get interface names
 #endif
 
   FILE *ifconfig_data;
   char buff[BUFFLEN];
-  char *p;
+  char *p = NULL;
 
   ifconfig_data = popen("/sbin/ifconfig -a" interface_name, "r");
   if (ifconfig_data == NULL)
@@ -5256,7 +5271,7 @@
     fprintf(stderr, "me lines over %d characters long.\n", BUFFLEN);
     goto err;
   }
-#if (HOST_OS == linux)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd)
   p = pos_after_string(buff, "inet addr:");
 #endif
 
@@ -6323,7 +6338,7 @@
   int find = 0;
   int counter = 0;
 
-#if (HOST_OS == linux)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd) || (HOST_OS == solaris)
   ink_strncpy(value, "", value_len);
   // coverity[fs_check_call]
   if (access(pathname, R_OK)) {

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h Wed Feb 24 18:48:42 2010
@@ -912,7 +912,7 @@
 int IsValidDomainname(char *str);
 int IsValidIpAddress(char *str);
 int getnetparms(char *ipaddr, char *netmask);
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 int getnetmask(char *mask);
 #endif
 char *pos_after_string(char const *haystack, char const *needle);

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeReadCmd.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeReadCmd.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeReadCmd.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeReadCmd.cc Wed Feb 24 18:48:42 2010
@@ -29,14 +29,14 @@
  ****************************************************************/
 
 
-
+#include "inktomi++.h"
 #include <ConfigCmd.h>
 #include <CliDisplay.h>
 #include <CliMgmtUtils.h>
 #include <ConfigUpgradeCmd.h>
 #include <string.h>
 #include "../api2/include/INKMgmtAPI.h"
-#include "inktomi++.h"
+
 
 extern Tcl_Interp *interp;
 CIFCReadEntry::CIFCReadEntry():

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeWriteCmd.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeWriteCmd.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeWriteCmd.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigUpgradeWriteCmd.cc Wed Feb 24 18:48:42 2010
@@ -28,7 +28,7 @@
  *
  ****************************************************************/
 
-
+#include "inktomi++.h"
 #include <ConfigCmd.h>
 #include <CliDisplay.h>
 #include <CliMgmtUtils.h>
@@ -36,7 +36,7 @@
 #include <CliMgmtUtils.h>
 #include <ConfigUpgradeCmd.h>
 #include <string.h>
-#include <inktomi++.h>
+
 
 CIFCWriteEntry::CIFCWriteEntry():CountOn(0)
 {

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/Makefile.am?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/Makefile.am (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/Makefile.am Wed Feb 24 18:48:42 2010
@@ -75,19 +75,16 @@
 traffic_shell_LDFLAGS =	$(EXTRA_CXX_LDFLAGS)
 
 traffic_shell_LDADD = \
-  $(top_builddir)/proxy/mgmt2/api2/remote/libmgmtapiremote.a \
-  $(LIBTCL) \
-  $(top_builddir)/libinktomi++/libinktomi++.a \
   libtrafficshell.a \
+  $(top_builddir)/proxy/mgmt2/api2/remote/libmgmtapiremote.a \
   $(top_builddir)/proxy/mgmt2/tools/libinksysapi.a \
   $(top_builddir)/proxy/mgmt2/tools/libinkconfigapi.a \
   $(top_builddir)/proxy/mgmt2/utils/libutils_lm.a \
+  $(top_builddir)/libinktomi++/libinktomi++.a \
+  $(LIBTCL) \
   @LIBDL@ \
-  -lm \
+  @LIBM@ \
+  @LIBICONV@ \
   @LIBEXPAT@ @LIBSSL@ \
   @LIBTHREAD@ @LIBSOCKET@ @LIBNSL@ @LIBRESOLV@ \
   @LIBRT@
-
-libtrafficshell_a_LIBADD = \
-  $(libtrafficshell_a_OBJECTS) \
-  $(libtrafficshell_a_DEPENDENCIES)

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cliMain.cc Wed Feb 24 18:48:42 2010
@@ -21,6 +21,7 @@
   limitations under the License.
  */
 
+#include "ink_config.h"
 #include <stdlib.h>
 //#include "tclExtend.h"
 #include "tcl.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_scriptpaths.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_scriptpaths.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_scriptpaths.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_scriptpaths.h Wed Feb 24 18:48:42 2010
@@ -28,18 +28,19 @@
 #define __SPI_SCRIPT_PATH__H
 
 #define INKTOMI_HOME "/home/inktomi"
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 #define DEFAULTROUTER_PATH "/etc/defaultrouter"
 #define DEFAULT_DOMAIN_PATH "/etc/defaultdomain"
 #define NETMASK_PATH "/etc/inet/netmasks"
 
-// not used by sunos
+// not used by solaris
 #define NIC_IDENTIFIER_STRING ""
 
 #define NIC_SETTINGS_FILE "/kernel/drv/iprb.conf"
 #define NIC_CHANGES_STRING "Changes Take Effect on Reboot"
 #define NIC_CONFIG_LABEL "ForceSpeedDuplex="
 #define SET_ROUTER_SCRIPT "./cli_setrouter.tcl"
+#define GATEWAY_MARKER "GATEWAY=" // FIXME:
 
 #elif (HOST_OS == linux)
 #define DEFAULTROUTER_PATH "/etc/sysconfig/network"
@@ -53,6 +54,12 @@
 #define NIC_IDENTIFIER_STRING "eth0"
 #define NIC_CHANGES_STRING "Changes Take Effect Immediately"
 #define NIC_SETTINGS_EXECUTABLE INKTOMI_HOME "/rubicon/bin/mii-diag"
+#elif (HOST_OS == darwin)
+#define DEFAULTROUTER_PATH "/tmp/tsrouterpath-fixme" // FIXME:
+#define GATEWAY_MARKER "GATEWAY=" // FIXME:
+#elif (HOST_OS == freebsd)
+#define DEFAULTROUTER_PATH "/tmp/tsrouterpath-fixme" // FIXME:
+#define GATEWAY_MARKER "GATEWAY=" // FIXME:
 #endif
 
 #define NAMESERVER_PATH "/etc/resolv.conf"
@@ -101,10 +108,14 @@
 
 #define SET_TIMEZONE_SCRIPT INKTOMI_HOME "/rubicon/bin/spi_settimezone.sh"
 #define SET_TIMEZONE_ARGS "1>/usr/tmp/spi_settimezone.log 2>&1"
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 #define TIMEZONE_FILE "/etc/default/init"
 #elif (HOST_OS == linux)
 #define TIMEZONE_FILE "/etc/sysconfig/clock"
+#elif (HOST_OS == darwin)
+#define TIMEZONE_FILE "/tmp/tstzonefile-fixme" // FIXME:
+#elif (HOST_OS == freebsd)
+#define TIMEZONE_FILE "/tmp/tstzonefile-fixme" // FIXME:
 #else
 #error No file set for this OS.
 #endif

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc Wed Feb 24 18:48:42 2010
@@ -31,19 +31,13 @@
  * 
  */
 
-#include "ink_unused.h"    /* MAGIC_EDITING_TAG */
+#include "inktomi++.h"
 
-#include "ink_platform.h"
-#include "Compatability.h"
 #include "I_Version.h"
 
-#include "ink_string.h"
-#include "ink_sock.h"
 #include "TextBuffer.h"
 #include "MgmtSocket.h"
 
-#include "Diags.h"
-
 #include "Main.h"
 #include "ClusterCom.h"
 #include "WebMgmtUtils.h"
@@ -2546,9 +2540,14 @@
              (lmgmt->mgmt_shutdown_outstanding ? "true" : "false"));
     mgmt_writeline(req_fd, reply, strlen(reply));
 
-#ifndef _WIN32
+#if !defined(_WIN32)
+#if (HOST_OS == solaris)
+    snprintf(reply, sizeof(reply), "\twatched_process_fd: %d  watched_process_pid: %ld\n",
+             lmgmt->watched_process_fd, lmgmt->watched_process_pid);
+#else
     snprintf(reply, sizeof(reply), "\twatched_process_fd: %d  watched_process_pid: %d\n",
              lmgmt->watched_process_fd, lmgmt->watched_process_pid);
+#endif
     mgmt_writeline(req_fd, reply, strlen(reply));
 #else // We don't have unix domain sockets on NT
     snprintf(reply, sizeof(reply), "\tprocess_server_hpipe: %d  watched_process_pid: %ld\n",

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.cc Wed Feb 24 18:48:42 2010
@@ -29,9 +29,10 @@
  * 
  */
 
+#include "ink_config.h"
+#include "ink_platform.h"
 #include "ink_unused.h"        /* MAGIC_EDITING_TAG */
 
-#include "ink_platform.h"
 #include "Main.h"
 #include "VMap.h"
 #include "P_RecLocal.h"
@@ -241,7 +242,7 @@
           }
         }
       }
-#if (HOST_OS == freebsd)
+#if (HOST_OS == freebsd) || (HOST_OS == darwin)
       ifr = (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
 #else
       ifr = (struct ifreq *) (((char *) ifr) + sizeof(*ifr));
@@ -1091,8 +1092,8 @@
     interface = ((VIPInfo *) hash_value)->interface;
     sub_id = ((VIPInfo *) hash_value)->sub_interface_id;
 
-#if (HOST_OS == linux) || (HOST_OS == freebsd)
-    res = execl(absolute_vipconf_binary, vip_conf, "up", virt_ip, "/sbin/ifconfig", interface, sub_id, NULL);
+#if (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == solaris) || (HOST_OS == darwin)
+    res = execl(absolute_vipconf_binary, vip_conf, "up", virt_ip, "/sbin/ifconfig", interface, sub_id, (char*) NULL);
 #else
     res = execl(absolute_vipconf_binary, vip_conf, "up", virt_ip, "/usr/sbin/ifconfig", interface, sub_id, NULL);
 #endif
@@ -1147,8 +1148,8 @@
     interface = ((VIPInfo *) hash_value)->interface;
     sub_id = ((VIPInfo *) hash_value)->sub_interface_id;
 
-#if (HOST_OS == linux) || (HOST_OS == freebsd)
-    res = execl(absolute_vipconf_binary, vip_conf, "down", virt_ip, "/sbin/ifconfig", interface, sub_id, NULL);
+#if (HOST_OS == linux)|| (HOST_OS == freebsd) || (HOST_OS == solaris) || (HOST_OS == darwin)
+    res = execl(absolute_vipconf_binary, vip_conf, "down", virt_ip, "/sbin/ifconfig", interface, sub_id, (char*)NULL);
 #else
     res = execl(absolute_vipconf_binary, vip_conf, "down", virt_ip, "/usr/sbin/ifconfig", interface, sub_id, NULL);
 #endif

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cluster/VMap.h Wed Feb 24 18:48:42 2010
@@ -34,10 +34,7 @@
 #ifndef _VMAP_H
 #define _VMAP_H
 
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "ink_mutex.h"
+#include "inktomi++.h"
 
 #ifdef _WIN32
 /* Currently, iphlpapi.h is not present in VC98\include;

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc Wed Feb 24 18:48:42 2010
@@ -242,7 +242,7 @@
 }
 
 static void
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
 sig_fatal(int signum, siginfo_t * t, void *c)
 #else
 sig_fatal(int signum)
@@ -251,7 +251,7 @@
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Entering sig_fatal(%d)\n", signum);
 #endif
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   if (t) {
     if (t->si_code <= 0) {
       cop_log(COP_FATAL, "cop received fatal user signal [%d] from"
@@ -262,7 +262,7 @@
   } else {
 #endif
     cop_log(COP_FATAL, "cop received fatal signal [%d]\n", signum);
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   }
 #endif
 #ifdef TRACE_LOG_COP
@@ -272,7 +272,7 @@
 }
 
 static void
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
 sig_alarm_warn(int signum, siginfo_t * t, void *c)
 #else
 sig_alarm_warn(int signum)
@@ -310,7 +310,7 @@
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Entering set_alarm_death()\n");
 #endif
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   action.sa_handler = NULL;
   action.sa_sigaction = sig_fatal;
   sigemptyset(&action.sa_mask);
@@ -335,7 +335,7 @@
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Entering set_alarm_warn()\n");
 #endif
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   action.sa_handler = NULL;
   action.sa_sigaction = sig_alarm_warn;
   sigemptyset(&action.sa_mask);
@@ -461,7 +461,7 @@
 #ifdef ENOBUFS
   case ENOBUFS:
 #endif
-#if (HOST_OS != freebsd)
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   case ENOSR:
 #endif
     if (wait_ms)
@@ -868,7 +868,7 @@
     if (err < 0) {
       break;
     }
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
     err = semctl(err, 1, IPC_RMID);
 #else
     union semun dummy_semun;
@@ -892,8 +892,10 @@
   i = 1;
   tok = ink_strtok_r(manager_options, " ", &last);
   options[i++] = tok;
-  while (i < OPTIONS_MAX && (tok = ink_strtok_r(NULL, " ", &last))) {
-    options[i++] = tok;
+  if (tok != NULL) {
+    while (i < OPTIONS_MAX && (tok = ink_strtok_r(NULL, " ", &last))) {
+      options[i++] = tok;
+    }
   }
 
   // coverity[fs_check_call]
@@ -1127,7 +1129,11 @@
     if (err == 0) {
       fd = fopen(rni_rpass_lockfile, "w+");
       if (fd > 0) {
+#if (HOST_OS == solaris)
+	fprintf(fd, "%d\n", (int)getpid());
+#else
         fprintf(fd, "%d\n", getpid());
+#endif
         fclose(fd);
       }
 
@@ -2169,14 +2175,14 @@
   // these signals arrive in order to generate a core. There is some
   // difficulty with generating core files when linking with libthread
   // under solaris.
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   action.sa_handler = NULL;
   action.sa_sigaction = sig_fatal;
 #else
   action.sa_handler = sig_fatal;
 #endif
   sigemptyset(&action.sa_mask);
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   action.sa_flags = SA_SIGINFO;
 #else
   action.sa_flags = 0;
@@ -2384,7 +2390,11 @@
   signal(SIGTTIN, SIG_IGN);
 
   setsid();                     // Important, thanks Vlad. :)
+#if (HOST_OS == freebsd)
+  setpgrp(0,0);
+#else
   setpgrp();
+#endif
 
   close(STDIN_FILENO);
   close(STDOUT_FILENO);

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/html2/tune/navigation_tree.xmlcpp
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/html2/tune/navigation_tree.xmlcpp?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/html2/tune/navigation_tree.xmlcpp (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/html2/tune/navigation_tree.xmlcpp Wed Feb 24 18:48:42 2010
@@ -187,7 +187,7 @@
     </MENU>
 
     <MENU name="Networking">
-#if (HOST_OS == linux) || (HOST_OS == sunos)
+#if (HOST_OS == linux) || (HOST_OS == solaris)
       <ITEM name="System">
         <LINK refresh="true"
               file_link="/monitor/m_net.ink"
@@ -525,7 +525,7 @@
     </MENU>
 
     <MENU name="Networking">
-#if (HOST_OS == linux) || (HOST_OS == sunos)
+#if (HOST_OS == linux) || (HOST_OS == solaris)
       <ITEM name="System">
         <LINK name="General"
               file_link="/configure/c_net_config.ink"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/IPRange.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/IPRange.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/IPRange.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/IPRange.cc Wed Feb 24 18:48:42 2010
@@ -21,7 +21,6 @@
   limitations under the License.
  */
 
-#include "ink_unused.h"    /* MAGIC_EDITING_TAG */
 /****************************************************************************
 
   IPRange.cc
@@ -29,6 +28,9 @@
   This file an IPRange object that reads a range of IPS, and does
   matching of a given IP address against those ranges.
  ****************************************************************************/
+
+#include "ink_config.h"
+#include "ink_unused.h"    /* MAGIC_EDITING_TAG */
 #if !defined (_WIN32)
 #include <ctype.h>
 #include <sys/types.h>

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/RemapReadConfig.cc Wed Feb 24 18:48:42 2010
@@ -29,6 +29,7 @@
  *
  ****************************************************************************/
 
+#include "ink_config.h"
 #include "ink_platform.h"
 #include "ink_string.h"
 #include "ink_file.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/StoreReadConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/StoreReadConfig.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/StoreReadConfig.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/preparse/StoreReadConfig.cc Wed Feb 24 18:48:42 2010
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-#include "ink_unused.h"    /* MAGIC_EDITING_TAG */
+#include "inktomi++.h"
 /****************************************************************************
 
   StoreReadConfig.cc
@@ -29,10 +29,6 @@
   
  ****************************************************************************/
 
-#include "ink_platform.h"
-#include "Compatability.h"
-#include "ink_file.h"
-
 char *
 parseStorageFile(int fd)
 {

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatProcessor.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatProcessor.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatProcessor.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatProcessor.cc Wed Feb 24 18:48:42 2010
@@ -30,6 +30,7 @@
  *
  ****************************************************************************/
 
+#include "ink_config.h"
 #include "StatProcessor.h"
 #include "ink_unused.h"
 

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatType.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatType.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatType.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatType.cc Wed Feb 24 18:48:42 2010
@@ -30,6 +30,7 @@
  *
  ****************************************************************************/
 
+#include "ink_config.h"
 #include "StatType.h"
 
 bool StatError = false;         // global error flag

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatXML.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatXML.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatXML.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/stats/StatXML.cc Wed Feb 24 18:48:42 2010
@@ -21,6 +21,7 @@
   limitations under the License.
  */
 
+#include "ink_config.h"
 #include "StatXML.h"
 #include <stdlib.h>
 #include <ctype.h>

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc Wed Feb 24 18:48:42 2010
@@ -21,10 +21,12 @@
   limitations under the License.
  */
 
-#if (HOST_OS == linux) || (HOST_OS == sunos)
+#if (HOST_OS == linux) || (HOST_OS == solaris) || (HOST_OS == freebsd) || (HOST_OS == darwin)
 
+#include "inktomi++.h"
 #include "ConfigAPI.h"
 #include "SysAPI.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -32,7 +34,7 @@
 #include <sys/wait.h>
 #include <stdarg.h>
 #include <string.h>
-#include "inktomi++.h"
+
 #include "CoreAPI.h"
 
 #include "../utils/XmlUtils.h"
@@ -72,27 +74,29 @@
 int
 Config_GetHostname(char *hostname, size_t hostname_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetHostname(hostname, hostname_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetHostname(char *hostname)
 {
-  int status;
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   char old_hostname[256];
   INKInt val;
   bool rni = false;
 
-
   //printf("Inside Config_SetHostname(), hostname = %s\n", hostname);
 
   //validate
   ink_strncpy(old_hostname, "", sizeof(old_hostname));
-
   if (hostname == NULL)
     return -1;
 
-
   //System call first
   status = Net_SetHostname(hostname);
   if (status) {
@@ -126,7 +130,6 @@
     if (status) {
       // If this fails, we need to restore old machine hostname
       // at this poing we already have TS and network configured
-
       Net_GetHostname(old_hostname, sizeof(old_hostname));
       if (!strlen(old_hostname)) {
         DPRINTF(("Config_SetHostname: FATAL: recovery failed - failed to get old_hostname\n"));
@@ -152,21 +155,25 @@
       DPRINTF(("Config_SetHostname: Failed starting rm proxy in rm_start_proxy\n"));
     }
   }
-
+#endif /* !freebsd && !darwin */
   return status;
 }
 
 int
 Config_GetDefaultRouter(char *router, size_t len)
 {
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetDefaultRouter(router, len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetDefaultRouter(char *router)
 {
-  int status;
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   char old_router[80];
 
   //validate
@@ -180,11 +187,8 @@
   }
 
   DPRINTF(("Config_SetDefaultRouter: router %s\n", router));
-
   status = Net_SetDefaultRouter(router);
-
   DPRINTF(("Config_SetDefaultRouter: Net_SetDefaultRouter returned %d\n", status));
-
   if (status) {
     return status;
   }
@@ -203,19 +207,25 @@
     }
     return -1;
   }
+#endif /* !freebsd && !darwin */
   return status;
 }
 
 int
 Config_GetDomain(char *domain, size_t domain_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetDomain(domain, domain_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetDomain(char *domain)
 {
-  int status;
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   char old_domain[80];
 
   status = Config_GetDomain(old_domain, sizeof(old_domain));
@@ -241,29 +251,33 @@
     }
     return -1;
   }
+#endif /* !freebsd && !darwin */
   return status;
 }
 
 int
 Config_GetDNS_Servers(char *dns, size_t dns_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetDNS_Servers(dns, dns_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetDNS_Servers(char *dns)
 {
-  int status;
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   char old_dns[80];
 
   DPRINTF(("Config_SetDNS_Servers: dns %s\n", dns));
-
   status = Config_GetDNS_Servers(old_dns, sizeof(old_dns));
   if (status) {
     DPRINTF(("Config_SetDNS_Servers: falied to retrieve old dns name\n"));
     ink_strncpy(old_dns, "", sizeof(old_dns));
   }
-
   status = Net_SetDNS_Servers(dns);
   if (status) {
     return status;
@@ -275,7 +289,6 @@
       DPRINTF(("Config_SetDNS_Servers: FATAL: falied to retrieve old dns name\n"));
       return -1;
     }
-
     status = Net_SetDNS_Servers(old_dns);
     if (status) {
       DPRINTF(("Config_SetDNS_Servers: FATAL: falied to revert to old dns name\n"));
@@ -283,74 +296,111 @@
     }
     return -1;
   }
+#endif /* !freebsd && !darwin */
   return status;
 }
 
 int
 Config_GetDNS_Server(char *server, size_t server_len, int no)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetDNS_Server(server, server_len, no));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNetworkIntCount()
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetNetworkIntCount());
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNetworkInt(int int_num, char *interface, size_t interface_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetNetworkInt(int_num, interface, interface_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNIC_Status(char *interface, char *status, size_t status_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetNIC_Status(interface, status, status_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNIC_Start(char *interface, char *start, size_t start_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetNIC_Start(interface, start, start_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNIC_Protocol(char *interface, char *protocol, size_t protocol_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetNIC_Protocol(interface, protocol, protocol_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNIC_IP(char *interface, char *ip, size_t ip_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetNIC_IP(interface, ip, ip_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNIC_Netmask(char *interface, char *netmask, size_t netmask_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetNIC_Netmask(interface, netmask, netmask_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetNIC_Gateway(char *interface, char *gateway, size_t gateway_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return (Net_GetNIC_Gateway(interface, gateway, gateway_len));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetNIC_Down(char *interface)
 {
-  int status;
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   char ip[80];
 
   //validate 
   if (interface == NULL) {
     return -1;
   }
-
   status = Net_SetNIC_Down(interface);
   if (status) {
     return status;
@@ -363,6 +413,7 @@
   if (status) {
     DPRINTF(("Config_SetNIC_down: falied to config TS for SetNIC_Down\n"));
   }
+#endif /* !freebsd && !darwin */
   return status;
 }
 
@@ -374,8 +425,11 @@
   if ((interface == NULL) || (onboot == NULL)) {
     return -1;
   }
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_SetNIC_StartOnBoot(interface, onboot));
+#else
+  return -1;
+#endif
 }
 
 int
@@ -385,48 +439,62 @@
   if ((interface == NULL) || (nic_protocol == NULL)) {
     return -1;
   }
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_SetNIC_BootProtocol(interface, nic_protocol));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetNIC_IP(char *interface, char *nic_ip)
 {
+  int status = -1;
   //validate
   if ((interface == NULL) || (nic_ip == NULL)) {
     return -1;
   }
-  return (Net_SetNIC_IP(interface, nic_ip));
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
+  status = (Net_SetNIC_IP(interface, nic_ip));
+#endif
+  return status;
 }
 
 int
 Config_SetNIC_Netmask(char *interface, char *nic_netmask)
 {
+  int status = -1;
   //validate
   if ((interface == NULL) || (nic_netmask == NULL)) {
     return -1;
   }
-
-  return (Net_SetNIC_Netmask(interface, nic_netmask));
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
+  status = (Net_SetNIC_Netmask(interface, nic_netmask));
+#endif
+  return status;
 }
 
 int
 Config_SetNIC_Gateway(char *interface, char *nic_gateway)
 {
+  int status = -1;
   //validate
   if ((interface == NULL) || (nic_gateway == NULL)) {
     return -1;
   }
 
   DPRINTF(("Config_SetNIC_gateway:: interface %s gateway %s\n", interface, nic_gateway));
-
-  return (Net_SetNIC_Gateway(interface, nic_gateway));
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
+  status = (Net_SetNIC_Gateway(interface, nic_gateway));
+#endif
+  return status;
 }
 
 int
 Config_SetNIC_Up(char *interface, char *onboot, char *protocol, char *ip, char *netmask, char *gateway)
 {
-  int status;
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   char old_ip[80];
   INKInt val;
   bool rni = false;
@@ -471,7 +539,7 @@
       return -1;
     }
   }
-
+#endif /* !freebsd && !darwin */
   return status;
 }
 
@@ -479,105 +547,116 @@
 Config_GetTime(char *hour, const size_t hourSize, char *minute, const size_t minuteSize, char *second,
                const size_t secondSize)
 {
-  int status;
-
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_GetTime(hour, hourSize, minute, minuteSize, second, secondSize);
+#endif
   return status;
 }
 
 int
 Config_SetTime(bool restart, char *hour, char *minute, char *second)
 {
-  int status;
+  int status = -1;
 
   if (hour == NULL || minute == NULL || second == NULL) {
     return -1;
   }
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   status = Time_SetTime(restart, hour, minute, second);
+#endif
   return status;
 }
 
 int
 Config_GetDate(char *month, const size_t monthSize, char *day, const size_t daySize, char *year, const size_t yearSize)
 {
-  int status;
-
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_GetDate(month, monthSize, day, daySize, year, yearSize);
+#endif
   return status;
 }
 
 int
 Config_SetDate(bool restart, char *month, char *day, char *year)
 {
-  int status;
+  int status = -1;
 
   if (month == NULL || day == NULL || year == NULL) {
     return -1;
   }
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_SetDate(restart, month, day, year);
+#endif
   return status;
 }
 
 int
 Config_SortTimezone(void)
 {
-  int status;
-
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_SortTimezone();
+#endif
   return status;
 }
 
 int
 Config_GetTimezone(char *timezone, size_t timezone_len)
 {
-  int status;
-
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_GetTimezone(timezone, timezone_len);
+#endif
   return status;
 }
 
 int
 Config_SetTimezone(bool restart, char *timezone)
 {
-  int status;
+  int status = -1;
 
   if (timezone == NULL) {
     return -1;
   }
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   status = Time_SetTimezone(restart, timezone);
+#endif
   return status;
 }
 
 int
 Config_GetNTP_Servers(char *server, size_t server_len)
 {
-  int status;
-
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_GetNTP_Servers(server, server_len);
+#endif
   return status;
 }
 
 int
 Config_SetNTP_Servers(bool restart, char *server)
 {
-  int status;
+  int status = -1;
 
   if (server == NULL) {
     return -1;
   }
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   status = Time_SetNTP_Servers(restart, server);
+#endif
   return status;
 }
 
 int
 Config_GetNTP_Server(char *server, size_t server_len, int no)
 {
-  int status;
-
+  int status = -1;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   status = Time_GetNTP_Server(server, server_len, no);
+#endif
   return status;
 }
 
@@ -645,42 +724,66 @@
            trap_community, trap_host));
   return status;
 }
-#endif
+#endif /* linux */
 
 int
 Config_GetNTP_Status(char *status, size_t status_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   return Time_GetNTP_Status(status, status_len);
+#else
+  return -1;
+#endif
 }
 
 int
 Config_SetNTP_Off(void)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return Time_SetNTP_Off();
+#else
+  return -1;
+#endif
 }
 
 int
 Config_User_Root(int *old_euid)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return Sys_User_Root(old_euid);
+#else
+  return -1;
+#endif
 }
 
 int
 Config_User_Inktomi(int euid)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return Sys_User_Inktomi(euid);
+#else
+  return -1;
+#endif
 }
 
 int
 Config_Grp_Root(int *old_egid)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return Sys_Grp_Root(old_egid);
+#else
+  return -1;
+#endif
 }
 
 int
 Config_Grp_Inktomi(int egid)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return Sys_Grp_Inktomi(egid);
+#else
+  return -1;
+#endif
 }
 
 #if (HOST_OS == linux)
@@ -781,7 +884,7 @@
       }
       snprintf(eth, sizeof(eth), "eth%d", ++count);
     }
-#endif
+#endif /* linux */
 
     // Check that we always have eth0. If eth0 is missing, exit.
     // Check for all others if eth0 is found
@@ -836,7 +939,7 @@
       xfree(trap_community);
     if (trap_host != NULL)
       xfree(trap_host);
-#endif
+#endif /* linux */
 
     // Get Admin GUI encrypted password.
     char *e_gui_passwd;
@@ -876,9 +979,13 @@
     if (TagValue != NULL) {
       //This is the last one - here we restart TM if it is not floppy configuration
       if (!isFloppyConfig) {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
         Time_SetTimezone(true, TagValue);
+#endif
       } else {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
         Time_SetTimezone(false, TagValue);
+#endif
       }
     }
     xfree(TagValue);
@@ -898,7 +1005,7 @@
   //char ethXNM[24];
   //char ethXGW[24];
   XMLDom netConfigXML;
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   netConfigXML.setNodeName("APPLIANCE_CONFIG");
 
   XMLNode *child2 = new XMLNode;
@@ -1125,7 +1232,7 @@
     SNMPinfo->setNodeValue(trap_host);
     child->AppendChild(SNMPinfo);
   }
-#endif
+#endif /* linux */
 
   XMLNode *child1 = new XMLNode;
   char *parentAttributes1[3];
@@ -1166,7 +1273,7 @@
   netConfigXML.AppendChild(child);
   netConfigXML.AppendChild(child1);
   netConfigXML.SaveToFile(file);
-
+#endif /* !freebsd && !darwin */
   return 0;
 }
 
@@ -1239,13 +1346,21 @@
 int
 Config_SetSMTP_Server(char *server)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_SetSMTP_Server(server));
+#else
+  return -1;
+#endif
 }
 
 int
 Config_GetSMTP_Server(char *server)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   return (Net_GetSMTP_Server(server));
+#else
+  return -1;
+#endif
 }
 
 
@@ -1272,10 +1387,7 @@
       return 1;
     }
   } else {
-    int res = execl(net_floppy_config,
-                    "net_floppy_config",
-                    "done",
-                    NULL);
+    int res = execl(net_floppy_config,"net_floppy_config","done",(char*)NULL);
     return res;
   }
 
@@ -1349,10 +1461,7 @@
       return 1;
     }
   } else {
-    int res = execl(net_floppy_config,
-                    "net_floppy_config",
-                    "do",
-                    NULL);
+    int res = execl(net_floppy_config,"net_floppy_config","do", (char*)NULL);
     return res;
   }
 
@@ -1422,4 +1531,4 @@
 
 }
 
-#endif
+#endif /* (HOST_OS == linux) || (HOST_OS == solaris) || (HOST_OS == freebsd) || (HOST_OS == darwin) */

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h Wed Feb 24 18:48:42 2010
@@ -26,7 +26,7 @@
 
 #include "../utils/XmlUtils.h"
 
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 #include "ink_bool.h"
 #endif
 

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/McastSnoop.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/McastSnoop.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/McastSnoop.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/McastSnoop.cc Wed Feb 24 18:48:42 2010
@@ -31,13 +31,14 @@
  *
  ******************************************************************/
 
+#include "inktomi++.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include "Tokenizer.h"
-#include "inktomi++.h"
+
 
 char version_str[] = "2.0";
 int packet_count = 0;

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/NetConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/NetConfig.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/NetConfig.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/NetConfig.cc Wed Feb 24 18:48:42 2010
@@ -30,6 +30,8 @@
  *
  */
 
+#include "ink_config.h"
+
 #if (HOST_OS == darwin) || (HOST_OS == freebsd)
 /* This program has not been ported to these operating systems at all,
  * and even the linux one is insanely distro specific.
@@ -1506,7 +1508,7 @@
   } else if (pid > 0) {
     wait(&status);
   } else {
-    int res = execl(ifconfig_binary, "ifconfig", nic_name, "down", NULL);
+    int res = execl(ifconfig_binary, "ifconfig", nic_name, "down", (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't bring interface down");
     }
@@ -1520,7 +1522,7 @@
   } else if (pid > 0) {
     wait(&status);
   } else {
-    int res = execl(rmmod_binary, "rmmod", modname, NULL);
+    int res = execl(rmmod_binary, "rmmod", modname, (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't rmmod the ethernet driver");
     }
@@ -1534,7 +1536,7 @@
   } else if (pid > 0) {
     wait(&status);
   } else {
-    int res = execl(insmod_binary, "insmod", modname, options, NULL);
+    int res = execl(insmod_binary, "insmod", modname, options, (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't insmod the ethernet driver");
     }
@@ -1548,7 +1550,7 @@
     wait(&status);
   } else {
     //trying something a bit different
-    int res = execl("/etc/rc.d/init.d/network", "network", "start", NULL);
+    int res = execl("/etc/rc.d/init.d/network", "network", "start", (char*)NULL);
     //int res = execl(ifconfig_binary, "ifconfig", nic_name, "up", NULL);
     if (res != 0) {
       perror("[net_confg] couldn't bring interface up");
@@ -1611,7 +1613,7 @@
       wait(&status);
     } else {
       int res;
-      res = execl(mv_binary, "mv", module_path_new, module_path, NULL);
+      res = execl(mv_binary, "mv", module_path_new, module_path, (char*)NULL);
       if (res != 0) {
         perror("[net_config] mv of new module config file failed ");
       }
@@ -1812,7 +1814,7 @@
 
 #endif
 
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -1848,6 +1850,7 @@
 #include<sys/types.h>
 
 #include "ink_bool.h"
+#include "ink_string.h"
 
 #define UP_INTERFACE     0
 #define DOWN_INTERFACE   1
@@ -1957,7 +1960,7 @@
   } else {
     int res;
     //printf("!! overwriteFiles mv %s %s\n", source, dest);
-    res = execl(MV_BINARY, "mv", source, dest, NULL);
+    res = execl(MV_BINARY, "mv", source, dest, (char*)NULL);
     if (res != 0)
       perror(errmsg);
     _exit(res);
@@ -1979,7 +1982,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(SYMBOLIC_LINK_BINARY, "ln", "-s", original_file, symbolic_link, NULL);
+    res = execl(SYMBOLIC_LINK_BINARY, "ln", "-s", original_file, symbolic_link, (char*)NULL);
     if (res != 0)
       perror(errmsg);
     _exit(res);
@@ -2003,7 +2006,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(CHMOD_BINARY, "chmod", mode, filename, NULL);
+    res = execl(CHMOD_BINARY, "chmod", mode, filename, (char*)NULL);
     if (res != 0)
       perror(errmsg);
     _exit(res);
@@ -2028,7 +2031,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(ROUTE_BINARY, "route", "delete", dest, gateway, NULL);
+    res = execl(ROUTE_BINARY, "route", "delete", dest, gateway, (char*)NULL);
     if (res != 0) {
       perror(errmsg);
     }
@@ -2054,7 +2057,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(ROUTE_BINARY, "route", "delete", dest, gateway, "-ifp", interface, NULL);
+    res = execl(ROUTE_BINARY, "route", "delete", dest, gateway, "-ifp", interface, (char*)NULL);
     if (res != 0) {
       perror(errmsg);
     }
@@ -2077,7 +2080,7 @@
   } else if (pid > 0) {
     waitpid(pid, &status, 0);
   } else {
-    int res = execl(ROUTE_BINARY, "route", "add", dest, gateway, NULL);
+    int res = execl(ROUTE_BINARY, "route", "add", dest, gateway, (char*)NULL);
     if (res != 0) {
       perror(errmsg);
     }
@@ -2103,7 +2106,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(ROUTE_BINARY, "route", "add", dest, gateway, "-ifp", interface, NULL);
+    res = execl(ROUTE_BINARY, "route", "add", dest, gateway, "-ifp", interface, (char*)NULL);
     if (res != 0) {
       perror(errmsg);
     }
@@ -2129,7 +2132,7 @@
     waitpid(pid, &status, 0);
   } else {                      // also update the broadcast address field
     int res;
-    res = execl(IF_CONFIG_BINARY, "ifconfig", interface, ip, "netmask", mask, "broadcast", "+", NULL);
+    res = execl(IF_CONFIG_BINARY, "ifconfig", interface, ip, "netmask", mask, "broadcast", "+", (char*)NULL);
     if (res != 0) {
       perror(errmsg);
     }
@@ -2178,7 +2181,7 @@
 {
   const int BUFFLEN = 1024;
   const int PATHLEN = 200;
-  char command[PATHLEN], buffer[BUFFLEN], hostname_path[PATHLEN];
+  char buffer[BUFFLEN], hostname_path[PATHLEN];
   char hosts_path[PATHLEN], hosts_path_new[PATHLEN];
   char hostname[PATHLEN];
   FILE *fd, *fd1;
@@ -2321,7 +2324,7 @@
 
   //need 3 + 1 + 3 + 1+ 3 + 1 + 3 = 15 chars, +1 for the null
   char buff[17];
-  snprintf(buff, sizeof(buf), "%d.%d.%d.%d",
+  snprintf(buff, sizeof(buff), "%d.%d.%d.%d",
            (ip & FIRST_OCTET) >> 24, (ip & SECOND_OCTET) >> 16, (ip & THIRD_OCTET) >> 8, (ip & FOURTH_OCTET));
   ink_strncpy(ipAddr, buff, ipAddrSize);
   return NETCONFIG_SUCCESS;
@@ -2335,7 +2338,7 @@
 getNetworkNumber(char *ip, char *netmask, char *network_number)
 {
   unsigned int network = (ipDot2int(ip) & ipDot2int(netmask));
-  return ipInt2Dot(network, network_number);
+  return ipInt2Dot(network, network_number, sizeof(network_number));
 }
 
 int
@@ -2377,7 +2380,7 @@
        modify - find line of adding route to specific nic_name
        replace that line
      */
-    snprintf(static_filename_new, sizeof(stat_filename_new), "%s.new", static_filename);
+    snprintf(static_filename_new, sizeof(static_filename_new), "%s.new", static_filename);
     if ((fd1 = fopen(static_filename_new, "w")) == NULL) {
       perror("[net_config] setGatewayForBoot, failed to open new config files");
       return NETCONFIG_FAIL;
@@ -2546,7 +2549,7 @@
     } else if (pid > 0) {
       waitpid(pid, &status, 0);
     } else {
-      int res = execl(IF_CONFIG_BINARY, "ifconfig", nic_name, "up", NULL);
+      int res = execl(IF_CONFIG_BINARY, "ifconfig", nic_name, "up", (char*)NULL);
       if (res != 0)
         perror(errmsg);
       _exit(res);
@@ -2560,7 +2563,7 @@
       waitpid(pid, &status, 0);
     } else {
       int res;
-      res = execl(IF_CONFIG_BINARY, "ifconfig", nic_name, "plumb", NULL);
+      res = execl(IF_CONFIG_BINARY, "ifconfig", nic_name, "plumb", (char*)NULL);
       if (res != 0)
         perror(errmsg);
       _exit(res);
@@ -2589,7 +2592,7 @@
         waitpid(pid, &status, 0);
       } else {
         int res;
-        res = execl(STATIC_ROUTE_FILENAME, NULL);
+        res = execl(STATIC_ROUTE_FILENAME, NULL, (char*)NULL);
         if (res != 0)
           perror(errmsg);
         _exit(res);
@@ -2637,7 +2640,7 @@
   } else if (pid > 0) {
     waitpid(pid, &status, 0);
   } else {
-    int res = execl(IFCONFIG, "ifconfig", nic_name, "auto-dhcp", "drop", NULL);
+    int res = execl(IFCONFIG, "ifconfig", nic_name, "auto-dhcp", "drop", (char*)NULL);
     if (res != 0) {
       perror(errmsg);
     }
@@ -2792,7 +2795,7 @@
   } else if (pid > 0) {
     waitpid(pid, &status, 0);
   } else {
-    int res = execl(ifconfig_binary, "ifconfig", nic_name, "down", NULL);
+    int res = execl(ifconfig_binary, "ifconfig", nic_name, "down", (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't bring interface down");
     }
@@ -2864,7 +2867,7 @@
         waitpid(pid, &status, 0);
       } else {
         // printf("MV: %s %s %s \n",mv_binary,mrtg_path_new, mrtg_path); 
-        res = execl(mv_binary, "mv", mrtg_path_new, mrtg_path, NULL);
+        res = execl(mv_binary, "mv", mrtg_path_new, mrtg_path, (char*)NULL);
         if (res != 0) {
           perror("[net_config] mv of new mrtg file failed ");
         }
@@ -3009,7 +3012,7 @@
   char buffer[BUFFLEN];
   char default_router_path[PATHLEN], default_router_path_new[PATHLEN];
   char cur_gateway_addr[BUFFLEN];
-  FILE *fd, *fd1;
+  FILE *fd;
 
   /* first overwrite the default router file */
   snprintf(default_router_path, sizeof(default_router_path), "%s", DEFAULT_ROUTER_PATH);
@@ -3113,7 +3116,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(mv_binary, "mv", dns_path_new, dns_path, NULL);
+    res = execl(mv_binary, "mv", dns_path_new, dns_path, (char*)NULL);
     if (res != 0) {
       perror("[net_config] mv of new dns config file failed ");
     }
@@ -3171,7 +3174,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(mv_binary, "mv", domain_path_new, domain_path, NULL);
+    res = execl(mv_binary, "mv", domain_path_new, domain_path, (char*)NULL);
     if (res != 0) {
       perror("[net_config] mv of new domain config file failed ");
     }
@@ -3227,7 +3230,7 @@
     waitpid(pid, &status, 0);
   } else {
     int res;
-    res = execl(mv_binary, "mv", search_domain_path_new, search_domain_path, NULL);
+    res = execl(mv_binary, "mv", search_domain_path_new, search_domain_path, (char*)NULL);
     if (res != 0) {
       perror("[net_config] mv of new  search domain config file failed ");
     }
@@ -3375,7 +3378,7 @@
   } else if (pid > 0) {
     waitpid(pid, &status, 0);
   } else {
-    int res = execl(ifconfig_binary, "ifconfig", nic_name, "down", NULL);
+    int res = execl(ifconfig_binary, "ifconfig", nic_name, "down", (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't bring interface down");
     }
@@ -3389,7 +3392,7 @@
   } else if (pid > 0) {
     waitpid(pid, &status, 0);
   } else {
-    int res = execl(rmmod_binary, "rmmod", modname, NULL);
+    int res = execl(rmmod_binary, "rmmod", modname, (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't rmmod the ethernet driver");
     }
@@ -3403,7 +3406,7 @@
   } else if (pid > 0) {
     waitpid(pid, &status, 0);
   } else {
-    int res = execl(insmod_binary, "insmod", modname, options, NULL);
+    int res = execl(insmod_binary, "insmod", modname, options, (char*)NULL);
     if (res != 0) {
       perror("[net_confg] couldn't insmod the ethernet driver");
     }
@@ -3417,7 +3420,7 @@
     waitpid(pid, &status, 0);
   } else {
     //trying something a bit different
-    int res = execl("/etc/rc.d/init.d/network", "network", "start", NULL);
+    int res = execl("/etc/rc.d/init.d/network", "network", "start", (char*)NULL);
     //int res = execl(ifconfig_binary, "ifconfig", nic_name, "up", NULL);
     if (res != 0) {
       perror("[net_confg] couldn't bring interface up");
@@ -3480,7 +3483,7 @@
       waitpid(pid, &status, 0);
     } else {
       int res;
-      res = execl(mv_binary, "mv", module_path_new, module_path, NULL);
+      res = execl(mv_binary, "mv", module_path_new, module_path, (char*)NULL);
       if (res != 0) {
         perror("[net_config] mv of new module config file failed ");
       }

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ShmemClean.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ShmemClean.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ShmemClean.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/ShmemClean.cc Wed Feb 24 18:48:42 2010
@@ -31,6 +31,7 @@
  * 
  */
 
+#include "ink_config.h"
 #include "ink_unused.h"      /* MAGIC_EDITING_TAG */
 
 #include <stdlib.h>

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc Wed Feb 24 18:48:42 2010
@@ -21,20 +21,15 @@
   limitations under the License.
  */
 
-#if (HOST_OS == linux)
+
+#include "inktomi++.h"
+#if (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == darwin)
 
 #include "SysAPI.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <sys/wait.h>
-#include <sys/time.h>
-#include <stdarg.h>
-#include <string.h>
 #include <ink_string.h>
 #include <regex.h>
-#include <time.h>
 #include <grp.h>
 
 #include <ctype.h>
@@ -611,12 +606,12 @@
 Net_SetNIC_BootProtocol(char *interface, char *nic_protocol)
 {
   char nic_boot[80], nic_ip[80], nic_netmask[80], nic_gateway[80];
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   Net_GetNIC_Start(interface, nic_boot, sizeof(nic_boot));
   Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
   Net_GetNIC_Netmask(interface, nic_netmask, sizeof(nic_netmask));
   Net_GetNIC_Gateway(interface, nic_gateway, sizeof(nic_gateway));
-
+#endif
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
 }
 
@@ -624,8 +619,8 @@
 Net_SetNIC_IP(char *interface, char *nic_ip)
 {
   //int status;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   char nic_boot[80], nic_protocol[80], nic_netmask[80], nic_gateway[80], old_ip[80];
-
   Net_GetNIC_IP(interface, old_ip, sizeof(old_ip));
   Net_GetNIC_Start(interface, nic_boot, sizeof(nic_boot));
   Net_GetNIC_Protocol(interface, nic_protocol, sizeof(nic_protocol));
@@ -633,26 +628,32 @@
   Net_GetNIC_Gateway(interface, nic_gateway, sizeof(nic_gateway));
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
 Net_SetNIC_Netmask(char *interface, char *nic_netmask)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   char nic_boot[80], nic_protocol[80], nic_ip[80], nic_gateway[80];
-
   Net_GetNIC_Start(interface, nic_boot, sizeof(nic_boot));
   Net_GetNIC_Protocol(interface, nic_protocol, sizeof(nic_protocol));
   Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
   Net_GetNIC_Gateway(interface, nic_gateway, sizeof(nic_gateway));
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
 Net_SetNIC_Gateway(char *interface, char *nic_gateway)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   char nic_boot[80], nic_protocol[80], nic_ip[80], nic_netmask[80];
-
   Net_GetNIC_Start(interface, nic_boot, sizeof(nic_boot));
   Net_GetNIC_Protocol(interface, nic_protocol, sizeof(nic_protocol));
   Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
@@ -661,6 +662,9 @@
            nic_protocol, nic_ip, nic_netmask, nic_gateway));
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
@@ -733,7 +737,7 @@
   return status;
 }
 
-#endif
+#endif /* linux */
 
 
 int
@@ -1015,6 +1019,7 @@
   return 0;
 }
 
+
 bool
 recordRegexCheck(const char *pattern, const char *value)
 {
@@ -1589,7 +1594,7 @@
     }
   } else {
     int res;
-    res = execl(mv_binary, "mv", snmp_path_new, snmp_path, NULL);
+    res = execl(mv_binary, "mv", snmp_path_new, snmp_path, (char*)NULL);
     if (res != 0) {
       DPRINTF(("[SysAPI] mv of new snmp cfg file failed\n"));
     }
@@ -1602,7 +1607,7 @@
     wait(&status);
   } else {
     int res;
-    res = execl(mv_binary, "mv", ts_snmp_path_new, ts_snmp_path, NULL);
+    res = execl(mv_binary, "mv", ts_snmp_path_new, ts_snmp_path, (char*)NULL);
     if (res != 0) {
       DPRINTF(("[SysAPI] mv of new ts_snmp cfg file failed\n"));
     }
@@ -1657,7 +1662,7 @@
       wait(&status);
     } else {
       int res;
-      res = execl(mv_binary, "mv", snmp_pass_new, snmp_pass, NULL);
+      res = execl(mv_binary, "mv", snmp_pass_new, snmp_pass, (char*)NULL);
       if (res != 0) {
         DPRINTF(("[SysAPI] mv of new snmpass.sh file failed\n"));
       }
@@ -1827,9 +1832,9 @@
   return 0;
 }
 
-#endif
+#endif /* (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == darwin) */
 
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 
 #include "SysAPI.h"
 #include <stdio.h>
@@ -1843,6 +1848,9 @@
 #include <regex.h>
 
 #include <ctype.h>
+
+#include "ink_string.h"
+
 #include "../api2/include/INKMgmtAPI.h"
 
 #include <arpa/inet.h>
@@ -1851,6 +1859,13 @@
 
 #include "ParseRules.h"
 
+// TODO: consolidate location of these defaults
+#define DEFAULT_ROOT_DIRECTORY            PREFIX
+#define DEFAULT_LOCAL_STATE_DIRECTORY     "var/trafficserver"
+#define DEFAULT_SYSTEM_CONFIG_DIRECTORY   "etc/trafficserver"
+#define DEFAULT_LOG_DIRECTORY             "var/log/trafficserver"
+#define DEFAULT_TS_DIRECTORY_FILE         PREFIX "/etc/traffic_server"
+
 #define NETCONFIG_HOSTNAME  0
 #define NETCONFIG_GATEWAY   1
 #define NETCONFIG_DOMAIN    2
@@ -1900,7 +1915,7 @@
 static int getTSdirectory(char *ts_path, size_t ts_path_len);
 
 int
-Net_GetHostname(char *hostname)
+Net_GetHostname(char *hostname, size_t hostname_len)
 {
   strcpy(hostname, "");
   return (gethostname(hostname, 256));
@@ -1923,7 +1938,7 @@
     return -1;
   }
 
-  Net_GetHostname(old_hostname);
+  Net_GetHostname(old_hostname,sizeof(old_hostname));
   if (!strlen(old_hostname)) {
     DPRINTF(("Net_SetHostname: failed to get old_hostname\n"));
     return -1;
@@ -1941,13 +1956,13 @@
     nic_status[0] = 0;
     protocol[0] = 0;
     for (int i = 0; i < count; i++) {   //since we are looping - we will get the "last" available IP - doesn't matter to us
-      Net_GetNetworkInt(i, name);       //we know we have at least one
+      Net_GetNetworkInt(i, name, sizeof(name)); //we know we have at least one
       if (name != NULL) {
-        Net_GetNIC_Status(name, nic_status);
-        Net_GetNIC_Protocol(name, protocol);
+        Net_GetNIC_Status(name, nic_status, sizeof(nic_status));
+        Net_GetNIC_Protocol(name, protocol, sizeof(protocol));
         if ((strcmp("up", nic_status) == 0) && (!found)) {
           //we can use this interface
-          Net_GetNIC_IP(name, ip_addr);
+          Net_GetNIC_IP(name, ip_addr, sizeof(ip_addr));
           found = true;
         }
       }
@@ -2049,14 +2064,14 @@
       }
       if (fgets(buffer, BUFFLEN, fd)) {
         char *p = buffer;
-        while (*p && !isspace(*p) && (p - buffer) < router_len)
+        while (*p && !isspace(*p) && ((size_t)(p - buffer) < router_len))
           *(router++) = *(p++);
         *router = 0;
       }
       fclose(fd);
     } else {                    // found, already in ip format, just need to cpy it
       char *p = buffer;
-      while (*p && !isspace(*p) && (p - buffer) < router_len)
+      while (*p && !isspace(*p) && ((size_t)(p - buffer) < router_len))
         *(router++) = *(p++);
       *router = 0;
     }
@@ -2095,7 +2110,7 @@
 }
 
 int
-Net_GetDomain(char *domain)
+Net_GetDomain(char *domain, size_t domain_len)
 {
   //  domain can be defined using search or domain keyword
   strcpy(domain, "");
@@ -2124,7 +2139,7 @@
 }
 
 int
-Net_GetDNS_Servers(char *dns)
+Net_GetDNS_Servers(char *dns, size_t dns_len)
 {
   char ip[80];
   strcpy(dns, "");
@@ -2195,7 +2210,7 @@
 }
 
 int
-Net_GetNetworkInt(int int_num, char *interface)
+Net_GetNetworkInt(int int_num, char *interface, size_t interface_len)//FIXME: use interface_len
 {
   strcpy(interface, "");
 
@@ -2248,7 +2263,7 @@
 }
 
 int
-Net_GetNIC_Status(char *interface, char *status)
+Net_GetNIC_Status(char *interface, char *status, size_t status_len) // FIXME: use status_line
 {
   const int BUFFLEN = 80;
   char buffer[BUFFLEN];
@@ -2270,7 +2285,7 @@
 }
 
 int
-Net_GetNIC_Start(char *interface, char *start)
+Net_GetNIC_Start(char *interface, char *start, size_t start_len)
 {
   const int PATHLEN = 200;
   char hostnamefile[PATHLEN];
@@ -2286,7 +2301,7 @@
 }
 
 int
-Net_GetNIC_Protocol(char *interface, char *protocol)
+Net_GetNIC_Protocol(char *interface, char *protocol, size_t protocol_len)
 {
   const int PATHLEN = 200;
   char dhcp_filename[PATHLEN];
@@ -2383,7 +2398,7 @@
 }
 
 int
-Net_GetNIC_IP(char *interface, char *ip)
+Net_GetNIC_IP(char *interface, char *ip, size_t nic_ip_len)//FIXME: use nic_ip_len
 {
   strcpy(ip, "");               // bug 50628, initialize for null value
   int status = parseIfconfig(interface, "inet ", ip);
@@ -2410,7 +2425,7 @@
     while (!feof(fd) && isLineCommented(hostname))      // skip # and blank
       fgets(hostname, PATHLEN, fd);
 
-    if (!hostname) {
+    if (hostname[0] == '\0') {
       DPRINTF(("[NET_GETNIC_IP] failed to get hostname"));
       return -1;
     }
@@ -2453,7 +2468,7 @@
     FILE *fd;
 
 
-    status = Net_GetNIC_IP(interface, ip_addr);
+    status = Net_GetNIC_IP(interface, ip_addr, sizeof(ip_addr));
     if (status != 0) {
       DPRINTF(("[NET_GETNIC_NETMASK] failed to obtain ip address"));
       return -1;
@@ -2522,7 +2537,7 @@
 }
 
 int
-Net_GetNIC_Gateway(char *interface, char *gateway)
+Net_GetNIC_Gateway(char *interface, char *gateway, size_t gateway_len)
 {
   // command is netstat -rn | grep <interface name> | grep G
   // the 2nd column is the Gateway
@@ -2561,7 +2576,7 @@
     return status;
   }
 
-  Net_GetNIC_IP(interface, ip);
+  Net_GetNIC_IP(interface, ip, sizeof(ip));
 
   return status;
 }
@@ -2571,10 +2586,10 @@
 {
   char nic_protocol[80], nic_ip[80], nic_netmask[80], nic_gateway[80];
 
-  Net_GetNIC_Protocol(interface, nic_protocol);
-  Net_GetNIC_IP(interface, nic_ip);
-  Net_GetNIC_Netmask(interface, nic_netmask);
-  Net_GetNIC_Gateway(interface, nic_gateway);
+  Net_GetNIC_Protocol(interface, nic_protocol,sizeof(nic_protocol));
+  Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
+  Net_GetNIC_Netmask(interface, nic_netmask, sizeof(nic_netmask));
+  Net_GetNIC_Gateway(interface, nic_gateway, sizeof(nic_gateway));
 
   return (Net_SetNIC_Up(interface, onboot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
 }
@@ -2583,55 +2598,68 @@
 Net_SetNIC_BootProtocol(char *interface, char *nic_protocol)
 {
   char nic_boot[80], nic_ip[80], nic_netmask[80], nic_gateway[80];
-
-  Net_GetNIC_Start(interface, nic_boot);
-  Net_GetNIC_IP(interface, nic_ip);
-  Net_GetNIC_Netmask(interface, nic_netmask);
-  Net_GetNIC_Gateway(interface, nic_gateway);
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
+  Net_GetNIC_Start(interface, nic_boot, sizeof(nic_boot));
+  Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
+  Net_GetNIC_Netmask(interface, nic_netmask, sizeof(nic_netmask));
+  Net_GetNIC_Gateway(interface, nic_gateway, sizeof(nic_gateway));
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
 Net_SetNIC_IP(char *interface, char *nic_ip)
 {
   //int status;
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   char nic_boot[80], nic_protocol[80], nic_netmask[80], nic_gateway[80], old_ip[80];
-
-  Net_GetNIC_IP(interface, old_ip);
+  Net_GetNIC_IP(interface, old_ip, sizeof(old_ip));
   Net_GetNIC_Start(interface, nic_boot);
   Net_GetNIC_Protocol(interface, nic_protocol);
-  Net_GetNIC_Netmask(interface, nic_netmask);
+  Net_GetNIC_Netmask(interface, nic_netmask, sizeof(nic_netmask));
   Net_GetNIC_Gateway(interface, nic_gateway);
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
 Net_SetNIC_Netmask(char *interface, char *nic_netmask)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   char nic_boot[80], nic_protocol[80], nic_ip[80], nic_gateway[80];
-
   Net_GetNIC_Start(interface, nic_boot);
   Net_GetNIC_Protocol(interface, nic_protocol);
-  Net_GetNIC_IP(interface, nic_ip);
+  Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
   Net_GetNIC_Gateway(interface, nic_gateway);
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
 Net_SetNIC_Gateway(char *interface, char *nic_gateway)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != solaris)
   char nic_boot[80], nic_protocol[80], nic_ip[80], nic_netmask[80];
-
   Net_GetNIC_Start(interface, nic_boot);
   Net_GetNIC_Protocol(interface, nic_protocol);
-  Net_GetNIC_IP(interface, nic_ip);
-  Net_GetNIC_Netmask(interface, nic_netmask);
+  Net_GetNIC_IP(interface, nic_ip, sizeof(nic_ip));
+  Net_GetNIC_Netmask(interface, nic_netmask, sizeof(nic_netmask));
+
   //   DPRINTF(("Net_SetNIC_Gateway:: interface %s onboot %s protocol %s ip %s netmask %s gateway %s\n", interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
 
   return (Net_SetNIC_Up(interface, nic_boot, nic_protocol, nic_ip, nic_netmask, nic_gateway));
+#else
+  return -1;
+#endif
 }
 
 int
@@ -2656,9 +2684,9 @@
   const int BUFFLEN = 200;
   char old_ip[BUFFLEN], old_mask[BUFFLEN], old_gateway[BUFFLEN], default_gateway[BUFFLEN];
 
-  Net_GetNIC_IP(interface, old_ip);
-  Net_GetNIC_Netmask(interface, old_mask);
-  Net_GetNIC_Gateway(interface, old_gateway);
+  Net_GetNIC_IP(interface, old_ip, sizeof(old_ip));
+  Net_GetNIC_Netmask(interface, old_mask, sizeof(old_mask));
+  Net_GetNIC_Gateway(interface, old_gateway, sizeof(old_gateway));
   Net_GetDefaultRouter(default_gateway, sizeof(default_gateway));
 
   if (strcmp(protocol, "static") == 0)
@@ -2693,7 +2721,7 @@
   }
   int count = Net_GetNetworkIntCount();
   for (int i = 0; i < count; i++) {
-    Net_GetNetworkInt(i, name);
+    Net_GetNetworkInt(i, name, sizeof(name));
     if (strcmp(name, interface) == 0)
       return 1;
   }
@@ -2779,7 +2807,7 @@
 {
   char addr[80];
   char octet1[16], octet2[16], octet3[16], octet4[16];
-  int byte1, byte2, byte3, byte4;
+  int byte1 = 0, byte2 = 0, byte3 = 0, byte4 = 0;
   char junk[256];
 
   if (ip_addr == NULL) {
@@ -3013,7 +3041,7 @@
   char *env_path;
 
   if ((env_path = getenv("TS_ROOT"))) {
-    ink_strcnpy(ts_path, env_path, ts_path_len);
+    ink_strncpy(ts_path, env_path, ts_path_len);
     return 0;
   }
   if ((fp = fopen(DEFAULT_TS_DIRECTORY_FILE, "r")) == NULL) {
@@ -3107,7 +3135,7 @@
   FILE *fp;
   const char *ntpconf = "/etc/ntp.conf";
   char buffer[1024];
-  char *option, *server_name;
+  char *option, *server_name = NULL;
 
   fp = fopen(ntpconf, "r");
   if (fp == NULL) {
@@ -3309,4 +3337,4 @@
   return 0;
 }
 
-#endif
+#endif /* (HOST_OS == solaris) */

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h Wed Feb 24 18:48:42 2010
@@ -24,7 +24,7 @@
 #ifndef _SYS_API_H
 #define _SYS_API_H
 
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 #include "ink_bool.h"
 #endif
 

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/VIPConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/VIPConfig.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/VIPConfig.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/tools/VIPConfig.cc Wed Feb 24 18:48:42 2010
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-#include "ink_unused.h"      /* MAGIC_EDITING_TAG */
+#include "inktomi++.h"
 /*
  *
  * VIPConfig.cc
@@ -33,18 +33,6 @@
  * 
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
 
 #include <sys/un.h>
 struct ifafilt;
@@ -222,7 +210,7 @@
     } else if (pid > 0) {
       wait(&status);
     } else {                    /* Exec the up */
-      int res = execl(binary, "ifconfig", interface, "up", NULL);
+      int res = execl(binary, "ifconfig", interface, "up", (char*)NULL);
       if (res != 0) {
         perror("[vip_confg] ");
       }
@@ -235,7 +223,7 @@
 
 // "netmask +" is broken on Solaris 2.6 & 2.7,
 // it never actually checks against /etc/netmasks.
-    int res = execl(binary, "ifconfig", interface, vip, "netmask", "+", "broadcast", "+", "metric", "1", NULL);
+    int res = execl(binary, "ifconfig", interface, vip, "netmask", "+", "broadcast", "+", "metric", "1", (char*)NULL);
     if (res != 0) {
       perror("[vip_config] ");
     }
@@ -306,7 +294,7 @@
     } else if (pid > 0) {
       wait(&status);
     } else {                    /* Exec the remove */
-      int res = execl(binary, "ifconfig", interface, "inet", "0.0.0.0", NULL);
+      int res = execl(binary, "ifconfig", interface, "inet", "0.0.0.0", (char*)NULL);
       if (res != 0) {
         perror("[vip_confg] ");
       }
@@ -318,7 +306,7 @@
   } else {                      /* Exec the down */
     int res = 0;
     // don't down the inter on linux, it'll shutdown the driver
-    res = execl(binary, "ifconfig", interface, "down", NULL);
+    res = execl(binary, "ifconfig", interface, "down", (char*)NULL);
     if (res != 0) {
       perror("[vip_confg] ");
     }

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/EnvBlock.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/EnvBlock.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/EnvBlock.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/EnvBlock.cc Wed Feb 24 18:48:42 2010
@@ -22,12 +22,12 @@
  */
 
 /***************************************/
+#include "inktomi++.h"
 #include "ink_unused.h"  /* MAGIC_EDITING_TAG */
 
 #include "EnvBlock.h"
 #include "string.h"
 
-#include "inktomi++.h"
 
 EnvBlock::EnvBlock(void)
 {

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/IpLookup.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/IpLookup.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/IpLookup.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/IpLookup.cc Wed Feb 24 18:48:42 2010
@@ -216,7 +216,7 @@
   DynArray<ip_match_el> *array = (DynArray<ip_match_el> *)array_in;
   ip_match_el *cur;
   /* struct in_addr debug;  */
-  int j;
+  intptr_t j;
 
   for (j = s->array_slot + 1; j < array->length(); j++) {
     cur = &((*array)[j]);
@@ -393,7 +393,7 @@
   struct in_addr rangeStart;
   struct in_addr rangeEnd;
 
-  for (int j = 0; j < array->length(); j++) {
+  for (intptr_t j = 0; j < array->length(); j++) {
     cur = &((*array)[j]);
     ink_assert(cur != NULL);
     rangeStart.s_addr = htonl(cur->range_start);

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtConverter.cc Wed Feb 24 18:48:42 2010
@@ -26,13 +26,10 @@
  *
  ****************************************************************************/
 
-#include "ink_unused.h"     /* MAGIC_EDITING_TAG */
-
-#include "Compatability.h"
+#include "inktomi++.h"
 #include "MgmtConverter.h"
 #include "RecordsConfig.h"
 #include "Main.h"
-#include "ink_hash_table.h"
 #include "WebMgmtUtils.h"
 #include "CfgContextUtils.h"
 #include "CoreAPI.h"            // for testing

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtPing.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtPing.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtPing.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtPing.cc Wed Feb 24 18:48:42 2010
@@ -29,6 +29,8 @@
  * 
  */
 
+#include "ink_config.h"
+#include "ink_platform.h"
 #include "ink_unused.h"        /* MAGIC_EDITING_TAG */
 
 #include "MgmtPing.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtSchema.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtSchema.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtSchema.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtSchema.cc Wed Feb 24 18:48:42 2010
@@ -21,13 +21,10 @@
   limitations under the License.
  */
 
-#include "ink_unused.h"  /* MAGIC_EDITING_TAG */
-
-#include "Compatability.h"
+#include "inktomi++.h"
 #include "MgmtSchema.h"
 #include "RecordsConfig.h"
 #include "Main.h"
-#include "ink_hash_table.h"
 
 //********************************************************
 // XML Schema Validation

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtServerRPC.cc Wed Feb 24 18:48:42 2010
@@ -32,10 +32,9 @@
  *
  ****************************************************************************/
 
-#include "ink_unused.h"        /* MAGIC_EDITING_TAG */
-
-#include "ink_platform.h"
 #include "inktomi++.h"
+#include "ink_platform.h"
+#include "ink_unused.h"        /* MAGIC_EDITING_TAG */
 #include "ink_sock.h"
 
 #include "MgmtServerRPC.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtUtils.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtUtils.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtUtils.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/MgmtUtils.cc Wed Feb 24 18:48:42 2010
@@ -580,7 +580,7 @@
     mgmt_log(stderr, "[getAddrForIntr] Unable to obtain MTU for " "interface '%s'", ifr->ifr_name);
     return 0;
   } else
-#if (HOST_OS == sunos) || (HOST_OS == hpux)
+#if (HOST_OS == solaris) || (HOST_OS == hpux)
     return ifr->ifr_metric;
 #else
     return ifr->ifr_mtu;
@@ -662,7 +662,7 @@
         }
       }
     }
-#if (HOST_OS == freebsd)
+#if (HOST_OS == freebsd) || (HOST_OS == darwin)
     ifr = (struct ifreq *) ((char *) &ifr->ifr_addr + ifr->ifr_addr.sa_len);
 #else
     ifr = (struct ifreq *) (((char *) ifr) + sizeof(*ifr));

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.cc Wed Feb 24 18:48:42 2010
@@ -21,6 +21,8 @@
   limitations under the License.
  */
 
+#include "ink_config.h"
+#include "ink_platform.h"
 #include "ink_unused.h"    /* MAGIC_EDITING_TAG */
 #include "ink_assert.h"
 
@@ -49,7 +51,16 @@
 SimpleQueue::SimpleQueue()
 {
   ink_mutex_init(&accessLock, "SimpleQueue Lock");
+#if (HOST_OS == darwin)
+  static int qnum = 0;
+  char sname[NAME_MAX];
+  qnum++;
+  snprintf(sname,NAME_MAX,"%s%d","SimpleQueueLock",qnum);
+  ink_sem_unlink(sname); // FIXME: remove, semaphore should be properly deleted after usage
+  waitSema = ink_sem_open(sname, O_CREAT | O_EXCL, 0777, 0);
+#else /* !darwin */
   ink_sem_init(&waitSema, 0);
+#endif /* !darwin */
   head = NULL;
   tail = NULL;
 }
@@ -75,7 +86,11 @@
   }
 
   ink_mutex_destroy(&accessLock);
+#if (HOST_OS == darwin)
+  ink_sem_close(waitSema);
+#else
   ink_sem_destroy(&waitSema);
+#endif
 }
 
 //
@@ -91,8 +106,11 @@
   void *data;
 
   // Wait for something to be on the queue
+#if (HOST_OS == darwin)
+  ink_sem_wait(waitSema);
+#else
   ink_sem_wait(&waitSema);
-
+#endif
   ink_mutex_acquire(&accessLock);
 
   ink_assert(head != NULL && tail != NULL);
@@ -129,8 +147,11 @@
   void *data;
 
   // Wait for something to be on the queue
+#if (HOST_OS == darwin)
+  ink_sem_wait(waitSema);
+#else
   ink_sem_wait(&waitSema);
-
+#endif
   ink_mutex_acquire(&accessLock);
 
   ink_assert(head != NULL && tail != NULL);
@@ -182,7 +203,11 @@
   }
 
   ink_mutex_release(&accessLock);
+#if (HOST_OS == darwin)
+  ink_sem_post(waitSema);
+#else
   ink_sem_post(&waitSema);
+#endif
 }
 
 //

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/SimpleQueue.h Wed Feb 24 18:48:42 2010
@@ -58,7 +58,11 @@
   void Print();
 private:
     ink_mutex accessLock;
+#if (HOST_OS == darwin)
+  ink_sem *waitSema;
+#else
   ink_sem waitSema;
+#endif
   SimpleQueueEntry *head;
   SimpleQueueEntry *tail;
 };

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.cc Wed Feb 24 18:48:42 2010
@@ -21,17 +21,11 @@
   limitations under the License.
  */
 
-#include "ink_unused.h"        /* MAGIC_EDITING_TAG */
-/***************************************/
-
-#include "Compatability.h"
-#include "ink_bool.h"
+#include "inktomi++.h"
 #include "Main.h"
 #include "WebMgmtUtils.h"
 #include "BaseRecords.h"
-#include "Tokenizer.h"
 #include "RecordsConfig.h"
-#include "ink_regex-3.6.h"
 
 /****************************************************************************
  *

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/Makefile.am?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/Makefile.am (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/Makefile.am Wed Feb 24 18:48:42 2010
@@ -36,7 +36,6 @@
 DEFS  += $(MGMT_DEFS)
 
 noinst_LIBRARIES = libweb.a
-
 libweb_a_SOURCES = \
   MgmtAllow.cc \
   MgmtAllow.h \

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtAllow.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtAllow.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtAllow.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/MgmtAllow.cc Wed Feb 24 18:48:42 2010
@@ -28,6 +28,7 @@
  * 
  ****************************************************************************/
 
+#include "ink_config.h"
 #include "ink_platform.h"
 #include "MgmtAllow.h"
 #include "Main.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.cc Wed Feb 24 18:48:42 2010
@@ -28,6 +28,7 @@
  * 
  ****************************************************************************/
 
+#include "ink_config.h"
 #include "WebCompatibility.h"
 #include "MgmtSocket.h"
 

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebCompatibility.h Wed Feb 24 18:48:42 2010
@@ -57,12 +57,11 @@
 //-------------------------------------------------------------------------
 
 #if (HOST_OS == freebsd)
-extern "C"
-  struct hostent *gethostbyaddr_r(const char *addr, int length, int type,
-                                  struct hostent *result, char *buffer, int buflen, int *h_errnop);
+//extern "C" struct hostent *gethostbyaddr_r(const char *addr, int length, int type,
+//                                  struct hostent *result, char *buffer, int buflen, int *h_errnop);
 #endif
 
-#if (HOST_OS == sunos)
+#if (HOST_OS == solaris)
 extern "C"
 {
   struct hostent *gethostbyaddr_r(const char *addr,

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfig.cc Wed Feb 24 18:48:42 2010
@@ -29,10 +29,9 @@
  *
  ****************************************************************************/
 
-#include "ink_unused.h"       /* MAGIC_EDITING_TAG */
-
-#include "ink_platform.h"
 #include "inktomi++.h"
+#include "ink_platform.h"
+#include "ink_unused.h"       /* MAGIC_EDITING_TAG */
 
 #include "WebConfig.h"
 #include "WebGlobals.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebConfigRender.cc Wed Feb 24 18:48:42 2010
@@ -28,6 +28,7 @@
  * 
  ****************************************************************************/
 
+#include "ink_config.h"
 #include "ink_platform.h"
 
 #include "ink_hash_table.h"

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebGlobals.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebGlobals.h?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebGlobals.h (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebGlobals.h Wed Feb 24 18:48:42 2010
@@ -108,7 +108,11 @@
 {
   ink_mutex serviceThrLock;
   ink_mutex submitLock;
+#if (HOST_OS == darwin)
+  ink_sem *serviceThrCount;
+#else
   ink_sem serviceThrCount;
+#endif
   serviceThr_t *serviceThrArray;
   int webPort;
   ink_thread_key tmpFile;       // used by WebFileEdit.cc

Modified: incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc?rev=915922&r1=915921&r2=915922&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttp.cc Wed Feb 24 18:48:42 2010
@@ -29,10 +29,10 @@
  *
  ****************************************************************************/
 
+#include "inktomi++.h"
+#include "ink_platform.h"
 #include "ink_unused.h" /* MAGIC_EDITING_TAG */
 
-#include "ink_platform.h"
-#include "inktomi++.h"
 #include "SimpleTokenizer.h"
 
 #include "WebCompatibility.h"
@@ -3932,7 +3932,7 @@
 //  if (recs_out_of_date)
 //    goto Lout_of_date;
 
-#if (HOST_OS == linux) || (HOST_OS == sunos)
+#if (HOST_OS == linux) || (HOST_OS == solaris)
 
   InkHashTableIteratorState htis;
   InkHashTableEntry *hte;
@@ -6613,7 +6613,7 @@
 #if !defined(_WIN32)
   sigset_t sigsToBlock;
   // FreeBSD and Linux use SIGUSR1 internally in the threads library
-#if (HOST_OS != linux) && (HOST_OS != freebsd)
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin)
   // Set up the handler for SIGUSR1
   struct sigaction sigHandler;
   sigHandler.sa_handler = signal_handler_do_nothing;



Mime
View raw message