--- projects/pystatgrab/_statgrab.pyx 2004/02/13 17:53:15 1.7 +++ projects/pystatgrab/_statgrab.pyx 2004/03/20 21:29:59 1.10 @@ -17,7 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# $Id: _statgrab.pyx,v 1.7 2004/02/13 17:53:15 tdb Exp $ +# $Id: _statgrab.pyx,v 1.10 2004/03/20 21:29:59 tdb Exp $ # ctypedef long time_t @@ -98,6 +98,11 @@ cdef extern from "statgrab.h": char *interface_name long long tx long long rx + long long ipackets + long long opackets + long long ierrors + long long oerrors + long long collisions time_t systime ctypedef enum statgrab_duplex: @@ -109,6 +114,7 @@ cdef extern from "statgrab.h": char *interface_name int speed statgrab_duplex dup + int up ctypedef struct page_stat_t: long long pages_pagein @@ -356,6 +362,11 @@ def py_get_network_stats(): {'interface_name': s.interface_name, 'tx': s.tx, 'rx': s.rx, + 'ipackets': s.ipackets, + 'opackets': s.opackets, + 'ierrors': s.ierrors, + 'oerrors': s.oerrors, + 'collisions': s.collisions, 'systime': s.systime, } )) @@ -374,6 +385,11 @@ def py_get_network_stats_diff(): {'interface_name': s.interface_name, 'tx': s.tx, 'rx': s.rx, + 'ipackets': s.ipackets, + 'opackets': s.opackets, + 'ierrors': s.ierrors, + 'oerrors': s.oerrors, + 'collisions': s.collisions, 'systime': s.systime, } )) @@ -392,6 +408,7 @@ def py_get_network_iface_stats(): {'interface_name': s.interface_name, 'speed': s.speed, 'dup': s.dup, + 'up' : s.up, } )) s = s + 1 @@ -420,7 +437,13 @@ def py_get_page_stats_diff(): ) def py_statgrab_init(): - return statgrab_init() + if statgrab_init() == 0: + return True + else: + return False def py_statgrab_drop_privileges(): - return statgrab_drop_privileges() + if statgrab_drop_privileges() == 0: + return True + else: + return False