#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: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n");
- fprintf(stderr, " [ sender SRC[/PORT | GPI ] ]\n");
- fprintf(stderr, " [ classid CLASSID ] [ action ACTION_SPEC ]\n");
- fprintf(stderr, " [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n");
- fprintf(stderr, "Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n");
- fprintf(stderr, " u{8|16|32} NUMBER mask MASK at OFFSET}\n");
- fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
- fprintf(stderr, " FILTERID := X:Y\n");
- fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+ fprintf(stderr,
+ "Usage: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n"
+ " [ sender SRC[/PORT | GPI ] ]\n"
+ " [ classid CLASSID ] [ action ACTION_SPEC ]\n"
+ " [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n"
+ "Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n"
+ " u{8|16|32} NUMBER mask MASK at OFFSET}\n"
+ " ACTION_SPEC := ... look at individual actions\n"
+ " FILTERID := X:Y\n"
+ "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
}
static int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix *addr,
}
-static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
+static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc,
+ char **argv, struct nlmsghdr *n)
{
int family = strcmp(qu->id, "rsvp") == 0 ? AF_INET : AF_INET6;
struct tc_rsvp_pinfo pinfo = {};
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, "session") == 0) {
if (pinfo_ok)
addattr_l(n, 4096, TCA_RSVP_PINFO, &pinfo, sizeof(pinfo));
- tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+ addattr_nest_end(n, tail);
return 0;
}