Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
* Proposing to add a structure to UserData
@ 2020-02-13 14:12 sbezverk
  2020-02-17 14:40 ` Florian Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: sbezverk @ 2020-02-13 14:12 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

Hello Pablo,

I would like to propose to add some structure to UserData. Currently nft tool uses UserData to carry comments and it prints out whatever is stored in it without much of processing. Since UserData is the only available mechanism to store some metadata for a rule, if it is used, then comments in nft cli get totally screwed up.

What do you think about to add a little structure to userdata in order to preserve nft comments and at the same time allow developers to use UserData for other things.

If we could add attributes to UserData indicating type NFT_USERDATA_COMMENT with length, then we could preserve nft comments and at the same time allow to use UserData for other things.

What do you think?

Thank you
Serguei

   



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposing to add a structure to UserData
  2020-02-13 14:12 Proposing to add a structure to UserData sbezverk
@ 2020-02-17 14:40 ` Florian Westphal
  2020-02-17 15:42   ` sbezverk
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Westphal @ 2020-02-17 14:40 UTC (permalink / raw)
  To: sbezverk; +Cc: Pablo Neira Ayuso, netfilter-devel

sbezverk <sbezverk@gmail.com> wrote:
> I would like to propose to add some structure to UserData. Currently nft tool uses UserData to carry comments and it prints out whatever is stored in it without much of processing. Since UserData is the only available mechanism to store some metadata for a rule, if it is used, then comments in nft cli get totally screwed up.

Then you are using it wrong :-)

Userdata is structured, its not used only for comments.
Which userdata are you referring to?  We have this for
rules, sets, and elements.

> If we could add attributes to UserData indicating type NFT_USERDATA_COMMENT with length, then we could preserve nft comments and at the same time allow to use UserData for other things.
> What do you think?

As far as I can see what you want is already implemented, for example
rule comments live in NFTNL_UDATA_RULE_COMMENT sub-type.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposing to add a structure to UserData
  2020-02-17 14:40 ` Florian Westphal
@ 2020-02-17 15:42   ` sbezverk
  2020-02-17 15:48     ` Phil Sutter
  0 siblings, 1 reply; 4+ messages in thread
From: sbezverk @ 2020-02-17 15:42 UTC (permalink / raw)
  To: Florian Westphal; +Cc: Pablo Neira Ayuso, netfilter-devel

Hi Florian,

Thank you for letting me know, I checked golang unix package and I did not find definition for NFTNL_UDATA_RULE_COMMENT.  That explains why I did not use it.
Could you please point me where UDATA relate types and subtypes are defined, so I could replicate them in go.

Thank you
Serguei


On 2020-02-17, 9:40 AM, "Florian Westphal" <fw@strlen.de> wrote:

    sbezverk <sbezverk@gmail.com> wrote:
    > I would like to propose to add some structure to UserData. Currently nft tool uses UserData to carry comments and it prints out whatever is stored in it without much of processing. Since UserData is the only available mechanism to store some metadata for a rule, if it is used, then comments in nft cli get totally screwed up.
    
    Then you are using it wrong :-)
    
    Userdata is structured, its not used only for comments.
    Which userdata are you referring to?  We have this for
    rules, sets, and elements.
    
    > If we could add attributes to UserData indicating type NFT_USERDATA_COMMENT with length, then we could preserve nft comments and at the same time allow to use UserData for other things.
    > What do you think?
    
    As far as I can see what you want is already implemented, for example
    rule comments live in NFTNL_UDATA_RULE_COMMENT sub-type.
    



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposing to add a structure to UserData
  2020-02-17 15:42   ` sbezverk
@ 2020-02-17 15:48     ` Phil Sutter
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Sutter @ 2020-02-17 15:48 UTC (permalink / raw)
  To: sbezverk; +Cc: Florian Westphal, Pablo Neira Ayuso, netfilter-devel

Hi Serguei,

On Mon, Feb 17, 2020 at 10:42:48AM -0500, sbezverk wrote:
> Thank you for letting me know, I checked golang unix package and I did not find definition for NFTNL_UDATA_RULE_COMMENT.  That explains why I did not use it.
> Could you please point me where UDATA relate types and subtypes are defined, so I could replicate them in go.

Please check libnftnl/udata.h. In general, all NFTNL_* named defines
belong to libnftnl.

Cheers, Phil

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 14:12 Proposing to add a structure to UserData sbezverk
2020-02-17 14:40 ` Florian Westphal
2020-02-17 15:42   ` sbezverk
2020-02-17 15:48     ` Phil Sutter

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org
	public-inbox-index netfilter-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git