Skip to content

Commit

Permalink
XR SHOW DROPS NP ALL: Add new template (#359)
Browse files Browse the repository at this point in the history
* XR SHOW DROPS NP ALL: Add new template

* XR SHOW DROPS NP ALL: Add new templated

CHANGES TO EXISTING PROPOSAL:
- Remove State Changes:
  * There was little regex being avoided by them,
  * Logic did not require state change for accurate capturing
- Move Record to happen on "Node" and "NP" lines
- Make `NP` Required to prevent capturing an empty entry on "Node" lines
- Remove `EOF` in order to capture last group now that `Record` does not happen on `-`

* XR SHOW DROPS NP ALL: Change capture groups to use lists

TEMPLATE UPDATES:
- Change variable data to be a list
  * Allows for platforms with additional capacity to still work
  * Changed capture groups:
    `DROP_FRM_CRC_ERR_ILKN$variable` -> `ILKN_CRC_ERR_LOCATION` & `DROP_FROM_CRC_ERR_ILKN`
    `DROP_FRM_CRC_ERR_SGMII$variable` -> `SGMII_CRC_ERR_LOCATION` & `DROP_FROM_CRC_ERR_SGMII`
    `DROP_FRM_CRC_ERR_XAUI$variable` -> `XAUI_CRC_ERR_LOCATION` & `DROP_FROM_CRC_ERR_XAUI`
    `DROP_FRM_FRAME_ERR_ILKN$variable` -> `ILKN_FRAME_ERR_LOCATION` & `DROP_FROM_FRAME_ERR_ILKN`
    `DROP_FRM_FRAME_ERR_SGMII$variable` -> `SGMII_FRAME_ERR_LOCATION` & `DROP_FROM_FRAME_ERR_SGMII`
    `DROP_FRM_FRAME_ERR_XAUI$variable` -> `XAUI_FRAME_ERR_LOCATION` & `DROP_FROM_FRAME_ERR_XAUI`

TEST FILES:
- Update parsed file to use lists with new capture group names

* Revert "XR SHOW DROPS NP ALL: Change capture groups to use lists"

This reverts commit 06876f7.
  • Loading branch information
jmcgill298 authored Feb 23, 2019
2 parents e284829 + c565b2b commit d63e638
Show file tree
Hide file tree
Showing 8 changed files with 5,330 additions and 0 deletions.
160 changes: 160 additions & 0 deletions templates/cisco_xr_show_drops_np_all.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
Value Filldown LOCATION (\S+)
Value Required NP (\d+)
Value BFD_NEIGHBOR_DROP (\d+)
Value BFD_REMOTE_PUNT_DISC_0_DROP (\d+)
Value DROP_FRM_CRC_ERR_ILKN0 (\d+)
Value DROP_FRM_CRC_ERR_ILKN1 (\d+)
Value DROP_FRM_CRC_ERR_ILKN2 (\d+)
Value DROP_FRM_CRC_ERR_SGMII0 (\d+)
Value DROP_FRM_CRC_ERR_SGMII1 (\d+)
Value DROP_FRM_CRC_ERR_SGMII2 (\d+)
Value DROP_FRM_CRC_ERR_SGMII3 (\d+)
Value DROP_FRM_CRC_ERR_XAUI4 (\d+)
Value DROP_FRM_CRC_ERR_XAUI5 (\d+)
Value DROP_FRM_CRC_ERR_XAUI6 (\d+)
Value DROP_FRM_FRM_ERR_ILKN0 (\d+)
Value DROP_FRM_FRM_ERR_ILKN1 (\d+)
Value DROP_FRM_FRM_ERR_ILKN2 (\d+)
Value DROP_FRM_FRM_ERR_SGMII0 (\d+)
Value DROP_FRM_FRM_ERR_SGMII1 (\d+)
Value DROP_FRM_FRM_ERR_SGMII2 (\d+)
Value DROP_FRM_FRM_ERR_SGMII3 (\d+)
Value DROP_FRM_FRM_ERR_XAUI4 (\d+)
Value DROP_FRM_FRM_ERR_XAUI5 (\d+)
Value DROP_FRM_FRM_ERR_XAUI6 (\d+)
Value DROP_FRM_RUNT (\d+)
Value IPV4_BFD_EXCD (\d+)
Value IPV4_FRAG_NEEDED_PUNT_EXCD (\d+)
Value IPV4_TTL_ERROR_EXCD (\d+)
Value MDF_PUNT_POLICE_DROP (\d+)
Value MDF_RPF_FAIL_DROP (\d+)
Value MODIFY_PUNT_REASON_MISS_DROP (\d+)
Value MPLS_TTL_ONE_PUNT_EXCD (\d+)
Value NP_SECTION (\d+)
Value PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_0 (\d+)
Value PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_1 (\d+)
Value PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_0_MONITOR (\d+)
Value PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_1_MONITOR (\d+)
Value PARSE_DROP_IN_UIDB_DOWN (\d+)
Value PARSE_DROP_IN_UIDB_TCAM_MISS (\d+)
Value PARSE_DROP_IPV4_DISABLED (\d+)
Value PARSE_DROP_IPV4_LENGTH_ERROR (\d+)
Value PARSE_DROP_IPV4_CHECKSUM_ERROR (\d+)
Value PARSE_EGR_INJ_PKT_TYP_UNKNOWN (\d+)
Value PARSE_L3_TAGGED_PUNT_DROP (\d+)
Value PARSE_OPEN_NETWORK_SERVICE_KEY_ACTION_UNKNOWN (\d+)
Value PARSE_UNKNOWN_NPH_TYPE_DROP (\d+)
Value PUNT_ADJ_EXCD (\d+)
Value PUNT_IFIB_OSPF_OPT_EXCD (\d+)
Value PUNT_IPV4_ADJ_NULL_RTE_EXCD (\d+)
Value PUNT_NO_MATCH_EXCD (\d+)
Value PUNT_STATISTICS_EXCD (\d+)
Value RSV_DROP_EGR_LAG_NO_MATCH (\d+)
Value RSV_DROP_EGR_UIDB_DOWN (\d+)
Value RSV_DROP_EGR_UIDB_NO_MATCH (\d+)
Value RSV_DROP_IFIB_TTL_CHECK (\d+)
Value RSV_DROP_IN_L3_NOT_MYMAC (\d+)
Value RSV_DROP_ING_BFD (\d+)
Value RSV_DROP_IPM4_EGR_FILTER_DROP (\d+)
Value RSV_DROP_IPM4_EGR_RPF_FAIL_DROP (\d+)
Value RSV_DROP_IPM4_EGR_TTL_DROP (\d+)
Value RSV_DROP_IPM4_NO_OLIST (\d+)
Value RSV_DROP_IPM4_NO_OLIST_REP (\d+)
Value RSV_DROP_IPV4_DROP_NULL_RTE (\d+)
Value RSV_DROP_IPV4_NRLDI_NOT_LOCAL (\d+)
Value RSV_DROP_IPV4_RXADJ_DROP (\d+)
Value RSV_DROP_IPV4_TXADJ_NO_MATCH (\d+)
Value RSV_DROP_MPLS_LEAF_NO_MATCH (\d+)
Value RSV_DROP_MPLS_LEAF_NO_MATCH_MONITOR (\d+)
Value RSV_DROP_MPLS_NRLDI_NO_MATCH (\d+)
Value RSV_DROP_MPLS_NRLDI_NOT_LOCAL (\d+)
Value RSV_DROP_MPLS_RXADJ_DROP (\d+)
Value RSV_DROP_MPLS_TXADJ_NO_MATCH (\d+)
Value RSV_DROP_NHINDEX (\d+)
Value RSV_EGR_LAG_NOT_LOCAL_DROP_CNT (\d+)
Value RSV_MLDP_EGR_DROP (\d+)
Value UNKNOWN_L2_ON_L3_DISCARD (\d+)

Start
^\s*Node:\s+\S+ -> Continue.Record
^\s*Node:\s+${LOCATION}:
^-+
^(?:No\s+)?NP -> Continue.Record
^No\s+NP\s+${NP}\s+Drops
^NP\s+${NP}\s+Drops:
^BFD_NEIGHBOR_DROP\s+${BFD_NEIGHBOR_DROP}
^BFD_REMOTE_PUNT_DISC_0_DROP\s+${BFD_REMOTE_PUNT_DISC_0_DROP}
^DROP_FRM_CRC_ERR_ILKN0\s+${DROP_FRM_CRC_ERR_ILKN0}
^DROP_FRM_CRC_ERR_ILKN1\s+${DROP_FRM_CRC_ERR_ILKN1}
^DROP_FRM_CRC_ERR_ILKN2\s+${DROP_FRM_CRC_ERR_ILKN2}
^DROP_FRM_CRC_ERR_SGMII0\s+${DROP_FRM_CRC_ERR_SGMII0}
^DROP_FRM_CRC_ERR_SGMII1\s+${DROP_FRM_CRC_ERR_SGMII1}
^DROP_FRM_CRC_ERR_SGMII2\s+${DROP_FRM_CRC_ERR_SGMII2}
^DROP_FRM_CRC_ERR_SGMII3\s+${DROP_FRM_CRC_ERR_SGMII3}
^DROP_FRM_CRC_ERR_XAUI4\s+${DROP_FRM_CRC_ERR_XAUI4}
^DROP_FRM_CRC_ERR_XAUI5\s+${DROP_FRM_CRC_ERR_XAUI5}
^DROP_FRM_CRC_ERR_XAUI6\s+${DROP_FRM_CRC_ERR_XAUI6}
^DROP_FRM_FRM_ERR_ILKN0\s+${DROP_FRM_FRM_ERR_ILKN0}
^DROP_FRM_FRM_ERR_ILKN1\s+${DROP_FRM_FRM_ERR_ILKN1}
^DROP_FRM_FRM_ERR_ILKN2\s+${DROP_FRM_FRM_ERR_ILKN2}
^DROP_FRM_FRM_ERR_SGMII0\s+${DROP_FRM_FRM_ERR_SGMII0}
^DROP_FRM_FRM_ERR_SGMII1\s+${DROP_FRM_FRM_ERR_SGMII1}
^DROP_FRM_FRM_ERR_SGMII2\s+${DROP_FRM_FRM_ERR_SGMII2}
^DROP_FRM_FRM_ERR_SGMII3\s+${DROP_FRM_FRM_ERR_SGMII3}
^DROP_FRM_FRM_ERR_XAUI4\s+${DROP_FRM_FRM_ERR_XAUI4}
^DROP_FRM_FRM_ERR_XAUI5\s+${DROP_FRM_FRM_ERR_XAUI5}
^DROP_FRM_FRM_ERR_XAUI6\s+${DROP_FRM_FRM_ERR_XAUI6}
^DROP_FRM_RUNT\s+${DROP_FRM_RUNT}
^IPV4_BFD_EXCD\s+${IPV4_BFD_EXCD}
^IPV4_FRAG_NEEDED_PUNT_EXCD\s+${IPV4_FRAG_NEEDED_PUNT_EXCD}
^IPV4_TTL_ERROR_EXCD\s+${IPV4_TTL_ERROR_EXCD}
^MDF_PUNT_POLICE_DROP\s+${MDF_PUNT_POLICE_DROP}
^MDF_RPF_FAIL_DROP\s+${MDF_RPF_FAIL_DROP}
^MODIFY_PUNT_REASON_MISS_DROP\s+${MODIFY_PUNT_REASON_MISS_DROP}
^MPLS_TTL_ONE_PUNT_EXCD\s+${MPLS_TTL_ONE_PUNT_EXCD}
^NP_SECTION\s+${NP_SECTION}
^PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_0\s+${PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_0}
^PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_1\s+${PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_1}
^PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_0_MONITOR\s+${PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_0_MONITOR}
^PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_1_MONITOR\s+${PARSE_FAST_DISCARD_LOW_PRIORITY_DROP_1_MONITOR}
^PARSE_DROP_IN_UIDB_DOWN\s+${PARSE_DROP_IN_UIDB_DOWN}
^PARSE_DROP_IN_UIDB_TCAM_MISS\s+${PARSE_DROP_IN_UIDB_TCAM_MISS}
^PARSE_DROP_IPV4_DISABLED\s+${PARSE_DROP_IPV4_DISABLED}
^PARSE_DROP_IPV4_CHECKSUM_ERROR\s+${PARSE_DROP_IPV4_CHECKSUM_ERROR}
^PARSE_DROP_IPV4_LENGTH_ERROR\s+${PARSE_DROP_IPV4_LENGTH_ERROR}
^PARSE_L3_TAGGED_PUNT_DROP\s+${PARSE_L3_TAGGED_PUNT_DROP}
^PARSE_OPEN_NETWORK_SERVICE_KEY_ACTION_UNKNOWN\s+${PARSE_OPEN_NETWORK_SERVICE_KEY_ACTION_UNKNOWN}
^PARSE_EGR_INJ_PKT_TYP_UNKNOWN\s+${PARSE_EGR_INJ_PKT_TYP_UNKNOWN}
^PARSE_UNKNOWN_NPH_TYPE_DROP\s+${PARSE_UNKNOWN_NPH_TYPE_DROP}
^PUNT_ADJ_EXCD\s+${PUNT_ADJ_EXCD}
^PUNT_IFIB_OSPF_OPT_EXCD\s+${PUNT_IFIB_OSPF_OPT_EXCD}
^PUNT_IPV4_ADJ_NULL_RTE_EXCD\s+${PUNT_IPV4_ADJ_NULL_RTE_EXCD}
^PUNT_NO_MATCH_EXCD\s+${PUNT_NO_MATCH_EXCD}
^PUNT_STATISTICS_EXCD\s+${PUNT_STATISTICS_EXCD}
^RSV_DROP_EGR_LAG_NO_MATCH\s+${RSV_DROP_EGR_LAG_NO_MATCH}
^RSV_DROP_EGR_UIDB_DOWN\s+${RSV_DROP_EGR_UIDB_DOWN}
^RSV_DROP_EGR_UIDB_NO_MATCH\s+${RSV_DROP_EGR_UIDB_NO_MATCH}
^RSV_DROP_IFIB_TTL_CHECK\s+${RSV_DROP_IFIB_TTL_CHECK}
^RSV_DROP_IN_L3_NOT_MYMAC\s+${RSV_DROP_I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EGR_DROP\s+${RSV_MLDP_EGR_DROP}
^UNKNOWN_L2_ON_L3_DISCARD\s+${UNKNOWN_L2_ON_L3_DISCARD}
^\s*$$
^. -> Error "LINE NOT FOUND"
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ cisco_xr_show_bgp_neighbors.template, .*, cisco_xr, sh[[ow]] bg[[p]] nei[[ghbors
cisco_xr_show_ospf_neighbor.template, .*, cisco_xr, sh[[ow]] ospf nei[[ghbor]]
cisco_xr_show_processes_cpu.template, .*, cisco_xr, sh[[ow]] proc[[esses]] c[[pu]]
cisco_xr_show_bfd_sessions.template, .*, cisco_xr, sh[[ow]] bf[[d]] sess[[ions]]
cisco_xr_show_drops_np_all.template, .*, cisco_xr, sh[[ow]] drops np all
cisco_xr_show_pim_neighbor.template, .*, cisco_xr, sh[[ow]] pi[[m]] neigh[[bor]]
cisco_xr_show_controllers.template, .*, cisco_xr, sh[[ow]] contr[[ollers]] (\S+) phy
cisco_xr_show_interfaces.template, .*, cisco_xr, sh[[ow]] inte[[rfaces]]
Expand Down
Loading

0 comments on commit d63e638

Please sign in to comment.