Trusted Solaris Developer's Guide

Label Encodings Information

The labelinfo(3TSOL) routine returns maximum length values as short integers for various character data fields from the label library. An application laying out a field that contains label information might use these lengths. The length values change depending on the actual contents of the label_encodings(4) file.

#include <tsol/label.h>
main()
{
	int retval;
	struct label_info info;

	retval = labelinfo(&info);
	printf("Max sensitivity label length = %d\n", info.slabel_len);
	printf("Max CMW label length = %d\n", info.clabel_len);
	printf("Max clearance length = %d\n", info.clear_len);
	printf("Max version string length = %d\n", info.vers_len);
	printf("Max banner and trailer string length = %d\n", info.header_len);
	printf("Max protect as section string length = %d\n",
		info.protect_as_len);
	printf("Max caveats section string length = %d\n", info.caveats_len);
	printf("Max handling channels string length = %d\n", info.channels_len);
}

The printf statements print the following lengths:


Max sensitivity label length = 45
Max CMW label length = 259
Max clearance length = 76
Max Version String length = 56
Max Banner and trailer page string length = 13
Max Protect as section string length = 256
Max Caveats section string length = 62
Max Handling channels section string length = 81