rename net_info.domain to domain_name
This commit is contained in:
parent
b000f97bd3
commit
9e98a05fc7
|
@ -569,7 +569,7 @@ my %classes = (
|
||||||
plat => ''
|
plat => ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => 'domain', type => 'String',
|
name => 'domain_name', type => 'String',
|
||||||
desc => '',
|
desc => '',
|
||||||
plat => ''
|
plat => ''
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,8 +23,8 @@ public class NetInfo extends SigarCommandBase {
|
||||||
net.hyperic.sigar.NetInfo info =
|
net.hyperic.sigar.NetInfo info =
|
||||||
this.sigar.getNetInfo();
|
this.sigar.getNetInfo();
|
||||||
|
|
||||||
println("domain................" +
|
println("domain name..........." +
|
||||||
info.getDomain());
|
info.getDomainName());
|
||||||
|
|
||||||
println("default gateway......." +
|
println("default gateway......." +
|
||||||
info.getDefaultGateway());
|
info.getDefaultGateway());
|
||||||
|
|
|
@ -391,7 +391,7 @@ sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char default_gateway[INET6_ADDRSTRLEN];
|
char default_gateway[INET6_ADDRSTRLEN];
|
||||||
char domain[SIGAR_MAXDOMAINNAMELEN];
|
char domain_name[SIGAR_MAXDOMAINNAMELEN];
|
||||||
char dhcp_server[INET6_ADDRSTRLEN];
|
char dhcp_server[INET6_ADDRSTRLEN];
|
||||||
char primary_dns[INET6_ADDRSTRLEN];
|
char primary_dns[INET6_ADDRSTRLEN];
|
||||||
char secondary_dns[INET6_ADDRSTRLEN];
|
char secondary_dns[INET6_ADDRSTRLEN];
|
||||||
|
|
|
@ -845,6 +845,7 @@ int sigar_who_list_get(sigar_t *sigar,
|
||||||
int sigar_net_info_get(sigar_t *sigar,
|
int sigar_net_info_get(sigar_t *sigar,
|
||||||
sigar_net_info_t *netinfo)
|
sigar_net_info_t *netinfo)
|
||||||
{
|
{
|
||||||
|
int size;
|
||||||
char buffer[BUFSIZ], *ptr;
|
char buffer[BUFSIZ], *ptr;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
@ -880,11 +881,12 @@ int sigar_net_info_get(sigar_t *sigar,
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
if (getdomainname(netinfo->domain, sizeof(netinfo->domain)) == 0) {
|
size = sizeof(netinfo->domain_name)-1;
|
||||||
netinfo->domain[sizeof(netinfo->domain)-1] = '\0';
|
if (getdomainname(netinfo->domain_name, size) == 0) {
|
||||||
|
netinfo->domain_name[size] = '\0';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
netinfo->domain[0] = '\0';
|
netinfo->domain_name[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
|
|
Loading…
Reference in New Issue