]> git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_util.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / include / snmp_util.h
1 /*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_SNMP_UTIL_H
10 #define SQUID_SNMP_UTIL_H
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 /* call a function at regular intervals (in seconds): */
17 extern void snmp_alarm(int ival, void (*handler) (void));
18
19 /* service for filedescriptors: */
20
21 extern void fd_add(int fd, void (*func) (int fd));
22 extern void fd_service(void);
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 /* Function to safely copy a string, and ensure the last
33 * character is always '\0'. */
34 void strcpy_safe(char *str, int str_len, char *val);
35
36 /* Function to get IP address of this agent
37 * WARNING: this scans all interfaces (slow) */
38 u_long Util_local_ip_address(void);
39
40 /* Function to get the current time in seconds */
41 long Util_time_now(void);
42
43 /* Function to determine how long the agent has been running
44 * (WARNING: this seems rather slow) */
45 long Util_time_running();
46
47 /* Read data from file */
48 int Util_file_read(char *file, int offset, char *data, int dataSz);
49
50 /* Write data into file */
51 int Util_file_write(char *file, int offset, char *data, int dataSz);
52
53 /* ---------------------------------------------------------------------- */
54
55 #ifdef __cplusplus
56 }
57 #endif
58 #endif /* SQUID_SNMP_UTIL_H */
59