diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-04-03 00:01:26 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-03 00:01:26 +0000 |
commit | 5cd3a7658cc2389a20c343e814ca63400356c6d0 (patch) | |
tree | 3c2052fdc85765032cb541db3fe7515b17d17a53 | |
parent | 3a6c9c3ae24f6cc3e1db166e66f10592fb97bec8 (diff) | |
parent | 89a5ed820ab0ba2a68bc00088fd3cd91c295b89d (diff) | |
download | iptables-5cd3a7658cc2389a20c343e814ca63400356c6d0.tar.gz |
Merge changes from topic "b183485987" am: 90c8570e0b am: 74515b357f am: 7b1df5255c am: 89a5ed820a
Original change: https://android-review.googlesource.com/c/platform/external/iptables/+/1650938
Change-Id: I3414eaf9f56dde724b0fc18da4731cc866d15047
-rw-r--r-- | extensions/libxt_IDLETIMER.c | 9 | ||||
-rw-r--r-- | extensions/libxt_IDLETIMER.man | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/extensions/libxt_IDLETIMER.c b/extensions/libxt_IDLETIMER.c index 216b6257..c414801c 100644 --- a/extensions/libxt_IDLETIMER.c +++ b/extensions/libxt_IDLETIMER.c @@ -28,6 +28,7 @@ enum { O_TIMEOUT = 0, O_LABEL, O_ALARM, + O_NETLINK, }; #define s struct idletimer_tg_info @@ -47,6 +48,7 @@ static const struct xt_option_entry idletimer_tg_opts_v1[] = { {.name = "label", .id = O_LABEL, .type = XTTYPE_STRING, .flags = XTOPT_MAND | XTOPT_PUT, XTOPT_POINTER(s, label)}, {.name = "alarm", .id = O_ALARM, .type = XTTYPE_NONE}, + {.name = "send_nl_msg", .id = O_NETLINK, .type = XTTYPE_NONE}, XTOPT_TABLEEND, }; #undef s @@ -67,6 +69,7 @@ static void idletimer_tg_help_v1(void) " --timeout time Timeout until the notification is sent (in seconds)\n" " --label string Unique rule identifier\n" " --alarm Use alarm instead of default timer\n" +" --send_nl_msg Enable netlink messages and show remaining time in sysfs.\n" "\n"); } @@ -92,6 +95,8 @@ static void idletimer_tg_print_v1(const void *ip, printf(" label:%s", info->label); if (info->timer_type == XT_IDLETIMER_ALARM) printf(" alarm"); + if (info->send_nl_msg) + printf(" send_nl_msg"); } @@ -115,6 +120,8 @@ static void idletimer_tg_save_v1(const void *ip, printf(" --label %s", info->label); if (info->timer_type == XT_IDLETIMER_ALARM) printf(" --alarm"); + if (info->send_nl_msg) + printf(" --send_nl_msg"); } static void idletimer_tg_parse_v1(struct xt_option_call *cb) @@ -124,6 +131,8 @@ static void idletimer_tg_parse_v1(struct xt_option_call *cb) xtables_option_parse(cb); if (cb->entry->id == O_ALARM) info->timer_type = XT_IDLETIMER_ALARM; + if (cb->entry->id == O_NETLINK) + info->send_nl_msg = 1; } static struct xtables_target idletimer_tg_reg[] = { diff --git a/extensions/libxt_IDLETIMER.man b/extensions/libxt_IDLETIMER.man index e3c91cea..bd4add9b 100644 --- a/extensions/libxt_IDLETIMER.man +++ b/extensions/libxt_IDLETIMER.man @@ -18,3 +18,7 @@ This is the time in seconds that will trigger the notification. \fB\-\-label\fP \fIstring\fP This is a unique identifier for the timer. The maximum length for the label string is 27 characters. +.TP +\fB\-\---send_nl_msg\fP +Send netlink messages in addition to sysfs notifications and show remaining +time. |