6 #define LNSTAT_VERSION "0.02 041002"
8 #define PROC_NET_STAT "/proc/net/stat"
10 #define LNSTAT_MAX_FILES 32
11 #define LNSTAT_MAX_FIELDS_PER_LINE 32
12 #define LNSTAT_MAX_FIELD_NAME_LEN 32
17 struct lnstat_file
*file
;
18 unsigned int num
; /* field number in line */
19 char name
[LNSTAT_MAX_FIELD_NAME_LEN
+1];
20 unsigned long values
[2]; /* two buffers for values */
25 struct lnstat_file
*next
;
26 char path
[PATH_MAX
+1];
27 char basename
[NAME_MAX
+1];
28 struct timeval last_read
; /* last time of read */
29 struct timeval interval
; /* interval */
30 int compat
; /* 1 == backwards compat mode */
32 unsigned int num_fields
; /* number of fields */
33 struct lnstat_field fields
[LNSTAT_MAX_FIELDS_PER_LINE
];
37 struct lnstat_file
*lnstat_scan_dir(const char *path
, const int num_req_files
,
38 const char **req_files
);
39 int lnstat_update(struct lnstat_file
*lnstat_files
);
40 int lnstat_dump(FILE *outfd
, struct lnstat_file
*lnstat_files
);
41 struct lnstat_field
*lnstat_find_field(struct lnstat_file
*lnstat_files
,
43 #endif /* _LNSTAT_H */