trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jplev...@apache.org
Subject svn commit: r897276 - in /incubator/trafficserver/traffic/branches/dev: ./ iocore/cache/ iocore/eventsystem/ iocore/net/ libinktomi++/ proxy/ proxy/config/ proxy/http2/remap/ proxy/mgmt2/ proxy/mgmt2/api2/ proxy/mgmt2/api2/include/ proxy/mgmt2/api2/rem...
Date Fri, 08 Jan 2010 17:47:09 GMT
Author: jplevyak
Date: Fri Jan  8 17:47:06 2010
New Revision: 897276

URL: http://svn.apache.org/viewvc?rev=897276&view=rev
Log:
TS-50: Part 1 of the FreeBSD port.
traffic_server proper works on file storage using libev on FreeBSD 8.
This corresponds to TS50_patch2.diff in jira.

Modified:
    incubator/trafficserver/traffic/branches/dev/configure.ac
    incubator/trafficserver/traffic/branches/dev/iocore/cache/Store.cc
    incubator/trafficserver/traffic/branches/dev/iocore/eventsystem/P_UnixEventProcessor.h
    incubator/trafficserver/traffic/branches/dev/iocore/net/UnixUDPNet.cc
    incubator/trafficserver/traffic/branches/dev/libinktomi++/Compatability.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/List.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/Regex.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_bool.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_hrtime.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_inet.cc
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_regex-3.6.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_string.cc
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_thread.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/ptrdef.h
    incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.cc
    incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.h
    incubator/trafficserver/traffic/branches/dev/proxy/Main.cc
    incubator/trafficserver/traffic/branches/dev/proxy/config/records.config.in
    incubator/trafficserver/traffic/branches/dev/proxy/http2/remap/UrlRewrite.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Alarms.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/LocalManager.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Main.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Makefile.am
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/CoreAPI.h
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/EventCallback.h
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/Makefile.am
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/include/INKMgmtAPI.h
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/CoreAPIRemote.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/EventRegistration.h
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/Makefile.am
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/ConfigCmd.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/Makefile.am
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/cli_scriptpaths.h
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cluster/VMap.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cop/TrafficCop.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/ConfigAPI.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/SysAPI.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/VIPConfig.cc
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/Makefile.am
    incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/WebCompatibility.h

Modified: incubator/trafficserver/traffic/branches/dev/configure.ac
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/configure.ac?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/configure.ac (original)
+++ incubator/trafficserver/traffic/branches/dev/configure.ac Fri Jan  8 17:47:06 2010
@@ -432,7 +432,15 @@
    ;;
 esac
 AC_SUBST([LIBTCL],[$TCL_LIB_FLAG])
-CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
+
+case $host_os in
+  freebsd*)
+    CPPFLAGS="$CPPFLAGS -I/usr/local/include $TCL_INCLUDE_SPEC"
+    ;;
+  *)         
+   CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC"
+   ;;
+esac
 
 AC_CHECK_LIB([expat],[XML_SetUserData],
   [AC_SUBST([LIBEXPAT],["-lexpat"])],

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/Store.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/Store.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/Store.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/Store.cc Fri Jan  8 17:47:06 2010
@@ -436,7 +436,7 @@
 #include <sys/mount.h>
 #if (HOST_OS == freebsd)
 #include <sys/disklabel.h>
-#include <sys/diskslice.h>
+//#include <sys/diskslice.h>
 #elif (HOST_OS == darwin)
 #include <sys/disk.h>
 #include <sys/statvfs.h>

Modified: incubator/trafficserver/traffic/branches/dev/iocore/eventsystem/P_UnixEventProcessor.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/eventsystem/P_UnixEventProcessor.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/eventsystem/P_UnixEventProcessor.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/eventsystem/P_UnixEventProcessor.h Fri Jan  8 17:47:06 2010
@@ -44,8 +44,8 @@
 inline off_t
 EventProcessor::allocate(int size)
 {
-  static off_t start = (offsetof(EThread, thread_private) + 7) & ~7;
-  static off_t loss = start - offsetof(EThread, thread_private);
+  static off_t start = (ink_offsetof(EThread, thread_private) + 7) & ~7;
+  static off_t loss = start - ink_offsetof(EThread, thread_private);
   size = (size + 7) & ~7;       // 8 byte alignment
 
   int old;

Modified: incubator/trafficserver/traffic/branches/dev/iocore/net/UnixUDPNet.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/net/UnixUDPNet.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/net/UnixUDPNet.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/net/UnixUDPNet.cc Fri Jan  8 17:47:06 2010
@@ -1172,8 +1172,8 @@
 UDPNetHandler::UDPNetHandler()
 {
   mutex = new_ProxyMutex();
-  ink_atomiclist_init(&udpOutQueue.atomicQueue, "Outgoing UDP Packet queue", offsetof(UDPPacketInternal, alink.next));
-  ink_atomiclist_init(&udpNewConnections, "UDP Connection queue", offsetof(UnixUDPConnection, newconn_alink.next));
+  ink_atomiclist_init(&udpOutQueue.atomicQueue, "Outgoing UDP Packet queue", ink_offsetof(UDPPacketInternal, alink.next));
+  ink_atomiclist_init(&udpNewConnections, "UDP Connection queue", ink_offsetof(UnixUDPConnection, newconn_alink.next));
   nextCheck = ink_get_hrtime_internal() + HRTIME_MSECONDS(1000);
   lastCheck = 0;
   SET_HANDLER((UDPNetContHandler) & UDPNetHandler::startNetEvent);

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/Compatability.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/Compatability.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/Compatability.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/Compatability.h Fri Jan  8 17:47:06 2010
@@ -245,6 +245,12 @@
 #define ink_mmap       mmap
 #define ink_sleep      sleep
 
+#if (HOST_OS == darwin)
+#define ink_offsetof(TYPE, MEMBER) (__builtin_offsetof (TYPE, MEMBER))
+#else
+#define ink_offsetof offsetof
+#endif
+
 #include "Resource.h"
 
 #endif

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/List.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/List.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/List.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/List.h Fri Jan  8 17:47:06 2010
@@ -60,6 +60,7 @@
 #include "ink_assert.h"
 #include "ink_queue.h"
 #include "ink_resource.h"
+#include "Compatability.h"
 
 //
 //      Link cell for singly-linked list of objects of type C.
@@ -102,7 +103,7 @@
   SLL() : head(NULL) {}
   SLL(C *c) : head(c) {}
 };
-#define SList(_c, _f)  SLL<_c, offsetof(_c, _f)>
+#define SList(_c, _f)  SLL<_c, ink_offsetof(_c, _f)>
 #define forl_LL(_c, _p, _l) for (_c *_p = (_l).head; _p; _p = (_l).next_link(_p))
 
 template<class C, int o> inline void 
@@ -179,7 +180,7 @@
 
   DLL() : head(NULL) {}
 };
-#define DList(_c, _f)  DLL<_c, offsetof(_c, _f)>
+#define DList(_c, _f)  DLL<_c, ink_offsetof(_c, _f)>
 
 template<class C, int o> inline void 
 DLL<C,o>::push(C *c, Link<C> &l)
@@ -332,7 +333,7 @@
   
   Queue() : tail(NULL) {}
 };
