Node and Host Name Sizes on HP-UX: Using the Expanded Capabilities of HP-UX

22
this, the program needs to recognize that it has encountered a nonexpanded format, and it must be
able to use the nonexpanded structure layout to read it. Updating the the stored format to the
expanded version is optional.
Second, if other programs are expected to read the expanded stored format, they must be updated to
use the expanded version. If the other programs are user programs, this can be compatibility issue if
older user programs need to be supported. One solution might be to always write two versions of the
stored data. The nonexpanded version can be used by some programs, the expanded version can be
used by enhanced user programs.
Some storage formats have flexible formats where the sizes of the data are described by metadata
stored with or alongside the actual data. It might be possible to add expanded sectionswhich are
generally ignored except by programs that can recognize them. If so, the data that depends on the
node/host name structures or constants can be added to the data in an expanded section, rather than
replacing existing sections.
Embedded in IPC Communication Protocols
Node/host name structure/constants might be embedded in communication protocols. This is similar
to having them embedded in storage formats, except there is no persistent, nonexpanded, stored
data. In most cases, protocol version levels are negotiated between the parties. This leads to a natural
way for the programs to adapt to one version or another.
In many cases, simply recompiling all the programs that use the protocol is the solution.
Embedded in Shared Memory Structures
The node/host name structure/constants might be embedded in structures that are placed in shared
memory. Again, the situation is similar to that of having them embedded in storage formats.
When accessed only by multiple instantiations of a single program, updating that program to the
expanded version (that is, recompiling with the expanded version selected) is sufficient. This is
usually the case.
When accessed by different programs, the differing data layout can cause problems. Therefore, all
the programs that access the shared memory should be updated together, if possible. Since
programs evolve, changes to the shared memory format are not uncommon. This is not an unusual
situation.
Depending on the data structures used, supporting both the nonexpanded and expanded formats in
shared memory might be possible. All writers must be updated to deal with both formats. However,
readers can use either format.
If the shared memory is accessed by others (such as, by customer applications), developers must
devise a reasonable migration plan. However, this situation is highly unusual.
Embedded in Exported Interfaces (Re-exported)
Through a library, an application might export a function (or data structure) interface that includes in
its definition arrays or structures containing a node/host name structure/constant. That interface is
said to re-export the node/host name interfaces. The developer has some choices: