Skip to content
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
Expand Up @@ -14,21 +14,24 @@
"MIRROR_ERSPAN_ENTRY_WITH_VALID_DEC_VALUES_2": {
"desc": "Configuring ERSPAN entry with valid decimal values."
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_IPV6_SRC_AND_DST_IP": {
"desc": "Configuring ERSPAN entry with valid IPv6 source and destination IPs."
},
"MIRROR_ERSPAN_ENTRY_WRONG_TYPE": {
"desc": "Configuring ERSPAN entry with invalid type",
"eStrKey": "InvalidValue"
},
"MIRROR_ERSPAN_ENTRY_WRONG_DST_IP": {
"desc": "Configuring ERSPAN entry with invalid dst_ip",
"eStrKey" : "Pattern"
"eStr" : "src_ip and dst_ip must have the same IP version."
},
"MIRROR_ERSPAN_ENTRY_WRONG_DST_IP_TYPE": {
"desc": "Configuring ERSPAN entry with invalid dst_ip",
"eStrKey" : "When"
},
"MIRROR_ERSPAN_ENTRY_WRONG_SRC_IP": {
"desc": "Configuring ERSPAN entry with invalid src_ip",
"eStrKey" : "Pattern"
"eStr" : "src_ip and dst_ip must have the same IP version."
},
"MIRROR_ERSPAN_ENTRY_WRONG_SRC_IP_TYPE": {
"desc": "Configuring ERSPAN entry with invalid src_ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@
}
}
},
"MIRROR_ERSPAN_ENTRY_WITH_VALID_IPV6_SRC_AND_DST_IP": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
"MIRROR_SESSION_LIST": [
{
"name": "erspan",
"type": "ERSPAN",
"dst_ip": "1001::1",
"src_ip": "2002::2",
"gre_type": "0x1234",
"dscp": "10",
"ttl": "64",
"queue": "0",
"direction": "RX"
}
]
}
}
},
"MIRROR_ERSPAN_ENTRY_WRONG_TYPE": {
"sonic-mirror-session:sonic-mirror-session": {
"MIRROR_SESSION": {
Expand Down
10 changes: 8 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-mirror-session.yang
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,21 @@ module sonic-mirror-session {

leaf src_ip {
when "current()/../type = 'ERSPAN'";
type inet:ipv4-address;
must "(contains(current(), ':') and contains(../dst_ip, ':')) or (not(contains(current(), ':')) and not(contains(../dst_ip, ':')))" {
error-message "src_ip and dst_ip must have the same IP version.";
}
type inet:ip-address;
description
"ERSPAN source ip. This IP will be set as source ip in
outer header of mirrored frame ";
}

leaf dst_ip {
when "current()/../type = 'ERSPAN'";
type inet:ipv4-address;
must "(contains(current(), ':') and contains(../src_ip, ':')) or (not(contains(current(), ':')) and not(contains(../src_ip, ':')))" {
error-message "src_ip and dst_ip must have the same IP version.";
}
type inet:ip-address;
description
"ERSPAN destination ip. Mirrored frames will be routed to this destination.
This IP will be set as destination ip in outer header of mirrored frame ";
Expand Down
Loading