tninfo.c revision f875b4ebb1dd9fdbeb043557cab38ab3bf7f6e01
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* tninfo.c - Trusted network reporting utility
*/
#include <errno.h>
#include <stdio.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <libtsnet.h>
#include <netdb.h>
#include <zone.h>
/* maximum string size desired as returned by sb*tos calls */
#define MAX_STRING_SIZE 60
static void usage(void);
static int print_rhtp(const char *);
static int print_rh(const char *);
static int print_mlp(const char *);
int
{
int chr;
int ret = 0; /* return code */
/* set the locale for only the messages system (all else is clean) */
#ifndef TEXT_DOMAIN /* Should be defined by cc -D */
#endif
(void) textdomain(TEXT_DOMAIN);
if (argc <= 1)
usage();
switch (chr) {
case 'h':
break;
case 'm':
break;
case 't':
break;
default:
usage();
}
}
return (ret);
}
static void
usage(void)
{
"[-m zone_name] [-t template_name]\n"));
exit(1);
}
static int
print_rhtp(const char *rhtp_name)
{
int i;
else
gettext("tninfo: tnrhtp TNDB_GET(%1$s) failed: "
return (1);
}
(void) printf("=====================================\n");
(void) printf("__________________________\n");
case UNLABELED:
}
if (bisinvalid(l1))
break;
}
}
break;
case SUN_CIPSO:
if (bisinvalid(l1))
break;
}
}
break;
default:
}
return (0);
}
static int
{
int herr;
char abuf[INET6_ADDRSTRLEN];
"invalid literal address: %s\n"), rh_name);
gettext("\t(try again later)\n"));
return (1);
}
if (IN6_IS_ADDR_V4MAPPED(&in6)) {
sizeof (abuf));
} else {
}
"%1$s does not exist\n"), abuf);
else
return (1);
}
else
return (0);
}
static int
{
/* get the first entry */
return (0);
} else {
perror("tnmlp TNDB_GET");
return (-1);
}
}
for (;;) {
else
} else {
}
break;
(void) putchar(';');
}
(void) putchar('\n');
return (0);
}
/*
* Print all of the MLPs for the given zone.
*/
static int
{
zonename);
return (1);
}
tsme.tsme_flags = 0;
return (1);
return (1);
return (0);
}