Hi Oliver!

Oliver Hartkopp wrote:
> 
> ...
> indeed we used a similar setup some time ago.
> 
> The idea is to run the CAN applications on the virtual CAN interface (e.g.
> vcan0)
> and then cross-route the CAN frames between vcan0 <-> can0.
> 
> Even if the can0 interface goes down/up the cross-route remains.
> Only when you remove can0, all routings from/to can0 are purged.
> 
> To use the kernel-based CAN routing, you need to build the can-gw protocol
> which
> is based on the PF_CAN network layer stuff and currently only sits in the
> Berlios SVN:
> 
> http://svn.berlios.de/wsvn/socketcan/trunk/kernel/2.6/net/can/gw.c?op=log&;
> 

That was patched into my kernel within minutes. 


Oliver Hartkopp wrote:
> 
> You also need the configuration tool cangw which is in
> trunk/can-utils/cangw.c
> 

That should be easy too, I thought...
I have those can-utils in my target code so I just copied cangw.c there and
added it to the Makefile....
Then I rewrote the Makefile to be less talking and more informative...
Then I hardened the compiler flags and then I was busy to remove all those
double- and shadow-declarations from all of the tools, including cangw.c...


Oliver Hartkopp wrote:
> 
> The can-gw is pretty fast and efficient, so that you won't see any
> relevant timing
> differences.
> 
> If you get any problems using can-gw or the cangw userspacetool please ask
> me.
> 
> I'm always interested in feedback ;-)
> 
It's actually flashing and we see.... Ready!

Normally, as I just like to mirror vcan0<->can0, my rule should be easy like
#cangw -A -s can0 -d vcan0
#cangw -A -s vcan0 -d can0 -e

and I run slave and master on vcan0.
I don't see the need for any filtering, are you?

A first simple compare of candump -ta can0 and candump -ta vcan0 looks
pretty fine!
Disconnected plug from can0... vcan0 still active -> Good!
Reconnecting the debugger... can0 active again -> Good!
CanOPEN LEDs constantly showing green... -> Not so perfect but that's one
for the next release :)

So I guess this is the correct setup?


Oliver Hartkopp wrote:
> 
> Even if can-gw is using netlink i created a separate tool as all the
> CAN-stuff
> and filtering is so different to IP and other networking.
> 

And you did a pretty good job with that :)

As kernel 2.6.39 has some different include paths I quick hacked them into
the code. After cleaning it up I can send you the code or a diff if you
like.

A big thanks!

Ulrich

-----
Best regards
Ulrich
-- 
View this message in context: 
http://old.nabble.com/On-Linux-two-applications-use-the-same-bus--tp30728796p32194659.html
Sent from the Socket-CAN Users mailing list archive at Nabble.com.

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to