[Xorp-hackers] Multicast Programming

Pavlin Radoslavov pavlin at icir.org
Thu Oct 4 13:01:25 PDT 2007


Luca Giraudo <luca.giraudo at gmail.com> wrote:

> The process is able to receive multicast packets from every interface if I
> do the next operations:
> * udp_open_and_bind to IPv4::ANY
> * udp_join_group on every configured IPv4 address on the PC (obtained by
> calling finder://fea/ifmgr/0.1/get_configured_interface_names ->
> finder://fea/ifmgr/0.1/get_configured_vif_names ->
> finder://fea/ifmgr/0.1/get_configured_vif_addresses4)
> 
> In the first version of the demon I utilised udp_open_bind_join (with
> parameter IPv4Constants::any), but this doesn't work because it's impossible
> to join the multicast group on IPv4Constants::any (or IPv4::ANY) that isn't
> a local interface (error: ... the address must belong to a local interface);
> the solution is to call the bind and the join separately.
> 
> In this way I can receive packets on every interface and I can send packets
> from every interface (finder://fea/socket4/0.1/send_from_multicast_if). In
> the previous e-mail I didn't describe well the process behaviour, sorry.

I am glad that now it is working for you.

Regarding obtaining the interface/vif names and the configured
addresses, yes you could use the get_configured_* XRLs you mentioned
above. However, you won't obtain other important information (e.g.,
whether an interface/vif is enabled, etc), and you won't get any
updates when any of that information changes.
The recommended (and much better solution) is to use the
libfeaclient mechanism. You could check the static_routes
implementation re. how it is used (hint: search for IfMgr and
iftree), but unfortunately there is no documentation (yet) about the
details.

Of course, you could always add the libfeaclient mechanism at some
later stage when you need to polish your implementation.

Regards,
Pavlin



More information about the Xorp-hackers mailing list