ipt_recent Time Format

Gregory D Hough mr6re9-mI4xJ4qlgtBiLUuM0BA3LQ at public.gmane.org
Sat Aug 12 16:37:26 UTC 2006


Tluggers,

Is anyone familiar with NetFilter's timestamps? This is what they 
typically look like:

[root at localhost ~]# cat /proc/net/ipt_recent/ZW | grep '69\.63\.21\.188'
src=69.63.21.188 ttl: 32 last_seen: 2484808297 oldest_pkt: 1 last_pkts: 
2484808297

And from the log I know the time it was last_seen three days ago:

[root at localhost ~]# grep SYNYSTR-RESET /var/log/messages | grep 
'69\.63\.21\.188'
Aug  9 00:24:18 localhost kernel: SYNYSTR-RESET: IN=eth1 OUT= 
SRC=69.63.21.188 DST=192.168.1.251 LEN=64 TOS=0x00 PREC=0x00 TTL=32 
ID=19088 DF PROTO=TCP SPT=2930 DPT=445 WINDOW=53760 RES=0x00 SYN URGP=0

"Aug  9 00:24:18" && 2484808297 are true somehow

I'm primarily interested in last_seen. I need a clean-up script which 
removes an IP's record after a certain period of inactivity and I don't 
know how to work with that value. Naturally if I can get the current 
time in the correct format I can work with that value. I suspect it is 
microseconds since the module was (re)loaded.

How do I use date or time or whatever to read in the current value of 
NOW in this format?

Thanks,
greg
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list