Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 7, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

)

Add parsing support for Juniper switch-options interface-mac-limit
configuration, including the limit value and packet-action options
(drop, drop-and-log, log, none, shutdown).

This change adds grammar rules to parse both hierarchical and
set-style configurations:
- set switch-options interface <iface> interface-mac-limit <limit>
- set switch-options interface <iface> interface-mac-limit packet-action
<action>

Parsing is implemented using _null suffix rules as this configuration
does not affect the Batfish data model (MAC learning is not modeled).

---
Prompt:
```
Add Juniper parsing support for

    interface ge-0/0/0.0 {
        interface-mac-limit {
            5;
            packet-action shutdown;
        }
    }

set switch-options interface ge-0/0/24.0 interface-mac-limit 5
set switch-options interface ge-0/0/24.0 interface-mac-limit packet-action shutdown

The docs for this are https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/interface-mac-limit-edit-bridge-domains-edit-switch-options.html

Read the general parsing and specific juniper docs/, and add a parsing "don't crash" test.
```

commit-id:24734f36

---

**Stack**:
- #9582
- #9581
- #9580⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do
not merge manually using the UI - doing so may have unexpected results.*
…9581)

Refactor the generic `sy_services_linetype` rule into service-specific
rules to enable service-specific configuration parsing. This change:

1. Replaced generic `sy_services_linetype` + `line_type` with:
- `syserv_ftp` for FTP service
- `syserv_ssh` for SSH service
- `syserv_telnet` for TELNET service

2. Renamed `sy_services_null` to `syserv_null` for naming consistency

3. Created SSH-specific `syservs_null` rule (currently identical to
`sysl_null` but will diverge when SSH-specific options are added)

4. Kept `sysl_null` for legacy use by FTP/TELNET with TODO comments
for future service-specific refactoring

This separation enables service-specific parsing while maintaining
backward compatibility. Reference tests updated to reflect new
parse tree structure.

---
Prompt:
```
so, I don't like that we have a generic sysl where we mix different line types. Let's do a minimal refactoring to extract ssh. I think we get rid of system_line_type and replace it with 3 rules for the three line types. The non-SSH ones can stay sysl_null as their body with a comment to improve this later with line-type-specific code. Then let's move all the stuff we just added into system_ssh-specific rules and not in sysl_null
```
Add parsing support for SSH boolean configuration options:
- access-disable-external
- allow-tcp-forwarding (replacement for deprecated tcp-forwarding)
- no-challenge-response
- no-password-authentication
- no-passwords (already existed in sysl_null)
- no-public-keys
- no-tcp-forwarding (deprecated, kept for compatibility)
- root-login (with null_filler to consume the login mode parameter)
- tcp-forwarding (deprecated, kept for compatibility)

Each option is parsed as a distinct grammar rule with _null suffix
rather than being grouped in a generic _null rule. This provides
grammatical precision while still indicating the options are not
extracted into the Batfish data model.

The `syservs_null` rule is simplified to contain only the remaining
SSH options that don't yet have individual rules.

---
Prompt:
```
In exactly the same style as last commit, add support for `set system services ssh allow-tcp-forwarding`: https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/ssh-edit-system.html . This is a large grammar, so implement only the things that are easy and obvious. Maybe just the booleans with no parameters, like no-passwords?
```
@pull pull bot locked and limited conversation to collaborators Nov 7, 2025
@pull pull bot added the ⤵️ pull label Nov 7, 2025
@pull pull bot merged commit 5c051dc into OF815:master Nov 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant