File: snmp_util.h

package info (click to toggle)
snmp 3.6-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,284 kB
  • ctags: 1,929
  • sloc: ansic: 18,710; sh: 585; makefile: 311
file content (90 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef SNMP_UTIL_H
#define SNMP_UTIL_H


#undef _ANSI_ARGS_
#if (defined(__STDC__) && ! defined(NO_PROTOTYPE)) || defined(USE_PROTOTYPE)
# define _ANSI_ARGS_(x) x
#else
# define _ANSI_ARGS_(x) ()
#endif


/*
 * call a function at regular intervals (in seconds):
 */
extern void snmp_alarm _ANSI_ARGS_((int ival, void (*handler) (void)));


/*
 * service for filedescriptors:
 */

extern void fd_add _ANSI_ARGS_((int fd, void (*func)(int fd)));
extern void fd_service _ANSI_ARGS_((void));


/* ---------------------------------------------------------------------- */

/*
**  SNMP Agent extension for Spacer-Controler Management
**
**  Copyright (c) 1997 FT/CNET/DES/GRL Olivier Montanuy
** 
*/
/*
** Function to safely copy a string, and ensure the last
** character is always '\0'.
*/
void
strcpy_safe _ANSI_ARGS_((char *str, int str_len, char *val));


/*
** Function to get IP address of this agent
** WARNING: this scans all interfaces (slow)
*/
unsigned long 
Util_local_ip_address _ANSI_ARGS_((void));

/*
** Function to get the current time in seconds
*/
long 
Util_time_now _ANSI_ARGS_((void));

/*
** Function to determine how long the agent has been running
*  (WARNING: this seems rather slow)
*/
long 
Util_time_running();

/*
** Read data from file
*/
int
Util_file_read _ANSI_ARGS_((char *file, int offset, char *data, int dataSz));

/*
** Write data into file
*/
int
Util_file_write _ANSI_ARGS_((char *file, int offset, char *data, int dataSz));


/* ---------------------------------------------------------------------- */













#endif