~ubuntu-branches/ubuntu/quantal/dovecot/quantal

« back to all changes in this revision

Viewing changes to sieve/src/lib-sieve/sieve-code.h

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-29 09:21:32 UTC
  • mfrom: (4.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20100629092132-q4pr5lfuvmjqou19
Tags: 1:1.2.12-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  + Add mail-stack-delivery as per server-maverick-mail-integration spec:
   - Update debian/rules
   - Convert existing package to a dummy package and add new binary in debian/control
   - Update maintainer scripts.
   - Move previously installed backups and config files to new package name
     space in preinst
   - Add new debian/mail-stack-delivery.prerm to handle downgrades
   - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*
  + Use Snakeoil SSL certificates by default.
    - debian/control: Depend on ssl-cert.
    - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert paths to snakeoil.
    - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - Created debian/dovecot-common.ufw.profile.
    - debian/rules: install profile.
    - debian/control: suggest ufw.
  + debian/{control,rules}: enable PIE hardening.
  + debian/control: Update Vcs-* headers.
  + Add SMTP-AUTH support for Outlook (login auth mechanism) 
  + debian/dovecot-common.dirs: Added usr/share/doc/dovecot-common
  + debian/patches/fix-dovecot-config-parser.patch: Fix ordering of external config 
    files. (LP: #597818)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (c) 2002-2010 Dovecot Sieve authors, see the included COPYING file
2
2
 */
3
 
 
 
3
 
4
4
#ifndef __SIEVE_CODE_H
5
5
#define __SIEVE_CODE_H
6
6
 
11
11
 
12
12
#include "sieve-common.h"
13
13
 
14
 
/* 
15
 
 * Coded string list 
 
14
/*
 
15
 * Coded string list
16
16
 */
17
17
 
18
18
struct sieve_coded_stringlist;
32
32
sieve_size_t sieve_coded_stringlist_get_current_offset
33
33
        (struct sieve_coded_stringlist *strlist);
34
34
 
35
 
/* 
 
35
/*
36
36
 * Source line coding
37
37
 */
38
38
 
41
41
bool sieve_code_source_line_dump
42
42
        (const struct sieve_dumptime_env *denv, sieve_size_t *address);
43
43
bool sieve_code_source_line_read
44
 
        (const struct sieve_runtime_env *renv, sieve_size_t *address, 
 
44
        (const struct sieve_runtime_env *renv, sieve_size_t *address,
45
45
        unsigned int *source_line_r);
46
46
 
47
 
/* 
 
47
/*
48
48
 * Operand object
49
49
 */
50
50
 
54
54
 
55
55
struct sieve_operand_def {
56
56
        const char *name;
57
 
        
 
57
 
58
58
        const struct sieve_extension_def *ext_def;
59
59
        unsigned int code;
60
 
        
 
60
 
61
61
        const struct sieve_operand_class *class;
62
62
        const void *interface;
63
63
};
77
77
        (struct sieve_binary *sbin, const struct sieve_extension *ext,
78
78
                const struct sieve_operand_def *oprnd);
79
79
bool sieve_operand_read
80
 
        (struct sieve_binary *sbin, sieve_size_t *address, 
 
80
        (struct sieve_binary *sbin, sieve_size_t *address,
81
81
                struct sieve_operand *oprnd);
82
82
 
83
83
bool sieve_operand_optional_present
84
84
        (struct sieve_binary *sbin, sieve_size_t *address);
85
 
bool sieve_operand_optional_read        
86
 
        (struct sieve_binary *sbin, sieve_size_t *address, 
 
85
bool sieve_operand_optional_read
 
86
        (struct sieve_binary *sbin, sieve_size_t *address,
87
87
                signed int *id_code);
88
88
 
89
89
/*
90
90
 * Core operands
91
91
 */
92
 
 
 
92
 
93
93
/* Operand codes */
94
94
 
95
95
enum sieve_core_operand {
125
125
/* Operand object interfaces */
126
126
 
127
127
struct sieve_opr_number_interface {
128
 
        bool (*dump)    
 
128
        bool (*dump)
129
129
                (const struct sieve_dumptime_env *denv, sieve_size_t *address,
130
130
                        const char *field_name);
131
131
        bool (*read)
132
 
          (const struct sieve_runtime_env *renv, sieve_size_t *address, 
 
132
          (const struct sieve_runtime_env *renv, sieve_size_t *address,
133
133
                sieve_number_t *number_r);
134
134
};
135
135
 
136
136
struct sieve_opr_string_interface {
137
137
        bool (*dump)
138
 
                (const struct sieve_dumptime_env *denv, const struct sieve_operand *operand, 
 
138
                (const struct sieve_dumptime_env *denv, const struct sieve_operand *operand,
139
139
                        sieve_size_t *address, const char *field_name);
140
140
        bool (*read)
141
 
                (const struct sieve_runtime_env *renv, const struct sieve_operand *operand, 
 
141
                (const struct sieve_runtime_env *renv, const struct sieve_operand *operand,
142
142
                        sieve_size_t *address, string_t **str_r);
143
143
};
144
144
 
150
150
                (const struct sieve_runtime_env *renv, sieve_size_t *address);
151
151
};
152
152
 
153
 
/* 
154
 
 * Core operand functions 
 
153
/*
 
154
 * Core operand functions
155
155
 */
156
156
 
157
157
/* Omitted */
168
168
/* Number */
169
169
 
170
170
void sieve_opr_number_emit(struct sieve_binary *sbin, sieve_number_t number);
171
 
bool sieve_opr_number_dump_data 
 
171
bool sieve_opr_number_dump_data
172
172
        (const struct sieve_dumptime_env *denv, const struct sieve_operand *operand,
173
 
                sieve_size_t *address, const char *field_name); 
174
 
bool sieve_opr_number_dump      
 
173
                sieve_size_t *address, const char *field_name);
 
174
bool sieve_opr_number_dump
175
175
        (const struct sieve_dumptime_env *denv, sieve_size_t *address,
176
 
                const char *field_name); 
 
176
                const char *field_name);
177
177
bool sieve_opr_number_read_data
178
178
        (const struct sieve_runtime_env *renv, const struct sieve_operand *operand,
179
179
                sieve_size_t *address, sieve_number_t *number_r);
180
180
bool sieve_opr_number_read
181
 
        (const struct sieve_runtime_env *renv, sieve_size_t *address, 
 
181
        (const struct sieve_runtime_env *renv, sieve_size_t *address,
182
182
                sieve_number_t *number_r);
183
183
 
184
184
static inline bool sieve_operand_is_number
185
185
(const struct sieve_operand *operand)
186
186
{
187
 
        return ( operand != NULL && operand->def != NULL && 
 
187
        return ( operand != NULL && operand->def != NULL &&
188
188
                operand->def->class == &number_class );
189
189
}
190
190
 
193
193
void sieve_opr_string_emit(struct sieve_binary *sbin, string_t *str);
194
194
bool sieve_opr_string_dump_data
195
195
        (const struct sieve_dumptime_env *denv, const struct sieve_operand *operand,
196
 
                sieve_size_t *address, const char *field_name); 
 
196
                sieve_size_t *address, const char *field_name);
197
197
bool sieve_opr_string_dump
198
198
        (const struct sieve_dumptime_env *denv, sieve_size_t *address,
199
 
                const char *field_name); 
 
199
                const char *field_name);
200
200
bool sieve_opr_string_dump_ex
201
 
        (const struct sieve_dumptime_env *denv, sieve_size_t *address, 
202
 
                const char *field_name, bool *literal_r); 
 
201
        (const struct sieve_dumptime_env *denv, sieve_size_t *address,
 
202
                const char *field_name, bool *literal_r);
203
203
bool sieve_opr_string_read_data
204
204
        (const struct sieve_runtime_env *renv, const struct sieve_operand *operand,
205
205
                sieve_size_t *address, string_t **str_r);
225
225
void sieve_opr_stringlist_emit_end
226
226
        (struct sieve_binary *sbin, void *context);
227
227
bool sieve_opr_stringlist_dump_data
228
 
        (const struct sieve_dumptime_env *denv, const struct sieve_operand *operand, 
 
228
        (const struct sieve_dumptime_env *denv, const struct sieve_operand *operand,
229
229
                sieve_size_t *address, const char *field_name);
230
230
bool sieve_opr_stringlist_dump
231
231
        (const struct sieve_dumptime_env *denv, sieve_size_t *address,
232
232
                const char *field_name);
233
233
struct sieve_coded_stringlist *sieve_opr_stringlist_read_data
234
 
        (const struct sieve_runtime_env *renv, const struct sieve_operand *operand, 
 
234
        (const struct sieve_runtime_env *renv, const struct sieve_operand *operand,
235
235
                sieve_size_t *address);
236
236
struct sieve_coded_stringlist *sieve_opr_stringlist_read
237
237
        (const struct sieve_runtime_env *renv, sieve_size_t *address);
240
240
(const struct sieve_operand *operand)
241
241
{
242
242
        return ( operand != NULL && operand->def != NULL &&
243
 
                (operand->def->class == &stringlist_class || 
 
243
                (operand->def->class == &stringlist_class ||
244
244
                        operand->def->class == &string_class) );
245
245
}
246
246
 
248
248
 
249
249
void sieve_opr_catenated_string_emit
250
250
        (struct sieve_binary *sbin, unsigned int elements);
251
 
        
 
251
 
252
252
/*
253
253
 * Operation object
254
254
 */
255
 
 
 
255
 
256
256
struct sieve_operation_def {
257
257
        const char *mnemonic;
258
 
        
 
258
 
259
259
        const struct sieve_extension_def *ext_def;
260
260
        unsigned int code;
261
 
        
 
261
 
262
262
        bool (*dump)
263
263
                (const struct sieve_dumptime_env *denv, sieve_size_t *address);
264
264
        int (*execute)
279
279
 
280
280
sieve_size_t sieve_operation_emit
281
281
        (struct sieve_binary *sbin, const struct sieve_extension *ext,
282
 
                const struct sieve_operation_def *op_def);      
 
282
                const struct sieve_operation_def *op_def);
283
283
bool sieve_operation_read
284
284
        (struct sieve_binary *sbin, sieve_size_t *address,
285
285
                struct sieve_operation *oprtn);
286
286
const char *sieve_operation_read_string
287
287
        (struct sieve_binary *sbin, sieve_size_t *address);
288
288
 
289
 
/* 
290
 
 * Core operations 
 
289
/*
 
290
 * Core operations
291
291
 */
292
292
 
293
293
/* Opcodes */
297
297
        SIEVE_OPERATION_JMP,
298
298
        SIEVE_OPERATION_JMPTRUE,
299
299
        SIEVE_OPERATION_JMPFALSE,
300
 
        
 
300
 
301
301
        SIEVE_OPERATION_STOP,
302
302
        SIEVE_OPERATION_KEEP,
303
303
        SIEVE_OPERATION_DISCARD,
304
304
        SIEVE_OPERATION_REDIRECT,
305
 
        
 
305
 
306
306
        SIEVE_OPERATION_ADDRESS,
307
 
        SIEVE_OPERATION_HEADER, 
308
 
        SIEVE_OPERATION_EXISTS, 
 
307
        SIEVE_OPERATION_HEADER,
 
308
        SIEVE_OPERATION_EXISTS,
309
309
        SIEVE_OPERATION_SIZE_OVER,
310
310
        SIEVE_OPERATION_SIZE_UNDER,
311
 
        
 
311
 
312
312
        SIEVE_OPERATION_CUSTOM
313
313
};
314
314
 
316
316
 
317
317
extern const struct sieve_operation_def sieve_jmp_operation;
318
318
extern const struct sieve_operation_def sieve_jmptrue_operation;
319
 
extern const struct sieve_operation_def sieve_jmpfalse_operation; 
 
319
extern const struct sieve_operation_def sieve_jmpfalse_operation;
320
320
 
321
321
extern const struct sieve_operation_def *sieve_operations[];
322
322
extern const unsigned int sieve_operations_count;