/*
* 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
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <syslog.h>
#include <unistd.h>
#include <netdb.h>
#include <signal.h>
#include <fcntl.h>
#include <libstmfproxy.h>
/*
* NOTE:
* This is demo code to be used with the existing demo proxy daemon
*/
struct _s_handle {
int sockfd;
};
static ssize_t
{
}
static ssize_t
{
}
static void *
{
"socket() call failed: %d", errno);
return (NULL);
}
if (server_node) {
sizeof (on)) < 0) {
"setsockopt() failed: %d", errno);
goto serv_out;
}
/* XXX get from smf? */
sizeof (serv_addr)) < 0) {
errno);
goto serv_out;
}
if (new_sfd < 0) {
errno);
goto serv_out;
}
} else {
/*
* Assume IP dot notation or if that fails, gethostbyname()
* If that fails, return
*/
} else {
"Cannot get IP address for %s", server);
return (NULL);
}
} else {
"Sorry, cannot use ip address format\n");
return (NULL);
}
/* XXX pass in from smf */
sizeof (sin)) < 0) {
if (errno == ECONNREFUSED) {
/* get a fresh socket and retry */
if (sfd < 0) {
"socket() call failed: %d", errno);
return (NULL);
}
sleep(2);
} else {
return (NULL);
}
}
}
return (sh);
}
};
int
{
*pt_ops = &pt_socket_ops;
return (0);
} else {
return (-1);
}
}