Trusted Solaris Developer's Guide

Compare Attribute Structures

This example compares the sendattrs with recvattrs for equality.

#include <tsix/t6attrs.h>
#include <tsol/label.h>

main()
{
	int retval;
	t6attr_t sendattrs, recvattrs;
	t6mask_t sendmask, recvmask;

	recvmask = T6M_SL;
	recvattrs = t6alloc_blk(recvmask);
	sendmask = T6M_SESSION_ID;
	sendattrs = t6alloc_blk(sendmask);

	retval = t6cmp_blk(sendattrs, recvattrs);
	printf("Does sendattrs = recvattrs? %d\n", retval);
}

The printf statement prints the following where 0 means the structures are equal and any non-zero value means they are not.


Does sendattrs = recvattrs? 5