Subject: ldap_init() and IPv6 addresses

From: Stig Ven�s <[email-masked]>
Date: Mon, 1 Jan 2001 20:36:25 +0100

From draft-ietf-ldapext-ldap-c-api-05.txt:

Parameters are:

hostname Contains a space-separated list of hostnames or dotted strings
         representing the IP address of hosts running an LDAP server to
         connect to. Each hostname in the list MAY include a port number
         which is separated from the host itself with a colon (:) char-
         acter.  The hosts will be tried in the order listed, stopping
         with the first one to which a successful connection is made.

   Note: A suitable representation for including a literal IPv6[10]
   address in the hostname parameter is desired, but has not yet been
   determined or implemented in practice.

This has been implemented in OpenLDAP. The format chosen is based on
the URL syntax in RFC 2732 which uses [] around the address, an example
from the RFC:

	http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html

So the format I suggest (and is implemented in OpenLDAP) would then be
to write host and port as [FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80.

Just to make myself clear, here are some other examples:

ldap_init("[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]", LDAP_PORT )

ldap_init("[FEDC:BA98::7654:3210] 127.0.0.1", LDAP_PORT )

ldap_init("[FEDC:BA98:7654:3210::1]:390 [FEDC:BA98:7654::1]:391", LDAP_PORT )

ldap_init("[FEDC:BA98:7654:3210::1]:390 [FEDC:BA98:7654:3210::1]", LDAP_PORT )

My question then, can we agree on this format and use it in the next
revision of the draft, or is there anyone that doesn't like this?

Stig

-- 
Stig Venaas
UNINETT