-#define Que(_c, _f) Queue<_c, offsetof(_c, _f)>
+#define Que(_c, _f) Queue<_c, ink_offsetof(_c, _f)>
 
 template <class C, int o> inline void 
 Queue<C, o>::push(C * c, Link<C> &l) {
@@ -593,7 +594,7 @@
     }
   }
 };
-#define SortableQue(_c, _l) SortableQueue<_c, offsetof(_c, _l)>
+#define SortableQue(_c, _l) SortableQueue<_c, ink_offsetof(_c, _l)>
 
 //////////////////////////////////////////////////////////////////////////////
 //
@@ -762,7 +763,7 @@
   AtomicSLL(C * c, SLink<C> *l);
 };
 
-#define ASLL(_c, _l) AtomicSLL<_c, offsetof(_c, _l)>
+#define ASLL(_c, _l) AtomicSLL<_c, ink_offsetof(_c, _l)>
 
 template<class C, int o> inline SLink<C> &AtomicSLL<C,o>::link(C * x, C * c, SLink<C> &cl) {
   return *(SLink<C> *)(((char *) x) + (((char *) &cl) - ((char *) c)));

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/Regex.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/Regex.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/Regex.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/Regex.h Fri Jan  8 17:47:06 2010
@@ -21,8 +21,12 @@
   limitations under the License.
  */
 
-#ifndef __REGEX_H__
-#define __REGEX_H__
+#ifndef __TS_REGEX_H__
+#define __TS_REGEX_H__
+
+#if (HOST_OS == darwin) // FIXME: includes case sensitve(?)
+#include </usr/include/regex.h>
+#endif
 
 /*
   regular expression rules:
@@ -95,4 +99,4 @@
 };
 
 
-#endif /* __REGEX_H__ */
+#endif /* __TS_REGEX_H__ */

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_bool.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ink_bool.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_bool.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_bool.h Fri Jan  8 17:47:06 2010
@@ -46,8 +46,10 @@
  * bool, true, and false already declared in C++
  */
 #if !defined (bool)
+#if (HOST_OS != freebsd)
 #define bool int
 #endif
+#endif
 
 #if !defined (true)
 #define true 1

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_hrtime.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ink_hrtime.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_hrtime.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_hrtime.h Fri Jan  8 17:47:06 2010
@@ -48,11 +48,6 @@
 typedef hrtime_t ink_hrtime;
 #endif
 
-#if (HOST_OS == freebsd)
-#define NEED_HRTIME_BASIS
-#define USE_TIME_STAMP_COUNTER_HRTIME
-#endif
-
 
 //////////////////////////////////////////////////////////////////////////////
 //

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_inet.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ink_inet.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_inet.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_inet.cc Fri Jan  8 17:47:06 2010
@@ -26,7 +26,7 @@
 
 #include "ParseRules.h"
 
-#if (HOST_OS == freebsd) || (HOST_OS == darwin)
+#if (HOST_OS == darwin)
 extern "C"
 {
   struct hostent *gethostbyname_r(const char *name, struct hostent *result, char *buffer, int buflen, int *h_errnop);

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_regex-3.6.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ink_regex-3.6.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_regex-3.6.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_regex-3.6.h Fri Jan  8 17:47:06 2010
@@ -21,9 +21,9 @@
   limitations under the License.
  */
 
-#if (HOST_OS != linux)
-#ifndef _REGEX_H_
-#define	_REGEX_H_               /* never again */
+#if (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != sunos)
+#ifndef _INK_REGEX_H_
+#define	_INK_REGEX_H_               /* never again */
 /* ========= begin header generated by ./mkh ========= */
 #ifdef __cplusplus
 extern "C"
@@ -98,7 +98,7 @@
 }
 #endif
 /* ========= end header generated by ./mkh ========= */
-#endif                          /* #ifndef _REGEX_H_ */
-#else
+#endif                          /* #ifndef _INK_REGEX_H_ */
+#else /* linux || freebsd || darwin || sunos */
 #include "regex.h"
-#endif  // not linux
+#endif  /* (HOST_OS != linux) && (HOST_OS != freebsd) && (HOST_OS != darwin) && (HOST_OS != sunos) */

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_string.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ink_string.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_string.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_string.cc Fri Jan  8 17:47:06 2010
@@ -424,10 +424,15 @@
 
   inbytesleft = inlen;
   outbytesleft = *outlen;
-  if (iconv(ic, (char **) &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1) {
-    iconv_close(ic);
-    goto strip;
-  }
+#if (HOST_OS == freebsd)
+  if (iconv(ic, &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1) 
+#else
+  if (iconv(ic, (char **) &in, &inbytesleft, &out, &outbytesleft) == (size_t) - 1) 
+#endif
+    {
+      iconv_close(ic);
+      goto strip;
+    }
 
   *outlen -= outbytesleft;
   iconv_close(ic);

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_thread.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ink_thread.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_thread.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ink_thread.h Fri Jan  8 17:47:06 2010
@@ -274,7 +274,11 @@
 {
   int err;
   while (EINTR == (err = pthread_cond_timedwait(cp, mp, t)));
+#if (HOST_OS == freebsd)
+  ink_assert((err == 0) || (err == ETIMEDOUT));
+#else
   ink_assert((err == 0) || (err == ETIME) || (err == ETIMEDOUT));
+#endif
   return err;
 }
 

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/ptrdef.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/ptrdef.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/ptrdef.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/ptrdef.h Fri Jan  8 17:47:06 2010
@@ -43,7 +43,11 @@
 #error "Invalid __WORDSIZE!"
 #endif  /* #if (__WORDSIZE == 64) || (__WORDSIZE == 32) */
 #else   /*  */
+#ifdef _LP64
+ typedef long long int_pointer;
+#else
 #error "__WORDSIZE not defined!"
+#endif
 #endif  /* #ifdef __WORDSIZE  */
   
 #endif  /* #ifndef H_PTRDEF_H */

Modified: incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.cc Fri Jan  8 17:47:06 2010
@@ -130,7 +130,7 @@
 int program_counter = 0;
 #endif  // linux check
 
-#if (HOST_OS == darwin)
+#if (HOST_OS == darwin) || (HOST_OS == freebsd)
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -1141,7 +1141,11 @@
 
     // This is not 64-bit correct. /leif
     printf("----------- EThread @ 0x%p ----------\n", eth_test);
-    printf("   thread_id: %d\n", (int) loaded_eth->tid);
+#if (HOST_OS == freebsd) 
+    printf("   thread_id: %p\n", loaded_eth->tid);
+#else
+    printf("   thread_id: %i\n", (int) loaded_eth->tid);
+#endif
     //    printf("   NetHandler: 0x%x\n\n", (int) loaded_eth->netHandler);
   }
 

Modified: incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/CoreUtils.h Fri Jan  8 17:47:06 2010
@@ -82,7 +82,7 @@
 };
 #endif  // linux check
 
-#if (HOST_OS == darwin)
+#if (HOST_OS == darwin) || (HOST_OS == freebsd)
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>

Modified: incubator/trafficserver/traffic/branches/dev/proxy/Main.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/Main.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/Main.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/Main.cc Fri Jan  8 17:47:06 2010
@@ -46,7 +46,7 @@
 #include <sys/filio.h>
 #endif
 #include <syslog.h>
-#if (HOST_OS != darwin)
+#if (HOST_OS != darwin) && (HOST_OS != freebsd)
 #include <mcheck.h>
 #endif
 
@@ -1518,8 +1518,11 @@
 {
   struct passwd pwbuf;
   struct passwd *pwbufp = NULL;
+#if (HOST_OS == freebsd) // TODO: investigate sysconf(_SC_GETPW_R_SIZE_MAX)) failure
+  long buflen = 1024; // or 4096?
+#else
   long buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-
+#endif
   if (buflen < 0) {
     ink_fatal_die("sysconf() failed for _SC_GETPW_R_SIZE_MAX");
   }

Modified: incubator/trafficserver/traffic/branches/dev/proxy/config/records.config.in
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/config/records.config.in?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/config/records.config.in (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/config/records.config.in Fri Jan  8 17:47:06 2010
@@ -425,7 +425,7 @@
 #
 ##############################################################################
 CONFIG proxy.config.cluster.cluster_port INT 8086
-CONFIG proxy.config.cluster.ethernet_interface STRING en0
+CONFIG proxy.config.cluster.ethernet_interface STRING eth0
 ##############################################################################
 #
 # Cache

Modified: incubator/trafficserver/traffic/branches/dev/proxy/http2/remap/UrlRewrite.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/http2/remap/UrlRewrite.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/http2/remap/UrlRewrite.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/http2/remap/UrlRewrite.cc Fri Jan  8 17:47:06 2010
@@ -2471,7 +2471,11 @@
     Debug("remap_plugin", "New remap plugin info created for \"%s\"", c);
 
     if ((pi->dlh = dlopen(c, RTLD_NOW)) == NULL) {
+#if (HOST_OS == freebsd)
+      err = (char *)dlerror();
+#else
       err = dlerror();
+#endif
       ink_snprintf(errbuf, errbufsize, "Can't load plugin \"%s\" - %s", c, err ? err : "Unknown dlopen() error");
       return -4;
     }

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Alarms.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Alarms.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Alarms.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Alarms.cc Fri Jan  8 17:47:06 2010
@@ -635,9 +635,17 @@
   } else {
     int res;
     if (alarm_email_from_name && alarm_email_from_addr && alarm_email_to_addr) {
+#if (HOST_OS == freebsd)
+      res = execl(cmd_line, alarm_bin, desc, alarm_email_from_name, alarm_email_from_addr, alarm_email_to_addr, (char *)0);
+#else
       res = execl(cmd_line, alarm_bin, desc, alarm_email_from_name, alarm_email_from_addr, alarm_email_to_addr, NULL);
+#endif
     } else {
+#if (HOST_OS == freebsd)
+      res = execl(cmd_line, alarm_bin, desc, (char *)0);
+#else
       res = execl(cmd_line, alarm_bin, desc, NULL);
+#endif
     }
     _exit(res);
   }

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/LocalManager.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/LocalManager.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/LocalManager.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/LocalManager.cc Fri Jan  8 17:47:06 2010
@@ -1136,8 +1136,11 @@
           Debug("lm-filter", "[LocalManager::startProxy] " "%s execution completed\n", absolute_convert_binary);
         }
       } else {                  // invoke the converter script - no args
-        int res = execl(absolute_convert_binary,
-                        convert_bin, NULL, NULL);
+#if (HOST_OS == freebsd)
+        int res = execl(absolute_convert_binary, convert_bin, NULL, (char *)0);
+#else
+        int res = execl(absolute_convert_binary, convert_bin, NULL, NULL);
+#endif
         if (res < 0) {
           mgmt_elog(stderr, "[LocalManager::startProxy] "
                     "%s failed to execute successfully.", absolute_convert_binary);
@@ -1202,7 +1205,11 @@
       char env_prep_bin[1024];
 
       snprintf(env_prep_bin, sizeof(env_prep_bin), "%s/%s", bin_path, env_prep);
+#if (HOST_OS == freebsd)
+      res = execl(env_prep_bin, env_prep, (char *)0);
+#else
       res = execl(env_prep_bin, env_prep, NULL);
+#endif
       _exit(res);
     }
   }

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Main.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Main.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Main.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Main.cc Fri Jan  8 17:47:06 2010
@@ -76,7 +76,7 @@
 #endif
 
 
