comp.lang.ada
 help / color / mirror / Atom feed
From: ahlan.marriott@gmail.com
Subject: Broadcasting UDP
Date: Sun, 24 Apr 2016 09:31:48 -0700 (PDT)
Date: 2016-04-24T09:31:48-07:00	[thread overview]
Message-ID: <276b8c43-7280-48ad-94be-c8324c6ae326@googlegroups.com> (raw)

I asked this question sometime ago but I can no longer find the post.
In any case it was never really resolved so let me try again.
I am looking for a platform independent Ada solution on how to broadcast a UDP packet.
I would be satisfied with a GNAT only solution, i.e. one that uses Gnat.Sockets and/or Gnat specific libraries.
Attempting to broadcast to the limited broadcast address 255.255.255.255 has no effect (under Windows at least)
To successfully broadcast one needs to use the subnet directed broadcast address.
As I want to support PCs that have multiple ethernet adapters this means that I must iterate over the ethernet adapters, discover my ethernet address and subnet for each adapter, calculate the broadcast address and then send the UDP packet to that address.
So far so good.
My problem is that I don't know how to iterate over my adapters and obtain the address and subnet mask for each adapter using just Ada.
Can anyone tell me how I can do this using Ada?

The solution I currently employ is to bind to a windows API.
However this is obviously not target independent.

If there is no Ada way of iterating over the ethernet adapters then I will have to do a separate implementation for each platform.
In which case I would be grateful if anyone could tell me how I can iterate my adapters under Linux and OSX.

Best wishes,
Ahlan

             reply	other threads:[~2016-04-24 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24 16:31 ahlan.marriott [this message]
2016-04-24 17:22 ` Broadcasting UDP Dmitry A. Kazakov
2016-04-25 14:18   ` ahlan
2016-04-25 14:51     ` Dmitry A. Kazakov
2016-04-25 17:11       ` ahlan.marriott
2016-04-26 16:21         ` ahlan
2016-04-29 23:35 ` douty.chris
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox