


t6export_attr(3n)                               t6export_attr(3n)


WWAARRNNIINNGG  -  This  is  a TSIG draft specification, currently under
review.



NNaammee
       t6export_attr, t6import_attr - TSIX(re) 1.1 interfaces for
       sending and receiving in-message security attributes


SSyynnooppssiiss
        ##iinncclluuddee



       tt66aattttrr__eexxtt__bbuuffffeerr__tt **tt66eexxppoorrtt__aattttrr(
           tt66aattttrr__mmaasskk__tt mask, tt66aattttrr__tt *attr, lloonngg *buflen)


       tt66aattttrr__tt **tt66iimmppoorrtt__aattttrr(
           tt66aattttrr__eexxtt__bbuuffffeerr__tt  *buf,  lloonngg buflen, tt66aattttrr__mmaasskk__tt
           *mask)



DDeessccrriippttiioonn
       These functions allow communicating applications  to  pass
       attributes  in  a system-independent format.  They provide
       what is called in-message  attribute  passing,  where  the
       attributes  are  passed  in an application defined message
       protocol along with the data to which they  apply.  It  is
       distinct  from  and  may  be  used  in addition to the on-
       message attribute passing provided  by  the  TTSSIIXX((rree))  11..11
       SSeeccuurriittyy AAttttrriibbuuttee MMoodduullaattiioonn PPrroottooccooll( ssaammpp((77))).

       The  tt66eexxppoorrtt__aattttrr function encodes the supplied attr list
       in the system independent format and returns a buffer con-
       taining  the encoded attributes. The buffer is dynamically
       allocated and may  be  freed  using  ffrreeee((33nn)).  The  total
       length  of  the  encoded  attribute  buffer is returned in
       buflen.  Only those attributes whose corresponding bit  is
       set  in  mask and whose value has been set by a prior call
       to tt66sseett__aattttrr((33nn)) are converted.

       The tt66iimmppoorrtt__aattttrr function takes as input  a  buffer  con-
       taining  attributes encoded in the system independent for-
       mat and converts them to  local  internal  representation.
       The  buflen  specifies the actual length of the buffer and
       must be consistent with the  total  length  field  in  the
       encoded  attribute  header.  The  converted attributes are
       returned in a  dynamically  allocated  tt66aattttrr__tt  structure
       which  may be freed using tt66ffrreeee__aattttrr((33nn)).  The attributes
       which were converted are identified  in  the  mask  output
       parameter.



                                                                1





t6export_attr(3n)                               t6export_attr(3n)


SSyysstteemm IInnddeeppeennddeenntt EEnnccooddeedd FFoorrmmaatt
       The SSyysstteemm IInnddeeppeennddeenntt EEnnccooddeedd FFoorrmmaatt consists of a header
       and a variable  number  of  attribute  specifications,  as
       illustrated below. The illustration describes the contents
       of the tt66aattttrr__eexxtt__bbuuffffeerr__tt returned by  tt66eexxppoorrtt__aattttrr  and
       expected as input to tt66iimmppoorrtt__aattttrr. All fields are in net-
       work byte order with no padding for alignment.
            ______________________________________________________________________________________________
           ||                 OOcctteettss                        ||
           ||______________________________________________________________________________________________||
           ||    11  ||    22  ||    33  ||    44  ||    55  ||   66   ||
           ||______________||______________||______________||______________||______________||______________||
           ||            TToottaall LLeennggtthh       ||   VVeerrssiioonn     ||
           ||______________||______________||______________||______________||______________||______________||<<----HHeeaaddeerr

            ______________________________________________________________________________________________
           ||  IIdd     ||FFoorrmmaatt  ||     DDOOTT  LLeennggtthh  ||EEnnccooddeedd  LLeennggtthh
       ||<<----AAttttrriibbuuttee
           ||______________||______________||______________||______________||______________||______________||
       ##11
           || DDOOTT NNaammee ((vvaarriiaabbllee lleennggtthh))                    ||
           ||                                               ||
           ||______________||______________||______________||______________||______________||______________||
           || EEnnccooddeedd AAttttrriibbuuttee ((vvaarriiaabbllee lleennggtthh))           ||
           ||                                               ||
           ||______________||______________||______________||______________||______________||______________||

            ______________________________________________________________________________________________
           ||  IIdd     ||FFoorrmmaatt  ||     DDOOTT  LLeennggtthh  ||EEnnccooddeedd  LLeennggtthh
       ||<<----AAttttrriibbuuttee
           ||______________||______________||______________||______________||______________||______________||
       ##22
           || DDOOTT NNaammee ((vvaarriiaabbllee lleennggtthh))                    ||
           ||                                               ||
           ||______________||______________||______________||______________||______________||______________||
           || EEnnccooddeedd AAttttrriibbuuttee ((vvaarriiaabbllee lleennggtthh))           ||
           ||                                               ||
           ||______________||______________||______________||______________||______________||______________||




       The total length field in the header gives the size of the
       encoded attribute buffer and includes the  length  of  the
       header  itself.  The version identifies the version of the
       attribute  buffer  and  currently  must  be  assigned  the
       TSIX(re) 1.1 value 00xx00110011.

       Each   attribute  is  represented  by  a  variable  length
       attribute specification.  The id is a tt66aattttrr__iidd__tt  identi-
       fying the attribute type as follows:






                                                                2





