netfilter: xtables: Add snapshot of hardidletimer target
This is a snapshot of hardifletimer netfilter target as of msm-4.4 commit 469a150b7426 ("netfilter: xtables: hardidletimer target implementation") This patch implements a hardidletimer Xtables target that can be used to identify when interfaces have been idle for a certain period of time. Timers are identified by labels and are created when a rule is set with a new label. The rules also take a timeout value (in seconds) as an option. If more than one rule uses the same timer label, the timer will be restarted whenever any of the rules get a hit. One entry for each timer is created in sysfs. This attribute contains the timer remaining for the timer to expire. The attributes are located under the xt_idletimer class: /sys/class/xt_hardidletimer/timers/<label> When the timer expires, the target module sends a sysfs notification to the userspace, which can then decide what to do (eg. disconnect to save power) Compared to xt_IDLETIMER, xt_HARDIDLETIMER can send notifications when CPU is in suspend too, to notify the timer expiry. netfilter:Notify user space on creating sysfs file uevent indication is required to notify the user space on creation of sysfs file entry. This helps in creating specific sysfs labeled entries for newly created file which are module specific. xt_hardidletiemr: Check for remaining expiry time -xt_hardidletimers are getting reset with addition/ deletion of any iptable rule in any chain of raw/mangle table. -Check and restart the timer with remaining expiry time. Change-Id: I55c6fb211b929dfe500edda8e7c01530f944b067 CRs-Fixed: 1078373 Acked-by:Manoj Basapathi <manojbm@qti.qualcomm.com> Signed-off-by:
Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by:
Tejaswi Tanikella <tejaswit@codeaurora.org> Signed-off-by:
Devi Sandeep Endluri V V <dendluri@codeaurora.org>
Loading
Please register or sign in to comment