slbtohr, slhrtob, clbtohr, clhrtob, tlbtohr, or tlhrtob Subroutine

Purpose

Converts labels from binary equivalent to human readable format and from human readable format to binary equivalent.

Library

Trusted AIX® Library (libmls.a)

Syntax

#include <mls/mls.h>

int slbtohr (hr_sl, sl, type)
char *hr_sl;
const sl_t *sl;
enum hr_type type;

int clbtohr (hr_cl, cl, type)
char *hr_cl;
const sl_t *cl;
enum hr_type type;

int tlbtohr (hr_tl, tl, type)
char *hr_tl;
const tl_t *tl;
enum hr_type type;

int clhrtob (cl, hr_cl)
sl_t *cl;
const char *hr_cl;

int slhrtob (sl, hr_sl)
sl_t *sl;
const char *hr_sl;

int tlhrtob (tl, hr_tl)
tl_t *tl;
const char *hr_tl;

Description

The btohr routines convert the binary labels into long or short human readable form, based on the value of the type parameter.

The slbtohr subroutine converts binary sensitivity labels to human readable form, that is, the conversion is made as per SENSITIVITY LABELS section of Label Encoding File.

The clbtohr subroutine converts binary clearance labels to human readable form, that is, the conversion is made as per as per CLEARANCE LABELS section of Label Encoding File.

The tlbtohr subroutine converts binary integrity labels to human readable form, that is, the conversion is made as per optional INTEGRITY LABELS or SENSITIVITY LABELS section of Label Encoding File.

Similarly, the respective hrtob routines convert human (short or long) readable form to binary format.

Note: The database has to be initialized before you start any of these routines.

Parameters

The btohr routines have the following parameters:
Item Description
hr_sl Points to the human readable forms of binary labels. This buffer is expected to be of length determined by the maxlen_sl subroutine.
hr_cl Points to the human readable forms of binary labels. This buffer is expected to be of length determined by the maxlen_cl subroutine.
hr_tl Points to the human readable forms of binary labels. This buffer is expected to be of length determined by the maxlen_tl subroutine.
sl Points to the binary sensitivity label of sl_t * type.
cl Points to the clearance label of sl_t * type.
tl Points to the integrity label of tl_t * type.
type Specifies the human readable format the binary label is to be converted to. It can be one of the following values:
HR_LONG
Specifies the long human readable format.
HR_SHORT
Specifies the short human readable format.
The hrtob routines have the following parameters:
Item Description
hr_sl Points to the human readable labels, either short form or long form.
hr_cl Points to the human readable labels, either short form or long form.
hr_tl Points to the human readable labels, either short form or long form.
sl Points to binary sensitivity labels.
cl Points to clearance labels.
tl Points to binary integrity label.

Security

Files Accessed:

Modes File
R /etc/security/enc/LabelEncodings

Return Values

Item Description
0 Indicates a successful completion.
1 Indicates that an error occurred.

Error Codes

Item Description
EINVAL Indicates that the passed-in parameter is NULL.
ENOTREADY Indicates that the database is not initialized.