sending a rip1 request via python

scripteaze scripteaze at gmail.com
Thu Dec 20 20:57:24 EST 2007


On Dec 19, 5:50 pm, Dirk Loss <li... at dirk-loss.de> wrote:
> scripteaze wrote:
>
>  >>> I need to be able to send a rip1 request to my rip1 enabled device.,
ok i got everthing setup and its sending the packets, do i have to
create a socket server or cant i simply setup a buf = 1024 and recieve
the replies and display them, i dont need to interact, just view the
returned data if any, thanks

>
 > Well, i use scapy quite often, however, this needs to be very
portable
>
> import socket
> rip_request = '\x01\x01\x00\x00\x00\x02' + '\x00' * 17 + '\x10'
> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
> s.sendto(rip_request, ("servername", 520))
> s.close()
>
> If you also want to handle the replies, you might want to have a look at
> the SocketServer module:
>
> http://docs.python.org/lib/module-SocketServer.html
>
> Regards
> Dirk




More information about the Python-list mailing list