Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement enums and structs from nl80211.h #5

Open
AbuShawarib opened this issue Mar 8, 2023 · 8 comments
Open

Implement enums and structs from nl80211.h #5

AbuShawarib opened this issue Mar 8, 2023 · 8 comments

Comments

@AbuShawarib
Copy link
Contributor

AbuShawarib commented Mar 8, 2023

Implement the following enums in rust enums with appropriate implementation:

  • nl80211_ac
  • nl80211_acl_policy
  • nl80211_ap_settings_flags
  • nl80211_ap_sme_features
  • nl80211_attr_coalesce_rule
  • nl80211_attr_cqm
  • nl80211_attrs: (Nl80211Attr)
  • nl80211_auth_type
  • nl80211_band
  • nl80211_band_attr
  • nl80211_band_iftype_attr
  • nl80211_bitrate_attr
  • nl80211_bss
  • nl80211_bss_color_attributes
  • nl80211_bss_scan_width
  • nl80211_bss_select_attr
  • nl80211_bss_status
  • nl80211_chan_width (Nl80211ChannelWidth)
  • nl80211_channel_type (Nl80211WiPhyChannelType)
  • nl80211_coalesce_condition
  • nl80211_commands (Nl80211Cmd)
  • nl80211_connect_failed_reason
  • nl80211_cqm_rssi_threshold_event
  • nl80211_crit_proto_id
  • nl80211_dfs_regions
  • nl80211_dfs_state
  • nl80211_eht_gi
  • nl80211_eht_ru_alloc
  • nl80211_ext_feature_index
  • nl80211_external_auth_action
  • nl80211_feature_flags
  • nl80211_fils_discovery_attributes
  • nl80211_frequency_attr
  • nl80211_ftm_responder_attributes
  • nl80211_ftm_responder_stats
  • nl80211_he_gi
  • nl80211_he_ltf
  • nl80211_he_ru_alloc
  • nl80211_hidden_ssid
  • nl80211_if_combination_attrs
  • nl80211_iface_limit_attrs
  • nl80211_iftype (Nl80211InterfaceType)
  • nl80211_iftype_akm_attributes
  • nl80211_key_attributes
  • nl80211_key_default_types
  • nl80211_key_mode
  • nl80211_key_type
  • nl80211_mbssid_config_attributes
  • nl80211_mesh_power_mode
  • nl80211_mesh_setup_params
  • nl80211_meshconf_params
  • nl80211_mfp
  • nl80211_mntr_flags
  • nl80211_mpath_flags
  • nl80211_mpath_info
  • nl80211_nan_func_attributes
  • nl80211_nan_func_term_reason
  • nl80211_nan_function_type
  • nl80211_nan_match_attributes
  • nl80211_nan_publish_type
  • nl80211_nan_srf_attributes
  • nl80211_obss_pd_attributes
  • nl80211_packet_pattern_attr
  • nl80211_peer_measurement_attrs
  • nl80211_peer_measurement_ftm_capa
  • nl80211_peer_measurement_ftm_failure_reasons
  • nl80211_peer_measurement_ftm_req
  • nl80211_peer_measurement_ftm_resp
  • nl80211_peer_measurement_peer_attrs
  • nl80211_peer_measurement_req
  • nl80211_peer_measurement_resp
  • nl80211_peer_measurement_status
  • nl80211_peer_measurement_type
  • nl80211_plink_state
  • plink_actions
  • nl80211_pmksa_candidate_attr
  • nl80211_preamble
  • nl80211_probe_resp_offload_support_attr
  • nl80211_protocol_features
  • nl80211_ps_state
  • nl80211_radar_event
  • nl80211_rate_info
  • nl80211_reg_initiator
  • nl80211_reg_rule_attr
  • nl80211_reg_rule_flags
  • nl80211_reg_type
  • nl80211_rekey_data
  • nl80211_rxmgmt_flags
  • nl80211_sae_pwe_mechanism
  • nl80211_sar_attrs
  • nl80211_sar_specs_attrs
  • nl80211_sar_type
  • nl80211_scan_flags
  • nl80211_sched_scan_match_attr
  • nl80211_sched_scan_plan
  • nl80211_smps_mode
  • nl80211_sta_bss_param
  • nl80211_sta_flags
  • nl80211_sta_info
  • nl80211_sta_p2p_ps_status
  • nl80211_sta_wme_attr
  • nl80211_survey_info
  • nl80211_tdls_operation
  • nl80211_tdls_peer_capability
  • nl80211_tid_config
  • nl80211_tid_config_attr
  • nl80211_tid_stats
  • nl80211_timeout_reason
  • nl80211_tx_power_setting
  • nl80211_tx_rate_attributes
  • nl80211_tx_rate_setting
  • nl80211_txq_attr
  • nl80211_txq_stats (Nl80211TransmitQueueStat)
  • nl80211_txrate_gi
  • nl80211_unsol_bcast_probe_resp_attributes
  • nl80211_user_reg_hint_type
  • nl80211_wmm_rule
  • nl80211_wowlan_tcp_attrs
  • nl80211_wowlan_triggers
  • nl80211_wpa_versions