-#if (HOST_OS != linux) && (HOST_OS != darwin)
+#if (HOST_OS != linux) && (HOST_OS != darwin) && (HOST_OS != freebsd)
 extern "C"
 {
   int gethostname(char *name, int namelen);

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Makefile.am?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/Makefile.am Fri Jan  8 17:47:06 2010
@@ -95,9 +95,9 @@
   cluster/libcluster.a \
   preparse/libpreparse.a \
   stats/libstats.a \
-  web2/libweb.la \
+  web2/libweb.a \
   cli/libcli_lm.a \
-  api2/libmgmtapilocal.la \
+  api2/libmgmtapilocal.a \
   utils/libutils_lm.a \
   $(top_builddir)/proxy/hdrs/libhdrs.a \
   $(top_builddir)/librecords/libreclocal.a \

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/CoreAPI.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/CoreAPI.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/CoreAPI.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/CoreAPI.h Fri Jan  8 17:47:06 2010
@@ -35,6 +35,11 @@
 #include "CfgContextDefs.h"
 #include "Tokenizer.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 INKError Init(char *socket_path = NULL);
 INKError Terminate();
 
@@ -154,4 +159,8 @@
 void RmReadCfgList(Tokenizer * Tp, tok_iter_state * Tstate, char **, INKRmServerListT ListType);
 INKError WriteRmCfgFile(char *text);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/EventCallback.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/EventCallback.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/EventCallback.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/EventCallback.h Fri Jan  8 17:47:06 2010
@@ -59,6 +59,10 @@
   ink_mutex event_callback_lock;
 } CallbackTable;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
 
 EventCallbackT *create_event_callback(INKEventSignalFunc func, void *data);
 void delete_event_callback(EventCallbackT * event_cb);
