Skip to content

Extending IpPrefix class to return the subnet associated to any given prefix#184

Merged
lguohan merged 2 commits intosonic-net:masterfrom
rodnymolina:ipprefix_subnet
Feb 8, 2018
Merged

Extending IpPrefix class to return the subnet associated to any given prefix#184
lguohan merged 2 commits intosonic-net:masterfrom
rodnymolina:ipprefix_subnet

Conversation

@rodnymolina
Copy link
Copy Markdown
Contributor

This method is being currently utilized by the new interface's overlapping-detection logic (to be submitted under a different PR within sonic-swss repo). Method's goal is to simply return the subnet associated to any given prefix (see example below). A new pytest testcase will be appended shortly.

Examples:

subnet("10.1.1.1/24") = 10.1.1.0/24
subnet("fc00:0003:0002:0002::2/64") = fc00:0003:0002:0002:0000:0000:0000:0000/64

… prefix.

This method is being currently utilized by the new interface's overlapping-detection logic (to be submitted under a different sonic-swss PR). Method's goal is to simply return the subnet associated to any given prefix (see example below). A new pytest testcase will be appended shortly.

Examples:

subnet("10.1.1.1/24") = 10.1.1.0/24
subnet("fc00:0003:0002:0002::2/64") = fc00:0003:0002:0002:0000:0000:0000:0000/64
@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Jan 27, 2018

please add unit test.

Copy link
Copy Markdown
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

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

can you add unit test for this new function.

@rodnymolina
Copy link
Copy Markdown
Contributor Author

UT's created. Please review when have a chance.

@lguohan lguohan merged commit 2bbb6c9 into sonic-net:master Feb 8, 2018
prgeor pushed a commit to prgeor/sonic-swss-common that referenced this pull request Feb 27, 2025
…ties (sonic-net#184)

Added a `get_revision()` method to the generic platform device class which returns the hardware revision number of the device as a string.
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.

3 participants