-/* $OpenBSD: bgpctl.c,v 1.265 2021/02/16 08:30:21 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.266 2021/04/15 14:12:05 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
warnx("bad IMSG_CTL_SHOW_RIB_ATTR received");
break;
}
- output->attr(imsg->data, ilen, res);
+ output->attr(imsg->data, ilen, res->flags);
break;
case IMSG_CTL_SHOW_RIB_MEM:
if (imsg->hdr.len < IMSG_HEADER_SIZE + sizeof(stats))
if (req->flags & F_CTL_DETAIL) {
for (j = 0; j < mre->nattrs; j++)
output->attr(mre->attrs[j].attr,
- mre->attrs[j].attr_len, &res);
+ mre->attrs[j].attr_len, req->flags);
}
}
}
/* XXX this function does not handle JSON output */
static void
-show_mrt_update(u_char *p, u_int16_t len)
+show_mrt_update(u_char *p, u_int16_t len, int reqflags)
{
struct bgpd_addr prefix;
int pos;
attrlen += 1 + 2;
}
- output->attr(p, attrlen, 0);
+ output->attr(p, attrlen, reqflags);
p += attrlen;
alen -= attrlen;
len -= attrlen;
u_char *p;
u_int16_t len;
u_int8_t type;
+ struct ctl_show_rib_request *req = arg;
printf("%s %s[%u] -> ", fmt_time(&mm->time),
log_addr(&mm->src), mm->src_as);
printf("illegal length: %u byte\n", len);
return;
}
- show_mrt_update(p, len - MSGSIZE_HEADER);
+ show_mrt_update(p, len - MSGSIZE_HEADER, req->flags);
break;
case KEEPALIVE:
printf("%s ", msgtypenames[type]);
void (*fib_table)(struct ktable *);
void (*nexthop)(struct ctl_show_nexthop *);
void (*interface)(struct ctl_show_interface *);
- void (*attr)(u_char *, size_t, struct parse_result *);
+ void (*attr)(u_char *, size_t, int);
void (*communities)(u_char *, size_t, struct parse_result *);
void (*rib)(struct ctl_show_rib *, u_char *, size_t,
struct parse_result *);
-/* $OpenBSD: output.c,v 1.14 2021/03/01 08:02:34 jsg Exp $ */
+/* $OpenBSD: output.c,v 1.15 2021/04/15 14:12:05 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
}
static void
-show_attr(u_char *data, size_t len, struct parse_result *res)
+show_attr(u_char *data, size_t len, int reqflags)
{
u_char *path;
struct in_addr id;
break;
}
done:
- printf("%c", EOL0(res->flags));
+ printf("%c", EOL0(reqflags));
}
static void
-/* $OpenBSD: output_json.c,v 1.8 2021/03/01 08:02:34 jsg Exp $ */
+/* $OpenBSD: output_json.c,v 1.9 2021/04/15 14:12:05 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
}
static void
-json_attr(u_char *data, size_t len, struct parse_result *res)
+json_attr(u_char *data, size_t len, int reqflags)
{
struct bgpd_addr prefix;
struct in_addr id;