t6export_attr(3n)                               t6export_attr(3n)


       00 -- TT66EEXXTT__SSEENN__LLAABBEELL

       11 -- TT66EEXXTT__CCLLEEAARRAANNCCEE

       22 -- TT66EEXXTT__IINNFFOO__LLAABBEELL

       33 -- TT66EEXXTT__PPRRIIVVIILLEEGGEESS

       44 -- TT66EEXXTT__AAUUDDIITT__IIDD

       55 -- TT66EEXXTT__UUIIDD

       66 -- TT66EEXXTT__GGIIDD

       77 -- TT66EEXXTT__GGRROOUUPPSS

       88 -- TT66EEXXTT__NNAATT__CCAAVVEEAATTSS

       99 -- TT66EEXXTT__IINNTTEEGG__LLAABBEELL

       1100 -- TT66EEXXTT__AACCLL


       The  format  field specifies the attribute system indepen-
       dent format as a tt66aattttrr__ffoorrmmaatt__tt and may have one  of  the
       following values:


       11 -- BBIINNAARRYY__FFOORRMMAATT
           This  value  indicates that the attribute is in binary
           encoded system independent format.  The  encoding  for
           each attribute type is described below.

       22 -- AASSCCIIII__FFOORRMMAATT
           This  value  indicates  that the attribute is in ASCII
           encoded system independent format.  The  encoding  for
           each attribute type is described below.

       33 -- VVEENNDDOORR__IIRR__FFOORRMMAATT
           This  value indicates that the attribute is in vendor-
           specific internal representation format. The  encoding
           is  entirely  vendor  defined  and  results are unpre-
           dictable if used  between  different  vendor  systems.
           Support for this encoding is optional.

       44 -- TTOOKKEENN__FFOORRMMAATT
           This value indicates that the attribute encoding is in
           the form of a 32-bit token. Support for this format is
           optional  and  implies  that  both  hosts  support the
           TTSSIIXX((rree))  11..11   SSeeccuurriittyy   TTookkeenn   MMaappppiinngg   PPrroottooccooll(
           ssaattmmpp((77))).


       The  DOT  Name  gives  the  domain of translation for this



                                                                3





