selfcheck.c revision 5e7d5a1cbfee5e2c9825e0f408196db6db88257b
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <errno.h>
#include <syslog.h>
#include <strings.h>
#include <malloc.h>
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
int
self_check(char *hostname)
{
int s, res = 0;
struct sioc_addrreq areq;
int family;
int flags;
int error_num;
char **hostptr;
struct sockaddr_in6 ipv6addr;
flags = AI_DEFAULT;
return (0);
}
"self_check: unknown host: %s (try again later)\n",
hostname);
else
"self_check: unknown host: %s\n", hostname);
(void) close(s);
return (0);
}
res = 1;
break;
}
}
(void) close(s);
return (res);
}
#define MAXIFS 32
/*
* create an ifconf structure that represents all the interfaces
* configured for this host. Two buffers are allcated here:
* lifc - the ifconf structure returned
* lifc->lifc_buf - the list of ifreq structures
* Both of the buffers must be freed by the calling routine.
* A NULL pointer is returned upon failure. In this case any
* data that was allocated before the failure has already been
* freed.
*/
struct lifconf *
getmyaddrs(void)
{
int sock;
int numifs;
char *buf;
}
lifn.lifn_flags = 0;
"statd:getmyaddrs, get number of interfaces, error: %m");
}
"statd:getmyaddrs, malloc for lifconf failed: %m");
}
"statd:getmyaddrs, malloc for lifreq failed: %m");
}
lifc->lifc_flags = 0;
}
return (lifc);
}
int
Is_ipv6present(void)
{
int sock;
if (sock < 0)
return (0);
lifn.lifn_flags = 0;
return (0);
}
if (lifn.lifn_count == 0)
return (0);
return (1);
}