Skip to content

Commit

Permalink
Add "interface wireless" to API data (#195)
Browse files Browse the repository at this point in the history
The default values match those of RouterOS 7.11 on a Mikrotik
RB924i-2nD-BT5&BG77 ("Knot"). They're cross-checked with upstream
documentation[1].

[1] https://help.mikrotik.com/docs/display/ROS/Wireless+Interface

Signed-off-by: Michael Hanselmann <[email protected]>
  • Loading branch information
hansmi authored Aug 20, 2023
1 parent 2e1159b commit e4a2131
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/195-add-interface-wireless-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- api_info, api_modify - add support for the ``interface wireless`` path (https://github.com/ansible-collections/community.routeros/pull/195).
98 changes: 98 additions & 0 deletions plugins/module_utils/_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,104 @@ def join_path(path):
'public-key': KeyInfo(),
},
),
('interface', 'wireless'): APIData(
fully_understood=True,
primary_keys=('name', ),
required_one_of=[['default-name', 'master-interface']],
fields={
'adaptive-noise-immunity': KeyInfo(default='none'),
'allow-sharedkey': KeyInfo(default=False),
'ampdu-priorities': KeyInfo(default=0),
'amsdu-limit': KeyInfo(default=8192),
'amsdu-threshold': KeyInfo(default=8192),
'antenna-gain': KeyInfo(default=0),
'antenna-mode': KeyInfo(),
'area': KeyInfo(default=''),
'arp': KeyInfo(default='enabled'),
'arp-timeout': KeyInfo(default='auto'),
'band': KeyInfo(),
'basic-rates-a/g': KeyInfo(default='6Mbps'),
'basic-rates-b': KeyInfo(default='1Mbps'),
'bridge-mode': KeyInfo(default='enabled'),
'channel-width': KeyInfo(default='20mhz'),
'comment': KeyInfo(can_disable=True, remove_value=''),
'compression': KeyInfo(default=False),
'country': KeyInfo(default='etsi'),
'default-ap-tx-limit': KeyInfo(default=0),
'default-authentication': KeyInfo(default=True),
'default-client-tx-limit': KeyInfo(default=0),
'default-forwarding': KeyInfo(default=True),
'default-name': KeyInfo(),
'disable-running-check': KeyInfo(default=False),
'disabled': KeyInfo(default=True),
'disconnect-timeout': KeyInfo(default='3s'),
'distance': KeyInfo(default='dynamic'),
'frame-lifetime': KeyInfo(default=0),
'frequency': KeyInfo(),
'frequency-mode': KeyInfo(default='regulatory-domain'),
'frequency-offset': KeyInfo(default=0),
'guard-interval': KeyInfo(default='any'),
'hide-ssid': KeyInfo(default=False),
'ht-basic-mcs': KeyInfo(),
'ht-supported-mcs': KeyInfo(),
'hw-fragmentation-threshold': KeyInfo(default='disabled'),
'hw-protection-mode': KeyInfo(default='none'),
'hw-protection-threshold': KeyInfo(default=0),
'hw-retries': KeyInfo(default=7),
'installation': KeyInfo(default='any'),
'interworking-profile': KeyInfo(default='disabled'),
'keepalive-frames': KeyInfo(default='enabled'),
'l2mtu': KeyInfo(default=1600),
'mac-address': KeyInfo(),
'master-interface': KeyInfo(),
'max-station-count': KeyInfo(default=2007),
'mode': KeyInfo(default='ap-bridge'),
'mtu': KeyInfo(default=1500),
'multicast-buffering': KeyInfo(default='enabled'),
'multicast-helper': KeyInfo(default='default'),
'name': KeyInfo(),
'noise-floor-threshold': KeyInfo(default='default'),
'nv2-cell-radius': KeyInfo(default=30),
'nv2-downlink-ratio': KeyInfo(default=50),
'nv2-mode': KeyInfo(default='dynamic-downlink'),
'nv2-noise-floor-offset': KeyInfo(default='default'),
'nv2-preshared-key': KeyInfo(default=''),
'nv2-qos': KeyInfo(default='default'),
'nv2-queue-count': KeyInfo(default=2),
'nv2-security': KeyInfo(default='disabled'),
'nv2-sync-secret': KeyInfo(default=''),
'on-fail-retry-time': KeyInfo(default='100ms'),
'preamble-mode': KeyInfo(default='both'),
'radio-name': KeyInfo(),
'rate-selection': KeyInfo(default='advanced'),
'rate-set': KeyInfo(default='default'),
'running': KeyInfo(default=False),
'rx-chains': KeyInfo(default='0,1'),
'scan-list': KeyInfo(default='default'),
'secondary-frequency': KeyInfo(default=''),
'security-profile': KeyInfo(default='default'),
'skip-dfs-channels': KeyInfo(default='disabled'),
'ssid': KeyInfo(required=True),
'station-bridge-clone-mac': KeyInfo(),
'station-roaming': KeyInfo(default='disabled'),
'supported-rates-a/g': KeyInfo(),
'supported-rates-b': KeyInfo(),
'tdma-period-size': KeyInfo(default=2),
'tx-chains': KeyInfo(),
'tx-power-mode': KeyInfo(default='default'),
'update-stats-interval': KeyInfo(default='disabled'),
'vlan-id': KeyInfo(default=1),
'vlan-mode': KeyInfo(default='no-tag'),
'wds-cost-range': KeyInfo(default='50-150'),
'wds-default-bridge': KeyInfo(default='none'),
'wds-default-cost': KeyInfo(default=100),
'wds-ignore-ssid': KeyInfo(default=False),
'wds-mode': KeyInfo(default='disabled'),
'wireless-protocol': KeyInfo(default='any'),
'wmm-support': KeyInfo(default='disabled'),
'wps-mode': KeyInfo(default='push-button'),
},
),
('interface', 'wireless', 'align'): APIData(
single_value=True,
fully_understood=True,
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/api_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
- interface vrrp
- interface wireguard
- interface wireguard peers
- interface wireless
- interface wireless align
- interface wireless cap
- interface wireless sniffer
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/api_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
- interface vrrp
- interface wireguard
- interface wireguard peers
- interface wireless
- interface wireless align
- interface wireless cap
- interface wireless sniffer
Expand Down

0 comments on commit e4a2131

Please sign in to comment.