From a144500f93ccf5a906b2897b1a15a1cb281fe977 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Fri, 20 Oct 2023 16:31:51 +0200 Subject: [PATCH] ns: Add zero field checks --- pkg/networkserver/grpc_deviceregistry.go | 228 +++++++++++++++++++++++ 1 file changed, 228 insertions(+) diff --git a/pkg/networkserver/grpc_deviceregistry.go b/pkg/networkserver/grpc_deviceregistry.go index ab42be71e35..78618824130 100644 --- a/pkg/networkserver/grpc_deviceregistry.go +++ b/pkg/networkserver/grpc_deviceregistry.go @@ -613,6 +613,29 @@ var ( "pending_mac_state.current_parameters.ping_slot_frequency", "pending_mac_state.current_parameters.rejoin_count_periodicity", "pending_mac_state.current_parameters.rejoin_time_periodicity", + "pending_mac_state.current_parameters.relay.mode.served.backoff", + "pending_mac_state.current_parameters.relay.mode.served.mode.always", + "pending_mac_state.current_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "pending_mac_state.current_parameters.relay.mode.served.mode.end_device_controlled", + "pending_mac_state.current_parameters.relay.mode.served.second_channel.ack_offset", + "pending_mac_state.current_parameters.relay.mode.served.second_channel.data_rate_index", + "pending_mac_state.current_parameters.relay.mode.served.second_channel.frequency", + "pending_mac_state.current_parameters.relay.mode.served.serving_device_id", + "pending_mac_state.current_parameters.relay.mode.serving.cad_periodicity", + "pending_mac_state.current_parameters.relay.mode.serving.default_channel_index", + "pending_mac_state.current_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "pending_mac_state.current_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "pending_mac_state.current_parameters.relay.mode.serving.limits.notifications.bucket_size", + "pending_mac_state.current_parameters.relay.mode.serving.limits.notifications.reload_rate", + "pending_mac_state.current_parameters.relay.mode.serving.limits.overall.bucket_size", + "pending_mac_state.current_parameters.relay.mode.serving.limits.overall.reload_rate", + "pending_mac_state.current_parameters.relay.mode.serving.limits.reset_behavior", + "pending_mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "pending_mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "pending_mac_state.current_parameters.relay.mode.serving.second_channel.ack_offset", + "pending_mac_state.current_parameters.relay.mode.serving.second_channel.data_rate_index", + "pending_mac_state.current_parameters.relay.mode.serving.second_channel.frequency", + "pending_mac_state.current_parameters.relay.mode.serving.uplink_forwarding_rules", "pending_mac_state.current_parameters.rx1_data_rate_offset", "pending_mac_state.current_parameters.rx1_delay", "pending_mac_state.current_parameters.rx2_data_rate_index", @@ -632,6 +655,29 @@ var ( "pending_mac_state.desired_parameters.ping_slot_frequency", "pending_mac_state.desired_parameters.rejoin_count_periodicity", "pending_mac_state.desired_parameters.rejoin_time_periodicity", + "pending_mac_state.desired_parameters.relay.mode.served.backoff", + "pending_mac_state.desired_parameters.relay.mode.served.mode.always", + "pending_mac_state.desired_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "pending_mac_state.desired_parameters.relay.mode.served.mode.end_device_controlled", + "pending_mac_state.desired_parameters.relay.mode.served.second_channel.ack_offset", + "pending_mac_state.desired_parameters.relay.mode.served.second_channel.data_rate_index", + "pending_mac_state.desired_parameters.relay.mode.served.second_channel.frequency", + "pending_mac_state.desired_parameters.relay.mode.served.serving_device_id", + "pending_mac_state.desired_parameters.relay.mode.serving.cad_periodicity", + "pending_mac_state.desired_parameters.relay.mode.serving.default_channel_index", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.notifications.bucket_size", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.notifications.reload_rate", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.overall.bucket_size", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.overall.reload_rate", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.reset_behavior", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "pending_mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "pending_mac_state.desired_parameters.relay.mode.serving.second_channel.ack_offset", + "pending_mac_state.desired_parameters.relay.mode.serving.second_channel.data_rate_index", + "pending_mac_state.desired_parameters.relay.mode.serving.second_channel.frequency", + "pending_mac_state.desired_parameters.relay.mode.serving.uplink_forwarding_rules", "pending_mac_state.desired_parameters.rx1_data_rate_offset", "pending_mac_state.desired_parameters.rx1_delay", "pending_mac_state.desired_parameters.rx2_data_rate_index", @@ -697,7 +743,99 @@ var ( ifNotZeroThenZeroFields = map[string][]string{ "multicast": { + "mac_settings.desired_relay.mode.served.backoff", + "mac_settings.desired_relay.mode.served.mode.always", + "mac_settings.desired_relay.mode.served.mode.dynamic.smart_enable_level", + "mac_settings.desired_relay.mode.served.mode.end_device_controlled", + "mac_settings.desired_relay.mode.served.second_channel.ack_offset", + "mac_settings.desired_relay.mode.served.second_channel.data_rate_index", + "mac_settings.desired_relay.mode.served.second_channel.frequency", + "mac_settings.desired_relay.mode.served.serving_device_id", + "mac_settings.desired_relay.mode.serving.cad_periodicity", + "mac_settings.desired_relay.mode.serving.default_channel_index", + "mac_settings.desired_relay.mode.serving.limits.join_requests.bucket_size", + "mac_settings.desired_relay.mode.serving.limits.join_requests.reload_rate", + "mac_settings.desired_relay.mode.serving.limits.notifications.bucket_size", + "mac_settings.desired_relay.mode.serving.limits.notifications.reload_rate", + "mac_settings.desired_relay.mode.serving.limits.overall.bucket_size", + "mac_settings.desired_relay.mode.serving.limits.overall.reload_rate", + "mac_settings.desired_relay.mode.serving.limits.reset_behavior", + "mac_settings.desired_relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_settings.desired_relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_settings.desired_relay.mode.serving.second_channel.ack_offset", + "mac_settings.desired_relay.mode.serving.second_channel.data_rate_index", + "mac_settings.desired_relay.mode.serving.second_channel.frequency", + "mac_settings.desired_relay.mode.serving.uplink_forwarding_rules", + "mac_settings.relay.mode.served.backoff", + "mac_settings.relay.mode.served.mode.always", + "mac_settings.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_settings.relay.mode.served.mode.end_device_controlled", + "mac_settings.relay.mode.served.second_channel.ack_offset", + "mac_settings.relay.mode.served.second_channel.data_rate_index", + "mac_settings.relay.mode.served.second_channel.frequency", + "mac_settings.relay.mode.served.serving_device_id", + "mac_settings.relay.mode.serving.cad_periodicity", + "mac_settings.relay.mode.serving.default_channel_index", + "mac_settings.relay.mode.serving.limits.join_requests.bucket_size", + "mac_settings.relay.mode.serving.limits.join_requests.reload_rate", + "mac_settings.relay.mode.serving.limits.notifications.bucket_size", + "mac_settings.relay.mode.serving.limits.notifications.reload_rate", + "mac_settings.relay.mode.serving.limits.overall.bucket_size", + "mac_settings.relay.mode.serving.limits.overall.reload_rate", + "mac_settings.relay.mode.serving.limits.reset_behavior", + "mac_settings.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_settings.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_settings.relay.mode.serving.second_channel.ack_offset", + "mac_settings.relay.mode.serving.second_channel.data_rate_index", + "mac_settings.relay.mode.serving.second_channel.frequency", + "mac_settings.relay.mode.serving.uplink_forwarding_rules", "mac_settings.schedule_downlinks.value", + "mac_state.current_parameters.relay.mode.served.backoff", + "mac_state.current_parameters.relay.mode.served.mode.always", + "mac_state.current_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_state.current_parameters.relay.mode.served.mode.end_device_controlled", + "mac_state.current_parameters.relay.mode.served.second_channel.ack_offset", + "mac_state.current_parameters.relay.mode.served.second_channel.data_rate_index", + "mac_state.current_parameters.relay.mode.served.second_channel.frequency", + "mac_state.current_parameters.relay.mode.served.serving_device_id", + "mac_state.current_parameters.relay.mode.serving.cad_periodicity", + "mac_state.current_parameters.relay.mode.serving.default_channel_index", + "mac_state.current_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.notifications.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.notifications.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.overall.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.overall.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.reset_behavior", + "mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_state.current_parameters.relay.mode.serving.second_channel.ack_offset", + "mac_state.current_parameters.relay.mode.serving.second_channel.data_rate_index", + "mac_state.current_parameters.relay.mode.serving.second_channel.frequency", + "mac_state.current_parameters.relay.mode.serving.uplink_forwarding_rules", + "mac_state.desired_parameters.relay.mode.served.backoff", + "mac_state.desired_parameters.relay.mode.served.mode.always", + "mac_state.desired_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_state.desired_parameters.relay.mode.served.mode.end_device_controlled", + "mac_state.desired_parameters.relay.mode.served.second_channel.ack_offset", + "mac_state.desired_parameters.relay.mode.served.second_channel.data_rate_index", + "mac_state.desired_parameters.relay.mode.served.second_channel.frequency", + "mac_state.desired_parameters.relay.mode.served.serving_device_id", + "mac_state.desired_parameters.relay.mode.serving.cad_periodicity", + "mac_state.desired_parameters.relay.mode.serving.default_channel_index", + "mac_state.desired_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.notifications.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.notifications.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.overall.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.overall.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.reset_behavior", + "mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.second_channel.ack_offset", + "mac_state.desired_parameters.relay.mode.serving.second_channel.data_rate_index", + "mac_state.desired_parameters.relay.mode.serving.second_channel.frequency", + "mac_state.desired_parameters.relay.mode.serving.uplink_forwarding_rules", "mac_state.last_adr_change_f_cnt_up", "mac_state.last_confirmed_downlink_at", "mac_state.last_dev_status_f_cnt_up", @@ -905,6 +1043,28 @@ var ( "mac_state.current_parameters.ping_slot_frequency", "mac_state.current_parameters.rejoin_count_periodicity", "mac_state.current_parameters.rejoin_time_periodicity", + "mac_state.current_parameters.relay.mode.served.backoff", + "mac_state.current_parameters.relay.mode.served.mode.always", + "mac_state.current_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_state.current_parameters.relay.mode.served.mode.end_device_controlled", + "mac_state.current_parameters.relay.mode.served.second_channel.ack_offset", + "mac_state.current_parameters.relay.mode.served.second_channel.data_rate_index", + "mac_state.current_parameters.relay.mode.served.second_channel.frequency", + "mac_state.current_parameters.relay.mode.serving.cad_periodicity", + "mac_state.current_parameters.relay.mode.serving.default_channel_index", + "mac_state.current_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.notifications.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.notifications.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.overall.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.overall.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.reset_behavior", + "mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_state.current_parameters.relay.mode.serving.second_channel.ack_offset", + "mac_state.current_parameters.relay.mode.serving.second_channel.data_rate_index", + "mac_state.current_parameters.relay.mode.serving.second_channel.frequency", + "mac_state.current_parameters.relay.mode.serving.uplink_forwarding_rules", "mac_state.current_parameters.rx1_data_rate_offset", "mac_state.current_parameters.rx1_delay", "mac_state.current_parameters.rx2_data_rate_index", @@ -924,6 +1084,28 @@ var ( "mac_state.desired_parameters.ping_slot_frequency", "mac_state.desired_parameters.rejoin_count_periodicity", "mac_state.desired_parameters.rejoin_time_periodicity", + "mac_state.desired_parameters.relay.mode.served.backoff", + "mac_state.desired_parameters.relay.mode.served.mode.always", + "mac_state.desired_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_state.desired_parameters.relay.mode.served.mode.end_device_controlled", + "mac_state.desired_parameters.relay.mode.served.second_channel.ack_offset", + "mac_state.desired_parameters.relay.mode.served.second_channel.data_rate_index", + "mac_state.desired_parameters.relay.mode.served.second_channel.frequency", + "mac_state.desired_parameters.relay.mode.serving.cad_periodicity", + "mac_state.desired_parameters.relay.mode.serving.default_channel_index", + "mac_state.desired_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.notifications.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.notifications.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.overall.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.overall.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.reset_behavior", + "mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.second_channel.ack_offset", + "mac_state.desired_parameters.relay.mode.serving.second_channel.data_rate_index", + "mac_state.desired_parameters.relay.mode.serving.second_channel.frequency", + "mac_state.desired_parameters.relay.mode.serving.uplink_forwarding_rules", "mac_state.desired_parameters.rx1_data_rate_offset", "mac_state.desired_parameters.rx1_delay", "mac_state.desired_parameters.rx2_data_rate_index", @@ -3058,6 +3240,29 @@ func (ns *NetworkServer) Set(ctx context.Context, req *ttnpb.SetEndDeviceRequest "mac_state.current_parameters.ping_slot_frequency", "mac_state.current_parameters.rejoin_count_periodicity", "mac_state.current_parameters.rejoin_time_periodicity", + "mac_state.current_parameters.relay.mode.served.backoff", + "mac_state.current_parameters.relay.mode.served.mode.always", + "mac_state.current_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_state.current_parameters.relay.mode.served.mode.end_device_controlled", + "mac_state.current_parameters.relay.mode.served.second_channel.ack_offset", + "mac_state.current_parameters.relay.mode.served.second_channel.data_rate_index", + "mac_state.current_parameters.relay.mode.served.second_channel.frequency", + "mac_state.current_parameters.relay.mode.served.serving_device_id", + "mac_state.current_parameters.relay.mode.serving.cad_periodicity", + "mac_state.current_parameters.relay.mode.serving.default_channel_index", + "mac_state.current_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.notifications.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.notifications.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.overall.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.overall.reload_rate", + "mac_state.current_parameters.relay.mode.serving.limits.reset_behavior", + "mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_state.current_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_state.current_parameters.relay.mode.serving.second_channel.ack_offset", + "mac_state.current_parameters.relay.mode.serving.second_channel.data_rate_index", + "mac_state.current_parameters.relay.mode.serving.second_channel.frequency", + "mac_state.current_parameters.relay.mode.serving.uplink_forwarding_rules", "mac_state.current_parameters.rx1_data_rate_offset", "mac_state.current_parameters.rx1_delay", "mac_state.current_parameters.rx2_data_rate_index", @@ -3077,6 +3282,29 @@ func (ns *NetworkServer) Set(ctx context.Context, req *ttnpb.SetEndDeviceRequest "mac_state.desired_parameters.ping_slot_frequency", "mac_state.desired_parameters.rejoin_count_periodicity", "mac_state.desired_parameters.rejoin_time_periodicity", + "mac_state.desired_parameters.relay.mode.served.backoff", + "mac_state.desired_parameters.relay.mode.served.mode.always", + "mac_state.desired_parameters.relay.mode.served.mode.dynamic.smart_enable_level", + "mac_state.desired_parameters.relay.mode.served.mode.end_device_controlled", + "mac_state.desired_parameters.relay.mode.served.second_channel.ack_offset", + "mac_state.desired_parameters.relay.mode.served.second_channel.data_rate_index", + "mac_state.desired_parameters.relay.mode.served.second_channel.frequency", + "mac_state.desired_parameters.relay.mode.served.serving_device_id", + "mac_state.desired_parameters.relay.mode.serving.cad_periodicity", + "mac_state.desired_parameters.relay.mode.serving.default_channel_index", + "mac_state.desired_parameters.relay.mode.serving.limits.join_requests.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.join_requests.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.notifications.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.notifications.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.overall.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.overall.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.limits.reset_behavior", + "mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.bucket_size", + "mac_state.desired_parameters.relay.mode.serving.limits.uplink_messages.reload_rate", + "mac_state.desired_parameters.relay.mode.serving.second_channel.ack_offset", + "mac_state.desired_parameters.relay.mode.serving.second_channel.data_rate_index", + "mac_state.desired_parameters.relay.mode.serving.second_channel.frequency", + "mac_state.desired_parameters.relay.mode.serving.uplink_forwarding_rules", "mac_state.desired_parameters.rx1_data_rate_offset", "mac_state.desired_parameters.rx1_delay", "mac_state.desired_parameters.rx2_data_rate_index",