chirpstack / chirpstack-mqtt-forwarder

ChirpStack MQTT Forwarder is a forwarder which can be installed on the gateway to forward LoRa data over MQTT.
MIT License
21 stars 13 forks source link

Feature: Add support for NetID filters #25

Closed bconway closed 1 year ago

bconway commented 1 year ago

Perhaps JoinEUI filters as well? I only use the former, but I assume people use the latter.

Thanks.

brocaar commented 1 year ago

@bconway I started working on this :-) See the above commit.

I'm planning to implement this as DevAddr prefix filter, e.g. you would configure 01000000/8 which uses the first 8 bits of the prefix, thus a DevAddr 01020304 would pass, where 02020304 would not.

This is less complex than configuring a list of NetID filters + provides more flexibility. E.g. it makes it possible to filter on a sub-set of the DevAddr space within a NetID. As well, since the NetID based prefix is specified in the Backend specs, it might change over time (which already happened once in the past).

bconway commented 1 year ago

Interesting! I will break out my NetID math.

brocaar commented 1 year ago

@bconway I have implemented this in the above commit (still need to do some end-to-end testing as a final confirmation that this works as intended). There will be the configuration options:

https://github.com/chirpstack/chirpstack-mqtt-forwarder/blob/master/src/cmd/configfile.rs#L121

bconway commented 1 year ago

I was just reading through that, thanks! 👍