~ubuntu-branches/debian/sid/rlinetd/sid

« back to all changes in this revision

Viewing changes to src/db.h

  • Committer: Bazaar Package Importer
  • Author(s): Robert Luberda
  • Date: 2010-03-20 18:03:45 UTC
  • mfrom: (2.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320180345-x1srfbe2tg00ezsf
Tags: 0.7-1
* New upstream version.
* Recommend rsyslog instead of sysklogd (closes: #526922).
* update-inetd:
  + add support for enabling, disabling and removing entries;
  + use ucf for managing generated files;
  + ignore ucf files in rlinetd.conf;
  + make appropriate changes in  postinst and postrm scripts.
* Set debhelper compat level to 7
* Standards-Version: 3.8.4 (no changes). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef H_DB
 
2
#define H_DB
 
3
 
 
4
#include <sys/types.h>
 
5
#include <grp.h>
 
6
#include <netinet/in.h>
 
7
#include <sys/uio.h>
 
8
#include <sys/time.h>
 
9
#include <sys/resource.h>
 
10
#include <unistd.h>
 
11
 
 
12
#include "config.h"
 
13
 
 
14
#ifdef HAVE_CAPABILITIES
 
15
#include <sys/capability.h>
 
16
#endif
 
17
 
 
18
#include "rlinetd.h"
 
19
 
 
20
struct loglist {
 
21
        int type;
 
22
        char *arg;
 
23
        int len;
 
24
};
 
25
 
 
26
#include "strings.h"
 
27
 
 
28
enum { LOG_TEXT, LOG_SOURCE_IP, LOG_SOURCE_PORT, LOG_CPU,
 
29
                         LOG_CPU_USER, LOG_CPU_SYSTEM, LOG_RSS, LOG_SHMEM, LOG_DATA, LOG_STACK,
 
30
                         LOG_MINFLT, LOG_MAJFLT, LOG_SWAPS, LOG_BIN, LOG_BOUT, LOG_MOUT,
 
31
                         LOG_MIN, LOG_NSIG, LOG_VCSW, LOG_IVCSW, LOG_EXITCODE, LOG_TIME,
 
32
                         LOG_ATIME, LOG_CTIME
 
33
};
 
34
 
 
35
void pidtab_add(pid_t, int, struct rl_instance *);
 
36
struct pidtab *pidtab_get(pid_t);
 
37
int logtab_add(int, char *);
 
38
struct logtab *logtab_get(int);
 
39
int rlimittab_add(rlim_t, rlim_t);
 
40
struct rlimit *rlimittab_get(int);
 
41
void argvtab_grow();
 
42
struct argvtab *argvtab_get(int);
 
43
struct iovec *iov_build(struct rl_instance *, struct argvtab *);
 
44
char **argv_build(struct rl_instance *, struct argvtab *);
 
45
int argvtab_add(char *, int);
 
46
 
 
47
#ifdef HAVE_CAPABILITIES
 
48
int captab_add(cap_t);
 
49
void captabs_free();
 
50
cap_t captab_get(int);
 
51
#endif
 
52
 
 
53
int stringtab_add(char *);
 
54
char *stringtab_get(int);
 
55
void stringtabs_free();
 
56
void addrtabs_free();
 
57
int addrtab_add(void *addr);
 
58
void addrtab_grow();
 
59
 
 
60
struct oplist {
 
61
        int ops_len;
 
62
        rl_opcode_t *ops_list;
 
63
};
 
64
 
 
65
int oplisttab_add(struct oplist *);
 
66
void oplisttabs_free();
 
67
rl_opcode_t *oplisttab_get(int);
 
68
void oplist_free(struct oplist *op);
 
69
 
 
70
struct logtab {
 
71
        int fd;
 
72
        int argv;
 
73
        char *path;
 
74
};
 
75
 
 
76
extern struct logtab *logtabs;
 
77
extern int numlogtabs;
 
78
 
 
79
extern struct argvtab *argvs;
 
80
extern int numargvs;
 
81
 
 
82
extern struct rlimit *rlimits;
 
83
extern int numrlimits;
 
84
 
 
85
#ifdef HAVE_CAPABILITIES
 
86
extern cap_t *caps;
 
87
extern int numcaps;
 
88
#endif
 
89
 
 
90
extern char **strings;
 
91
extern int numstrings;
 
92
 
 
93
struct buftab {
 
94
        void *addr;
 
95
        size_t len;
 
96
};
 
97
 
 
98
void buftabs_free();
 
99
int buftab_addfile(char *);
 
100
int buftab_addbuf(void *, int);
 
101
struct buftab *buftab_get(int);
 
102
 
 
103
extern struct buftab *bufs;
 
104
extern int numbufs;
 
105
 
 
106
extern struct oplist *oplists;
 
107
extern int numoplists;
 
108
 
 
109
extern char rl_lf[];
 
110
 
 
111
struct pidtab {
 
112
        pid_t pid;
 
113
        struct pidtab *next;
 
114
        struct pidtab *prev;
 
115
        struct pidtab *next_cleanup;
 
116
        int onexit;
 
117
        struct rl_instance *inst;
 
118
};
 
119
 
 
120
extern struct pidtab pidtabs[8];
 
121
 
 
122
struct semaphore {
 
123
        int limit;                                                                              /* could do hi/lo water marks */
 
124
        int count;
 
125
        rl_opcode_t match;                                              /* executed when count reaches limit */
 
126
        rl_opcode_t under;                                              /* executed when count drops below limit */
 
127
};
 
128
 
 
129
extern struct semaphore *sems;
 
130
extern int numsems;
 
131
 
 
132
struct semaphore *semaphore_get(int);
 
133
int semaphore_add(int, rl_opcode_t, rl_opcode_t);
 
134
void semaphores_free();
 
135
 
 
136
extern fd_set *fdsets;
 
137
extern int numfdsets;
 
138
 
 
139
int fdsettab_add(fd_set *);
 
140
void fdsettabs_free();
 
141
fd_set *fdsettab_get(int);
 
142
 
 
143
#endif /* !H_DB */
 
144
 
 
145
/* vim: set ts=2: */