@@ -74,4 +78,8 @@
                            bool * first_cb);
 INKError cb_table_unregister(CallbackTable * cb_table, char *event_name, INKEventSignalFunc func);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/Makefile.am?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/Makefile.am Fri Jan  8 17:47:06 2010
@@ -22,9 +22,8 @@
 MGMT_DEFS = @MGMT_DEFS@
 DEFS += $(MGMT_DEFS)
 
-#noinst_LIBRARIES = libmgmtapilocal.a
-lib_LTLIBRARIES = libmgmtapilocal.la
-libmgmtapilocal_la_SOURCES = \
+noinst_LIBRARIES = libmgmtapilocal.a
+libmgmtapilocal_a_SOURCES = \
   include/INKMgmtAPI.h \
   CfgContextDefs.h \
   CfgContextImpl.cc \

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/include/INKMgmtAPI.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/include/INKMgmtAPI.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/include/INKMgmtAPI.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/include/INKMgmtAPI.h Fri Jan  8 17:47:06 2010
@@ -57,8 +57,8 @@
 
 #if defined (__SUNPRO_CC) || (defined (__GNUC__) || ! defined(__cplusplus))
 
-#if (HOST_OS != darwin)
 #if !defined (bool)
+#if (HOST_OS != darwin) && (HOST_OS != freebsd)
 #define bool int
 #endif
 #endif

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/CoreAPIRemote.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/CoreAPIRemote.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/CoreAPIRemote.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/CoreAPIRemote.cc Fri Jan  8 17:47:06 2010
@@ -310,7 +310,7 @@
   // do this last so that everything else on client side is set up even if 
   // connection fails; this might happen if client is set up and running 
   // before TM
