BSM token format questions

Robert Watson rwatson at FreeBSD.org
Sun May 1 18:56:42 GMT 2005


To those on the list who are interested in such things, and might be able 
to speak authoritatively on these matters :-).  I have a number of 
questions regarding the BSM file format, generally relating to specific 
tokens.  I'm about 1/3 of the way through creating the OpenBSM 
documentation of the file format, and am interested in clarifying both 
syntax and semantics.  By token type, then:

(0) All Tokens

   For all typed tokens, is it correct to use big endian (or network byte
   order) conversion on little endian systems?

(1) Arbitrary Data Token

   The Sun web site file format documentation indictes there is a 1-byte
   "how to print" token.  How should this value be interpreted?  Is any
   treatment of byte order performed for the data?

(2) in_addr and in_addr_ex Tokens

   The Sun web site documents in_addr as consisting of a 1 byte token ID, 1
   byte address type ID, and 4 or 16 bytes of address data.  Is the address
   type assumed to be the AF_xxx constant associated with that type on
   Solaris?

   The Sun web site documents in_addr_ex tokens as consisting of a 1 byte
   token ID, 4 or 16 bytes of address type/length information, and 16 bytes
   of address.

   FWIW, the Darwin BSM library implementation uses both of these types
   differently than is defined in the Sun docs.  It treats in_addr as a 1
   byte token ID followed byt a 4-byte IPv4 address in network byte order,
   and the in_add_ex token as a 1 byte token ID, a 4-byte address type
   field (AF_xxx), followed by 4 bytes of IPv4 address, or 16 bytes of IPv6
   address.  The implementation doesn't seem picky about byte order, but I
   assume network byte order.

   Questions: Is the assumption relating to type referring to the AF_xxx
   constant correct?  Why can the address type/length field be 4 or 16
   bytes, and how do you tell, in in_addr_ex?  Maybe there is a
   documentation error?  Is it correct to use only network byte order for
   the addresses?  How about the address type?

(3) ip Token

   Is it correct to assume that the 20 bytes is an IP header, and that all
   fields are stored in network byte order from the wire?

More questions undoubtably to follow as I work my way through.

FYI, the URL for the file format documentation I've been using is:

   http://docs.sun.com/app/docs/doc/816-5174/6mbb98udf?a=view

Robert N M Watson
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-discuss" in the body of the message



More information about the trustedbsd-discuss mailing list