The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
rfc4533.h File Reference
#include <freeradius-devel/ldap/base.h>
#include "proto_ldap_sync_ldap.h"
+ Include dependency graph for rfc4533.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int rfc4533_sync_init (fr_ldap_connection_t *conn, size_t sync_no, proto_ldap_sync_t const *inst, uint8_t const *cookie)
 Allocate and initialise RFC 4533 sync queries. More...
 
int rfc4533_sync_intermediate (sync_state_t *sync, LDAPMessage *msg, LDAPControl **ctrls)
 
int rfc4533_sync_refresh_required (sync_state_t *sync, LDAPMessage *msg, LDAPControl **ctrls)
 Handle result code of e-syncRefreshRequired. More...
 
int rfc4533_sync_search_entry (sync_state_t *sync, LDAPMessage *msg, LDAPControl **ctrls)
 Handle a SearchResultEntry or SearchResultReference response from an RFC 4533 server. More...
 
int rfc4533_sync_search_result (sync_state_t *sync, LDAPMessage *msg, LDAPControl **ctrls)
 

Function Documentation

◆ rfc4533_sync_init()

int rfc4533_sync_init ( fr_ldap_connection_t conn,
size_t  sync_no,
proto_ldap_sync_t const *  inst,
uint8_t const *  cookie 
)

Allocate and initialise RFC 4533 sync queries.

The Sync Request Control is an LDAP Control [RFC4511] where the controlType is the object identifier 1.3.6.1.4.1.4203.1.9.1.1 and the controlValue, an OCTET STRING, contains a BER-encoded syncRequestValue.

syncRequestValue ::= SEQUENCE { mode ENUMERATED { – 0 unused refreshOnly (1), – 2 reserved refreshAndPersist (3) }, cookie syncCookie OPTIONAL, reloadHint BOOLEAN DEFAULT FALSE }

reloadHint specifies whether we prefer a complete directory load or an eSyncRefreshRequired response when the provided cookie does not give the server a point in its change log from which it can send suitable changes to bring the client into sync. We always send 'false' since we handle eSyncRefreshRequired.

The Sync Request Control is only applicable to the SearchRequest Message.

Definition at line 74 of file rfc4533.c.

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

◆ rfc4533_sync_intermediate()

int rfc4533_sync_intermediate ( sync_state_t sync,
LDAPMessage *  msg,
LDAPControl **  ctrls 
)

◆ rfc4533_sync_refresh_required()

int rfc4533_sync_refresh_required ( sync_state_t sync,
LDAPMessage *  msg,
LDAPControl **  ctrls 
)

Handle result code of e-syncRefreshRequired.

If the server wishes to indicate that a refresh is required, it sends a searchResultDone message with the result code e-syncRefreshRequired result code. Any cookie provided should be used on a query to re-start the sync. If no cookie is provided, the new query should be performed without a cookie to get a full refresh.

Parameters
[in]syncmessage was associated with.
[in]msgrequesting the refresh.
[in]ctrlsassociated with the msg.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 717 of file rfc4533.c.

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

◆ rfc4533_sync_search_entry()

int rfc4533_sync_search_entry ( sync_state_t sync,
LDAPMessage *  msg,
LDAPControl **  ctrls 
)

Handle a SearchResultEntry or SearchResultReference response from an RFC 4533 server.

Upon receipt of a search request containing the syncControl the server provides the initial content using zero or more SearchResultEntries followed by a SearchResultdone.

Each SearchResultEntry includes a Sync State control with state set to add, an entryUUID containing the entry's UUID, and no cookie.

For refreshAndPersist operations SearchResultEntries are also used after the refresh phase to inform clients of changes to entries within the scope of the search request.

The Sync State Control is an LDAP Control where the controlType is the object identifier 1.3.6.1.4.1.4203.1.9.1.2 and the controlValue, an OCTET STRING. It contains a BER-encoded syncStateValue.

syncStateValue ::= SEQUENCE { state ENUMERATED { present (0), add (1), modify (2), delete (3) }, entryUUID syncUUID, cookie syncCookie OPTIONAL }

The Sync State Control is only included in SearchResultEntry and SearchResultReference Messages.

Parameters
[in]syncmessage was associated with.
[in]msgcontaining an entry to process.
[in]ctrlsassociated with the msg.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 260 of file rfc4533.c.

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

◆ rfc4533_sync_search_result()

int rfc4533_sync_search_result ( sync_state_t sync,
LDAPMessage *  msg,
LDAPControl **  ctrls 
)