]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_util.h
1 #ifndef SQUID_SNMP_UTIL_H
2 #define SQUID_SNMP_UTIL_H
8 /* call a function at regular intervals (in seconds): */
9 extern void snmp_alarm(int ival
, void (*handler
) (void));
11 /* service for filedescriptors: */
13 extern void fd_add(int fd
, void (*func
) (int fd
));
14 extern void fd_service(void);
16 /* ---------------------------------------------------------------------- */
19 * SNMP Agent extension for Spacer-Controler Management
21 * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
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
);
28 /* Function to get IP address of this agent
29 * WARNING: this scans all interfaces (slow) */
30 u_long
Util_local_ip_address(void);
32 /* Function to get the current time in seconds */
33 long Util_time_now(void);
35 /* Function to determine how long the agent has been running
36 * (WARNING: this seems rather slow) */
37 long Util_time_running();
39 /* Read data from file */
40 int Util_file_read(char *file
, int offset
, char *data
, int dataSz
);
42 /* Write data into file */
43 int Util_file_write(char *file
, int offset
, char *data
, int dataSz
);
45 /* ---------------------------------------------------------------------- */
50 #endif /* SQUID_SNMP_UTIL_H */