-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add SNMPv3 support to nav.Snmp.pynetsnmp
implementation
#2703
Merged
lunkwill42
merged 5 commits into
Uninett:snmpv3
from
lunkwill42:feature/snmpv3-synchronous
Nov 2, 2023
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6897132
Add type annotations to Snmp.__init__
lunkwill42 ebe8813
Define SNMPv3 protocol config enums
lunkwill42 d63e1c3
Add SNMPv3 session parameters to Snmp init
lunkwill42 03eba24
Build SNMP command line args for SNMPv3
lunkwill42 2131cda
Protect against closing non-existant SNMP handles
lunkwill42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Copyright (C) 2023 Sikt | ||
# | ||
# This file is part of Network Administration Visualized (NAV). | ||
# | ||
# NAV is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU General Public License version 3 as published by | ||
# the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. You should have received a copy of the GNU General Public | ||
# License along with NAV. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
"""Defines types and enumerations for SNMP communication parameters""" | ||
from enum import Enum | ||
|
||
|
||
class SecurityLevel(Enum): | ||
"""SNMPv3 security levels""" | ||
|
||
NO_AUTH_NO_PRIV = "noAuthNoPriv" | ||
AUTH_NO_PRIV = "authNoPriv" | ||
AUTH_PRIV = "authPriv" | ||
|
||
|
||
class AuthenticationProtocol(Enum): | ||
"""SNMPv3 authentication protocols supported by NET-SNMP""" | ||
|
||
MD5 = "MD5" | ||
SHA = "SHA" | ||
SHA512 = "SHA-512" | ||
SHA384 = "SHA-384" | ||
SHA256 = "SHA-256" | ||
SHA224 = "SHA-224" | ||
|
||
|
||
class PrivacyProtocol(Enum): | ||
"""SNMPv3 privacy protocols supported by NET-SNMP""" | ||
|
||
DES = "DES" | ||
AES = "AES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I see what you mean about the ugly
__init__
.