netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Pilcher <arequipeno@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: "Decoding" ipset error codes
Date: Wed, 16 Mar 2022 11:40:09 -0500	[thread overview]
Message-ID: <86f13f61-ffae-1130-12fa-f638da3558a2@gmail.com> (raw)

I am using libmnl to add entries to an IP set.  (Code here[1] if anyone
is interested.)  I've got everything working, but I haven't yet found a
way to "decode" any protocol-specific errors that may be returned,
because the set is not of the correct type, for example.

I see that libipset has an ipset_errcode() function but it looks to be
designed for use only when libipset is being used for the actual netlink
communication.  (I didn't do that in this case, because libipset looks
to be targeted only on parsing and executing commands that are passed to
the ipset command.  It didn't make any sense to me to create a command
string in a buffer just so libipset could parse it back into information
that is already known.)

Is there any way that I can give users of my program something more
helpful than "unknown error XXXX"?

Thanks!

[1] https://github.com/ipilcher/fdf/blob/main/src/filters/ipset.c

-- 
========================================================================
Google                                      Where SkyNet meets Idiocracy
========================================================================

             reply	other threads:[~2022-03-16 16:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 16:40 Ian Pilcher [this message]
2022-03-18 19:38 ` "Decoding" ipset error codes Jozsef Kadlecsik

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=86f13f61-ffae-1130-12fa-f638da3558a2@gmail.com \
    --to=arequipeno@gmail.com \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).