note 54696 deleted from function.preg-match by colder

From: Date: Mon, 18 Jun 2007 18:25:18 +0000
Subject: note 54696 deleted from function.preg-match by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127610@lists.php.net to get a copy of this message
Note Submitter: ian at remove-this dot mecnet dot net ---- Linux kernel 2.6.11 changed the format of /proc/net/ip_conntrack. I have updated the regular expression mark@portinc.net created in a comment below so that his function works again. // Updated this regular expression for kernel 2.6.11 changes to /proc/net/ip_conntrack $GREP = '!([a-z]+) ' .// [1] protocol '\\s*([^ ]+) ' .// [2] protocl in decimal '([^ ]+) ' .// [3] time-to-live '?([A-Z_]|[^ ]+)?' .// [4] state ' src=(.*?) ' .// [5] source address 'dst=(.*?) ' .// [6] destination address 'sport=(\\d{1,5}) ' .// [7] source port 'dport=(\\d{1,5}) ' .// [8] destination port 'packets=(.*?) ' .// [9] num of packets so far 'bytes=(.*?) ' .// [10] num of bytes so far 'src=(.*?) ' .// [11] reversed source 'dst=(.*?) ' .// [12] reversed destination 'sport=(\\d{1,5}) ' .// [13] reversed source port 'dport=(\\d{1,5}) ' .// [14] reversed destination port 'packets=(.*?) ' .// [15] reversed num of packets so far 'bytes=(.*?) ' .// [16] reversed num of bytes so far '\\[([^]]+)\\] ' .// [17] status 'mark=(.*?) ' .// [18] marked? 'use=([0-9]+)!'; // [19] use

« previous php.notes (#127610) next »