extern int resolve_hosts;
extern int oneline;
extern int brief;
+extern int json;
extern int timestamp;
extern int timestamp_short;
extern const char * _SL_;
int print_timestamp(FILE *fp);
void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n);
+ #define BIT(nr) (1UL << (nr))
+
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
fprintf(stderr, "TIME := NUMBER[s|ms]\n");
fprintf(stderr, "BOOL := [1|0]\n");
fprintf(stderr, "FEATURES := ecn\n");
- fprintf(stderr, "ENCAPTYPE := [ mpls | ip | ip6 | seg6 ]\n");
+ fprintf(stderr, "ENCAPTYPE := [ mpls | ip | ip6 | seg6 | seg6local ]\n");
fprintf(stderr, "ENCAPHDR := [ MPLSLABEL | SEG6HDR ]\n");
fprintf(stderr, "SEG6HDR := [ mode SEGMODE ] segs ADDR1,ADDRi,ADDRn [hmac HMACKEYID] [cleanup]\n");
fprintf(stderr, "SEGMODE := [ encap | inline ]\n");
}
if (tb[RTA_MULTIPATH]) {
struct rtnexthop *nh = RTA_DATA(tb[RTA_MULTIPATH]);
- int first = 0;
+ int first = 1;
len = RTA_PAYLOAD(tb[RTA_MULTIPATH]);
if (nh->rtnh_len > len)
break;
if (r->rtm_flags&RTM_F_CLONED && r->rtm_type == RTN_MULTICAST) {
- if (first)
+ if (first) {
fprintf(fp, "Oifs: ");
- else
+ first = 0;
+ } else {
fprintf(fp, " ");
+ }
} else
fprintf(fp, "%s\tnexthop ", _SL_);
if (nh->rtnh_len > sizeof(*nh)) {
fprintf(fp, "onlink ");
if (nh->rtnh_flags & RTNH_F_PERVASIVE)
fprintf(fp, "pervasive ");
+ if (nh->rtnh_flags & RTNH_F_OFFLOAD)
+ fprintf(fp, "offload ");
if (nh->rtnh_flags & RTNH_F_LINKDOWN)
fprintf(fp, "linkdown ");
len -= NLMSG_ALIGN(nh->rtnh_len);