[Click] To/From Click devices
Praveen Balasubramanian
praveen_b at mail.utexas.edu
Tue Nov 28 11:20:59 EST 2006
Hello Roman,
I think the attachments were scrubbed out. Can you upload them to a
Web/FTP server? I think a tar/gzip attachment is also worth a try.
Thanks a lot,
Regards,
Praveen
------------------------------
Message: 6
Date: Tue, 28 Nov 2006 10:43:55 -0500
From: rchertov at purdue.edu
Subject: [Click] To/From Click devices
To: "click at pdos.csail.mit.edu" <click at pdos.csail.mit.edu>
Message-ID: <1164728635.456c593b73665 at webmail.purdue.edu>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
There was a request to take a look at my char device drivers I made for
user-Click interaction.
Build the new elements.
Create the devices
mknod /dev/toclick0 c 240 0
mknod /dev/toclick1 c 240 1
mknod /dev/toclick1 c 240 1
mknod /dev/touser0 c 241 0
mknod /dev/touser1 c 241 1
mknod /dev/touser2 c 241 2
(you can make as few or as many as you want (255 is max))
In the Click config file you use the elements as follows:
FromUser(MINORNUMBER, [SIZE, BURST])-> CheckIPHeader -> Discard;
MINORNUMBER is instance of the device you want to use (0 for /dev/toclick0)
SIZE is the size ring buffer inside of the device.
BURST how many packets to move from the ring buffer into click at once
In a user app you just do this
fd = open("/dev/toclick0", O_WRONLY);
// You write a single pkt at a time. buff contains a pkt of size buff_size
// you can't write pkts larger than (1536+16)
write(fd, buff, buff_size);
close(fd);
PollDevice(eth0) -> ToUser(MINORNUMBER, [SIZE]);
MINORNUMBER is instance of the device you want to use (0 for /dev/touser0)
SIZE is the size ring buffer inside of the device.
In user level land you just do
fd = open("/dev/touser0", O_RDONLY);
// you read pkts and not bytes. The returned value will be in bytes
// Each pkt is a slot of (1536+16). so make buff size a multiple of this
number
read(fd, buff, 2);
close(fd);
If you have any questions please let me know.
Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clicktouser.cc
Type: text/x-c++src
Size: 12249 bytes
Desc: not available
Url :
https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20061128/b406bc07/clicktouser.cc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clicktouser.hh
Type: text/x-c++hdr
Size: 2297 bytes
Desc: not available
Url :
https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20061128/b406bc07/clicktouser.hh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usertoclick.hh
Type: text/x-c++hdr
Size: 2120 bytes
Desc: not available
Url :
https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20061128/b406bc07/usertoclick.hh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usertoclick.cc
Type: text/x-c++src
Size: 12246 bytes
Desc: not available
Url :
https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20061128/b406bc07/usertoclick.cc
------------------------------
_______________________________________________
click mailing list
click at amsterdam.lcs.mit.edu
https://amsterdam.lcs.mit.edu/mailman/listinfo/click
End of click Digest, Vol 41, Issue 24
*************************************
More information about the click
mailing list