(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 keith.petley 1.13 #if defined(PEGASUS_OS_SOLARIS)
 50                   #include <netdb.h>
 51                   #endif
 52 karl         1.5  
 53 mike         1.8  #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_TRU64)
 54                   extern "C" char *strtok_r(char *, const char *, char **);
 55                   # include <arpa/inet.h>
 56                   # include <net/if.h>
 57 sage         1.9  #elif defined (PEGASUS_OS_TRU64) || defined(PEGASUS_OS_AIX)
 58 karl         1.5  # include <arpa/inet.h>
 59 keith.petley 1.13 # include <net/if.h>
 60                   #elif defined (PEGASUS_OS_SOLARIS)
 61                   extern "C" char *strtok_r(char *, const char *, char **);
 62                   # define INADDR_NONE INADDR_BROADCAST
 63 karl         1.5  # include <net/if.h>
 64 chuck        1.11 #elif defined (PEGASUS_OS_OS400)
 65                   # include <unistd.cleinc>
 66                   # include <sys/socket.h>  
 67                   # include <strings.h>
 68                   # include <arpa/inet.h>
 69                   # include <net/if.h>  
 70 karl         1.5  #else
 71 mday         1.1  #include <linux/inet.h>
 72                   #include <linux/if.h>
 73 karl         1.5  #endif
 74 mday         1.1  
 75                   #include <netdb.h>
 76                   #include <errno.h>
 77                   #include <assert.h>
 78                   #include <memory.h>
 79                   #include <string.h>
 80                   #include <ctype.h>
 81 chuck        1.11 
 82                   #ifndef PEGASUS_OS_OS400
 83                   // Not on OS/400
 84 mday         1.1  #include <syslog.h>
 85 chuck        1.11 #endif
 86 mday         1.1  
 87 mday         1.2  PEGASUS_USING_STD;
 88                   
 89                   PEGASUS_NAMESPACE_BEGIN
 90                   
 91 mday         1.1  
 92 mday         1.4  typedef char int8; 
 93                   typedef	unsigned char uint8; 
 94                   typedef uint8 byte; 
 95                   typedef short int16; 
 96                   typedef unsigned short uint16; 
 97                   typedef int int32; 
 98                   typedef unsigned int uint32; 
 99                   typedef long long int64; 
100                   typedef unsigned long long uint64; 
101                   typedef int BOOL; 
102 mday         1.1  
103                   #define _LSLP_SLEEP(m) usleep((m) * 1000)
104                   #define SOCKET int
105                   
106                   #define _LSLP_CLOSESOCKET close
107                   #define _LSLP_IOCTLSOCKET ioctl
108                   #define _LSLP_INIT_NETWORK()
109                   #define _LSLP_DEINIT_NETWORK()
110                   
111 chuck        1.12 #ifndef PEGASUS_OS_OS400
112 mday         1.1  #define _LSLP_SET_TTL(s, t)  setsockopt((s), IPPROTO_IP, IP_MULTICAST_TTL, (const char *)&(t), sizeof((t))) 
113 chuck        1.11 #else
114                   // Remove const for OS/400
115                   #define _LSLP_SET_TTL(s, t)  setsockopt((s), IPPROTO_IP, IP_MULTICAST_TTL, (char *)&(t), sizeof((t)))
116                   #endif
117 mday         1.1  
118                   #ifndef EINVAL
119                   #define EINVAL 0
120                   #endif
121                   #ifndef EWOULDBLOCK
122                   #define EWOULDBLOCK 0
123                   #endif
124                   #define _LSLP_GETLASTERROR() errno
125                   
126                   #define INVALID_SOCKET -1
127                   #define SOCKET_ERROR -1
128                   #define SD_BOTH 2
129                   
130                   #define FAR
131                   
132                   #define _LSLP_STRTOK(n, d, s) strtok_r((n), (d), (s))
133 mday         1.6    
134 mday         1.1  #define LSLP_MAXPATH FILENAME_MAX
135                   #define LSLP_NEWLINE \r
136                   
137                   #ifndef TRUE
138                   #define TRUE 1
139                   #define FALSE 0
140                   #endif
141                   
142                   
143                   #define _LSLP_CTIME(t, b)  ctime_r(((const time_t *)(t)), ((char *)(b)))
144                   
145 mday         1.2  PEGASUS_NAMESPACE_END
146 mday         1.1  
147                   #endif /* _LSLP_LINUX_INCLUDE_ */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2