/[svn]/hopm/trunk/src/libopm/src/opm.h
ViewVC logotype

Contents of /hopm/trunk/src/libopm/src/opm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5135 - (show annotations)
Thu Dec 25 18:51:51 2014 UTC (5 years, 5 months ago) by michael
File MIME type: text/x-csrc
File size: 2442 byte(s)
- propset svn:eol-style native

1 /* vim: set shiftwidth=3 softtabstop=3 expandtab: */
2
3 /** \file opm.h
4 * \brief Main header for libopm.
5 * \author Erik Fears
6 * \version $Id$
7 */
8
9 #ifndef OPM_H
10 #define OPM_H
11
12 #include "opm_common.h"
13
14 typedef struct _OPM_CONFIG OPM_CONFIG_T;
15 typedef struct _OPM OPM_T;
16 typedef struct _OPM_REMOTE OPM_REMOTE_T;
17 typedef struct _OPM_CALLBACK OPM_CALLBACK_T;
18
19 typedef int OPM_ERR_T;
20
21 typedef void OPM_CALLBACK_FUNC (OPM_T *, OPM_REMOTE_T *, int, void *);
22
23 struct _OPM_CALLBACK {
24 OPM_CALLBACK_FUNC *func;
25 void *data;
26 };
27
28 struct _OPM_CONFIG {
29 void **vars;
30 };
31
32 struct _OPM {
33 OPM_CONFIG_T *config; /* Individual scanner configuration */
34 OPM_LIST_T *queue; /* List of scans in the queue (not yet established) */
35 OPM_LIST_T *scans; /* List of scans (each scan containing a list of connections) */
36 OPM_LIST_T *protocols; /* List of protocols this scanner handles */
37 unsigned int fd_use; /* Number of file descriptors in use */
38
39 OPM_CALLBACK_T *callbacks; /* Scanner wide callbacks */
40 };
41
42 struct _OPM_REMOTE {
43
44 char *ip; /* Readable IP address */
45
46 unsigned short int port; /* Port passed back on certain callbacks */
47 unsigned short int protocol; /* Protocol passed back on certain callbacks */
48 unsigned short int bytes_read; /* Bytes read passed back on certain callbacks */
49
50 OPM_LIST_T *protocols; /* Remote specific protocols */
51
52 void *data; /* Arbitrary data that the client can point to for any purpose*/
53 };
54
55 OPM_T *opm_create(void);
56 void opm_free(OPM_T *);
57
58 OPM_REMOTE_T *opm_remote_create(const char *);
59 void opm_remote_free(OPM_REMOTE_T *);
60
61 OPM_ERR_T opm_config(OPM_T *, int, const void *);
62 OPM_ERR_T opm_scan(OPM_T *, OPM_REMOTE_T *);
63 void opm_end(OPM_T *, OPM_REMOTE_T *);
64 void opm_endscan(OPM_T *, OPM_REMOTE_T *);
65
66 OPM_ERR_T opm_addtype(OPM_T *, int, unsigned short int);
67 OPM_ERR_T opm_remote_addtype(OPM_REMOTE_T *, int, unsigned short int);
68 OPM_ERR_T opm_callback(OPM_T *, int, OPM_CALLBACK_FUNC *, void *);
69
70 void opm_cycle(OPM_T *);
71
72 size_t opm_active(OPM_T *);
73
74 #endif /* OPM_H */

Properties

Name Value
svn:eol-style native
svn:keywords Id

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28