mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-21 09:35:45 +02:00
Add IPv4 DHCP option matcher, minor fixes (#300)
* Fix typos in comment on IPsec policy "template" field * Move IPv4 DHCP server API data next to other DHCP APIs * Set default for "force" field on DHCP options Without the default value removing it from the options after it's been set once leads to an error: > Key "force" cannot be removed for name="…" * Add IPv4 DHCP option matcher RouterOS 7.4 and newer implement matchers for the Vendor ID provided by DHCP clients. RouterOS 7.16 will add a new `matching-type` property, but it's not in a stable release yet. Upstream documentation: https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-Genericmatcher
This commit is contained in:
parent
5ee2af49b8
commit
8c62d46198
5 changed files with 57 additions and 33 deletions
|
@ -774,36 +774,6 @@ PATHS = {
|
|||
)),
|
||||
],
|
||||
),
|
||||
('ip', 'dhcp-server'): APIData(
|
||||
unversioned=VersionedAPIData(
|
||||
fully_understood=True,
|
||||
primary_keys=('name', ),
|
||||
fields={
|
||||
'address-pool': KeyInfo(default='static-only'),
|
||||
'allow-dual-stack-queue': KeyInfo(can_disable=True, remove_value=True),
|
||||
'always-broadcast': KeyInfo(can_disable=True, remove_value=False),
|
||||
'authoritative': KeyInfo(default=True),
|
||||
'bootp-lease-time': KeyInfo(default='forever'),
|
||||
'bootp-support': KeyInfo(can_disable=True, remove_value='static'),
|
||||
'client-mac-limit': KeyInfo(can_disable=True, remove_value='unlimited'),
|
||||
'comment': KeyInfo(can_disable=True, remove_value=''),
|
||||
'conflict-detection': KeyInfo(can_disable=True, remove_value=True),
|
||||
'delay-threshold': KeyInfo(can_disable=True, remove_value='none'),
|
||||
'dhcp-option-set': KeyInfo(can_disable=True, remove_value='none'),
|
||||
'disabled': KeyInfo(default=False),
|
||||
'insert-queue-before': KeyInfo(can_disable=True, remove_value='first'),
|
||||
'interface': KeyInfo(required=True),
|
||||
'lease-script': KeyInfo(default=''),
|
||||
'lease-time': KeyInfo(default='10m'),
|
||||
'name': KeyInfo(),
|
||||
'parent-queue': KeyInfo(can_disable=True, remove_value='none'),
|
||||
'relay': KeyInfo(can_disable=True, remove_value='0.0.0.0'),
|
||||
'server-address': KeyInfo(can_disable=True, remove_value='0.0.0.0'),
|
||||
'use-framed-as-classless': KeyInfo(can_disable=True, remove_value=True),
|
||||
'use-radius': KeyInfo(default=False),
|
||||
},
|
||||
),
|
||||
),
|
||||
('routing', 'filter'): APIData(
|
||||
versioned=[
|
||||
('7', '<', VersionedAPIData(
|
||||
|
@ -2679,6 +2649,36 @@ PATHS = {
|
|||
},
|
||||
),
|
||||
),
|
||||
('ip', 'dhcp-server'): APIData(
|
||||
unversioned=VersionedAPIData(
|
||||
fully_understood=True,
|
||||
primary_keys=('name', ),
|
||||
fields={
|
||||
'address-pool': KeyInfo(default='static-only'),
|
||||
'allow-dual-stack-queue': KeyInfo(can_disable=True, remove_value=True),
|
||||
'always-broadcast': KeyInfo(can_disable=True, remove_value=False),
|
||||
'authoritative': KeyInfo(default=True),
|
||||
'bootp-lease-time': KeyInfo(default='forever'),
|
||||
'bootp-support': KeyInfo(can_disable=True, remove_value='static'),
|
||||
'client-mac-limit': KeyInfo(can_disable=True, remove_value='unlimited'),
|
||||
'comment': KeyInfo(can_disable=True, remove_value=''),
|
||||
'conflict-detection': KeyInfo(can_disable=True, remove_value=True),
|
||||
'delay-threshold': KeyInfo(can_disable=True, remove_value='none'),
|
||||
'dhcp-option-set': KeyInfo(can_disable=True, remove_value='none'),
|
||||
'disabled': KeyInfo(default=False),
|
||||
'insert-queue-before': KeyInfo(can_disable=True, remove_value='first'),
|
||||
'interface': KeyInfo(required=True),
|
||||
'lease-script': KeyInfo(default=''),
|
||||
'lease-time': KeyInfo(default='10m'),
|
||||
'name': KeyInfo(),
|
||||
'parent-queue': KeyInfo(can_disable=True, remove_value='none'),
|
||||
'relay': KeyInfo(can_disable=True, remove_value='0.0.0.0'),
|
||||
'server-address': KeyInfo(can_disable=True, remove_value='0.0.0.0'),
|
||||
'use-framed-as-classless': KeyInfo(can_disable=True, remove_value=True),
|
||||
'use-radius': KeyInfo(default=False),
|
||||
},
|
||||
),
|
||||
),
|
||||
('ip', 'dhcp-server', 'config'): APIData(
|
||||
unversioned=VersionedAPIData(
|
||||
single_value=True,
|
||||
|
@ -2738,7 +2738,7 @@ PATHS = {
|
|||
'code': KeyInfo(required=True),
|
||||
'name': KeyInfo(),
|
||||
'value': KeyInfo(default=''),
|
||||
'force': KeyInfo(),
|
||||
'force': KeyInfo(default=False),
|
||||
},
|
||||
),
|
||||
),
|
||||
|
@ -2752,6 +2752,23 @@ PATHS = {
|
|||
},
|
||||
),
|
||||
),
|
||||
('ip', 'dhcp-server', 'matcher'): APIData(
|
||||
versioned=[
|
||||
('7.4', '>=', VersionedAPIData(
|
||||
fully_understood=True,
|
||||
primary_keys=('name', ),
|
||||
fields={
|
||||
'address-pool': KeyInfo(default='none'),
|
||||
'code': KeyInfo(required=True),
|
||||
'disabled': KeyInfo(default=False),
|
||||
'name': KeyInfo(required=True),
|
||||
'option-set': KeyInfo(),
|
||||
'server': KeyInfo(default='all'),
|
||||
'value': KeyInfo(required=True),
|
||||
},
|
||||
)),
|
||||
],
|
||||
),
|
||||
('ip', 'dns'): APIData(
|
||||
unversioned=VersionedAPIData(
|
||||
single_value=True,
|
||||
|
@ -4966,9 +4983,10 @@ PATHS = {
|
|||
'protocol': KeyInfo(default='all'),
|
||||
'src-address': KeyInfo(),
|
||||
'src-port': KeyInfo(default='any'),
|
||||
# The template field can't really be changed once the item is
|
||||
# created. This config captures the behavior best as it can
|
||||
# i.e. template=yes is shown, template=no is hidden.
|
||||
'template': KeyInfo(can_disable=True, remove_value=False),
|
||||
# the tepmlate field can't really be changed once the item is created. This config captures the behavior best as it can
|
||||
# i.e. tepmplate=yes is shown, tepmlate=no is hidden
|
||||
'tunnel': KeyInfo(default=False),
|
||||
},
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue