-
Notifications
You must be signed in to change notification settings - Fork 48
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
setsockopt on ICMPSocket #39
Comments
To determine the best approach to take, do you have any other options to pass to the underlying socket? |
For now, I don't have any other option to pass. But some options are applicable even for ICMP. |
The code base use 2.a for broadcast: the property |
Not so many options, indeed, fewer than I imagined. 2.a should be consider as an option, IMHO, maybe with lazy implementation (PR accepted when use-case occurs). |
Hi @audeoudh! In the latest version of icmplib I added a property ( Sorry for the delay... |
I have a
ICMPSocket
. I have to use a.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, b"iface")
on the underlying socket. What is the recommended way to do that?s = ICMPv6Socket(); s._sock.setsockopt(...)
makes an access to a private attribute.ICMPSocket
and add such a functionality is possible and easy; but why is it not done inicmplib
itself then?a. Provide a wrapper for each possible option (as
_set_ttl
and_set_traffic_class
) is too heavy as the number of supported options increaseb. Provide a proxy method (
icmpsocket.setsockopt(...)
) that just forwards the call toself._sock.setsockopt(...)
is possible, while it adds a function call.c. Change
self._sock
to a public attribute is another possible solution.icmplib
won't support it (which I cannot accept for my personal project—but that is my personal problem then. 😉 )I would prefer 2.b supported by
icmplib
.The text was updated successfully, but these errors were encountered: