~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to include/snmp_util.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2010-05-04 11:15:49 UTC
  • mfrom: (1.3.1 upstream)
  • mto: (20.3.1 squeeze) (21.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20100504111549-1apjh2g5sndki4te
Tags: upstream-3.1.3
ImportĀ upstreamĀ versionĀ 3.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: snmp_util.h,v 1.10 2003/01/23 00:36:48 robertc Exp $
 
2
 * $Id$
3
3
 */
4
 
 
5
4
#ifndef SQUID_SNMP_UTIL_H
6
5
#define SQUID_SNMP_UTIL_H
7
6
 
 
7
#include "config.h"
 
8
 
8
9
#ifdef __cplusplus
9
10
extern "C" {
10
11
#endif
11
12
 
12
 
/* call a function at regular intervals (in seconds): */
13
 
extern void snmp_alarm(int ival, void (*handler) (void));
14
 
 
15
 
 
16
 
/* service for filedescriptors: */
17
 
 
18
 
extern void fd_add(int fd, void (*func) (int fd));
19
 
extern void fd_service(void);
20
 
 
21
 
 
22
 
/* ---------------------------------------------------------------------- */
23
 
 
24
 
/*
25
 
 * SNMP Agent extension for Spacer-Controler Management
26
 
 *
27
 
 * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
28
 
 */
29
 
 
30
 
 
31
 
/* Function to safely copy a string, and ensure the last
32
 
 * character is always '\0'. */
33
 
void strcpy_safe(char *str, int str_len, char *val);
34
 
 
35
 
/* Function to get IP address of this agent
36
 
 * WARNING: this scans all interfaces (slow) */
37
 
u_long Util_local_ip_address(void);
38
 
 
39
 
/* Function to get the current time in seconds */
40
 
long Util_time_now(void);
41
 
 
42
 
/* Function to determine how long the agent has been running
43
 
 * (WARNING: this seems rather slow) */
44
 
long Util_time_running();
45
 
 
46
 
/* Read data from file */
47
 
int Util_file_read(char *file, int offset, char *data, int dataSz);
48
 
 
49
 
/* Write data into file */
50
 
int Util_file_write(char *file, int offset, char *data, int dataSz);
51
 
 
52
 
/* ---------------------------------------------------------------------- */
 
13
    /* call a function at regular intervals (in seconds): */
 
14
    extern void snmp_alarm(int ival, void (*handler) (void));
 
15
 
 
16
 
 
17
    /* service for filedescriptors: */
 
18
 
 
19
    extern void fd_add(int fd, void (*func) (int fd));
 
20
    extern void fd_service(void);
 
21
 
 
22
 
 
23
    /* ---------------------------------------------------------------------- */
 
24
 
 
25
    /*
 
26
     * SNMP Agent extension for Spacer-Controler Management
 
27
     *
 
28
     * Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
 
29
     */
 
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
    /* ---------------------------------------------------------------------- */
53
54
 
54
55
#ifdef __cplusplus
55
56
}