Skip to content

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Sep 22, 2025

If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.

What did you implement:

skip invalid CPE and replace space with underscore

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

before

$ snmp2cpe version
snmp2cpe 0.34.0 5bcf29389a4705ad8aea6db6ce75e9d755ee17fc-2025-09-06T08:12:25Z

$ echo '{"****":{"sysDescr0":"Cisco IOS Software, IOS-XE Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 03.06.06E RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2016 by Cisco Systems, Inc.\r\nCompiled Sat 17-Dec-","entPhysicalTables":{"1":{"entPhysicalName":"c38xx Stack"}}}}' | snmp2cpe convert
{"****":["cpe:2.3:o:cisco:ios_xe:03.06.06e:*:*:*:*:*:*:*","cpe:2.3:h:cisco:c38xx stack:-:*:*:*:*:*:*:*"]}

// "cpe:2.3:h:cisco:c38xx stack:-:*:*:*:*:*:*:*" is invalid.
// CPE does not allow spaces.

after

$ echo '{"****":{"sysDescr0":"Cisco IOS Software, IOS-XE Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 03.06.06E RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2016 by Cisco Systems, Inc.\r\nCompiled Sat 17-Dec-","entPhysicalTables":{"1":{"entPhysicalName":"c38xx Stack"}}}}' | snmp2cpe convert
{"****":["cpe:2.3:o:cisco:ios_xe:03.06.06e:*:*:*:*:*:*:*","cpe:2.3:h:cisco:c38xx_stack:-:*:*:*:*:*:*:*"]}

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n requested a review from shino September 22, 2025 09:12
@MaineK00n MaineK00n self-assigned this Sep 22, 2025
Copy link
Collaborator

@shino shino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍻

@MaineK00n MaineK00n merged commit a8899b8 into master Sep 24, 2025
7 checks passed
@MaineK00n MaineK00n deleted the MaineK00n/snmp branch September 24, 2025 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants