~ubuntu-branches/ubuntu/natty/iptables/natty

« back to all changes in this revision

Viewing changes to extensions/libipt_SET.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-07-14 15:59:54 UTC
  • mfrom: (5.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714155954-9039kro8cnh6lb1q
Tags: 1.4.4-1ubuntu1
* Merge from debian unstable, remaining changes: LP: #399211
  - Don't fail to run iptables-save if iptables module isn't loaded.
  - debian/patches/0901-build-libipq_pic.a.patch - Build libipq_pic.a with
    -fPIC. Upstream changed build system and patch modified accordingly.
  - 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)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
               " --del-set name flags\n"
29
29
               "                add/del src/dst IP/port from/to named sets,\n"
30
30
               "                where flags are the comma separated list of\n"
31
 
               "                'src' and 'dst'.\n");
 
31
               "                'src' and 'dst' specifications.\n");
32
32
}
33
33
 
34
34
static const struct option SET_opts[] = {
35
 
        {"add-set",   1, NULL, '1'},
36
 
        {"del-set",   1, NULL, '2'},
37
 
        { }
 
35
        { .name = "add-set", .has_arg = true, .val = '1'},
 
36
        { .name = "del-set", .has_arg = true, .val = '2'},
 
37
        { .name = NULL }
38
38
};
39
39
 
40
40
static void SET_init(struct xt_entry_target *target)
129
129
static void SET_print(const void *ip, const struct xt_entry_target *target,
130
130
                      int numeric)
131
131
{
132
 
        struct ipt_set_info_target *info =
133
 
            (struct ipt_set_info_target *) target->data;
 
132
        const struct ipt_set_info_target *info = (const void *)target->data;
134
133
 
135
134
        print_target("add-set", &info->add_set);
136
135
        print_target("del-set", &info->del_set);
138
137
 
139
138
static void SET_save(const void *ip, const struct xt_entry_target *target)
140
139
{
141
 
        struct ipt_set_info_target *info =
142
 
            (struct ipt_set_info_target *) target->data;
 
140
        const struct ipt_set_info_target *info = (const void *)target->data;
143
141
 
144
142
        print_target("--add-set", &info->add_set);
145
143
        print_target("--del-set", &info->del_set);