bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Standard ports using IPPORT_*.


From: Mats Erik Andersson
Subject: Re: [bug-inetutils] Standard ports using IPPORT_*.
Date: Sun, 15 Jan 2012 18:09:03 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

söndag den 15 januari 2012 klockan 09:54 skrev Alfred M. Szmidt detta:
>    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.
> 
>    [...]
>
>    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.

We are using IPPORT_RESERVED without testing is presence. Good so:

  /* Glibc */
  enum {
    IPPORT_RESERVED = 1024
  }

  /* OpenBSD, NetBSD, OpenSolaris */
  #defined IPPORT_RESERVED 1024

The general situation is this:

  Glibc: A fairly small collection of IPPORT_*, all enum declared.

  OpenSolaris: A larger collection IPPORT_*, all are defined macros.

  OpenBSD, NetBSD: Only IPPORT_RESERVED and three (resp., four) more
    related to port ranges; all are defined as macros. No macros for
    serviceable port numbers.

> If we still want to support systems where IPPORT_* is not defined, we
> should do a configuration check.

Clearly Glibc is the misbehaving fellow here. The missing port numbers
in BSD are no problem at all.

Regards,
  Mats



reply via email to

[Prev in Thread] Current Thread [Next in Thread]