Converts labels from binary equivalent to human readable format and from human readable format to binary equivalent.
Trusted AIX® Library (libmls.a)
#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;
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.
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:
|
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. |
Files Accessed:
Modes | File |
---|---|
R | /etc/security/enc/LabelEncodings |
Item | Description |
---|---|
0 | Indicates a successful completion. |
1 | Indicates that an error occurred. |
Item | Description |
---|---|
EINVAL | Indicates that the passed-in parameter is NULL. |
ENOTREADY | Indicates that the database is not initialized. |