.BR outvalue
must be
.BR "int *" .
-.\".TP
-.\".B LDAP_OPT_REFHOPLIMIT
-.\"This option is OpenLDAP specific.
-.\"It is not currently implemented.
+.TP
+.B LDAP_OPT_REFHOPLIMIT
+Set the maximum number of referrals to chase for a request.
+.BR invalue
+must be
+.BR "const int *" ;
+.BR outvalue
+must be a
+.BR "int *" .
+They cannot be NULL.
+This option is OpenLDAP specific.
.TP
.B LDAP_OPT_RESTART
Determines whether the library should implicitly restart connections (FIXME).
.\".B RESTART <on/true/yes/off/false/no>
.\"Determines whether the library should implicitly restart connections (FIXME).
.TP
+.B REFHOPLIMIT <integer>
+Specified the maximum number of referrals to follow when performing a
+request. The number should be a positive integer. The default is 5.
+.TP
.B SIZELIMIT <integer>
Specifies a size limit (number of entries) to use when performing searches.
The number should be a non-negative integer. \fISIZELIMIT\fP of zero (0)
{0, ATTR_OPT_INT, "VERSION", NULL, LDAP_OPT_PROTOCOL_VERSION},
{0, ATTR_KV, "DEREF", deref_kv, /* or &deref_kv[0] */
offsetof(struct ldapoptions, ldo_deref)},
+ {0, ATTR_INT, "REFHOPLIMIT", NULL,
+ offsetof(struct ldapoptions, ldo_refhoplimit)},
{0, ATTR_INT, "SIZELIMIT", NULL,
offsetof(struct ldapoptions, ldo_sizelimit)},
{0, ATTR_INT, "TIMELIMIT", NULL,
rc = LDAP_OPT_SUCCESS;
break;
+ case LDAP_OPT_REFHOPLIMIT:
+ * (int *) outvalue = lo->ldo_refhoplimit;
+ rc = LDAP_OPT_SUCCESS;
+ break;
+
case LDAP_OPT_SIZELIMIT:
* (int *) outvalue = lo->ldo_sizelimit;
rc = LDAP_OPT_SUCCESS;
/* options which cannot withstand invalue == NULL */
case LDAP_OPT_DEREF:
+ case LDAP_OPT_REFHOPLIMIT:
case LDAP_OPT_SIZELIMIT:
case LDAP_OPT_TIMELIMIT:
case LDAP_OPT_PROTOCOL_VERSION:
rc = LDAP_OPT_SUCCESS;
break;
+ case LDAP_OPT_REFHOPLIMIT:
+ lo->ldo_refhoplimit = * (const int *) invalue;
+ rc = LDAP_OPT_SUCCESS;
+ break;
+
case LDAP_OPT_SIZELIMIT:
/* FIXME: check value for protocol compliance? */
lo->ldo_sizelimit = * (const int *) invalue;