On Mon, Oct 27, 2008 at 11:29 PM, Luis A. Bastiao Silva
<[EMAIL PROTECTED]> wrote:
> Hard way to make a sequence of packets it's using umpa.
>
> forever:
>
> second_packet = umpa.Packet(ip, udp)
add Payload protocol and keep a data in Payload (nopper wrote
something similar above)
> (..) ports ip etc...
> sock = umpa.utils.security.super_priviliges(umpa.Socket)
you don't really need it if you just want to send some packets,
obviosly you should use it for secure reasons but I hope, you know
what you do :)
> # sending packet
> sock.send(packet)
>
> Where shoudl I put the data of UDP?
at Payload protocol.
ok, here is the shortest example of what you need:
import umpa
from umpa.protocols import IP, UDP, Payload
payload = Payload()
packet = umpa.Packet(ip.IP(source_address=127.0.0.1,
destination_address=127.0.0.1), udp.UDP(source_port=0,
destination_port=666), payload)
sock = umpa.Socket()
for data in ("some", "various", "texts"):
payload.data = data
sock.send(packet)
Also, in next release there will be template system so generating of
packet's sequence will be totally fast and sexy. Me and Adriano
decided to not add this feature during GSoC because it's just a small
part of full template system which we cannot provide now because of
some licences issues.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Umit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/umit-devel