detect IP/UDP destination address

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

detect IP/UDP destination address

beach.dk
Hi,

I have set up an UDP-server using the raw API

    upcb= udp_new();
    udp_recv( upcb, callback_recv, get_nic_netif() );
    udp_bind( upcb, IP_ADDR_ANY, 1234 );

In my callback_recv function I can see the IP address of the UDP-client
so I can reply to it.

But........ I would like to detect if the client sent the incoming UDP
packet using unicast or broadcast (so I can respond with a
corresponding unicats/broacast packet).

Is this possible?

/Beach/


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: detect IP/UDP destination address

Kieran Mansley
On Mon, 2006-12-18 at 10:54 +0100, [hidden email] wrote:

> Hi,
>
> I have set up an UDP-server using the raw API
>
>     upcb= udp_new();
>     udp_recv( upcb, callback_recv, get_nic_netif() );
>     udp_bind( upcb, IP_ADDR_ANY, 1234 );
>
> In my callback_recv function I can see the IP address of the UDP-client
> so I can reply to it.
>
> But........ I would like to detect if the client sent the incoming UDP
> packet using unicast or broadcast (so I can respond with a
> corresponding unicats/broacast packet).
>
> Is this possible?

Someone may correct me, as I'm not sure about this, but
unicast/broadcast is a rather Ethernet specific concept, and so I'd be
surprised if it was visible at the higher layers as these have to
interoperate on many different physical networks.

Kieran



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: detect IP/UDP destination address

beach.dk
On 12/18/06, Kieran Mansley <[hidden email]> wrote:

> On Mon, 2006-12-18 at 10:54 +0100, [hidden email] wrote:
> > Hi,
> >
> > I have set up an UDP-server using the raw API
> >
> >     upcb= udp_new();
> >     udp_recv( upcb, callback_recv, get_nic_netif() );
> >     udp_bind( upcb, IP_ADDR_ANY, 1234 );
> >
> > In my callback_recv function I can see the IP address of the UDP-client
> > so I can reply to it.
> >
> > But........ I would like to detect if the client sent the incoming UDP
> > packet using unicast or broadcast (so I can respond with a
> > corresponding unicats/broacast packet).
> >
> > Is this possible?
>
> Someone may correct me, as I'm not sure about this, but
> unicast/broadcast is a rather Ethernet specific concept, and so I'd be
> surprised if it was visible at the higher layers as these have to
> interoperate on many different physical networks.
>
> Kieran
>

Maybe I was a bit careless with my vocabulary if unicast/broadcast is
only related to the ethernet layer.
It's the destination adress at the IP-layer (not ethernet layer) I'm
interested in.

/Beach/


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: detect IP/UDP destination address

Kieran Mansley
On Mon, 2006-12-18 at 11:17 +0100, [hidden email] wrote:

> Maybe I was a bit careless with my vocabulary if unicast/broadcast is
> only related to the ethernet layer.
> It's the destination adress at the IP-layer (not ethernet layer) I'm
> interested in.

Ahh, apologies, it was me who was confused!

So, you have the IP address of the sender, and you need the IP address
the packet was sent to so you can work out if that was a broadcast or
unicast?  I don't think the API supplies that at the moment.

Kieran



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users