version 1.19, 2005/02/05 23:00:18
|
version 1.21, 2006/01/27 19:21:20
|
|
|
| |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/ArrayInternal.h> | #include <Pegasus/Common/ArrayInternal.h> |
#include <Pegasus/Common/Destroyer.h> |
|
#include <Pegasus/Common/InternalException.h> | #include <Pegasus/Common/InternalException.h> |
#include "snmpDeliverTrap_emanate.h" | #include "snmpDeliverTrap_emanate.h" |
| |
|
|
struct hostent *targetHostInfo; | struct hostent *targetHostInfo; |
struct in_addr in; | struct in_addr in; |
| |
#ifdef PEGASUS_OS_SOLARIS |
#if defined(PEGASUS_OS_LINUX) |
#define HOSTENT_BUFF_SIZE 8192 |
char hostEntryBuffer[8192]; |
char buf[HOSTENT_BUFF_SIZE]; |
struct hostent hostEntryStruct; |
struct hostent h_result; |
int hostEntryErrno; |
int h_errorp; |
|
targetHostInfo=gethostbyname_r(hostName, &h_result, buff, |
gethostbyname_r( |
HOSTENT_BUFF_SIZE, &h_errorp); |
hostName, |
|
&hostEntryStruct, |
|
hostEntryBuffer, |
|
sizeof(hostEntryBuffer), |
|
&targetHostInfo, |
|
&hostEntryErrno); |
|
#elif defined(PEGASUS_OS_SOLARIS) |
|
char hostEntryBuffer[8192]; |
|
struct hostent hostEntryStruct; |
|
int hostEntryErrno; |
|
|
|
targetHostInfo = gethostbyname_r( |
|
(char *)hostName, |
|
&hostEntryStruct, |
|
hostEntryBuffer, |
|
sizeof(hostEntryBuffer), |
|
&hostEntryErrno); |
#else | #else |
targetHostInfo = gethostbyname(hostName); | targetHostInfo = gethostbyname(hostName); |
#endif | #endif |