FIxed to compiler on HPUX main
authormike <mike>
Wed, 18 Jul 2001 16:39:27 +0000 (16:39 +0000)
committermike <mike>
Wed, 18 Jul 2001 16:39:27 +0000 (16:39 +0000)
doc/todo.txt
src/Clients/TestClient/TestClient.cpp
src/Pegasus/Common/Logger.cpp
src/slp/slp.cpp

index 675350570739d941cf00901c2c65caa0ee9a6d9e..3dbc2791f2a7fc1b9d77c528b3f7cf549b424709 100644 (file)
@@ -1,4 +1,7 @@
 
+    -   Document that lex and yacc are no longer a requirement to build
+       Pegasus.
+
     -  Figure out how to handle very large CIM respones and possibly
        requests too.
 
index eb335fadb3a44fa7782b45e17c607d6232f2cd1e..c4ee092d3d33efd5a85714d4367391484e1bdf3a 100644 (file)
@@ -564,7 +564,7 @@ int main(int argc, char** argv)
                 {
                   Stopwatch elapsedTime;
                   Selector selector;
-                  CIMClient client(&selector);
+                  CIMClient client(&selector, 60 * 1000);
 
                   char * connection = connectionList[i].allocateCString();
                   cout << "connecting to " << connection << endl;
index 3aaf7c472182da0ef8b83f88e9abe8c9f491cc93..4acc05ef2862085ca813e9d278c80ac401f9d4ca 100644 (file)
@@ -59,7 +59,7 @@ static char* _allocLogFileName(
     const String& homeDirectory,
     Logger::LogFileType logFileType)
 {
-    static char* fileNames[] = 
+    static const char* fileNames[] = 
     {
        "PegasusTrace.log",
        "PegasusStandard.log",
@@ -163,18 +163,18 @@ void Logger::put(
        // This converts bitmap to string based on highest order
        // bit set
        // ATTN: KS Fix this more efficiently.
-       static char* svNames[] = 
-           {
+       static const char* svNames[] = 
+       {
            "TRACE   ",
            "INFO    ",
            "WARNING ",
            "SEVERE  ",
            "FATAL   "
-           };
+       };
        // NUM_LEVELS = 5
        int sizeSvNames = sizeof(svNames) / sizeof(svNames[0]) - 1;
 
-       char* tmp = "";
+       const char* tmp = "";
        if (severity & Logger::TRACE) tmp =       "TRACE   ";
        if (severity & Logger::INFORMATION) tmp = "INFO    ";
        if (severity & Logger::WARNING) tmp =     "WARNING ";
index b8163310fc87a923abf9f886ebbbb44137005859..14dbc2d8ae5e3115af8fedb35cfaaf759ef01e5b 100644 (file)
@@ -27,6 +27,7 @@
 //
 //%/////////////////////////////////////////////////////////////////////////////
 
+
 #include "slp.h"
 
 #ifdef PEGASUS_OS_TRU64
 extern "C" void usleep(unsigned int);
 #endif
 
+#if defined(PEGASUS_OS_HPUX)
+# include <netdb.h>
+#endif
 
 PEGASUS_USING_STD;
 
 PEGASUS_NAMESPACE_BEGIN
 
+// This is necessary to avoid the "reinterpret cast" warning generated
+// by the HP C++ compiler.
+#define SOCKADDR_IN_CAST (struct sockaddr_in*)(void*)
+#define SOCKADDR_CAST (struct sockaddr*)(void*)
+
 PEGASUS_EXPORT String slp_get_host_name(void)
 {
 
@@ -269,11 +278,11 @@ static int slp_get_local_interfaces(Uint32 **list)
 
       struct ifreq *r = conf.ifc_req;
       struct sockaddr_in *addr ;
-      addr = (struct sockaddr_in *)&r->ifr_addr;
+      addr = SOCKADDR_IN_CAST&r->ifr_addr;
       while(  addr->sin_addr.s_addr != 0 ) {
        interfaces++;
        r++;
-       addr = (struct sockaddr_in *)&r->ifr_addr;
+       addr = SOCKADDR_IN_CAST&r->ifr_addr;
       }
 
       // now store the addresses
@@ -281,12 +290,12 @@ static int slp_get_local_interfaces(Uint32 **list)
       *list  = new Uint32 [interfaces + 1 ];
       Uint32 *this_addr = *list;
       r = conf.ifc_req;
-      addr = (struct sockaddr_in *)&r->ifr_addr;
+      addr = SOCKADDR_IN_CAST&r->ifr_addr;
       while(  addr->sin_addr.s_addr != 0 ) {
        *this_addr = addr->sin_addr.s_addr;
        r++;
        this_addr++;
-       addr = (struct sockaddr_in *)&r->ifr_addr;
+       addr = SOCKADDR_IN_CAST&r->ifr_addr;
       }
       *this_addr = INADDR_ANY;
     } // did the ioctl 
@@ -348,7 +357,7 @@ static SOCKET slp_open_listen_sock( void )
   local.sin_family = AF_INET;
   local.sin_port = htons(427);
   local.sin_addr.s_addr  = INADDR_ANY;
-  if( 0 == bind(sock, (struct sockaddr *)&local, sizeof(local)) )
+  if( 0 == bind(sock, SOCKADDR_CAST&local, sizeof(local)) )
     slp_join_multicast_all(sock);
   return(sock);
 }
@@ -1350,9 +1359,9 @@ void slp_client::decode_srvreq(struct sockaddr_in *remote )
              local.sin_family = AF_INET;
              local.sin_port = _target_port ; 
              local.sin_addr.s_addr = _local_addr;
-             if(SOCKET_ERROR != bind(sock, (struct sockaddr *)&local, sizeof(local))) {
+             if(SOCKET_ERROR != bind(sock, SOCKADDR_CAST&local, sizeof(local))) {
                sendto(sock, _msg_buf, msg_len , 0, 
-                     (struct sockaddr *)remote, sizeof(struct sockaddr_in )) ;
+                     SOCKADDR_CAST(remote), sizeof(struct sockaddr_in )) ;
              } // successfully bound this socket 
              _LSLP_CLOSESOCKET(sock);
            } // successfully opened this socket
@@ -1480,7 +1489,7 @@ Boolean slp_client::send_rcv_udp( void )
     local.sin_family = AF_INET;
     local.sin_port = 0;
     local.sin_addr.s_addr = _local_addr;
-    if(SOCKET_ERROR != bind(sock, (struct sockaddr *)&local, sizeof(local))) {
+    if(SOCKET_ERROR != bind(sock, SOCKADDR_CAST&local, sizeof(local))) {
       int bcast = ( (_LSLP_GETFLAGS(_msg_buf)) & LSLP_FLAGS_MCAST) ? 1 : 0 ;
       if(bcast) {
        if( (SOCKET_ERROR ==  _LSLP_SET_TTL(sock, _ttl) )  ||  
@@ -1505,7 +1514,7 @@ Boolean slp_client::send_rcv_udp( void )
                                       _msg_buf, 
                                       _LSLP_GETLENGTH(_msg_buf), 
                                       0, 
-                                      (struct sockaddr *)&target, sizeof(target) ))) {
+                                      SOCKADDR_CAST&target, sizeof(target) ))) {
        _LSLP_CLOSESOCKET(sock);
        return(false);
       } /* oops - error sending data */
@@ -1576,10 +1585,10 @@ Sint32 slp_client::service_listener(SOCKET extra_sock )
 #endif
 
     if(extra_sock && FD_ISSET(extra_sock, &fds) )
-      err = recvfrom(extra_sock, _rcv_buf, LSLP_MTU, 0, (struct sockaddr *)&remote, &size);
+      err = recvfrom(extra_sock, _rcv_buf, LSLP_MTU, 0, SOCKADDR_CAST&remote, &size);
     if(_rcv_sock != INVALID_SOCKET) {
       if(FD_ISSET(_rcv_sock, &fds)) 
-       err = recvfrom(_rcv_sock, _rcv_buf, LSLP_MTU, 0, (struct sockaddr *)&remote, &size);
+       err = recvfrom(_rcv_sock, _rcv_buf, LSLP_MTU, 0, SOCKADDR_CAST&remote, &size);
     }
 
     if(err && err != SOCKET_ERROR)