[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] Standard ports using IPPORT_*.
From: |
Alfred M. Szmidt |
Subject: |
Re: [bug-inetutils] Standard ports using IPPORT_*. |
Date: |
Sun, 15 Jan 2012 09:54:07 -0500 |
I have just observe that depending on library vendor,
the file <netinet/in.h> might declare IPPORT_* as
"enum" as Glibc does, or as macro, as OpenSolaris does.
Presently, only IPPORT_RESERVED is in use by us, namely
in ftpd, libinetutils, rlogind, rshd, and traceroute.
It does make sense to use the values such as IPPORT_FTP,
IPPORT_CMDSERVER, IPPORT_LOGINSERVER, and IPPORT_SYSLOG
as fallback values when starting the corresponding services,
but code like
#ifdef IPPORT_FTP
# define DEFPORT IPPORT_FTP
#else
# define DEFPORT 21
#endif
is useless since Glibc uses "enum { IPPORT_FTP = 21 }".
Could we develop a configuration test to determine
the presence of the relevant constants?
The individual constants are not always present: IPPORT_SYSLOG
is missing in Glibc, but is present in SunOS.
Do we know any systems where IPPORT_* is not defined? If those
systems are not common, we can simply use the value directly.
If we still want to support systems where IPPORT_* is not defined, we
should do a configuration check.