-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Changes to add template support for copp.json. #5053
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
[ | ||
{ | ||
"COPP_TABLE:default": { | ||
"queue": "0", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"600", | ||
"cbs":"600", | ||
"red_action":"drop" | ||
}, | ||
"OP": "SET" | ||
}, | ||
{ | ||
"COPP_TABLE:trap.group.bgp.lacp": { | ||
"trap_ids": "bgp,bgpv6,lacp", | ||
"trap_action":"trap", | ||
"trap_priority":"4", | ||
"queue": "4" | ||
}, | ||
"OP": "SET" | ||
}, | ||
{ | ||
"COPP_TABLE:trap.group.arp": { | ||
"trap_ids": "arp_req,arp_resp,neigh_discovery", | ||
"trap_action":"copy", | ||
"trap_priority":"4", | ||
"queue": "4", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"600", | ||
"cbs":"600", | ||
"red_action":"drop" | ||
}, | ||
"OP": "SET" | ||
}, | ||
{% if DEVICE_METADATA['localhost']['type'] == "ToRRouter" %} | ||
{ | ||
"COPP_TABLE:trap.group.lldp.dhcp.dhcpv6.udld": { | ||
"trap_ids": "lldp,dhcp,dhcpv6,udld", | ||
"trap_action":"trap", | ||
"trap_priority":"4", | ||
"queue": "4" | ||
}, | ||
"OP": "SET" | ||
}, | ||
{% else %} | ||
{ | ||
"COPP_TABLE:trap.group.lldp.udld": { | ||
"trap_ids": "lldp,udld", | ||
"trap_action":"trap", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If type (if defined) is not ToRRouter have the trap-ids only for lldp & udlp and else case have ""trap_ids": "lldp,dhcp,dhcpv6,udld"," There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @venkatmahalingam yes this is the behavior There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @venkatmahalingam got your point. Updated accordingly. |
||
"trap_priority":"4", | ||
"queue": "4" | ||
}, | ||
"OP": "SET" | ||
}, | ||
{% endif %} | ||
{ | ||
"COPP_TABLE:trap.group.ip2me": { | ||
"trap_ids": "ip2me", | ||
"trap_action":"trap", | ||
"trap_priority":"1", | ||
"queue": "1", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"6000", | ||
"cbs":"6000", | ||
"red_action":"drop" | ||
}, | ||
"OP": "SET" | ||
}, | ||
{ | ||
"COPP_TABLE:trap.group.nat": { | ||
"trap_ids": "src_nat_miss,dest_nat_miss", | ||
"trap_action":"trap", | ||
"trap_priority":"1", | ||
"queue": "1", | ||
"meter_type":"packets", | ||
"mode":"sr_tcm", | ||
"cir":"600", | ||
"cbs":"600", | ||
"red_action":"drop" | ||
}, | ||
"OP": "SET" | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to check for the existence of
type
. If not present, the template might crash - RefThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please ensure if the type is not defined, the trap is installed? Type is not a mandatory parameter and this might cause backward compatibility issues in cases where type field is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prsunny @dgsudharsan Updated to add default else condition for backward compatibility
if DEVICE_METADATA and it sub-parameters are not define.