mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-05 20:26:38 +02:00

This commit adds an option to xt_quota2 called "no-change". The effect of this option, when used, is that it will skip incrementing or decrementing the quota counter, effectively providing a quota test only. The reason for implementing this is so that I could have a rule check if quota is available for a rule in the PREROUTING tables, without actually decrementing the amount of available quota. I only wanted to decrement the amount of available quota in the FORWARD rule. Otherwise, the first packet of every connection would be counted twice.
26 lines
478 B
C
26 lines
478 B
C
#ifndef _XT_QUOTA_H
|
|
#define _XT_QUOTA_H
|
|
|
|
enum xt_quota_flags {
|
|
XT_QUOTA_INVERT = 1 << 0,
|
|
XT_QUOTA_GROW = 1 << 1,
|
|
XT_QUOTA_PACKET = 1 << 2,
|
|
XT_QUOTA_NO_CHANGE = 1 << 3,
|
|
XT_QUOTA_MASK = 0x0F,
|
|
};
|
|
|
|
struct xt_quota_counter;
|
|
|
|
struct xt_quota_mtinfo2 {
|
|
char name[15];
|
|
u_int8_t flags;
|
|
|
|
/* Comparison-invariant */
|
|
aligned_u64 quota;
|
|
|
|
/* Used internally by the kernel */
|
|
struct xt_quota_counter *master __attribute__((aligned(8)));
|
|
};
|
|
|
|
#endif /* _XT_QUOTA_H */
|