Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yang] Update YANG model for mirror session to support decimal value for GRE type #10140

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"MIRROR_ERSPAN_ENTRY_WITH_VALID_VALUES": {
"desc": "Configuring ERSPAN entry with valid values."
"MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES": {
"desc": "Configuring ERSPAN entry with valid heximal values."
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES_1": {
"desc": "Configuring ERSPAN entry with valid heximal values."
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES": {
"desc": "Configuring ERSPAN entry with valid decimal values."
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_1": {
"desc": "Configuring ERSPAN entry with valid decimal values."
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_2": {
"desc": "Configuring ERSPAN entry with valid decimal values."
},
"MIRROR_ERSPAN_ENTRY_WRONG_TYPE": {
"desc": "Configuring ERSPAN entry with invalid type",
Expand All @@ -26,6 +38,14 @@
"desc": "Configuring ERSPAN entry with invalid GRE type",
"eStrKey" : "Pattern"
},
"MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_1": {
"desc": "Configuring ERSPAN entry with invalid GRE type",
"eStrKey" : "Pattern"
},
"MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_2": {
"desc": "Configuring ERSPAN entry with invalid GRE type",
"eStrKey" : "Pattern"
},
"MIRROR_ERSPAN_ENTRY_GRE_WRONG_TYPE": {
"desc": "Configuring ERSPAN entry with invalid GRE type",
"eStrKey" : "When"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"MIRROR_ERSPAN_ENTRY_WITH_VALID_VALUES": {
"MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
Expand All @@ -15,6 +15,70 @@
}
}
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_HEX_VALUES_1": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "0x0",
"dscp": "10"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "1234",
"dscp": "10"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_1": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "65535",
"dscp": "10"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_2": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "0",
"dscp": "10"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WRONG_TYPE": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
Expand Down Expand Up @@ -104,7 +168,39 @@
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "0",
"gre_type": "100000",
"dscp": "10"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_1": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "-1",
"dscp": "10"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE_2": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "11.1.1.1",
"src_ip": "10.1.1.1",
"gre_type": "65536",
"dscp": "10"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module sonic-mirror-session {
leaf gre_type {
when "current()/../type = 'ERSPAN'";
type string {
pattern "0[xX][0-9a-fA-F]*";
pattern "0[xX][0-9a-fA-F]*|([0-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[0-5])";
length 1..6 {
error-message "Invalid GRE type";
error-app-tag gre-type-invalid;
Expand Down