(file) Return to lslp-perl-linux.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / slp

  1 mday  1.1 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3 kumpf 1.10 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mday  1.1  //
  6 mike  1.3  // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.10 // of this software and associated documentation files (the "Software"), to
  8            // deal in the Software without restriction, including without limitation the
  9            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10 mike  1.3  // sell copies of the Software, and to permit persons to whom the Software is
 11            // furnished to do so, subject to the following conditions:
 12            // 
 13 kumpf 1.10 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.3  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16 kumpf 1.10 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19 mike  1.3  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21 mday  1.1  //
 22            //==============================================================================
 23            //
 24            // Author: Mike Day (mdday@us.ibm.com)
 25            //
 26            //%/////////////////////////////////////////////////////////////////////////////
 27            
 28            
 29            #ifndef _LSLP_LINUX_INCLUDE_
 30            #define _LSLP_LINUX_INCLUDE_
 31            
 32            #include <signal.h>
 33            #include <stdio.h>
 34            #include <stdlib.h>
 35            #include <stdarg.h>
 36            #include <unistd.h> 
 37            #include <fcntl.h>
 38            #include <time.h>
 39            #include <sys/types.h>
 40            #include <sys/time.h>
 41            #include <pthread.h>
 42 mday  1.1  #include <semaphore.h>
 43            #include <netinet/in.h>
 44            #include <arpa/inet.h>
 45            #include <sys/ioctl.h>
 46            #include <sys/socket.h>
 47            #include <sys/stat.h>
 48 mday  1.6  #include <string.h>
 49 karl  1.5  
 50 mike  1.8  #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64)
 51            extern "C" char *strtok_r(char *, const char *, char **);
 52            # include <arpa/inet.h>
 53            # include <net/if.h>
 54 sage  1.9  #elif defined (PEGASUS_OS_TRU64) || defined(PEGASUS_OS_AIX)
 55 karl  1.5  # include <arpa/inet.h>
 56            # include <net/if.h>
 57 chuck 1.11 #elif defined (PEGASUS_OS_OS400)
 58            # include <unistd.cleinc>
 59            # include <sys/socket.h>  
 60            # include <strings.h>
 61            # include <arpa/inet.h>
 62            # include <net/if.h>  
 63 karl  1.5  #else
 64 mday  1.1  #include <linux/inet.h>
 65            #include <linux/if.h>
 66 karl  1.5  #endif
 67 mday  1.1  
 68            #include <netdb.h>
 69            #include <errno.h>
 70            #include <assert.h>
 71            #include <memory.h>
 72            #include <string.h>
 73            #include <ctype.h>
 74 chuck 1.11 
 75            #ifndef PEGASUS_OS_OS400
 76            // Not on OS/400
 77 mday  1.1  #include <syslog.h>
 78 chuck 1.11 #endif
 79 mday  1.1  
 80 mday  1.2  PEGASUS_USING_STD;
 81            
 82            PEGASUS_NAMESPACE_BEGIN
 83            
 84 mday  1.1  
 85 mday  1.4  typedef char int8; 
 86            typedef	unsigned char uint8; 
 87            typedef uint8 byte; 
 88            typedef short int16; 
 89            typedef unsigned short uint16; 
 90            typedef int int32; 
 91            typedef unsigned int uint32; 
 92            typedef long long int64; 
 93            typedef unsigned long long uint64; 
 94            typedef int BOOL; 
 95 mday  1.1  
 96            #define _LSLP_SLEEP(m) usleep((m) * 1000)
 97            #define SOCKET int
 98            
 99            #define _LSLP_CLOSESOCKET close
100            #define _LSLP_IOCTLSOCKET ioctl
101            #define _LSLP_INIT_NETWORK()
102            #define _LSLP_DEINIT_NETWORK()
103            
104 chuck 1.12 #ifndef PEGASUS_OS_OS400
105 mday  1.1  #define _LSLP_SET_TTL(s, t)  setsockopt((s), IPPROTO_IP, IP_MULTICAST_TTL, (const char *)&(t), sizeof((t))) 
106 chuck 1.11 #else
107            // Remove const for OS/400
108            #define _LSLP_SET_TTL(s, t)  setsockopt((s), IPPROTO_IP, IP_MULTICAST_TTL, (char *)&(t), sizeof((t)))
109            #endif
110 mday  1.1  
111            #ifndef EINVAL
112            #define EINVAL 0
113            #endif
114            #ifndef EWOULDBLOCK
115            #define EWOULDBLOCK 0
116            #endif
117            #define _LSLP_GETLASTERROR() errno
118            
119            #define INVALID_SOCKET -1
120            #define SOCKET_ERROR -1
121            #define SD_BOTH 2
122            
123            #define FAR
124            
125            #define _LSLP_STRTOK(n, d, s) strtok_r((n), (d), (s))
126 mday  1.6    
127 mday  1.1  #define LSLP_MAXPATH FILENAME_MAX
128            #define LSLP_NEWLINE \r
129            
130            #ifndef TRUE
131            #define TRUE 1
132            #define FALSE 0
133            #endif
134            
135            
136            #define _LSLP_CTIME(t, b)  ctime_r(((const time_t *)(t)), ((char *)(b)))
137            
138 mday  1.2  PEGASUS_NAMESPACE_END
139 mday  1.1  
140            #endif /* _LSLP_LINUX_INCLUDE_ */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2