IP protocol conversion

From: Dancer <dancer@dont-contact.us>
Date: Tue, 15 Jun 1999 13:07:37 +1000

Okay..I've spent a chunk of the morning going over the snapshot. Kudos on the internal dns code. Very dense, but it looks well thought through. I figure protocol independence won't
be _too_ horrific to wedge in, though it won't be a small job. My first-cut plan goes something like this:

* Supply a portable getaddrinfo/getnameinfo. (Not a huge problem, I have such an implementation that builds and ports widely with little or no effort)
* Work over safe_inet_addr to use this, and to understand that a _list_ of addresses may be returned, and to still give sensible results to callers. That sensible result may be a
4-byte or 16-byte address, so a little care needs to be taken with representation and storage, so that we don't need to know what kind it is at any point.
* Look at dns_internal.c and get it to look up AAAA records as well as A records.
* Convert ipcache and comm_* code to using an encapsulated object (struct sockaddr* inside a structure containing a little extra information about address families).
* Go over all the address presentation storage and address conversion to use the opaque address representation structure.
* Back-modify the external dnsservers to allow for passing back a different address family
* Modify the code that interfaces to those to wrap up dnsserver responses in the new opaque type-block.

The opaque type block _probably_ looks something like:

struct generic_address_block {
        int family; /* AF_UNIX, AF_INET, AF_INET6, ... */
        int socktype; /* SOCK_STREAM, SOCK_DGRAM, ... */ (maybe)
        int protocol; /* maybe */
        int addrlen; /* Length of address structure */
        struct sockaddr *addr; /* Actual address block..with the above data for socket creation
                                        we don't need to know the actual type or protocol */
        };

Still thinking this through. Comments invited.

D
Received on Tue Jul 29 2003 - 13:15:59 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:15 MST