The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Typedefs | Enumerations | Functions
proto_ldap_sync.h File Reference
#include <freeradius-devel/io/master.h>
#include <freeradius-devel/ldap/base.h>
#include <freeradius-devel/ldap/sync.h>
+ Include dependency graph for proto_ldap_sync.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  proto_ldap_sync_t
 An instance of a proto_ldap_sync listen section. More...
 
struct  sync_config_s
 Areas of the directory to receive notifications for. More...
 

Typedefs

typedef struct sync_config_s sync_config_t
 
typedef int(* sync_init_t) (fr_ldap_connection_t *conn, size_t sync_no, proto_ldap_sync_t const *inst, uint8_t const *cookie)
 Allocate and initialise a sync query. More...
 
typedef int(* sync_msg_t) (sync_state_t *sync, LDAPMessage *msg, LDAPControl **ctrls)
 Received an LDAP message related to a sync. More...
 
typedef struct sync_state_s sync_state_t
 

Enumerations

enum  sync_op_t {
  SYNC_OP_INVALID = -1 ,
  SYNC_OP_PRESENT = 0 ,
  SYNC_OP_ADD = 1 ,
  SYNC_OP_MODIFY = 2 ,
  SYNC_OP_DELETE = 3
}
 Operations to perform on entries. More...
 

Functions

int ldap_sync_conf_attr_add (sync_config_t *config, char const *attr)
 Check if an attribute is in the config list and add if not present. More...
 

Data Structure Documentation

◆ proto_ldap_sync_t

struct proto_ldap_sync_t

An instance of a proto_ldap_sync listen section.

Definition at line 35 of file proto_ldap_sync.h.

+ Collaboration diagram for proto_ldap_sync_t:
Data Fields
fr_app_io_t const * app_io Easy access to the app_io handle.
CONF_SECTION * app_io_conf Easy access to the app_io's configuration.
void * app_io_instance Easy access to the app_io_instance.
uint32_t cookie_changes Number of LDAP changes to process between each cookie store operation.
fr_time_delta_t cookie_interval Interval between storing cookies.
CONF_SECTION * cs my configuration.
fr_dict_t * dict root dictionary
module_instance_t * io_submodule As provided by the transport_parse callback.

Broken out into the app_io_* fields below for convenience.

fr_listen_t * listen The listener structure which describes the I/O path.
uint32_t max_packet_size for message ring buffer
uint32_t num_messages for message ring buffer
uint32_t priority for packet processing.
fr_time_delta_t retry_interval Interval between retrying failed change packets.
fr_schedule_t * sc
fr_app_t * self child / parent linking issues
CONF_SECTION * server_cs server CS for this listener.
sync_config_t ** sync_config DNs and filters to monitor.

◆ sync_config_s

struct sync_config_s

Areas of the directory to receive notifications for.

Definition at line 116 of file proto_ldap_sync.h.

+ Collaboration diagram for sync_config_s:
Data Fields
char const ** attrs Zero terminated attribute array.
char const * base_dn DN to search for users under.
bool changes_only Do we only want changes, or do we want a full directory load.

Not supported by Active Directory.

CONF_SECTION * cs Config section where this sync was defined.

Used for logging.

sync_msg_t entry Called when we receive a searchEntry message.
map_list_t entry_map How to convert attributes in entries to FreeRADIUS attributes.
fr_event_timer_t const * ev Event for retrying cookie load.
char const * filter Filter to retrieve only user objects.
sync_init_t init Called to initialise a new search.
sync_msg_t intermediate Called when we receive a syncIntermediate message.
sync_msg_t reference Called when we receive a searchReference message.
sync_msg_t refresh Called when we receive a eSyncRefreshRequired code.
char const * root_dn The root DN for the directory.
int scope Scope as its libldap value.
char const * scope_str Scope (sub, one, base).
fr_pair_list_t sync_pairs Pairs representing the sync config sent to the worker with each request.
void * user_ctx User ctx to pass to the callbacks.

Typedef Documentation

◆ sync_config_t

typedef struct sync_config_s sync_config_t

Definition at line 1 of file proto_ldap_sync.h.

◆ sync_init_t

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

Allocate and initialise a sync query.

Called at the start of the sync operation, after any cookie has been retrieved.

Sends the persistent search query to the LDAP server with the appropriate controls for type of directory in use.

Parameters
[in]connto initialise the sync on
[in]sync_nonumber of the sync in the array of configs.
[in]instinstance of ldap_sync this query relates to
[in]cookieto send with the query (RFC 4533 only)
Returns
  • 0 on success.
  • -1 on error.

Definition at line 95 of file proto_ldap_sync.h.

◆ sync_msg_t

typedef int(* sync_msg_t) (sync_state_t *sync, LDAPMessage *msg, LDAPControl **ctrls)

Received an LDAP message related to a sync.

Called whenever the server returns a message, during any phase of the sync.

This function is responsible for freeing the LDAP message.

Parameters
[in]syncwe received the message for.
[in]msgthe LDAP message received.
[in]ctrlsreceived with the message.
Returns
  • 0 on success.
  • -1 on error.

Definition at line 111 of file proto_ldap_sync.h.

◆ sync_state_t

typedef struct sync_state_s sync_state_t

Definition at line 1 of file proto_ldap_sync.h.

Enumeration Type Documentation

◆ sync_op_t

enum sync_op_t

Operations to perform on entries.

Enumerator
SYNC_OP_INVALID 

Invalid sync operation.

SYNC_OP_PRESENT 

Entry is present and unchanged on the server.

SYNC_OP_ADD 

Entry should be added to our copy.

SYNC_OP_MODIFY 

Entry should be updated in our copy.

SYNC_OP_DELETE 

Entry should be deleted from our copy.

Definition at line 70 of file proto_ldap_sync.h.

Function Documentation

◆ ldap_sync_conf_attr_add()

int ldap_sync_conf_attr_add ( sync_config_t config,
char const *  attr 
)

Check if an attribute is in the config list and add if not present.

Parameters
[in,out]configto check for attribute.
[in]attrto look for.
Returns
  • 1 if attr is added
  • 0 if attr was already present

Definition at line 104 of file proto_ldap_sync.c.

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