>> 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. 

Fine :-)

> 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...

??? - what do you mean in detail? Something to improve?

> 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?

No - not in your use-case. It's just possible to do.

E.g. if you have several single CAN-IDs to route, you can just create a script
with several cangw -A ... lines and you're done.

> 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 :)

You can probable route the error msgs too, or query the controller state via
netlink.

> 
> So I guess this is the correct setup?

Yep!

> 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 :)

Thanks :-)

> 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.

Yes, of course.

I'll probably put some #if KERNELVERSION stuff around that in the SVN.

My plan is to check the gw.c code for the possibility to make Ethernet/IP
routings from/to CAN before i post it on netdev ML. Currently only CAN_CAN
mappings are possible.

> A big thanks!

Ditto! It's always nice to see, that things are requested i spent my time for 
;-)

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

Reply via email to