All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emmanuel Guiton <emmanuel@netlab.hut.fi>
To: netfilter-devel@lists.netfilter.org
Subject: iptables_target and unknown size data.
Date: Wed, 26 Nov 2003 12:05:30 +0200	[thread overview]
Message-ID: <3FC47AEA.5090104@netlab.hut.fi> (raw)

Hei!

I am writing an iptables extension. It's a new target. My problem is 
that I need to use a linked list whose size is unknown when registering 
the target. As I am not very familiar with the alignment problems, I am 
wondering if it can cause any trouble?

To be a bit more concrete, is the following ok?

struct ipt_sd_host
{
    struct in_addr    address;
    int                port;            
    struct ipt_sd_host    *next_host;
};

struct ip_new_targ_data
{
    struct ipt_sd_host   *host_list;
    int                            min_port;
    int                            max_port;
};

static
struct iptables_target my_new_target
= { NULL,
    "NEWTARG",
    IPTABLES_VERSION,
    IPT_ALIGN(sizeof(struct ip_new_targ_data)),
    IPT_ALIGN(sizeof(struct ip_new_targ_data)),
    &help,
    &init,
    &parse,
    &final_check,
    &print,
    &save,
    opts
};


                 Emmanuel

             reply	other threads:[~2003-11-26 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-26 10:05 Emmanuel Guiton [this message]
2003-11-26 10:18 ` iptables_target and unknown size data Henrik Nordstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FC47AEA.5090104@netlab.hut.fi \
    --to=emmanuel@netlab.hut.fi \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.