2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Binary label to label string translations. 2N/A#
endif /* TEXT_DOMAIN */ 2N/Astatic char *
sstring;
/* return string for sb*tos */ 2N/A * bsltos - Convert Binary Sensitivity Label to Sensitivity Label string. 2N/A * Entry label = Binary Sensitivity Label to be converted. 2N/A * string = NULL ((char *) 0), if memory to be allocated, 2N/A * otherwise, pointer to preallocated memory. 2N/A * str_len = Length of preallocated memory, else ignored. 2N/A * flags = Logical sum of: 2N/A * LONG_CLASSIFICATION or SHORT_CLASSIFICATION, 2N/A * LONG_WORDS or SHORT_WORDS, 2N/A * VIEW_INTERNAL or VIEW_EXTERNAL, and 2N/A * NO_CLASSIFICATION. 2N/A * LONG_CLASSIFICATION, use long classification names. 2N/A * SHORT_CLASSIFICATION, use short classification 2N/A * NO_CLASSIFICATION, don't translate classification. 2N/A * LONG_WORDS, use the long form of words (default). 2N/A * SHORTWORDS, use the short form of words where available. 2N/A * Exit string = Sensitivity Label string, or empty string if 2N/A * not enough preallocated memory. 2N/A * Returns -1, If unable to access label encodings database. 2N/A * 0, If unable to allocate string, 2N/A * or allocated string to short 2N/A * (and **string = '\0'). 2N/A * length (including null) of Sensitivity Label string, 2N/A * Calls RPC - LABELS_BSLTOS, BCLHIGH, BCLLOW, BCLTOSL, BLEQUAL, 2N/A * BLTYPE, SETBSLABEL, UCLNT, memcpy, clnt_call, 2N/A * clnt_perror, malloc, strcat, strlen. 2N/A * Uses ADMIN_HIGH, ADMIN_LOW, shigh, slow. 2N/A /* unpack Sensitivity Label */ 2N/A /* server not present */ 2N/A /* special case admin_high and admin_low */ 2N/A /* initialize static labels */ 2N/A * bcleartos - Convert Binary Clearance to Clearance string. 2N/A * Entry clearance = Binary Clearance to be converted. 2N/A * string = NULL ((char *) 0), if memory to be allocated, 2N/A * otherwise, pointer to preallocated memory. 2N/A * str_len = Length of preallocated memory, else ignored. 2N/A * flags = Logical sum of: 2N/A * LONG_CLASSIFICATION or SHORT_CLASSIFICATION, 2N/A * LONG_WORDS or SHORT_WORDS, 2N/A * VIEW_INTERNAL or VIEW_EXTERNAL. 2N/A * LONG_CLASSIFICATION, use long classification names. 2N/A * SHORT_CLASSIFICATION, use short classification 2N/A * LONG_WORDS, use the long form of words (default). 2N/A * SHORTWORDS, use the short form of words where available. 2N/A * Exit string = Clearance string, or empty string if not 2N/A * enough preallocated memory. 2N/A * Returns -1, If unable to access label encodings database. 2N/A * 0, If unable to allocate string, 2N/A * or allocated string to short 2N/A * (and **string = '\0'). 2N/A * length (including null) of Clearance string, 2N/A * Calls RPC - LABELS_BSLTOS, BCLHIGH, BCLLOW, BCLTOSL, BLEQUAL, 2N/A * BLTYPE, SETBSLABEL, UCLNT, memcpy, clnt_call, 2N/A * clnt_perror, malloc, strcat, strlen. 2N/A * Uses ADMIN_HIGH, ADMIN_LOW, clrhigh, clrlow. 2N/A /* unpack Clearance */ 2N/A /* release return buffer */ 2N/A /* server not present */ 2N/A /* special case admin_high and admin_low */ 2N/A /* initialize static labels */ 2N/A * sbsltos - Convert Sensitivity Label to canonical clipped form. 2N/A * Entry label = Sensitivity Label to be converted. 2N/A * len = Maximum length of translated string, excluding NULL. 2N/A * sstring = address of string to translate into. 2N/A * ssize = size of memory currently allocated to sstring. 2N/A * Exit sstring = Newly translated string. 2N/A * ssize = Updated if more memory pre-allocated. 2N/A * Returns NULL, If error, len too small, unable to translate, or get 2N/A * memory for string. 2N/A * Address of string containing converted value. 2N/A * Calls alloc_string, bsltos, strcpy. 2N/A * Uses ssize, sstring. 2N/A /* Allocate string memory. */ 2N/A /* can't get initial memory for string */ 2N/A /* error in translation */ 2N/A /* sstring not long enough */ 2N/A /* Can't get more memory */ 2N/A /* Adjust string size to desired length */ 2N/A /* sstring not long enough */ 2N/A /* Can't get more memory */ 2N/A * sbcleartos - Convert Clearance to canonical clipped form. 2N/A * Entry clearance = Clearance to be converted. 2N/A * len = Maximum length of translated string, excluding NULL. 2N/A * sstring = address of string to translate into. 2N/A * ssize = size of memory currently allocated to sstring. 2N/A * Exit sstring = Newly translated string. 2N/A * ssize = Updated if more memory pre-allocated. 2N/A * Returns NULL, If error, len too small, unable to translate, or get 2N/A * memory for string. 2N/A * Address of string containing converted value. 2N/A * Calls alloc_string, bcleartos, strcpy. 2N/A * Uses ssize, sstring. 2N/A /* Allocate string memory. */ 2N/A /* can't get initial memory for string */ 2N/A /* error in translation */ 2N/A /* sstring not long enough */ 2N/A /* Can't get more memory */ 2N/A /* Adjust string size to desired length */ 2N/A /* sstring not long enough */ 2N/A /* Can't get more memory */