sigar_inet_ntoa should only be used internally now
This commit is contained in:
parent
a58b419690
commit
f410dfa739
|
@ -651,12 +651,6 @@ typedef struct {
|
||||||
|
|
||||||
SIGAR_DECLARE(sigar_version_t *) sigar_version_get(void);
|
SIGAR_DECLARE(sigar_version_t *) sigar_version_get(void);
|
||||||
|
|
||||||
#define SIGAR_INET_ADDR_LEN (3 * 4 + 3 + 1)
|
|
||||||
|
|
||||||
SIGAR_DECLARE(int) sigar_inet_ntoa(sigar_t *sigar,
|
|
||||||
sigar_uint64_t address,
|
|
||||||
char *addr_str);
|
|
||||||
|
|
||||||
#define SIGAR_FQDN_LEN 512
|
#define SIGAR_FQDN_LEN 512
|
||||||
|
|
||||||
SIGAR_DECLARE(int) sigar_fqdn_get(sigar_t *sigar, char *name, int namelen);
|
SIGAR_DECLARE(int) sigar_fqdn_get(sigar_t *sigar, char *name, int namelen);
|
||||||
|
|
14
src/sigar.c
14
src/sigar.c
|
@ -1606,18 +1606,14 @@ int sigar_net_interface_list_get(sigar_t *sigar,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* threadsafe alternative to inet_ntoa (inet_ntop4 from apr) */
|
/* threadsafe alternative to inet_ntoa (inet_ntop4 from apr) */
|
||||||
SIGAR_DECLARE(int) sigar_inet_ntoa(sigar_t *sigar,
|
static int sigar_inet_ntoa(sigar_t *sigar,
|
||||||
sigar_uint64_t address,
|
sigar_uint32_t address,
|
||||||
char *addr_str)
|
char *addr_str)
|
||||||
{
|
{
|
||||||
char *next=addr_str;
|
char *next=addr_str;
|
||||||
int n=0;
|
int n=0;
|
||||||
const unsigned char *src;
|
const unsigned char *src =
|
||||||
struct in_addr addr;
|
(const unsigned char *)&address;
|
||||||
|
|
||||||
addr.s_addr = address;
|
|
||||||
|
|
||||||
src = (const unsigned char *)&addr.s_addr;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
unsigned char u = *src++;
|
unsigned char u = *src++;
|
||||||
|
|
Loading…
Reference in New Issue