Jorge Almeida wrote:
> 
> Hello Jan,
> 
> I'm trying to implement an easy way of monitoring the link beat of one board.
> 
> What i want is to pass the index of the board, and internaly call the 
> "do_ioctl" function that should be initialialized in the rtnet_device struct 
> for each device.
> 
> My question is, How do i call the do_ioctl function using the file descriptor 
> of one socket that is open passing the number of the if_index (or the 
> interface name)? And how rtnet knows wath device to call?

IOCTLs on RTDM sockets come in over the related protocol handler, see
e.g. this one for packet sockets:

http://www.rts.uni-hannover.de/rtnet/lxr/source/stack/packet/af_packet.c#L240

From there on you can easily go down the chain.

As the IOCTLs are per-socket and not per-device, you have to provide the
information about the address device within the request packet. Do you
have some Linux data structure you can reuse for it? Something like for
SIOCGIFINDEX?

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to