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