]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_util.h
2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SNMP_UTIL_H
10 #define SQUID_SNMP_UTIL_H
16 /* call a function at regular intervals (in seconds): */
17 extern void snmp_alarm(int ival
, void (*handler
) (void));
19 /* service for filedescriptors: */
21 extern void fd_add(int fd
, void (*func
) (int fd
));
22 extern void fd_service(void);
24 /* ---------------------------------------------------------------------- */
27 * SNMP Agent extension for Spacer-Controler Management
29 * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
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
);
36 /* Function to get IP address of this agent
37 * WARNING: this scans all interfaces (slow) */
38 u_long
Util_local_ip_address(void);
40 /* Function to get the current time in seconds */
41 long Util_time_now(void);
43 /* Function to determine how long the agent has been running
44 * (WARNING: this seems rather slow) */
45 long Util_time_running();
47 /* Read data from file */
48 int Util_file_read(char *file
, int offset
, char *data
, int dataSz
);
50 /* Write data into file */
51 int Util_file_write(char *file
, int offset
, char *data
, int dataSz
);
53 /* ---------------------------------------------------------------------- */
58 #endif /* SQUID_SNMP_UTIL_H */