Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Solaris Trusted Extensions Developer's Guide
Previous Next

Label APIs

The label APIs are introduced in Chapter 2, Labels and Clearances. Sample code is provided in Chapter 3, Label Code Examples. A fully described example is provided in Chapter 4, Printing and the Label APIs.

The following lists the types of label-related APIs and shows the prototype declarations of the routines and system calls for each type:

  • Accessing the label_encodings file

    • m_label_t *m_label_alloc(const m_label_type_t label_type);

    • int m_label_dup(m_label_t **dst, const m_label_t *src);

    • void m_label_free(m_label_t *label);

    • int label_to_str(const m_label_t *label, char **string, const m_label_str_t conversion_type, uint_t flags);

  • Comparing level relationships

    • int blequal(const m_label_t *level1, const m_label_t *level2);

    • int bldominates(const m_label_t *level1, const m_label_t *level2);

    • int blstrictdom(const m_label_t *level1, const m_label_t *level2);

    • int blinrange(const m_label_t *level, const brange_t *range);

    • void blmaximum(m_label_t *maximum_label, const m_label_t *bounding_label);

    • void blminimum(m_label_t *minimum_label, const m_label_t *bounding_label);

  • Accessing label ranges

    • m_range_t *getuserrange(const char *username);

    • blrange_t *getdevicerange(const char *device);

  • Accessing labels in zones

    • char *getpathbylabel(const char *path, char *resolved_path, size_t bufsize, const m_label_t *sl);

    • m_label_t *getzonelabelbyid(zoneid_t zoneid);

    • m_label_t *getzonelabelbyname(const char *zonename);

    • zoneid_t *getzoneidbylabel(const m_label_t *label);

    • char *getzonerootbyid(zoneid_t zoneid);

    • char *getzonerootbylabel(const m_label_t *label);

    • char *getzonerootbyname(const char *zonename);

  • Obtaining the remote host type

    • tsol_host_type_t tsol_getrhtype(char *hostname);

  • Accessing and modifying sensitivity labels

    • int fgetlabel(int fd, m_label_t *label_p);

    • int getlabel(const char *path, m_label_t *label_p);

    • int setflabel(const char *path, const m_label_t *label_p);

    • int getplabel(m_label_t *label_p);

    • int label_to_str(const m_label_t *label, char **string, const m_label_str_t conversion_type, uint_t flags);

    • int str_to_label(const char *string, m_label_t **label, const m_label_type_t label_type, uint_t flags, int *error);

Previous Next

  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire