#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <syslog.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
static void explain(void)
{
- fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
- fprintf(stderr, " [ classid CLASSID ] [ action ACTION_SPEC ]\n");
- fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
- fprintf(stderr, " CLASSID := X:Y\n");
- fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+ fprintf(stderr,
+ "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n"
+ " [ classid CLASSID ] [ action ACTION_SPEC ]\n"
+ " ACTION_SPEC := ... look at individual actions\n"
+ " CLASSID := X:Y\n"
+ "\n"
+ "NOTE: CLASSID is parsed as hexadecimal input.\n");
}
static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
if (argc == 0)
return 0;
- tail = NLMSG_TAIL(n);
- addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
+ tail = addattr_nest(n, 4096, TCA_OPTIONS);
while (argc > 0) {
if (matches(*argv, "to") == 0) {
}
argc--; argv++;
}
- tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+ addattr_nest_end(n, tail);
if (order) {
fh &= ~0x7F00;
fh |= (order<<8)&0x7F00;