Implement the following structures in rust structs with appropriate implementation:

  • nl80211_bss_select_rssi_adjust
  • nl80211_coalesce_rule_support
  • nl80211_pattern_support
  • nl80211_sta_flag_update
  • nl80211_txrate_he
  • nl80211_txrate_vht
  • nl80211_vendor_cmd_info
  • nl80211_wowlan_tcp_data_seq
  • nl80211_wowlan_tcp_data_token
  • nl80211_wowlan_tcp_data_token_feature
@AbuShawarib
Copy link
Contributor Author

Hello @cathay4t,
I would like to implement some of these, though I'm not sure what attributes to implement for these enums and their dependencies. In the current repository, I can see Nla, Parseable<NlaBuffer<&'a T>> From<u32> for X, From<X> for u32.

@cathay4t
Copy link
Member

In stead of tackle down in the way of C header, I prefer do it through mimicking iw command. For example, currently I am trying to mimic iw phy command via https://github.com/cathay4t/wl-nl80211/tree/iw_phy with that we add struct and enum with purpose.

@cathay4t
Copy link
Member

If you want to help, try to mimic iw dev wlan0 station dump command for NL80211_CMD_GET_STATION.

@AbuShawarib
Copy link
Contributor Author

Well, yes. My original goal was to do iw dev wlan0 scan dump. I wanted to implement the required struct/enums, then move on to the command. I'll look into the branch and try to imitate it.

@cathay4t
Copy link
Member

@AbuShawarib I have done the iw dev wlan0 scan dump support at #17.

This crate is not targeted to replace nl802.11.h , I intend to close this issue and accepting feature request instead of C data type listing.

@AbuShawarib
Copy link
Contributor Author

It's Ok to restructure features based on commands instead.

I have an unrelated question: There are many IEEE-802.11 info that require having a frame parser based on the spec to display in a meaningful way. It seems too big and broad of a parser to be a sub module inside this crate. Would you make use of something like ieee80211 or create our own?

@cathay4t
Copy link
Member

cathay4t commented Oct 3, 2024

I create from scratch by reading IEEE specification because I would like to minimize the dependency chain.
I am aware this would be duplication effort, but considering IEEE 802.11 is ABI stable, this parsing work is one-time works, it is better no depending external crates on this.

For simple bit structs, I use bitflags, for complex ones, I create struct to provide emit() and parse() function using helper function like get_bit and get_bits_as_u8(). Please check #18 as example.

@cathay4t
Copy link
Member

cathay4t commented Oct 20, 2024

I have finished the work on iw dev wlan0 scan trigger and iw dev wlan0 scan sched_start by #21

Next thing is iw dev wlan0 auth and iw dev wlan0 connect. I might focus on WPA2+ authentication, no WEP stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants