1label_to_str(3TSOL) Trusted Extensions Library Functions label_to_str(3TSOL)
2
3
4
6 label_to_str - convert labels to human readable strings
7
9 cc [flag...] file... -ltsol [library...]
10
11
12 #include <tsol/label.h>
13
14 int label_to_str(const m_label_t *label, char **string,
15 const m_label_str_t conversion_type, uint_t flags);
16
17
19 label_to_str() is a simple function to convert various mandatory label
20 types to human readable strings.
21
22
23 label is the mandatory label to convert. string points to memory that
24 is allocated by label_to_str() that contains the converted string. The
25 caller is responsible for calling free(3C) to free allocated memory.
26
27
28 The calling process must have mandatory read access to the resulting
29 human readable string. Or the calling process must have the
30 sys_trans_label privilege.
31
32
33 The conversion_type parameter controls the type of label conversion.
34 Not all types of conversion are valid for all types of label:
35
36 M_LABEL Converts label to a human readable string based
37 on its type.
38
39
40 M_INTERNAL Converts label to an internal text representation
41 that is safe for storing in a public object.
42 Internal conversions can later be parsed to their
43 same value.
44
45
46 M_COLOR Converts label to a string that represents the
47 color name that the administrator has associated
48 with the label.
49
50
51 PRINTER_TOP_BOTTOM Converts label to a human readable string that is
52 appropriate for use as the top and bottom label
53 of banner and trailer pages in the Defense Intel‐
54 ligence Agency (DIA) encodings printed output
55 schema.
56
57
58 PRINTER_LABEL Converts label to a human readable string that is
59 appropriate for use as the banner page downgrade
60 warning in the DIA encodings printed output
61 schema.
62
63
64 PRINTER_CAVEATS Converts label to a human readable string that is
65 appropriate for use as the banner page caveats
66 section in the DIA encodings printed output
67 schema.
68
69
70 PRINTER_CHANNELS Converts label to a human readable string that is
71 appropriate for use as the banner page handling
72 channels in the DIA encodings printed output
73 schema.
74
75
76
77 The flags parameter provides a hint to the label conversion:
78
79 DEF_NAMES The default names are preferred.
80
81
82 SHORT_NAMES Short names are preferred where defined.
83
84
85 LONG_NAMES Long names are preferred.
86
87
89 Upon successful completion, the label_to_str() function returns 0. Oth‐
90 erwise, -1 is returned, errno is set to indicate the error and the
91 string pointer is set to NULL.
92
94 The label_to_str() function will fail if:
95
96 EINVAL Invalid parameter.
97
98
99 ENOTSUP The system does not support label translations.
100
101
102 ENOMEM The physical limits of the system are exceeded by size bytes
103 of memory which cannot be allocated.
104
105
107 See attributes(5) for descriptions of the following attributes:
108
109
110
111
112 ┌─────────────────────────────┬─────────────────────────────┐
113 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
114 ├─────────────────────────────┼─────────────────────────────┤
115 │Interface Stability │See below. │
116 ├─────────────────────────────┼─────────────────────────────┤
117 │MT-Level │MT-Safe │
118 ├─────────────────────────────┼─────────────────────────────┤
119 │Standard │See below. │
120 └─────────────────────────────┴─────────────────────────────┘
121
122
123 The label_to_str() function is Committed. The returned string is Not-
124 an-Interface and is dependent on the specific label_encodings file. The
125 conversion type INTERNAL is Uncommitted, but is always accepted as
126 input to str_to_label(3TSOL).
127
128
129 Conversion types that are relative to the DIA encodings schema are
130 Standard. Standard is specified in label_encodings(4).
131
133 free(3C), libtsol(3LIB), str_to_label(3TSOL), label_encodings(4),
134 attributes(5), labels(5)
135
136
137 Using the label_to_str Function in Solaris Trusted Extensions Devel‐
138 oper's Guide
139
141 A number of these conversions rely on the DIA label encodings schema.
142 They might not be valid for other label schemata.
143
145 The functionality described on this manual page is available only if
146 the system is configured with Trusted Extensions.
147
148
149
150SunOS 5.11 20 Jul 2007 label_to_str(3TSOL)