Peter Memishian wrote: > > > 2.5 MAXLINKNAMELEN > > > > > > The MAXLINKNAMELEN constant has been added to <sys/param.h>, and it > > > defines the longest possible permitted datalink name (including the > > > terminating NULL character.) Its stability level is Committed. > > > > > > Note that the existing DLPI_LINKNAME_MAX constant remains, but it only > > > intended for use by libdlpi consumers, whereas MAXLINKNAMELEN is > > > appropriate for more general use. > > > > What relation does this have, if any, to the other #define'd > > constants such as LIFNAMSIZ, that are used by networking > > in, for example, struct lifreq? > > The LIFNAMSIZ constant represents the maximum length of an IP interface > and should only be used for that purpose. The MAXLINKNAMELEN constant > represents the maximum length of a datalink name and should only be used > for that purpose. Since the IP physical interface name often comes from > the datalink name, they are related, but they are neither the same > namespace nor syntactically identical -- e.g., an IP interface may include > a trailing logical interface identifier such as `:2', whereas a datalink > name may not (further, `:' is an invalid character in a datalink name).
Yes...but... My concern here is simple: is there a hidden rule along the lines of MAXLINKNAMELEN must never be greater than LIFNAMSIZ? If there is, this should be stated somewhere. If there isn't then how do we deal with the following example... If I were to define MAXLINKNAMELEN to be twice that of LIFNAMSIZ (64 vs 32) and gave a datalink interface a name that was 50 chars long, how would it be plumbed and given an IP address? At least at this point in time I'm not aware of any way to plumb an interface using a name that is not <datalinkname><number>[:<number>] and a 50 character name won't fit in the lifreq.... Darren
