Trusted Solaris Developer's Guide

Printer Banner Information

The bcltobanner(3TSOL) routine translates a binary CMW label into text coded labels and strings to appear on the printer banner page, trailer page, and document pages of print jobs. The labels and strings are computed from information in the label_encodings(4) file. This routine is used internally by the Trusted Solaris print system, and for most applications, this translation is unnecessary. However, it can be used in a print server application or in an application that needs the external character string representation used by the print system.

In this example, the CMW label is ADMIN_LOW [TS]. The first five fields of banner_fields are character pointers. If you preallocate memory for the character pointers, the second five fields contain short integer values indicating the length of the memory allocated. If you initialize the first five character pointers to (char *)0 as in the example, the short integer fields do not need initialization.

#include <tsol/label.h>
main()
{
	int retval;
	bclabel_t cmwlabel;

	static struct banner_fields banner = {(char *)0, (char *)0, (char *)0,
		(char *)0, (char *)0};

	getcmwplabel(&cmwlabel);

	retval = bcltobanner(&cmwlabel, &banner, SHORT_WORDS);

	printf("Top and bottom banner/trailer header = %s\n", banner.header);
	printf("Protect as section of banner page = %s\n", banner.protect_as);
	printf("Inf. label/top and bottom body pages = %s\n", banner.ilabel);
	printf("Caveats section of printer banner page = %s\n", banner.caveats);
	printf("Handling channels section of banner page = %s\n",
		banner.channels);
}

The text in the printf statement indicates where on the banner, trailer, and document pages the various strings appear. The caveats string is empty because no caveats are provided in the printer banner section of the label_encodings(4) file. See Trusted Solaris Label Administration and Compartmented Mode Workstation Labeling: Encodings Format for information on how the strings are computed.


Top and bottom banner/trailer header = TOP SECRET
Protect as section of banner page = TOP SECRET A B
Inf. label/top and bottom body pages = UNCLASSIFIED
Caveats section of printer banner page = 
Handling channels section of banner page = HANDLE 
         VIA (CH B)/(CH A) CHANNELS JOINTLY