]> git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_util.h
Author: Francesco Chemolli <kinkie@squid-cache.org>
[thirdparty/squid.git] / include / snmp_util.h
1 /*
2 * $Id: snmp_util.h,v 1.10 2003/01/23 00:36:48 robertc Exp $
3 */
4 #ifndef SQUID_SNMP_UTIL_H
5 #define SQUID_SNMP_UTIL_H
6
7 #include "config.h"
8
9 #ifdef __cplusplus
10 extern "C"
11 {
12 #endif
13
14 /* call a function at regular intervals (in seconds): */
15 extern void snmp_alarm(int ival, void (*handler) (void));
16
17
18 /* service for filedescriptors: */
19
20 extern void fd_add(int fd, void (*func) (int fd));
21 extern void fd_service(void);
22
23
24 /* ---------------------------------------------------------------------- */
25
26 /*
27 * SNMP Agent extension for Spacer-Controler Management
28 *
29 * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
30 */
31
32
33 /* Function to safely copy a string, and ensure the last
34 * character is always '\0'. */
35 void strcpy_safe(char *str, int str_len, char *val);
36
37 /* Function to get IP address of this agent
38 * WARNING: this scans all interfaces (slow) */
39 u_long Util_local_ip_address(void);
40
41 /* Function to get the current time in seconds */
42 long Util_time_now(void);
43
44 /* Function to determine how long the agent has been running
45 * (WARNING: this seems rather slow) */
46 long Util_time_running();
47
48 /* Read data from file */
49 int Util_file_read(char *file, int offset, char *data, int dataSz);
50
51 /* Write data into file */
52 int Util_file_write(char *file, int offset, char *data, int dataSz);
53
54 /* ---------------------------------------------------------------------- */
55
56 #ifdef __cplusplus
57 }
58 #endif
59 #endif /* SQUID_SNMP_UTIL_H */