~ubuntu-branches/ubuntu/oneiric/iptables/oneiric

« back to all changes in this revision

Viewing changes to extensions/libxt_quota.c

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge, Lorenzo De Liso, Jamie Strandboge
  • Date: 2010-11-12 15:58:40 UTC
  • mfrom: (5.1.8 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20101112155840-jm07l9o9722h0bvm
Tags: 1.4.10-1ubuntu1
[ Lorenzo De Liso ]
* Merge from debian unstable (LP: #671652), remaining changes:
  - Don't fail to run iptables-save if iptables module isn't loaded.
  - Revert changes between 1.4.1.1-3 and 1.4.1.1-4, thus bringing back
    the howtos.
  - Added linuxdoc-tools to Build-Depends
  - Modified debian/iptables{,-dev}.install to match DM syntax
    (removed debian/tmp)
  - Added -fno-strict-aliasing -Werror switches to regular_CFLAGS
    for catching errors early
  - Removed unused TC_NUM_RULES() and TC_GET_RULE()
* debian/patches/03-compilation-error.patch: updated
* debian/patches/0600-makefile_jedi_handwaving.patch: updated
* Dropped changes:
  - debian/patches/0902-docs-version-reference.diff: modifies files inside
    the debian/ directory and hence is not needed

[ Jamie Strandboge ]
* debian/patches/9000-howtos.patch:
  - combine 0102-howtos.patch and 0103-sgml_errors.patch into this patch
    and apply after the Debian patches for easier maintenance
  - add DEP-3 comments
* debian/patches/9001-build-libipq_pic.la.patch:
  - Build libipq_pic.la with -fPIC
  - add DEP-3 comments
* debian/iptables-dev.install: install lib/*.la in usr/lib
* merge debian/patches/9002-xt_recent-reap.patch:
  - support for the xt_recent filter --reap switch (refreshed and updated)
  - add DEP-3 comments
* debian/patches/9003-compilation-error.patch:
  - renamed 03-compilation-error.patch as 9003-compilation-error.patch
  - apply after Debian patches for easier maintenance
  - add DEP-3 comments
* debian/iptables.doc-base.{nat|packet-filter}: update for 2.6
* Dropped changes:
  - Replaced ipt_DSCP.h by xpt_DSCP.h in ipt_ECN.h and ipt_echn.h (applied
    upstream)
  - 9001-build-libipq_pic.a.patch (using la instead)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Sam Johnston <samj@samj.net>
5
5
 */
 
6
#include <stdbool.h>
6
7
#include <stddef.h>
7
8
#include <stdio.h>
8
9
#include <stdlib.h>
12
13
#include <linux/netfilter/xt_quota.h>
13
14
 
14
15
static const struct option quota_opts[] = {
15
 
        {"quota", 1, NULL, '1'},
16
 
        { .name = NULL }
 
16
        {.name = "quota", .has_arg = true, .val = '1'},
 
17
        XT_GETOPT_TABLEEND,
17
18
};
18
19
 
19
20
static void quota_help(void)
20
21
{
21
22
        printf("quota match options:\n"
22
 
               " --quota quota                  quota (bytes)\n");
 
23
               "[!] --quota quota               quota (bytes)\n");
23
24
}
24
25
 
25
26
static void
60
61
 
61
62
        switch (c) {
62
63
        case '1':
63
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
 
64
                if (xtables_check_inverse(optarg, &invert, NULL, 0, argv))
64
65
                        xtables_error(PARAMETER_PROBLEM, "quota: unexpected '!'");
65
66
                if (!parse_quota(optarg, &info->quota))
66
67
                        xtables_error(PARAMETER_PROBLEM,
67
68
                                   "bad quota: '%s'", optarg);
 
69
 
 
70
                if (invert)
 
71
                        info->flags |= XT_QUOTA_INVERT;
 
72
 
68
73
                break;
69
74
 
70
75
        default:
78
83
        .name           = "quota",
79
84
        .version        = XTABLES_VERSION,
80
85
        .size           = XT_ALIGN(sizeof (struct xt_quota_info)),
81
 
        .userspacesize  = offsetof(struct xt_quota_info, quota),
 
86
        .userspacesize  = offsetof(struct xt_quota_info, master),
82
87
        .help           = quota_help,
83
88
        .parse          = quota_parse,
84
89
        .print          = quota_print,