You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
673 B
29 lines
673 B
#
|
|
# This file is part of pysnmp software.
|
|
#
|
|
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
|
|
# License: http://snmplabs.com/pysnmp/license.html
|
|
#
|
|
import socket
|
|
|
|
from pysnmp import debug
|
|
|
|
|
|
SYMBOLS = {
|
|
'IP_PKTINFO': 8,
|
|
'IP_TRANSPARENT': 19,
|
|
'SOL_IPV6': 41,
|
|
'IPV6_RECVPKTINFO': 49,
|
|
'IPV6_PKTINFO': 50,
|
|
'IPV6_TRANSPARENT': 75
|
|
}
|
|
|
|
for symbol, value in SYMBOLS.items():
|
|
if not hasattr(socket, symbol):
|
|
setattr(socket, symbol, value)
|
|
|
|
debug.logger & debug.flagIO and debug.logger(
|
|
'WARNING: the socket module on this platform misses option %s. '
|
|
'Assuming its value is %d.' % (symbol, value)
|
|
)
|