-  err = connect();
+  err = ts_connect();
   if (err != INK_ERR_OKAY)
     goto END;
 

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/EventRegistration.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/EventRegistration.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/EventRegistration.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/EventRegistration.h Fri Jan  8 17:47:06 2010
@@ -35,10 +35,18 @@
 #include <stdio.h>
 
 #ifndef _WIN32
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
 
 void *event_callback_thread(void *arg);
 void *event_poll_thread_main(void *arg);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* !_WIN32 */
 
 #endif /* _EVENT_REGISTRATION_H */

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/Makefile.am?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/Makefile.am Fri Jan  8 17:47:06 2010
@@ -17,14 +17,10 @@
 MGMT_DEFS = @MGMT_DEFS@
 DEFS  += $(MGMT_DEFS)
 
-##noinst_LIBRARIES = libmgmtapiremote.la 
-##noinst_LTLIBRARIES = libmgmtapiremote.la 
-
 bin_PROGRAMS = api_cli_remote
 
-lib_LTLIBRARIES = libmgmtapiremote.la
-#libmgmtapiremote_la_LDFLAGS = -static
-libmgmtapiremote_la_SOURCES = \
+noinst_LIBRARIES = libmgmtapiremote.a 
+libmgmtapiremote_a_SOURCES = \
   ../CfgContextImpl.cc \
   ../CfgContextManager.cc \
   ../CfgContextUtils.cc \
@@ -40,7 +36,7 @@
 
 api_cli_remote_SOURCES = APITestCliRemote.cc 
 api_cli_remote_LDADD = \
-  libmgmtapiremote.la \
+  libmgmtapiremote.a \
   $(top_builddir)/libinktomi++/libinktomi++.a \
   @LIBTHREAD@ @LIBSOCKET@ @LIBNSL@ @LIBRESOLV@ \
   @LIBTCL@ @LIBDB@ @LIBRT@ @LIBDL@ @LIBSSL@ @LIBICONV@

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.cc Fri Jan  8 17:47:06 2010
@@ -140,7 +140,7 @@
  *        goes back to just sitting and listening for connection.
  ***************************************************************************/
 INKError
