Sadly I have not used it much myself, so I can't give terribly specific recommendations, but this is the general domain of `twisted.pair`. I can see it has some tun/tap stuff but I don't see a SOCK_RAW anywhere. The docs, such as they are, are here: https://docs.twistedmatrix.com/en/stable/pair/index.html
I hope someone else chimes in with more specificity, but I'd love to hear of your success, and maybe get some contributions which smooth over this sort of workflow… -g > On Nov 20, 2023, at 2:10 PM, Tim Nowaczyk <[email protected]> wrote: > > I am starting to work on a lightweight OSPFv2 protocol implementation and > thought that twisted looked like a good tool to use for a lot of the state > machine and timing parts. I need to create a SOCK_RAW socket for protocol 89. > Can someone point me in the right direction to get twisted to use this? > Here's a minimal example of what I need to do to receive the packets > > import socket > import struct > > sock = socket.socket(socket.AF_INET, socket.SOCK_RAW, 89) > sock.bind(('', 0)) > > multicast_group = '224.0.0.5' > group = socket.inet_aton(multicast_group) > mreq = struct.pack('4s4s', group, socket.inet_aton('192.168.88.253')) > sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) > > while True: > data, address = sock.recvfrom(1024) > print(data.hex()) > _______________________________________________ > Twisted mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/twisted.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/6ATYCIUTTCT364AEPLQUBSE36L7RUSA5/ > Code of Conduct: https://twisted.org/conduct
_______________________________________________ Twisted mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/twisted.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/LI2C4U7UGRZEM2T2IU3JIVXXVND6QR6O/ Code of Conduct: https://twisted.org/conduct
