diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:25:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:25:49 +0000 |
commit | 04fc174d50fd19d6ae78fd2fd2faae221acff807 (patch) | |
tree | 23e5482ac4eb332df0fc69bf932118f0d4e42eb0 /include/dscp.h | |
parent | Adding upstream version 2.1.9+dfsg. (diff) | |
download | iperf-upstream.tar.xz iperf-upstream.zip |
Adding upstream version 2.2.0+dfsg.upstream/2.2.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/dscp.h')
-rw-r--r-- | include/dscp.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dscp.h b/include/dscp.h index fe5486e..79d779b 100644 --- a/include/dscp.h +++ b/include/dscp.h @@ -44,11 +44,27 @@ * by Robert J. McMahon (rjmcmahon@rjmcmahon.com, bob.mcmahon@broadcom.com) * ------------------------------------------------------------------- */ +/* + * 7 6 5 4 3 2 1 0 + * +--+--+--+--+--+--+--+--+ + * | DSCP | ECN | + * +--+--+--+--+--+--+--+--+ + * + */ + #ifndef DSCP_H #define DSCP_H #ifdef __cplusplus extern "C" { #endif + +// DSCP bits +#define DSCP_SHIFT 2 +#define DSCP_BITMASK 0xFC +#define ECN_BITMASK 0x03 +#define DSCP_VALUE(value) (int)((value & DSCP_BITMASK) >> DSCP_SHIFT) +#define ECN_VALUE(value) (int)(value & ECN_BITMASK) + int parse_ipqos(const char *cp); const char * iptos2str(int iptos); #ifdef __cplusplus |