fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] [ initrwnd NUMBER ]\n");
+ fprintf(stderr, " [ features FEATURES ]\n");
fprintf(stderr, " [ quickack BOOL ]\n");
fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n");
fprintf(stderr, "RTPROTO := [ kernel | boot | static | NUMBER ]\n");
fprintf(stderr, "TIME := NUMBER[s|ms]\n");
fprintf(stderr, "BOOL := [1|0]\n");
+ fprintf(stderr, "FEATURES := ecn\n");
exit(-1);
}
return -1;
}
+static void print_rtax_features(FILE *fp, unsigned int features)
+{
+ unsigned int of = features;
+
+ if (features & RTAX_FEATURE_ECN) {
+ fprintf(fp, " ecn");
+ features &= ~RTAX_FEATURE_ECN;
+ }
+
+ if (features)
+ fprintf(fp, " 0x%x", of);
+}
+
int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE*)arg;
val = *(unsigned*)RTA_DATA(mxrta[i]);
switch (i) {
+ case RTAX_FEATURES:
+ print_rtax_features(fp, val);
+ break;
case RTAX_HOPLIMIT:
if ((int)val == -1)
val = 0;
if (get_unsigned(&win, *argv, 0))
invarg("\"initrwnd\" value is invalid\n", *argv);
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITRWND, win);
+ } else if (matches(*argv, "features") == 0) {
+ unsigned int features = 0;
+
+ while (argc > 0) {
+ NEXT_ARG();
+
+ if (strcmp(*argv, "ecn") == 0)
+ features |= RTAX_FEATURE_ECN;
+ else
+ invarg("\"features\" value not valid\n", *argv);
+ break;
+ }
+
+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_FEATURES, features);
} else if (matches(*argv, "quickack") == 0) {
unsigned quickack;
NEXT_ARG();
.IR NUMBER " ] [ "
.B initrwnd
.IR NUMBER " ] [ "
+.B features
+.IR FEATURES " ] [ "
.B quickack
.IR BOOL " ]"
.BR kernel " | " boot " | " static " |"
.IR NUMBER " ]"
+.ti -8
+.IR FEATURES " := [ "
+.BR ecn " | ]"
+
.SH DESCRIPTION
.B ip route
Actual window size is this value multiplied by the MSS of the connection.
The default value is zero, meaning to use Slow Start value.
+.TP
+.BI features " FEATURES " (3.18+ only)
+Enable or disable per-route features. Only available feature at this
+time is
+.B ecn
+to enable explicit congestion notification when initiating connections to the
+given destination network.
+When responding to a connection request from the given network, ecn will
+also be used even if the
+.B net.ipv4.tcp_ecn
+sysctl is set to 0.
+
.TP
.BI quickack " BOOL " "(3.11+ only)"
Enable or disable quick ack for connections to this destination.