-connect()
+ts_connect()
 {
   struct sockaddr_un client_sock;
   struct sockaddr_un client_event_sock;
@@ -255,7 +255,7 @@
   // use the socket_path that was called by remote client on first init
   // use connect instead of INKInit() b/c if TM restarted, client-side tables 
   // would be recreated; just want to reconnect to same socket_path
-  err = connect();
+  err = ts_connect();
   if (err != INK_ERR_OKAY)      // problem establishing connection
     return err;
 

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/api2/remote/NetworkUtilsRemote.h Fri Jan  8 17:47:06 2010
@@ -42,6 +42,11 @@
 #include "NetworkUtilsDefs.h"
 #include "EventCallback.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 /**********************************************************************
  * Socket Helper Functions
  **********************************************************************/
@@ -52,7 +57,7 @@
  * the client connection information stored in the variables in 
  * NetworkUtilsRemote.cc 
  */
-INKError connect();
+INKError ts_connect(); /* TODO: update documenation, Renamed due to conflict with connect() in <sys/socket.h> on some platforms*/
 INKError disconnect();
 INKError reconnect();
 INKError reconnect_loop(int num_attempts);
@@ -95,4 +100,8 @@
 INKError parse_event_active_reply(int fd, bool * is_active);
 INKError parse_event_notification(int fd, INKEvent * event);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/ConfigCmd.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/ConfigCmd.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/ConfigCmd.cc Fri Jan  8 17:47:06 2010
@@ -5149,7 +5149,7 @@
     char domain[256];
     char resolventry[256];
 
-#if (HOST_OS == linux) || (HOST_OS == darwin)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd)
     if (getdomainname(domain, 256) == -1)
       return CLI_ERROR;
     snprintf((char *) &resolventry, sizeof(resolventry), "domain %s\nnameserver %s\n", domain, nameserver);
@@ -5181,7 +5181,7 @@
 getrouter(char *router, int len)
 {
   FILE *fstr;
-#if (HOST_OS == linux) || (HOST_OS == darwin)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd)
   char buff[256];
   char *p;
 
@@ -5230,11 +5230,13 @@
 #define interface_name "eth0"
 #elif (HOST_OS == darwin)
 #define interface_name "en0"
+#elif (HOST_OS == freebsd)
+#define interface_name "eth0"
 #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)
@@ -5258,7 +5260,7 @@
     fprintf(stderr, "me lines over %d characters long.\n", BUFFLEN);
     goto err;
   }
-#if (HOST_OS == linux) || (HOST_OS == darwin)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd)
   p = pos_after_string(buff, "inet addr:");
 #endif
 
@@ -6325,7 +6327,7 @@
   int find = 0;
   int counter = 0;
 
-#if (HOST_OS == linux) || (HOST_OS == darwin)
+#if (HOST_OS == linux) || (HOST_OS == darwin) || (HOST_OS == freebsd)
   ink_strncpy(value, "", value_len);
   // coverity[fs_check_call]
   if (access(pathname, R_OK)) {

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/Makefile.am?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/Makefile.am Fri Jan  8 17:47:06 2010
@@ -32,9 +32,8 @@
   hashtable.h \
   ShowCmd.h
 
-#noinst_LIBRARIES = libtrafficshell.a
-lib_LTLIBRARIES = libtrafficshell.la
-libtrafficshell_la_SOURCES = \
+noinst_LIBRARIES = libtrafficshell.a
+libtrafficshell_a_SOURCES = \
   CliCreateCommands.cc \
   CliCreateCommands.h \
   CliCreateUpgradeCmd.cc \
@@ -66,19 +65,16 @@
 traffic_shell_LDFLAGS =	$(EXTRA_CXX_LDFLAGS)
 
 traffic_shell_LDADD = \
-  $(top_builddir)/proxy/mgmt2/api2/remote/libmgmtapiremote.la \
-  $(LIBTCL) \
-  $(top_builddir)/libinktomi++/libinktomi++.a \
-  libtrafficshell.la \
+  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 \
-  -ldl \
-  -lm \
+  $(top_builddir)/libinktomi++/libinktomi++.a \
+  $(LIBTCL) \
+  @LIBDL@ \
+  @LIBM@ \
+  @LIBICONV@ \
   @LIBEXPAT@ @LIBSSL@ \
   @LIBTHREAD@ @LIBSOCKET@ @LIBNSL@ @LIBRESOLV@ \
   @LIBRT@
-
-#libtrafficshell_la_LIBADD = \
-#  $(libtrafficshell_la_OBJECTS) \
-#  $(libtrafficshell_la_DEPENDENCIES)

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/cli_scriptpaths.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/cli_scriptpaths.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/cli_scriptpaths.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cli2/cli_scriptpaths.h Fri Jan  8 17:47:06 2010
@@ -56,6 +56,9 @@
 #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"
@@ -110,6 +113,8 @@
 #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/branches/dev/proxy/mgmt2/cluster/VMap.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cluster/VMap.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cluster/VMap.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cluster/VMap.cc Fri Jan  8 17:47:06 2010
@@ -1091,8 +1091,10 @@
     interface = ((VIPInfo *) hash_value)->interface;
     sub_id = ((VIPInfo *) hash_value)->sub_interface_id;
 
-#if (HOST_OS == linux) || (HOST_OS == freebsd)
+#if (HOST_OS == linux)
     res = execl(absolute_vipconf_binary, vip_conf, "up", virt_ip, "/sbin/ifconfig", interface, sub_id, NULL);
+#elif (HOST_OS == freebsd)
+    res = execl(absolute_vipconf_binary, vip_conf, "up", virt_ip, "/sbin/ifconfig", interface, sub_id, (char *)0);
 #else
     res = execl(absolute_vipconf_binary, vip_conf, "up", virt_ip, "/usr/sbin/ifconfig", interface, sub_id, NULL);
 #endif
@@ -1147,8 +1149,10 @@
     interface = ((VIPInfo *) hash_value)->interface;
     sub_id = ((VIPInfo *) hash_value)->sub_interface_id;
 
-#if (HOST_OS == linux) || (HOST_OS == freebsd)
+#if (HOST_OS == linux)
     res = execl(absolute_vipconf_binary, vip_conf, "down", virt_ip, "/sbin/ifconfig", interface, sub_id, NULL);
+#elif (HOST_OS == freebsd)
+    res = execl(absolute_vipconf_binary, vip_conf, "down", virt_ip, "/sbin/ifconfig", interface, sub_id, (char *)0);
 #else
     res = execl(absolute_vipconf_binary, vip_conf, "down", virt_ip, "/usr/sbin/ifconfig", interface, sub_id, NULL);
 #endif

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cop/TrafficCop.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cop/TrafficCop.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/cop/TrafficCop.cc Fri Jan  8 17:47:06 2010
@@ -2357,7 +2357,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/branches/dev/proxy/mgmt2/tools/ConfigAPI.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/ConfigAPI.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/ConfigAPI.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/ConfigAPI.cc Fri Jan  8 17:47:06 2010
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-#if (HOST_OS == linux) || (HOST_OS == sunos)
+#if (HOST_OS == linux) || (HOST_OS == sunos) || (HOST_OS == freebsd) || (HOST_OS == darwin)
 
 #include "ConfigAPI.h"
 #include "SysAPI.h"
@@ -64,27 +64,29 @@
 int
 Config_GetHostname(char *hostname, size_t hostname_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   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)
   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) {
@@ -118,7 +120,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"));
@@ -144,21 +145,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
@@ -172,11 +177,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;
   }
@@ -195,19 +197,25 @@
     }
     return -1;
   }