t6export_attr(3n)                               t6export_attr(3n)


       attribute as  a  null-terminated  ASCII  string.  The  DOT
       Length gives the length of the DOT name in octets, includ-
       ing the terminating null.  The DOT length may be zero,  in
       which  case  the  DOT  name shall not be present.  The DOT
       length may also be 1 with the DOT  name  consisting  of  a
       single null octet. Both of these shall be considered valid
       and ordinary special cases, indicating that no DOT  trans-
       lation  is  needed.  The  DOT  name is only meaningful for
       BBIINNAARRYY__FFOORRMMAATT and AASSCCIIII__FFOORRMMAATT.

       The DOT for an attribute is set by  tt66sseett__aattttrr__ddoommaaiinn((33nn)).
       and  determines  how  the  attribute in question is inter-
       preted by the sender and the receiver. If a DOT  has  been
       established  for  an  attribute,  the  domain name will be
       included along with  the  encoded  representation  of  the
       attribute.  Depending  upon  the  DOT,  either  sender  or
       receiver (or both) may perform a mapping between the  host
       internal  representation  of the attribute and the system-
       independent encoded format.  For more details  on  domains
       of  translation  please refer to the TTSSIIXX((rree)) 11..11 SSeeccuurriittyy
       AAttttrriibbuuttee TTookkeenn MMaappppiinngg PPrroottooccooll ( ssaattmmpp((77))).

       The Encoded Attribute holds the system independent  encod-
       ing of the attributes. The Encoded Length gives the length
       of the encoded attribute in octets. If the length is zero,
       the  encoded  attribute  shall not be present and shall be
       considered to have a  TT66NNUULLLL__AATTTTRR__RREEPP  value.  This  is  a
       valid but not ordinary special case and the interpretation
       is application dependent.


AASSCCIIII EEnnccooddeedd FFoorrmmaatt
       All ASCII  encoded  attributes  are  null  (0)  terminated
       strings,  with  the  followings  specific formats for each
       attribute type:



       TT66EEXXTT__SSEENN__LLAABBEELL,, TT66EEXXTT__CCLLEEAARRAANNCCEE
           A set of words separated by spaces.  The first word(s)
           must  be  the  classification. Any remaining words are
           elements of the compartment set. The various words can
           be  parsed  using  standard sensitivity label encoding
           rules.

        TT66EEXXTT__IINNFFOO__LLAABBEELL
           A set of words separated by spaces. The first  word(s)
           specifies  the classification. Remaining words consist
           of elements of the compartment set and elements of the
           marking set. The various words can be parsed using the
           DIA's standard encoding rules.

        TT66EEXXTT__PPRRIIVVIILLEEGGEESS
           A set  of  privilege  names  separated  by  spaces  or



                                                                4





t6export_attr(3n)                               t6export_attr(3n)


           commas.

        TT66EEXXTT__AAUUDDIITT__IIDD,, TT66EEXXTT__UUIIDD,, TT66EEXXTT__GGIIDD
           A user or group name.

        TT66EEXXTT__GGRROOUUPPSS
           A  uu__sshhoorrtt,  specifying  the  number  of supplementary
           groups, followed by that number of ASCII group  names.
           Each group name is a null (0) terminated string.  If a
           system does not support supplementary groups, the num-
           ber of groups shall be zero(0) with no following group
           names.

        TT66EEXXTT__IINNTTEEGG__LLAABBEELL
           Currently undefined.

        TT66EEXXTT__NNAATT__CCAAVVEEAATT
           A set of country names separated by spaces or  commas.

        TT66EEXXTT__AACCLL
           An  ACL  entry  consists  of a u_int32, specifying the
           number of entries in the ACL, followed by  a  list  of
           ACL  entries. Each ACL entry consists of an ACL header
           followed  by  zero  or  more   null-terminated   ASCII
           strings.  The  ASCII format ACL header is described as
           shown below:


              ttyyppeeddeeff ssttrruucctt {{
                   uu__cchhaarr aaccll__ttyyppee;;
                   uu__cchhaarr aaccll__ccllaassss;;
                   cchhaarr aaccll__ppeerrmm[[]];;
              }} tt66aattttrr__aaccll__aasscciiii;;


           The defined values for acl_type are:


               00 AACCLL__MMOODDEEMMAASSKK       NNoo ffoolllloowwiinngg ssttrriinngg
               11 AACCLL__UUSSEERR__OOBBJJ       OOnnee ffoolllloowwiinngg ssttrriinngg ssppeecciiffyy--
           iinngg tthhee oowwnniinngg
                                    uusseerr nnaammee
               22 AACCLL__GGRROOUUPP__OOBBJJ      OOnnee ffoolllloowwiinngg ssttrriinngg ssppeecciiffyy--
           iinngg tthhee oowwnniinngg
                                    ggrroouupp nnaammee
               33 AACCLL__OOTTHHEERR__OOBBJJ      NNoo ffoolllloowwiinngg ssttrriinngg
               44 AACCLL__UUSSEERR           OOnnee ffoolllloowwiinngg ssttrriinngg ssppeecciiffyy--
           iinngg aa uusseerr nnaammee
               55 AACCLL__GGRROOUUPP          OOnnee ffoolllloowwiinngg ssttrriinngg ssppeecciiffyy--
           iinngg aa ggrroouupp nnaammee
               66 AACCLL__UUSSEERR__GGRROOUUPP     TTwwoo ffoolllloowwiinngg ssttrriinnggss  ssppeeccii--
           ffyyiinngg aa uusseerr
                                    nnaammee aanndd aa ggrroouupp nnaammee
               77--112277                RReesseerrvveedd ffoorr ffuuttuurree uussee



                                                                5





