IPv6 raw socket (ICMPv6)

Thomas Delaet <[email protected]> Tue, 16 Mar 2004 23:13:51 +0100
Newsgroups gmane.os.openbsd.ipv6
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have 2 (probably stupid) questions about raw ipv6-sockets programming with
the OpenBSD networking-stack.

What I'm trying to do: Write a general interface to send/receive icmpv6
packets.
What I've done:
* Initialization function (mostly stolen from rtsol.c)
* Receive function (also from rtsol.c)
My problems (I've included my code in attachment):
1) I don't know how to convert the from-IPv6 address to a 128 bit-string. I
know it's in the pi->ipi6_addr structure, but I would like to see it as a
bit-string.
2) I would like to have the icmpv6-body in a char*. The type and code are put
in the icmp6_hdr structure, but when I ping6 my program isn't printing
anything, while the body should contain the icmp6_sequence number and id (in
this case).

Thanks a lot in advance for any help.

Kind Regards,
- --
Thomas

gpgkey @ http://thomas.delaet.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAV3wjIZsL90hyEFkRApC+AJ4/052vE3lucNjK/OQY5sA3tV29AQCgnw93
RZUh3nxzw8tARj7aJrARbLU=
=rEgq
-----END PGP SIGNATURE-----

[demime 0.98d removed an attachment of type text/x-csrc which had a name of icmpv6.c]