+#endif /* !freebsd && !darwin */
   return status;
 }
 
 int
 Config_GetDomain(char *domain, size_t domain_len)
 {
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   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));
@@ -233,29 +241,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)
   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;
@@ -267,7 +279,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"));
@@ -275,74 +286,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)
   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)
   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)
   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)
   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;
@@ -355,6 +403,7 @@
   if (status) {
     DPRINTF(("Config_SetNIC_down: falied to config TS for SetNIC_Down\n"));
   }
+#endif /* !freebsd && !darwin */
   return status;
 }
 
@@ -366,8 +415,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
@@ -377,48 +429,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;
@@ -463,7 +529,7 @@
       return -1;
     }
   }
-
+#endif /* !freebsd && !darwin */
   return status;
 }
 
@@ -471,105 +537,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)
   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)
   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)
   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)
   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)
   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)
   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)
   status = Time_GetNTP_Server(server, server_len, no);
+#endif
   return status;
 }
 
@@ -637,42 +714,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)
   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)
@@ -773,7 +874,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
@@ -828,7 +929,7 @@
       xfree(trap_community);
     if (trap_host != NULL)
       xfree(trap_host);
-#endif
+#endif /* linux */
 
     // Get Admin GUI encrypted password.
     char *e_gui_passwd;
@@ -868,9 +969,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);
@@ -890,7 +995,7 @@
   //char ethXNM[24];
   //char ethXGW[24];
   XMLDom netConfigXML;
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   netConfigXML.setNodeName("APPLIANCE_CONFIG");
 
   XMLNode *child2 = new XMLNode;
@@ -1117,7 +1222,7 @@
     SNMPinfo->setNodeValue(trap_host);
     child->AppendChild(SNMPinfo);
   }
-#endif
+#endif /* linux */
 
   XMLNode *child1 = new XMLNode;
   char *parentAttributes1[3];
@@ -1158,7 +1263,7 @@
   netConfigXML.AppendChild(child);
   netConfigXML.AppendChild(child1);
   netConfigXML.SaveToFile(file);
-
+#endif /* !freebsd && !darwin */
   return 0;
 }
 
@@ -1231,13 +1336,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
 }
 
 
@@ -1264,10 +1377,12 @@
       return 1;
     }
   } else {
-    int res = execl(net_floppy_config,
-                    "net_floppy_config",
-                    "done",
-                    NULL);
+
+#if (HOST_OS == freebsd) || (HOST_OS == darwin)
+    int res = execl(net_floppy_config,"net_floppy_config","done",(char *)0);
+#else
+    int res = execl(net_floppy_config,"net_floppy_config","done",NULL);
+#endif
     return res;
   }
 
@@ -1341,10 +1456,11 @@
       return 1;
     }
   } else {
-    int res = execl(net_floppy_config,
-                    "net_floppy_config",
-                    "do",
-                    NULL);
+#if (HOST_OS == freebsd) || (HOST_OS == darwin)
+    int res = execl(net_floppy_config,"net_floppy_config","do", (char *)0);
+#else
+    int res = execl(net_floppy_config,"net_floppy_config","do", NULL);
+#endif
     return res;
   }
 
@@ -1414,4 +1530,4 @@
 
 }
 
-#endif
+#endif /* (HOST_OS == linux) || (HOST_OS == sunos) || (HOST_OS == freebsd) || (HOST_OS == darwin) */

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/SysAPI.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/SysAPI.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/SysAPI.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/SysAPI.cc Fri Jan  8 17:47:06 2010
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-#if (HOST_OS == linux)
+#if (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == darwin)
 
 #include "SysAPI.h"
 #include <stdio.h>
@@ -604,12 +604,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));
 }
 
@@ -617,8 +617,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));
@@ -626,26 +626,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)
   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)
   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));
@@ -654,6 +660,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
@@ -726,7 +735,7 @@
   return status;
 }
 
-#endif
+#endif /* linux */
 
 
 int
@@ -1008,6 +1017,7 @@
   return 0;
 }
 
+
 bool
 recordRegexCheck(const char *pattern, const char *value)
 {
@@ -1583,7 +1593,11 @@
     }
   } else {
     int res;
+#if (HOST_OS ==freebsd) || (HOST_OS == darwin)
+    res = execl(mv_binary, "mv", snmp_path_new, snmp_path, (char *)0);
+#else
     res = execl(mv_binary, "mv", snmp_path_new, snmp_path, NULL);
+#endif
     if (res != 0) {
       DPRINTF(("[SysAPI] mv of new snmp cfg file failed\n"));
     }
@@ -1596,7 +1610,11 @@
     wait(&status);
   } else {
     int res;
+#if (HOST_OS == freebsd) || (HOST_OS == darwin)
+    res = execl(mv_binary, "mv", ts_snmp_path_new, ts_snmp_path, (char *)0);
+#else
     res = execl(mv_binary, "mv", ts_snmp_path_new, ts_snmp_path, NULL);
+#endif
     if (res != 0) {
       DPRINTF(("[SysAPI] mv of new ts_snmp cfg file failed\n"));
     }
@@ -1651,7 +1669,11 @@
       wait(&status);
     } else {
       int res;
+#if (HOST_OS == freebsd) || (HOST_OS == darwin)
+      res = execl(mv_binary, "mv", snmp_pass_new, snmp_pass, (char *)0);
+#else
       res = execl(mv_binary, "mv", snmp_pass_new, snmp_pass, NULL);
+#endif
       if (res != 0) {
         DPRINTF(("[SysAPI] mv of new snmpass.sh file failed\n"));
       }
@@ -1821,7 +1843,7 @@
   return 0;
 }
 
