All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Fisher <brad@info-link.net>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] Re: Setting skb->priority with libnetfilter_queue
Date: Mon, 27 Mar 2006 15:38:44 -0600	[thread overview]
Message-ID: <44285B64.1000004@info-link.net> (raw)
In-Reply-To: <44283F9F.4010206@info-link.net>

In case anyone is interested, I have written a couple of small patches 
to accomplish what I desired.  It adds three new functions to 
libnetfilter_queue:

   /* Set both mark and priority */
   int nfq_set_verdict_mark_priority(struct nfq_q_handle *qh, u_int32_t 
id, u_int32_t verdict, u_int32_t mark, u_int32_t priority,
                               u_int32_t data_len, unsigned char *buf)

   /* Sets priority, but leaves mark unchanged */
   int nfq_set_verdict_priority(struct nfq_q_handle *qh, u_int32_t id, 
u_int32_t verdict, u_int32_t priority,
                               u_int32_t data_len, unsigned char *buf)

   /* Get current skb->priority value */
    u_int32_t nfq_get_priority(struct nfq_data *nfad)

I have performed minimal testing and it appears to work as I had hoped.  
If anyone has any better way to do it, I'm open to suggestions.  I would 
like to see the functionality added to libnetlink_queue at some point, 
but am not hung up on the implementation.  That said, if the netfilter 
developers want to use my patch, feel free.  The libnetfilter_queue 
patch is against current svn (apply with -p0).  The kernel patch is 
against 2.6.16 (with the nfnetlink_queue: fix nfnetlink message size 
patch applied) (apply with -p1).

-Brad


Brad Fisher wrote:
> Does anyone know how I could go about setting the skb->priority for 
> queued packets?  I'd like to have my userspace program be able to 
> classify packets dynamically, but I believe that would require either 
> the skb pointer to the enqueued packet so I could use setsockopt, or a 
> change to the libnetfilter_queue api.  I suppose one could add a 
> function like:
>
>    int nfq_set_verdict_mark_priority(struct nfq_q_handle *qh, 
> u_int32_t id, u_int32_t verdict, u_int32_t mark, u_int32_t priority,
>                                u_int32_t data_len, unsigned char *buf)
>
> (or perhaps it  could be called nfq_set_mark_classify?)
>
> Either way, it seems that both the kernel and libnetfilter_queue must 
> be modified.  I'm hoping I'm wrong and that there is a way to do what 
> I want without patching the kernel and libnetfilter_queue.  If so 
> could someone please enlighten me?
>
> -Brad
>
>
> !DSPAM:3824,4428404557196205613798!
>

  reply	other threads:[~2006-03-27 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-27 19:40 Setting skb->priority with libnetfilter_queue Brad Fisher
2006-03-27 21:38 ` Brad Fisher [this message]
2006-03-27 21:40   ` [PATCH] Re: Setting skb->priority with libnetfilter_queue (patch really attached this time) Brad Fisher
2006-04-06 11:03     ` Patrick McHardy

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=44285B64.1000004@info-link.net \
    --to=brad@info-link.net \
    --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.