Hi Jon,

thanks for the help. Now a few things I didn't get so far make perfeclty sense.

Hope I manage to fix all the quick'n'dirty hacks in my IP (TCP for
now) bearer soon to be able to present it to the list ;-)

Best regards,
Martin


On 3/17/08, Jon Paul Maloy <[EMAIL PROTECTED]> wrote:
> Hi Martin,
>  The explanation is code encapsulation. Adaptation code
>  towards external media such as Ethernet
>  (tipc_eth_media.c) or IP-based protocols is not like
>  other code. It should be possible to write such code
>  in separate directories and as standalone drivers.
>  Therefore, in the beginning, I created a special,
>  exported "bearer adaptation" API for this purpose, the
>  one you find in tipc_plugin_if.h (tipc_bearer.h in in
>  pre-tipc1.7 versions.
>  I wanted to keep the exposed API as narrow as
>  possible, so we could retain liberty to do internal
>  changes to the bearer struct without breaking such
>  adaptation code, which in theory we may not even be
>  aware of.
>  So, ideally you should not include bearer.h at all
>  when you write such adaptors, only tipc_plugin_if.h
>  and the other files you find under include/linux and
>  include/net/tipc.
>
>  I admit that such as the code looks now in Linux,
>  where it is all thrown into one source directory (it
>  was not always like that, and Linux is not the only OS
>  we are running), this ambition may look a little
>  overstretched, but at least there is an intention
>  behind this.
>
>  Regards
>  ///jon
>
>
>  --- Martin Peylo <[EMAIL PROTECTED]> a écrit :
>
>
>  > Hi,
>  >
>  > I am not sure what the second argument of
>  > tipc_recv_msg from
>  > tipc_link.c was inteded to be.
>  >
>  > tipc_eth_media seems to pass an "struct tipc_bearer
>  > *", while the
>  > function's code casts it to a "struct bearer *" and
>  > continues to use
>  > it as such.
>  >
>  > void tipc_recv_msg(struct sk_buff *head, struct
>  > tipc_bearer *tb_ptr)
>  > {
>  > »·······read_lock_bh(&tipc_net_lock);
>  > »·······while (head) {
>  > »·······»·······struct bearer *b_ptr = (struct
>  > bearer *)tb_ptr;
>  > ...
>  >
>  > It seems to work if I am passing a "struct bearer *"
>  > casted to a
>  > "struct tipc_bearer *", but I don't see the point
>  > why there are all
>  > those casts at all.
>  >
>  > Could someone please clarify to me why it's like
>  > this?
>  >
>  > Thanks,
>  > Martin
>  >
>  >
>
> -------------------------------------------------------------------------
>  > This SF.net email is sponsored by: Microsoft
>  > Defy all challenges. Microsoft(R) Visual Studio
>  > 2008.
>  >
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  > _______________________________________________
>  > tipc-discussion mailing list
>  > [email protected]
>  >
>  https://lists.sourceforge.net/lists/listinfo/tipc-discussion
>  >
>
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to