Skip to content

Conversation

@denballakh
Copy link
Contributor

Rulebooks gain a new feature: %split blocks.

This will be used mainly in routeros rulebooks:

interface
    bridge
        vlan %split
            remove
        port %split
            remove
        remove
        add
        port %split
            add
        vlan %split
            add

This rulebook will enforce order like this, which was not achievable before:

/interface bridge vlan remove
/interface bridge port remove
/interface bridge remove
/interface bridge add
/interface bridge port add
/interface bridge vlan add

Copy link
Contributor

@azryve azryve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour is much more straightforward than default one.
We should consider making it a default one in future imo.

@denballakh
Copy link
Contributor Author

This behaviour is much more straightforward than default one. We should consider making it a default one in future imo.

Care should be taken when adapting Huawei order rulebooks for this new feature, they contain pretty weird stuff:

interface */Vbdif\d+/
interface */Eth-Trunk\d+/
interface */LoopBack\d+/
interface */Tunnel.*/
    // some extra rules

interface *
    // some common rules

interface */\S+\.\d+/
interface */Vlanif\d+/

All interfaces will have common rules, but */Tunnel.*/ interfaces will have extra sorting rules.

@drtyrsa drtyrsa merged commit 49ff6d4 into annetutil:main Dec 1, 2025
3 checks passed
@denballakh denballakh mentioned this pull request Dec 1, 2025
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

Successfully merging this pull request may close these issues.

3 participants