Chris Lightcap wrote:
> Hi Jan,
> 
> I've modified a simple arcnet communication program to support the 
> new real-time driver.. but I'm having a problem opening the socket 
> (the first step, i know!) where the function returns an integer 
> value of -97? The original program called the socket function with 
> the following socket type and protocol and I've modified it as 
> shown below.
> 
> int sockfd = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ALL)); // 
> the original
> 
> int sockfd = rt_dev_socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); 
> // the modified
> 
> I know that SOCK_PACKET is an outdated socket type but the 
> alternative SOCK_RAW will not work either. I found in the 
> rt_pci32.c driver that the arguments AF_INET and SOCK_DGRAM work 
> but I need to use header information in the arcnet packets.
> 
> Any suggestions?
> 

Depends on what you really need for your arcnet app: RTnet's rtpacket
currently provide PF_PACKET:SOCK_DGRAM, i.e. "cooked" access to some
networking device. And this access is limited to a per-protocol basis,
which means no ETH_P_ALL. Moreover, it's a bit Ethernet-specific, see
rt_packet_recvmsg().

Some generalisation of the rtpacket socket interface will therefore be
required. Whether you also have to add ETH_P_ALL support, depends on
your application design. Currently, the core would demux incoming arcnet
protocols for you and and distribute them to different sockets
(registered via socket(PF_PACKET, SOCK_DGRAM, <protocol>)). ETH_P_ALL
would require exclusive device access because RTnet has currently no
means to clone incoming packets for multiple receivers. SOCK_RAW might
be necessary if there is no clean way to get all required arcnet header
informations through the SOCK_DGRAM interface.

Re-check your situation and suggest what you think it's best for your
scenario. Then we can see how to generalise your usage scenario and
integrate it cleanly.

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