[wireless-regdb] [PATCH] wireless-regdb: add DFS CAC time parameter
Janusz Dziedzic
janusz.dziedzic at tieto.com
Mon Jun 9 05:27:15 PDT 2014
On 9 June 2014 12:22, Janusz Dziedzic <janusz.dziedzic at tieto.com> wrote:
> On 9 June 2014 10:00, Felix Fietkau <nbd at 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"
More information about the wireless-regdb
mailing list