t6export_attr(3n)                               t6export_attr(3n)


           The defined values for acl_class are:


               00  AACCLL__CCLL__AACCCCEESSSS       TThhee  eennttrryy  iiss  ppaarrtt  ooff aann
           aacccceessss AACCLL
               11  AACCLL__CCLL__DDEEFFAAUULLTT      TThhee  eennttrryy  iiss  ppaarrtt  ooff  aa
           ddeeffaauulltt AACCLL
               22--112277                RReesseerrvveedd ffoorr ffuuttuurree uussee



           The  value  of  acl_perm  is  a null-terminated string
           specifying the permissions  associated  with  the  ACL
           entry (for ACL types 1-6) or a mode mask (for ACL type
           0).  The format,  definition,  and  interpretation  of
           acl_perm  is  dependent upon the ACL policy implied by
           the DOT.  Any  requirement  for  ACL  entry  ordering,
           required  ACL  entries,  or  ACL  entry  uniqueness is
           dependent upon the ACL policy implied by the DOT.




BBIINNAARRYY EEnnccooddeedd FFoorrmmaatt
       All binary encoded attribute are specified as shown below.
       All  attribute  bit  masks are padded to a 32-bit longword
       boundary and are in network byte order. Bit 0 is  the  MSB
       of  the  first  longword,  bit 32 is the MSB of the second
       longword, and so forth.


       TT66EEXXTT__SSEENN__LLAABBEELL,, TT66EEXXTT__CCLLEEAARRAANNCCEE
           A uu__iinntt3322  classification followed by a  uu__iinntt3322  com-
           partment  set  bit mask size, specifying the number of
           octets in the compartment set bit mask.  If  the  com-
           partment set bit mask size is non-zero, it is followed
           by the compartment set bit mask octets.

        TT66EEXXTT__IINNFFOO__LLAABBEELL
           A uu__iinntt3322  classification followed by a  uu__iinntt3322  com-
           partment  set  bit mask size, specifying the number of
           octets in the compartment set bit mask.  If  the  com-
           partment set bit mask size is non-zero, it is followed
           by the compartment set bit mask octets. This  is  fol-
           lowed  by a uu__iinntt3322 markings bit mask size, specifying
           the number of octets in the markings bit mask. If  the
           markings  bit mask size is non-zero, it is followed by
           the markings bit mask octets.

        TT66EEXXTT__PPRRIIVVIILLEEGGEESS
           The privilege set is a bitmask rounded to a  uu__iinntt3322
           boundary.





                                                                6





