[Mono-list] UDP and ICMP

P Oscar Boykin boykin@pobox.com
Thu, 5 Feb 2004 00:40:06 -0800


--jI8keyz6grp/JLjh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

See, that's the problem.

I really don't care about getting the ICMP message, or sending it.  I
just want my NON-ROOT user to know that the host he is sending a UDP
packet to is responding with "destination unreachable" packets.

There has to be (or rather should be) a way for a non-root user to know
that the packets are not being received.  Otherwise, what good is the
ICMP message in the first place.

In my opinion, it would be nice if it went something like this:

If an ICMP message is sent, telling that a previous UDP packet was not
received, the ReceiveFrom method in socket should throw an exception the
next time it is called, and it should give this information.  But I
guess it does not matter what I think, it only matters what the API
does.

I am still hoping someone can tell me a way for a non-root user to get
access to this information.

Thanks,
POB.

On Thu, Feb 05, 2004 at 07:11:16AM +0100, Giuseppe Greco wrote:
> ... and of course, the application should be run
> as root.
>=20
> j3d.
>=20
> > Hello All.
> >
> > I am using using mono to send udp packets between two hosts.  At some
> > point, one host may go offline.  If I watch the network (using ethereal)
> > I see the UDP packet go from A->B, and host B responds with a ICMP
> > destination unreachable packet.  However, I don't see how I can get
> > access to that packet in my application.
> >
> > I was hoping that SendTo or ReceiveFrom could throw exceptions, but I
> > don't believe that is how they work.
> >
> > I also tried to make a separate socket to listen for the ICMP packets,
> > but under Linux and Mono 0.30, I get an exception when I try to create
> > the socket to listen for ICMP messages:
> >
> > Unhandled Exception: System.Net.Sockets.SocketException: Access denied
> > in (unmanaged) /usr/local/lib/libmono.so.0(mono_raise_exception+0x1f)
> > [0x4009176f]
> > in (unmanaged) /usr/local/lib/libmono.so.0 [0x400b1d7d]
> > in <0x00054> System.Net.Sockets.Socket:.ctor
> > (System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.=
Net.Sockets.ProtocolType)
> > in <0x000d3> Gnucla.UdpEdgeListener:.ctor (int)
> > in <0x001b0> Gnucla.EchoTest:Main (string[])
> >
> > Can anyone suggest a method that host A can see that host B is no longer
> > listening without doing it at the application layer?  I just want the
> > ICMP packet to have an effect.
> >
> > Thanks.
> > POB
> > --
> > boykin@pobox.com    http://pobox.com/~boykin    jabber:
> > johnynek@jabber.org
> > fingerprint=3DD250 4AD9 4544 B7D2 A17C  911D D608 D387 6718 D75F
> > fix copyright:
> > http://cyberlaw.stanford.edu/lessig/blog/archives/EAFAQ.html
> >
>=20
>=20
> ----------------------------------------
> Giuseppe Greco
>=20
> ::agamura::
>=20
> phone:  +41 (0)91 604 67 65
> mobile: +41 (0)76 390 60 32
> email:  giuseppe.greco@agamura.com
> web:    www.agamura.com
> ----------------------------------------
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

--=20
boykin@pobox.com    http://pobox.com/~boykin    jabber: johnynek@jabber.org
fingerprint=3DD250 4AD9 4544 B7D2 A17C  911D D608 D387 6718 D75F
fix copyright: http://cyberlaw.stanford.edu/lessig/blog/archives/EAFAQ.html

--jI8keyz6grp/JLjh
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAIgFl1gjTh2cY118RAlSaAKCSax+Ifl5q8GNsOP8qoH1zIF80+gCeLR5B
eXXsBtPlM9fh9A7bJDlhN8M=
=K7R4
-----END PGP SIGNATURE-----

--jI8keyz6grp/JLjh--