From 7be9e292dcd4aac22a326713413b41fc988c3203 Mon Sep 17 00:00:00 2001 From: fbernon Date: Sat, 26 Apr 2008 10:46:23 +0000 Subject: [PATCH] sockets.h: minor changes, add comments for ToS options --- src/include/lwip/sockets.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index 603b62fd..e261798f 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -177,7 +177,22 @@ typedef struct ip_mreq { } ip_mreq; #endif /* LWIP_IGMP */ -/* Unimplemented for now... */ +/* + * The Type of Service provides an indication of the abstract + * parameters of the quality of service desired. These parameters are + * to be used to guide the selection of the actual service parameters + * when transmitting a datagram through a particular network. Several + * networks offer service precedence, which somehow treats high + * precedence traffic as more important than other traffic (generally + * by accepting only traffic above a certain precedence at time of high + * load). The major choice is a three way tradeoff between low-delay, + * high-reliability, and high-throughput. + * The use of the Delay, Throughput, and Reliability indications may + * increase the cost (in some sense) of the service. In many networks + * better performance for one of these parameters is coupled with worse + * performance on another. Except for very unusual cases at most two + * of these three indications should be set. + */ #define IPTOS_TOS_MASK 0x1E #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) #define IPTOS_LOWDELAY 0x10 @@ -187,7 +202,13 @@ typedef struct ip_mreq { #define IPTOS_MINCOST IPTOS_LOWCOST /* - * Definitions for IP precedence (also in ip_tos) (Unimplemented) + * The Network Control precedence designation is intended to be used + * within a network only. The actual use and control of that + * designation is up to each network. The Internetwork Control + * designation is intended for use by gateway control originators only. + * If the actual use of these precedence designations is of concern to + * a particular network, it is the responsibility of that network to + * control the access to, and use of, those precedence designations. */ #define IPTOS_PREC_MASK 0xe0 #define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)