The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
referral.c File Reference

Functions to handle ldap referrals. More...

#include <freeradius-devel/ldap/base.h>
+ Include dependency graph for referral.c:

Go to the source code of this file.

Functions

static int _fr_ldap_referral_free (fr_ldap_referral_t *referral)
 Clear up a fr_ldap_referral_t. More...
 
 CC_NO_UBSAN (function)
 Callback to send LDAP referral queries when a trunk becomes active. More...
 
fr_ldap_referral_tfr_ldap_referral_alloc (TALLOC_CTX *ctx, request_t *request)
 Allocate a new structure to handle an LDAP referral, setting the destructor. More...
 
int fr_ldap_referral_follow (fr_ldap_thread_t *t, request_t *request, fr_ldap_query_t *query)
 Follow an LDAP referral. More...
 
int fr_ldap_referral_next (fr_ldap_thread_t *t, request_t *request, fr_ldap_query_t *query)
 Follow an alternative LDAP referral. More...
 

Detailed Description

Functions to handle ldap referrals.

Id
8afee84520f0d2c547b6d8c0d5b36d51d7f51d52
Author
Nick Porter nick..nosp@m.port.nosp@m.er@ne.nosp@m.twor.nosp@m.kradi.nosp@m.us.c.nosp@m.om

Definition in file referral.c.

Function Documentation

◆ _fr_ldap_referral_free()

static int _fr_ldap_referral_free ( fr_ldap_referral_t referral)
static

Clear up a fr_ldap_referral_t.

If there is a parsed referral_url, that must be freed using libldap's ldap_free_urldesc

Definition at line 34 of file referral.c.

+ Here is the caller graph for this function:

◆ CC_NO_UBSAN()

CC_NO_UBSAN ( function  )

Callback to send LDAP referral queries when a trunk becomes active.

Definition at line 67 of file referral.c.

+ Here is the call graph for this function:

◆ fr_ldap_referral_alloc()

fr_ldap_referral_t* fr_ldap_referral_alloc ( TALLOC_CTX *  ctx,
request_t request 
)

Allocate a new structure to handle an LDAP referral, setting the destructor.

Parameters
[in]ctxto allocate the referral in
[in]requestthe LDAP query relates to.
Returns
  • a new referral structure on success
  • NULL on failure

Definition at line 49 of file referral.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_ldap_referral_follow()

int fr_ldap_referral_follow ( fr_ldap_thread_t t,
request_t request,
fr_ldap_query_t query 
)

Follow an LDAP referral.

The returned list of LDAP referrals should already be in query->referrals. We check all the possible referrals and look for one where there already is an active trunk connection.

Parameters
tThread running the query.
requestrelated to the query.
querywhose result was one or more referral URLs.
Returns
  • 0 on success.
  • < 0 on failure.

Definition at line 113 of file referral.c.

+ Here is the call graph for this function:

◆ fr_ldap_referral_next()

int fr_ldap_referral_next ( fr_ldap_thread_t t,
request_t request,
fr_ldap_query_t query 
)

Follow an alternative LDAP referral.

If an initial chase of an LDAP referral results in an error being returned this function can be used to attempt one of the other referral URLs given in the initial query results.

The initial use of fr_ldap_referral_follow may have launched trunks for any referral URLs which parsed successfully, so this starts by looking for the first which has an active state and sends the query that way.

If no active trunks match the remaining servers listed in referrals then new trunks are launched with watchers to send the query on the first active trunk.

Parameters
tThread running the query.
requestthe query relates to.
querywhose referrals are being chased.
Returns
  • 0 on success.
  • < 0 on failure.

Definition at line 310 of file referral.c.

+ Here is the call graph for this function: