The MPLS WG Archive[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index][Thread Index][Author Index][Subject Index] Session attribute object
schultz@io.iol.unh.edu wrote: > > I am experiencing difficulty understanding the following piece of the > RSVP-TE draft (from section 4.7.3): > > "The contents of the Session Name field are a string, typically of > display-able characters. The Length MUST always be a multiple of 4 > and MUST be at least 8. For an object length that is not a multiple > of 4, the object is padded with trailing NULL characters. The Name > Length field contains the actual string length." > > There are 2 issues here: > > 1. I interpret "Length" in the second sentence to mean object > length. Is that correct? Or is it name length? Object length. > 2. Isn't the session name field padded with NULL characters and not > the object length field? Yes. Since the object length must be a multiple of 4, but the name does not, any space between the end of the name and the end of the object should be padded with NULL characters. Note, however, that if the name is a multiple of 4 bytes, then the last byte of the name is the last byte of the object. There is no requirement that there be a NULL character following the name. Be sure your code treats it as a counted string and not a null-terminated string when parsing the object. > My understanding of object length fields is that they are always > multiples of 4. Is this object length field an exception? I would > think that the pad characters would be included in an object length > field or the parser would not work. Objects are always multiples of 4 bytes long. This is a hard requirement from RFC 2205. The pad characters described exist specifically for the purpose of adhering to this requirement. -- David
|
|