print_obj.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
*
* This module contains a function for printing objects to standard out.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <rpcsvc/nis_dhext.h>
#include "nis_local.h"
#define nilstring(s) ((s) ? (s) : "(nil)")
#define CTBSIZE 26
/*
* forward function prototypes.
*/
void nis_print_server(nis_server *);
void
{
int s;
for (s = 24; s >= 0; s -= 8) {
if (r & (NIS_READ_ACC << s))
(void) printf("r");
else
(void) printf("-");
if (r & (NIS_MODIFY_ACC << s))
(void) printf("m");
else
(void) printf("-");
if (r & (NIS_CREATE_ACC << s))
(void) printf("c");
else
(void) printf("-");
if (r & (NIS_DESTROY_ACC << s))
(void) printf("d");
else
(void) printf("-");
}
}
void
{
int i;
int nkeys; /* number of keys */
switch (s->key_type) {
case NIS_PK_DHEXT :
(void) printf("%s",
(void) printf("Diffie-Hellman (");
for (i = 0; i < nkeys; i++) {
if (i > 0)
(void) printf(", ");
}
(void) printf(" bits)\n");
if (key_info)
break;
case NIS_PK_DH :
(void) printf("\tPublic Key : ");
(void) printf("Diffie-Hellman (%d bits)\n",
break;
case NIS_PK_RSA :
(void) printf("\tPublic Key : ");
break;
case NIS_PK_NONE :
(void) printf("None.\n");
break;
default :
}
}
void
{
}
void
{
int i;
(void) printf("Type : ");
switch (r->do_type) {
case NIS :
(void) printf("NIS\n");
break;
case SUNYP :
(void) printf("YP\n");
break;
case DNS :
(void) printf("DNS\n");
break;
default :
}
for (i = 0; i < r->do_servers.do_servers_len; i++) {
if (i == 0)
(void) printf("Master Server :\n");
else
(void) printf("Replicate : \n");
}
if (exptime > 0) {
} else {
do_ttl = 0;
}
}
}
(do_ttl % 60));
(void) printf("Default Access rights :\n");
for (i = 0; i < r->do_armask.do_armask_len; i++) {
case NIS_GROUP_OBJ :
(void) printf("\t\tGROUP Objects : ");
break;
case NIS_ENTRY_OBJ :
(void) printf("\t\tENTRY Objects : ");
break;
case NIS_LINK_OBJ :
(void) printf("\t\tLINK Objects : ");
break;
case NIS_DIRECTORY_OBJ :
(void) printf("\t\tDIRECTORY Objects : ");
break;
case NIS_TABLE_OBJ :
(void) printf("\t\tTABLE Objects : ");
break;
case NIS_BOGUS_OBJ :
(void) printf("\t\tBOGUS Objects : ");
break;
default :
(void) printf("\t\tUnknown Objects : ");
}
nis_print_rights(OARIGHTS(r, i));
(void) printf("\n");
}
}
void
{
int i;
(void) printf("Group Flags : ");
if (g->gr_flags & NEGMEM_GROUPS)
(void) printf("\tNegative Memberships allowed\n");
if (g->gr_flags & IMPMEM_GROUPS)
(void) printf("\tImplicit Membership allowed\n");
if (g->gr_flags & RECURS_GROUPS)
(void) printf("\tRecursive Memberships allowed\n");
if (! g->gr_flags)
(void) printf("\n");
(void) printf("Group Members :\n");
for (i = 0; i < g->gr_members.gr_members_len; i++)
(void) printf("\t%s\n",
}
static void
{
(void) printf("\t[%d]\tName : ", n);
(void) printf("\t\tAttributes : (");
(void) printf("SEARCHABLE, ");
(void) printf("TEXTUAL DATA");
(void) printf(", CASE INSENSITIVE");
else
(void) printf(", CASE SENSITIVE");
}
} else {
(void) printf("BINARY DATA");
(void) printf(", XDR ENCODED");
(void) printf(", ASN.1 ENCODED");
}
(void) printf(")\n");
(void) printf("\t\tAccess Rights : ");
(void) printf("\n");
}
void
{
int i;
(void) printf("Columns :\n");
for (i = 0; i < t->ta_cols.ta_cols_len; i++) {
}
}
void
{
int i;
(void) printf("Linked Object Type : ");
switch (l->li_rtype) {
case NIS_DIRECTORY_OBJ :
(void) printf("DIRECTORY\n");
break;
case NIS_TABLE_OBJ :
(void) printf("TABLE\n");
break;
case NIS_ENTRY_OBJ :
(void) printf("ENTRY\n");
break;
case NIS_GROUP_OBJ :
(void) printf("GROUP\n");
break;
case NIS_LINK_OBJ :
(void) printf("LINK\n");
break;
case NIS_PRIVATE_OBJ :
(void) printf("PRIVATE\n");
break;
default :
break;
}
(void) printf("Link to : ");
if (l->li_attrs.li_attrs_len) {
(void) printf("[");
(void) printf("%s=%s, ",
(void) printf("%s=%s ] ",
}
}
void
{
int i, j;
(void) printf("\t[%d] - [%d bytes] ", i,
(void) printf("Encrypted data\n");
continue;
}
(void) printf("XDR'd Data\n");
continue;
}
if (((j % 8) == 0) && (j != 0)) {
(void) printf("\n\t ");
}
(void) printf("0x%02x ",
}
(void) printf("\n");
continue;
} else {
(void) printf("'%s'\n",
continue;
}
}
}
static void
{
char pbuf[80],
buf1[5],
buf2[20],
buf3[20],
buf4[20];
int len, i, j;
/*
* dump private data as a formatted dump using format :
* "1234: 0011223344556677 8899aabbccddeeff ................\n"
*/
}
if (i < len) {
buf4[0] = '\0';
for (j = 0; j < 16; j++) {
if (i+j < len) {
if (j == 7)
} else {
if (j == 8)
}
}
}
}
void
{
/*
* Temporary p_time introduced for the LP64 world since int and
* long are not the same size, and time_t is a long.
*/
(void) printf("Access Rights : ");
(void) printf("\n");
(o->zo_ttl % 60));
(void) printf("Object Type : ");
switch (__type_of(o)) {
case NIS_NO_OBJ :
(void) printf("NONE\n");
break;
case NIS_DIRECTORY_OBJ :
(void) printf("DIRECTORY\n");
nis_print_directory(&(o->DI_data));
break;
case NIS_TABLE_OBJ :
(void) printf("TABLE\n");
nis_print_table(&(o->TA_data));
break;
case NIS_ENTRY_OBJ :
(void) printf("ENTRY\n");
nis_print_entry(&(o->EN_data));
break;
case NIS_GROUP_OBJ :
(void) printf("GROUP\n");
nis_print_group(&(o->GR_data));
break;
case NIS_LINK_OBJ :
(void) printf("LINK\n");
nis_print_link(&(o->LI_data));
break;
case NIS_PRIVATE_OBJ :
(void) printf("PRIVATE\n");
nis_print_private(&(o->zo_data));
break;
default :
break;
}
}
void
{
(void) printf("\tendpoint = (%s, %s, %s)\n",
(void) printf("\tcallback addr = (%s, %s, %s)\n",
}
void
{
int i;
(void) printf("Directory Name : %s\n",
(void) printf("Directory Object:\n");
(void) printf("Bound Endpoints:\n");
}