All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Dziedzic <janusz.dziedzic@tieto.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	"wireless-regdb@lists.infradead.org"
	<wireless-regdb@lists.infradead.org>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wireless-regdb: add DFS CAC time parameter
Date: Mon, 9 Jun 2014 14:27:15 +0200	[thread overview]
Message-ID: <CALhHN=ogLffM+esRwbNdvLHjq6RikpZBsduf58pRY0xVqjNqSA@mail.gmail.com> (raw)
In-Reply-To: <CALhHN=pRskkXn_Li2n+hOM24t1QHwHi_E_ozc726Gh0jnuc5=w@mail.gmail.com>

On 9 June 2014 12:22, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> On 9 June 2014 10:00, Felix Fietkau <nbd@openwrt.org> wrote:
>> On 2014-05-21 18:03, Johannes Berg wrote:
>>> On Tue, 2014-05-20 at 11:48 -0700, Luis R. Rodriguez wrote:
>>>
>>>> > I think we should, but if we can't then at least can we cut to an
>>>> > extensible format?
>>>
>>> I don't see any way to extend the format right now.
>>>
>>> There's a wrinkle with making it more extensible too though - if we do
>>> that then we must be extremely careful that future older crda versions
>>> (i.e. the next version that we're about to write) will not parse a newer
>>> extended file more permissively, so our extensions are limited anyway.
>>>
>>> Looks like the format update really is needed, which probably means we
>>> should change the scripts to generate two databases and change the
>>> filename, or so?
>> How about making the format properly extensible by reusing what we're
>> already doing to keep the kernel ABI stable? For example, we could store
>> the database in a netlink-like attribute format, with some changes to
>> make it fixed endian.
>> I'm already doing just that for a few things in OpenWrt, so I have
>> working C code for writing and parsing such a format.
>>
>> Another nice feature would be to indicate in the attributes if crda is
>> required to understand them, or if it can just continue with a warning.
>>
>> If done right, I think we can probably make this the last time we change
>> the format version.
>>
> What kind of benefit we have having binary format between crda <->
> wireless-regd (nl-based or current regulatory.bin)?
> This is additional code/work to do - why we need that?
>

This is example of /sbin/crda script I have - seems works fine (small
crda_tiny also required):

#!/bin/sh
PUBKEY=/usr/lib/crda/pubkeys/regdb_pubring.gpg
REGDB=/usr/lib/crda/db.txt
CRDA_BIN=/sbin/crda_tiny
LOG=/tmp/crda.err

gpg_verify() {
    PUBKEY=$1
    REGDB=$2
    gpg --no-default-keyring --keyring $PUBKEY --verify $REGDB
}

show_country() {
    REGDB=$1
    COUNTRY=$2

    cat $REGDB \
    | sed '
        s/#.*//
        s/^[ \t]*$//
    ' \
    | awk \
        -v ctry=$COUNTRY '

        /country/{show=0}
        /BEGIN PGP SIGNATURE/{show=0}
        /country / && $2 == ctry ":" {show=1}
        show && !/^$/
   '
}

(
/bin/date
echo "$0 called with params:"
echo "COUNTRY: $COUNTRY"
echo "DB: $REGDB"
echo "PUBKEY: $PUBKEY"
echo "CRDA: $CRDA_BIN"

gpg_verify "$PUBKEY" "$REGDB" && show_country "$REGDB" "$COUNTRY" | "$CRDA_BIN"

WARNING: multiple messages have this Message-ID (diff)
From: Janusz Dziedzic <janusz.dziedzic@tieto.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	"wireless-regdb@lists.infradead.org"
	<wireless-regdb@lists.infradead.org>,
	"John W. Linville" <linville@tuxdriver.com>,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Subject: Re: [wireless-regdb] [PATCH] wireless-regdb: add DFS CAC time parameter
Date: Mon, 9 Jun 2014 14:27:15 +0200	[thread overview]
Message-ID: <CALhHN=ogLffM+esRwbNdvLHjq6RikpZBsduf58pRY0xVqjNqSA@mail.gmail.com> (raw)
In-Reply-To: <CALhHN=pRskkXn_Li2n+hOM24t1QHwHi_E_ozc726Gh0jnuc5=w@mail.gmail.com>

On 9 June 2014 12:22, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> On 9 June 2014 10:00, Felix Fietkau <nbd@openwrt.org> wrote:
>> On 2014-05-21 18:03, Johannes Berg wrote:
>>> On Tue, 2014-05-20 at 11:48 -0700, Luis R. Rodriguez wrote:
>>>
>>>> > I think we should, but if we can't then at least can we cut to an
>>>> > extensible format?
>>>
>>> I don't see any way to extend the format right now.
>>>
>>> There's a wrinkle with making it more extensible too though - if we do
>>> that then we must be extremely careful that future older crda versions
>>> (i.e. the next version that we're about to write) will not parse a newer
>>> extended file more permissively, so our extensions are limited anyway.
>>>
>>> Looks like the format update really is needed, which probably means we
>>> should change the scripts to generate two databases and change the
>>> filename, or so?
>> How about making the format properly extensible by reusing what we're
>> already doing to keep the kernel ABI stable? For example, we could store
>> the database in a netlink-like attribute format, with some changes to
>> make it fixed endian.
>> I'm already doing just that for a few things in OpenWrt, so I have
>> working C code for writing and parsing such a format.
>>
>> Another nice feature would be to indicate in the attributes if crda is
>> required to understand them, or if it can just continue with a warning.
>>
>> If done right, I think we can probably make this the last time we change
>> the format version.
>>
> What kind of benefit we have having binary format between crda <->
> wireless-regd (nl-based or current regulatory.bin)?
> This is additional code/work to do - why we need that?
>

This is example of /sbin/crda script I have - seems works fine (small
crda_tiny also required):

#!/bin/sh
PUBKEY=/usr/lib/crda/pubkeys/regdb_pubring.gpg
REGDB=/usr/lib/crda/db.txt
CRDA_BIN=/sbin/crda_tiny
LOG=/tmp/crda.err

gpg_verify() {
    PUBKEY=$1
    REGDB=$2
    gpg --no-default-keyring --keyring $PUBKEY --verify $REGDB
}

show_country() {
    REGDB=$1
    COUNTRY=$2

    cat $REGDB \
    | sed '
        s/#.*//
        s/^[ \t]*$//
    ' \
    | awk \
        -v ctry=$COUNTRY '

        /country/{show=0}
        /BEGIN PGP SIGNATURE/{show=0}
        /country / && $2 == ctry ":" {show=1}
        show && !/^$/
   '
}

(
/bin/date
echo "$0 called with params:"
echo "COUNTRY: $COUNTRY"
echo "DB: $REGDB"
echo "PUBKEY: $PUBKEY"
echo "CRDA: $CRDA_BIN"

gpg_verify "$PUBKEY" "$REGDB" && show_country "$REGDB" "$COUNTRY" | "$CRDA_BIN"

_______________________________________________
wireless-regdb mailing list
wireless-regdb@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wireless-regdb


  reply	other threads:[~2014-06-09 12:27 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  8:40 [PATCH] wireless-regdb: add DFS CAC time parameter Janusz Dziedzic
2014-05-09  8:40 ` [wireless-regdb] " Janusz Dziedzic
2014-05-09  8:40 ` [PATCH] crda: add DFS CAC time support Janusz Dziedzic
2014-05-09  8:40   ` [wireless-regdb] " Janusz Dziedzic
2014-05-20  7:33 ` [PATCH] wireless-regdb: add DFS CAC time parameter Luis R. Rodriguez
2014-05-20  7:33   ` [wireless-regdb] " Luis R. Rodriguez
2014-05-20 13:26   ` Janusz Dziedzic
2014-05-20 13:26     ` [wireless-regdb] " Janusz Dziedzic
2014-05-20 14:24   ` John W. Linville
2014-05-20 14:24     ` [wireless-regdb] " John W. Linville
2014-05-20 18:01     ` Janusz Dziedzic
2014-05-20 18:01       ` [wireless-regdb] " Janusz Dziedzic
2014-05-20 18:08       ` John W. Linville
2014-05-20 18:08         ` [wireless-regdb] " John W. Linville
2014-05-20 18:24         ` Johannes Berg
2014-05-20 18:24           ` [wireless-regdb] " Johannes Berg
2014-05-20 18:48           ` Luis R. Rodriguez
2014-05-20 18:48             ` [wireless-regdb] " Luis R. Rodriguez
2014-05-21 16:03             ` Johannes Berg
2014-05-21 16:03               ` [wireless-regdb] " Johannes Berg
2014-05-21 18:00               ` John W. Linville
2014-05-21 18:00                 ` [wireless-regdb] " John W. Linville
2014-05-21 19:09                 ` Johannes Berg
2014-05-21 19:09                   ` [wireless-regdb] " Johannes Berg
2014-06-09  7:33                   ` Janusz Dziedzic
2014-06-09  7:33                     ` [wireless-regdb] " Janusz Dziedzic
2014-06-10 16:45                     ` Johannes Berg
2014-06-10 16:45                       ` [wireless-regdb] " Johannes Berg
2014-06-09  8:00               ` Felix Fietkau
2014-06-09  8:00                 ` [wireless-regdb] " Felix Fietkau
2014-06-09 10:22                 ` Janusz Dziedzic
2014-06-09 10:22                   ` [wireless-regdb] " Janusz Dziedzic
2014-06-09 12:27                   ` Janusz Dziedzic [this message]
2014-06-09 12:27                     ` Janusz Dziedzic
2014-06-10 16:46                 ` Johannes Berg
2014-06-10 16:46                   ` [wireless-regdb] " Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2014-02-12 18:54 [PATCH 1/4] cfg80211: regulatory, introduce DFS CAC time Janusz Dziedzic
2014-02-12 18:54 ` [PATCH] wireless-regdb: add DFS CAC time parameter Janusz Dziedzic

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='CALhHN=ogLffM+esRwbNdvLHjq6RikpZBsduf58pRY0xVqjNqSA@mail.gmail.com' \
    --to=janusz.dziedzic@tieto.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@do-not-panic.com \
    --cc=nbd@openwrt.org \
    --cc=wireless-regdb@lists.infradead.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.