printf(" %u", info->ttl);
}
+static int ttl_xlate(const struct xt_entry_match *match,
+ struct xt_buf *buf, int numeric)
+{
+ const struct ipt_ttl_info *info =
+ (struct ipt_ttl_info *) match->data;
+
+ switch (info->mode) {
+ case IPT_TTL_EQ:
+ xt_buf_add(buf, "ip ttl");
+ break;
+ case IPT_TTL_NE:
+ xt_buf_add(buf, "ip ttl !=");
+ break;
+ case IPT_TTL_LT:
+ xt_buf_add(buf, "ip ttl lt");
+ break;
+ case IPT_TTL_GT:
+ xt_buf_add(buf, "ip ttl gt");
+ break;
+ default:
+ /* Should not happen. */
+ break;
+ }
+
+ xt_buf_add(buf, " %u ", info->ttl);
+
+ return 1;
+}
+
#define s struct ipt_ttl_info
static const struct xt_option_entry ttl_opts[] = {
{.name = "ttl-lt", .id = O_TTL_LT, .excl = F_ANY, .type = XTTYPE_UINT8,
.x6_parse = ttl_parse,
.x6_fcheck = ttl_check,
.x6_options = ttl_opts,
+ .xlate = ttl_xlate,
};