return true;
}
+bool
+decode_nla_ip_proto(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ .xlat = inet_protocols, .dflt = "IPPROTO_???",
+ };
+
+ return decode_nla_xval(tcp, addr, len, &opts);
+}
+
bool
decode_nla_be16(struct tcb *const tcp,
const kernel_ulong_t addr,
return true;
}
+bool
+decode_nla_rt_proto(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint8_t num;
+
+ if (len < sizeof(num))
+ return false;
+ if (!umove_or_printaddr(tcp, addr, &num))
+ printxval_search(routing_protocols, num, "RTPROT_???");
+ return true;
+}
+
static bool
decode_route_addr(struct tcb *const tcp,
const kernel_ulong_t addr,
#endif
}
+static bool
+decode_rule_port_range(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct /* fib_rule_port_range */ {
+ uint16_t start;
+ uint16_t end;
+ } range;
+
+ if (len < sizeof(range))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &range)) {
+ PRINT_FIELD_U("{", range, start);
+ PRINT_FIELD_U(", ", range, end);
+ tprints("}");
+ }
+
+ return true;
+}
+
static const nla_decoder_t fib_rule_hdr_nla_decoders[] = {
[FRA_DST] = decode_rule_addr,
[FRA_SRC] = decode_rule_addr,
[FRA_OIFNAME] = decode_nla_str,
[FRA_PAD] = NULL,
[FRA_L3MDEV] = decode_nla_u8,
- [FRA_UID_RANGE] = decode_fib_rule_uid_range
+ [FRA_UID_RANGE] = decode_fib_rule_uid_range,
+ [FRA_PROTOCOL] = decode_nla_rt_proto,
+ [FRA_IP_PROTO] = decode_nla_ip_proto,
+ [FRA_SPORT_RANGE] = decode_rule_port_range,
+ [FRA_DPORT_RANGE] = decode_rule_port_range,
};
DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr)