]>
Commit | Line | Data |
---|---|---|
5c193dec | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
5c193dec AJ |
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 | ||
b5638623 | 9 | #ifndef SQUID_SNMP_UTIL_H |
10 | #define SQUID_SNMP_UTIL_H | |
8bde32ea | 11 | |
e6ccf245 | 12 | #ifdef __cplusplus |
e1381638 | 13 | extern "C" { |
e6ccf245 | 14 | #endif |
15 | ||
f53969cc SM |
16 | /* call a function at regular intervals (in seconds): */ |
17 | extern void snmp_alarm(int ival, void (*handler) (void)); | |
8bde32ea | 18 | |
f53969cc | 19 | /* service for filedescriptors: */ |
8bde32ea | 20 | |
f53969cc SM |
21 | extern void fd_add(int fd, void (*func) (int fd)); |
22 | extern void fd_service(void); | |
8bde32ea | 23 | |
f53969cc | 24 | /* ---------------------------------------------------------------------- */ |
8bde32ea | 25 | |
f53969cc SM |
26 | /* |
27 | * SNMP Agent extension for Spacer-Controler Management | |
28 | * | |
29 | * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy | |
30 | */ | |
8bde32ea | 31 | |
f53969cc SM |
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); | |
8bde32ea | 35 | |
f53969cc SM |
36 | /* Function to get IP address of this agent |
37 | * WARNING: this scans all interfaces (slow) */ | |
38 | u_long Util_local_ip_address(void); | |
8bde32ea | 39 | |
f53969cc SM |
40 | /* Function to get the current time in seconds */ |
41 | long Util_time_now(void); | |
8bde32ea | 42 | |
f53969cc SM |
43 | /* Function to determine how long the agent has been running |
44 | * (WARNING: this seems rather slow) */ | |
45 | long Util_time_running(); | |
8bde32ea | 46 | |
f53969cc SM |
47 | /* Read data from file */ |
48 | int Util_file_read(char *file, int offset, char *data, int dataSz); | |
8bde32ea | 49 | |
f53969cc SM |
50 | /* Write data into file */ |
51 | int Util_file_write(char *file, int offset, char *data, int dataSz); | |
8bde32ea | 52 | |
f53969cc | 53 | /* ---------------------------------------------------------------------- */ |
e6ccf245 | 54 | |
55 | #ifdef __cplusplus | |
56 | } | |
57 | #endif | |
b5638623 | 58 | #endif /* SQUID_SNMP_UTIL_H */ |
f53969cc | 59 |