forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Yang] SONiC Yang model support for NAT (sonic-net#7051)
This change has SONiC Yang model support for NAT - Created SONiC Yang model for NAT - Tables: STATIC_NAPT, STATIC_NAT, NAT_GLOBAL, NAT_POOL, NAT_BINDINGS. How I did it Defined Yang models for NAT based on Guideline doc: https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md and https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md How to verify it Added test cases to verify it.
- Loading branch information
1 parent
f8d46db
commit 720e816
Showing
18 changed files
with
1,227 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
src/sonic-yang-models/tests/yang_model_tests/tests/nat.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"STATIC_NAPT_ENTRY_WITH_VALID_VALUES": { | ||
"desc": "Configuring the Static NAPT table with valid values." | ||
}, | ||
"STATIC_NAPT_ENTRY_WRONG_GLOBAL_IP": { | ||
"desc": "Configuring a wrong global ip in Static NAPT table.", | ||
"eStrKey" : "Pattern" | ||
}, | ||
"STATIC_NAPT_ENTRY_WRONG_IP_PROTOCOL": { | ||
"desc": "Configuring a wrong ip protocol in Static NAPT table.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["ip_protocol"] | ||
}, | ||
"STATIC_NAPT_ENTRY_WRONG_GLOBAL_L4_PORT": { | ||
"desc": "Configuring a wrong global l4 port in Static NAPT table.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["global_l4_port"] | ||
}, | ||
"STATIC_NAPT_ENTRY_WITHOUT_LOCAL_IP": { | ||
"desc": "Configuring a Static NAPT table without local ip.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"STATIC_NAPT_ENTRY_WITHOUT_LOCAL_PORT": { | ||
"desc": "Configuring a Static NAPT table without local port.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"STATIC_NAPT_ENTRY_INVALID_TWICE_NAT_ID": { | ||
"desc": "Configuring a invalid twice nat id in Static NAPT table.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"STATIC_NAT_ENTRY_WITH_VALID_VALUES": { | ||
"desc": "Configuring the Static NAT table with valid values." | ||
}, | ||
"STATIC_NAT_ENTRY_WRONG_GLOBAL_IP": { | ||
"desc": "Configuring a wrong global ip in Static NAT table.", | ||
"eStrKey" : "Pattern" | ||
}, | ||
"STATIC_NAT_ENTRY_WITHOUT_LOCAL_IP": { | ||
"desc": "Configuring a Static NAT table without local ip.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"STATIC_NAT_ENTRY_INVALID_TWICE_NAT_ID": { | ||
"desc": "Configuring a invalid twice nat id in Static NAT table.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"NAT_GLOBAL_WITH_VALID_VALUES": { | ||
"desc": "Configuring a NAT Global table with valid values." | ||
}, | ||
"NAT_GLOBAL_WITH_INVALID_UDP_TIMEOUT": { | ||
"desc": "Configuring a NAT Global table with a invalid udp timeout.", | ||
"eStr": "Invalid NAT UDP Timeout, valid range 120 sec to 600 sec." | ||
}, | ||
"NAT_GLOBAL_WITH_INVALID_TIMEOUT": { | ||
"desc": "Configuring a NAT Global table with a invalid timeout.", | ||
"eStr": "Invalid NAT Timeout, valid range 300 sec to 432000 sec." | ||
}, | ||
"NAT_GLOBAL_WITH_INVALID_TCP_TIMEOUT": { | ||
"desc": "Configuring a NAT Global table with a invalid tcp timeout.", | ||
"eStr": "Invalid NAT TCP Timeout, valid range 300 sec to 432000 sec." | ||
}, | ||
"NAT_POOL_WITH_VALID_VALUES": { | ||
"desc": "Configuring a NAT Pool table with valid values." | ||
}, | ||
"NAT_POOL_WITH_INVALID_POOL_NAME": { | ||
"desc": "Configuring a invalid pool name in NAT Pool table.", | ||
"eStr": "Invalid length for the pool name." | ||
}, | ||
"NAT_POOL_WITHOUT_NAT_IP": { | ||
"desc": "Configuring a NAT Pool table without NAT ip.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"NAT_POOL_WITH_INVALID_NAT_IP": { | ||
"desc": "Configuring a invalid nat ip in NAT Pool table.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["nat_ip"] | ||
}, | ||
"NAT_POOL_WITH_INVALID_NAT_PORT": { | ||
"desc": "Configuring a invalid nat port in NAT Pool table.", | ||
"eStrKey" : "Pattern" | ||
}, | ||
"NAT_BINDING_WITH_INVALID_BINDING_NAME": { | ||
"desc": "Configuring a invalid binding name in NAT Binding table.", | ||
"eStr": "Invalid length for the binding name." | ||
}, | ||
"NAT_BINDING_WITHOUT_NAT_POOL": { | ||
"desc": "Configuring a NAT Binding table without NAT Pool.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"NAT_BINDING_WITH_INVALID_NAT_TYPE": { | ||
"desc": "Configuring a invalid nat type in NAT Binding table.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"NAT_BINDING_WITH_INVALID_TWICE_NAT_ID": { | ||
"desc": "Configuring a invalid twice nat id in NAT Binding table.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"NAT_BINDING_WITHOUT_ACL_TABLE": { | ||
"desc": "Configuring a NAT Binding table without acl." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.