-#endif
+#endif /* (HOST_OS == linux) || (HOST_OS == freebsd) || (HOST_OS == darwin) */
 
 #if (HOST_OS == sunos)
 
@@ -2577,13 +2599,16 @@
 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);
   Net_GetNIC_IP(interface, nic_ip);
   Net_GetNIC_Netmask(interface, 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
@@ -2591,7 +2616,7 @@
 {
   //int status;
   char nic_boot[80], nic_protocol[80], nic_netmask[80], nic_gateway[80], old_ip[80];
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   Net_GetNIC_IP(interface, old_ip);
   Net_GetNIC_Start(interface, nic_boot);
   Net_GetNIC_Protocol(interface, nic_protocol);
@@ -2599,33 +2624,43 @@
   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)
 {
   char nic_boot[80], nic_protocol[80], nic_ip[80], nic_gateway[80];
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   Net_GetNIC_Start(interface, nic_boot);
   Net_GetNIC_Protocol(interface, nic_protocol);
   Net_GetNIC_IP(interface, 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)
 {
   char nic_boot[80], nic_protocol[80], nic_ip[80], nic_netmask[80];
-
+#if (HOST_OS != freebsd) && (HOST_OS != darwin)
   Net_GetNIC_Start(interface, nic_boot);
   Net_GetNIC_Protocol(interface, nic_protocol);
   Net_GetNIC_IP(interface, nic_ip);
   Net_GetNIC_Netmask(interface, 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
@@ -3303,4 +3338,4 @@
   return 0;
 }
 
-#endif
+#endif /* (HOST_OS == sunos) */

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/VIPConfig.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/VIPConfig.cc?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/VIPConfig.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/tools/VIPConfig.cc Fri Jan  8 17:47:06 2010
@@ -222,7 +222,11 @@
     } else if (pid > 0) {
       wait(&status);
     } else {                    /* Exec the up */
+#if (HOST_OS == freebsd)
+      int res = execl(binary, "ifconfig", interface, "up", (char *)0);
+#else
       int res = execl(binary, "ifconfig", interface, "up", NULL);
+#endif
       if (res != 0) {
         perror("[vip_confg] ");
       }
@@ -235,7 +239,11 @@
 
 // "netmask +" is broken on Solaris 2.6 & 2.7,
 // it never actually checks against /etc/netmasks.
+#if (HOST_OS == freebsd)
+    int res = execl(binary, "ifconfig", interface, vip, "netmask", "+", "broadcast", "+", "metric", "1", (char *)0);
+#else
     int res = execl(binary, "ifconfig", interface, vip, "netmask", "+", "broadcast", "+", "metric", "1", NULL);
+#endif
     if (res != 0) {
       perror("[vip_config] ");
     }
@@ -306,7 +314,11 @@
     } else if (pid > 0) {
       wait(&status);
     } else {                    /* Exec the remove */
+#if (HOST_OS == freebsd)
+      int res = execl(binary, "ifconfig", interface, "inet", "0.0.0.0", (char *)0);
+#else
       int res = execl(binary, "ifconfig", interface, "inet", "0.0.0.0", NULL);
+#endif
       if (res != 0) {
         perror("[vip_confg] ");
       }
@@ -318,7 +330,11 @@
   } else {                      /* Exec the down */
     int res = 0;
     // don't down the inter on linux, it'll shutdown the driver
+#if (HOST_OS == freebsd)
+    res = execl(binary, "ifconfig", interface, "down", (char *)0);
+#else
     res = execl(binary, "ifconfig", interface, "down", NULL);
+#endif
     if (res != 0) {
       perror("[vip_confg] ");
     }

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/Makefile.am?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/Makefile.am Fri Jan  8 17:47:06 2010
@@ -20,9 +20,8 @@
 MGMT_DEFS = @MGMT_DEFS@
 DEFS  += $(MGMT_DEFS)
 
-#noinst_LIBRARIES = libweb.a
-lib_LTLIBRARIES = libweb.la
-libweb_la_SOURCES = \
+noinst_LIBRARIES = libweb.a
+libweb_a_SOURCES = \
   MgmtAllow.cc \
   MgmtAllow.h \
   MgmtRaf.h \

Modified: incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/WebCompatibility.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/WebCompatibility.h?rev=897276&r1=897275&r2=897276&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/WebCompatibility.h (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/mgmt2/web2/WebCompatibility.h Fri Jan  8 17:47:06 2010
@@ -57,9 +57,8 @@
 //-------------------------------------------------------------------------
 
 #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)



Mime
View raw message