t6export_attr(3n)                               t6export_attr(3n)


        TT66EEXXTT__AAUUDDIITT__IIDD,, TT66EEXXTT__UUIIDD,, TT66EEXXTT__GGIIDD
           A user id or a group id is a single uu__iinntt3322 .

        TT66EEXXTT__GGRROOUUPPSS
           A  uu__iinntt3322,  specifying  the  number  of supplementary
           groups, followed by that number of uu__iinntt3322 group iden-
           tifiers.   If  a system does not support supplementary
           groups, the number of groups shall be zero(0) with  no
           following group identifiers.

        TT66EEXXTT__IINNTTEEGG__LLAABBEELL
           Currently undefined.

        TT66EEXXTT__NNAATT__CCAAVVEEAATT
           A  caveat  set  is  a  bit  mask rounded to a  uu__iinntt3322
           boundary.


        TT66EEXXTT__AACCLL
           An ACL entry consists of  a  u_int32,  specifying  the
           number  of  entries  in the ACL, followed by a list of
           ACL entries. Each ACL entry consists of an ACL  header
           followed  by  zero  or more u_int32 values. The binary
           format ACL header is described as shown below:


              ttyyppeeddeeff ssttrruucctt {{
                   uu__cchhaarr aaccll__ttyyppee;;
                   uu__cchhaarr aaccll__ccllaassss;;
                   uusshhoorrtt aaccll__ppeerrmm;;
              }} tt66aattttrr__aaccll__bbiinnaarryy;;


           The defined values for acl_type are:


               00 AACCLL__MMOODDEEMMAASSKK       NNoo ffoolllloowwiinngg uu__iinntt3322
               1 ACL_USER_OBJ       One following u_int32  speci-
           fying the owning
                                    user id
               2  ACL_GROUP_OBJ      One following u_int32 speci-
           fying the owning
                                    group id
               3 ACL_OTHER_OBJ      No following u_int32
               4 ACL_USER           One following u_int32  speci-
           fying a user id
               5  ACL_GROUP          One following u_int32 speci-
           fying a group id
               6 ACL_USER_GROUP     Two following strings  speci-
           fying a user id and
                                    a group id
               7-127                Reserved for future use

           The defined values for acl_class are:



                                                                7





t6export_attr(3n)                               t6export_attr(3n)



               00  AACCLL__CCLL__AACCCCEESSSS       TThhee  eennttrryy  iiss  ppaarrtt  ooff aann
           aacccceessss AACCLL
               11  AACCLL__CCLL__DDEEFFAAUULLTT      TThhee  eennttrryy  iiss  ppaarrtt  ooff  aa
           ddeeffaauulltt AACCLL
               22--112277                RReesseerrvveedd ffoorr ffuuttuurree uussee



           The  value of acl_perm is a bit pattern specifying the
           permissions associated with the  ACL  entry  (for  ACL
           types  1-6) or a mode mask (for ACL type 0).  The for-
           mat, definition, and  interpretation  of  acl_perm  is
           dependent upon the ACL policy implied by the DOT.

           Any  requirement  for ACL entry ordering, required ACL
           entries, or ACL entry uniqueness is dependent upon the
           ACL policy implied by the DOT.




RReettuurrnn VVaalluuee
       Both  tt66eexxppoorrtt__aattttrr  and tt66iimmppoorrtt__aattttrr return addresses of
       dynamically allocated memory on  success.  They  return  a
       NNUULLLL   address  on  any  error.  The  memory  returned  by
       tt66eexxppoorrtt__aattttrr may be releases using  free(3).  The  memory
       returned  by   tt66eexxppoorrtt__aattttrr  is an opaque attribute block
       and should be released using tt66ffrreeee__aattttrr((33nn)).

NNootteess
        1.  Programs using these routines must be  compiled  with
            --lltt66 .

        2.  It  is recommended that DOT naming conventions follow
            those described in ssaattmmpp((77))



SSeeee AAllssoo
       lliibbtt66((33nn)), tt66sseett__aattttrr__ddoommaaiinn((33nn)), tt66sseett__aattttrr((33nn)), ttssiixx((77)),
       ssaattmmpp((77))















                                                                8


