IPTOS constants

Dag-Erling Smørgrav des at des.no
Wed May 4 06:50:29 EST 2011


defines.h defines a bunch of IPTOS constants if they're not already
available:

#ifndef IPTOS_LOWDELAY
# define IPTOS_LOWDELAY          0x10
# define IPTOS_THROUGHPUT        0x08
# define IPTOS_RELIABILITY       0x04
# define IPTOS_LOWCOST           0x02
# define IPTOS_MINCOST           IPTOS_LOWCOST
#endif /* IPTOS_LOWDELAY */

A few lines further down, it includes <netinet/ip.h>, which is where
those constants are defined (at least in FreeBSD).

--- /home/des/freebsd/base/vendor-crypto/openssh/dist/defines.h
    2011-01-17 11:15:31.000000000 +0100
+++ defines.h  2011-05-03 22:34:47.724047823 +0200
@@ -45,6 +45,7 @@
 /*
  * Definitions for IP type of service (ip_tos)
  */
+#include <netinet/ip.h>
 #ifndef IPTOS_LOWDELAY
 # define IPTOS_LOWDELAY          0x10
 # define IPTOS_THROUGHPUT        0x08
@@ -57,7 +58,6 @@
  * Definitions for DiffServ Codepoints as per RFC2474
  */
 #include <netinet/in_systm.h>
-#include <netinet/ip.h>
 #ifndef IPTOS_DSCP_AF11
 # define       IPTOS_DSCP_AF11         0x28
 # define       IPTOS_DSCP_AF12                 0x30

These include directives should really be moved to includes.h - in fact,
<netinet/in_systm.h> is already there.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the openssh-unix-dev mailing list