]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/snmp_util.h
2 * $Id: snmp_util.h,v 1.10 2003/01/23 00:36:48 robertc Exp $
4 #ifndef SQUID_SNMP_UTIL_H
5 #define SQUID_SNMP_UTIL_H
14 /* call a function at regular intervals (in seconds): */
15 extern void snmp_alarm(int ival
, void (*handler
) (void));
18 /* service for filedescriptors: */
20 extern void fd_add(int fd
, void (*func
) (int fd
));
21 extern void fd_service(void);
24 /* ---------------------------------------------------------------------- */
27 * SNMP Agent extension for Spacer-Controler Management
29 * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
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
);
37 /* Function to get IP address of this agent
38 * WARNING: this scans all interfaces (slow) */
39 u_long
Util_local_ip_address(void);
41 /* Function to get the current time in seconds */
42 long Util_time_now(void);
44 /* Function to determine how long the agent has been running
45 * (WARNING: this seems rather slow) */
46 long Util_time_running();
48 /* Read data from file */
49 int Util_file_read(char *file
, int offset
, char *data
, int dataSz
);
51 /* Write data into file */
52 int Util_file_write(char *file
, int offset
, char *data
, int dataSz
);
54 /* ---------------------------------------------------------------------- */
59 #endif /* SQUID_SNMP_UTIL_H */