The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
proto_ldap_sync_ldap.c File Reference

LDAP sync handler. More...

#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
#include <freeradius-devel/internal/internal.h>
#include <freeradius-devel/server/protocol.h>
#include <freeradius-devel/server/request.h>
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/io/application.h>
#include <freeradius-devel/unlang/call.h>
#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/ldap/base.h>
#include <freeradius-devel/ldap/conf.h>
#include "proto_ldap_sync_ldap.h"
#include "rfc4533.h"
#include "persistent_search.h"
#include "active_directory.h"
+ Include dependency graph for proto_ldap_sync_ldap.c:

Go to the source code of this file.

Data Structures

struct  proto_ldap_dir_ctx
 Context used when looking up Directory types. More...
 

Macros

#define LOG_PREFIX   "proto_ldap_sync_ldap"
 

Functions

static void _proto_ldap_socket_closed (UNUSED connection_t *conn, connection_state_t prev, UNUSED connection_state_t state, void *uctx)
 Callback for closure of LDAP connection. More...
 
static void _proto_ldap_socket_init (connection_t *conn, UNUSED connection_state_t prev, UNUSED connection_state_t state, void *uctx)
 Allocate a child listener. More...
 
static void _proto_ldap_socket_open_connected (connection_t *conn, UNUSED connection_state_t prev, UNUSED connection_state_t state, void *uctx)
 Query an LDAP server to establish its type. More...
 
static void _proto_ldap_socket_open_error (UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, UNUSED int fd_errno, void *uctx)
 Callback for socket errors when running initial root query. More...
 
static void _proto_ldap_socket_open_read (fr_event_list_t *el, int fd, UNUSED int flags, void *uctx)
 Callback to process results of initial root query, identifying directory type. More...
 
void ldap_sync_cookie_event (fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
 Event to handle storing of cookies on a timed basis. More...
 
int ldap_sync_cookie_send (sync_packet_ctx_t *sync_packet_ctx)
 Enqueue a new cookie store packet. More...
 
int ldap_sync_cookie_store (sync_state_t *sync, bool refresh)
 Add a new cookie packet ctx to the pending list. More...
 
int ldap_sync_entry_send (sync_state_t *sync, uint8_t const uuid[SYNC_UUID_LENGTH], struct berval *orig_dn, LDAPMessage *msg, sync_op_t op)
 Enqueue a new entry change packet. More...
 
static int ldap_sync_entry_send_network (sync_packet_ctx_t *sync_packet_ctx)
 Send a change packet to the workers. More...
 
static void ldap_sync_retry_event (fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
 Event to handle sending of any change packets which failed to send. More...
 
static void mod_event_list_set (fr_listen_t *li, fr_event_list_t *el, void *nr)
 Callback triggered when parent listener app_io has its event list set. More...
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static int proto_ldap_child_mod_close (fr_listen_t *li)
 Child listener mod_close. More...
 
static ssize_t proto_ldap_child_mod_read (fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, UNUSED uint8_t *buffer, UNUSED size_t buffer_len, UNUSED size_t *leftover)
 LDAP sync mod_read for child listener. More...
 
static ssize_t proto_ldap_child_mod_write (fr_listen_t *li, void *packet_ctx, UNUSED fr_time_t request_time, uint8_t *buffer, size_t buffer_len, UNUSED size_t written)
 LDAP sync mod_write for child listener. More...
 
static void proto_ldap_connection_init (UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *user_ctx)
 Attempt to (re)initialise a connection. More...
 
static void proto_ldap_cookie_load_retry (fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
 Timer event to retry running "load Cookie" on failures. More...
 
static int proto_ldap_cookie_load_send (TALLOC_CTX *ctx, proto_ldap_sync_ldap_t const *inst, size_t sync_no, proto_ldap_sync_ldap_thread_t *thread)
 Send a fake packet to run the "load Cookie" section. More...
 
sync_state_tsync_state_alloc (TALLOC_CTX *ctx, fr_ldap_connection_t *conn, proto_ldap_sync_t const *inst, size_t sync_no, sync_config_t const *config)
 Allocate a sync state. More...
 
int8_t sync_state_cmp (void const *one, void const *two)
 Compare two sync state structures on msgid. More...
 
static int sync_state_free (sync_state_t *sync)
 Tell the remote server to stop the sync. More...
 

Variables

static fr_dict_attr_t const * attr_ldap_sync_base_dn
 
static fr_dict_attr_t const * attr_ldap_sync_cookie
 
static fr_dict_attr_t const * attr_ldap_sync_entry_dn
 
static fr_dict_attr_t const * attr_ldap_sync_entry_uuid
 
static fr_dict_attr_t const * attr_ldap_sync_orig_dn
 
static fr_dict_attr_t const * attr_ldap_sync_packet_id
 
static fr_dict_attr_t const * attr_ldap_sync_root_dn
 
static fr_dict_attr_t const * attr_packet_type
 
static fr_dict_t const * dict_freeradius
 
static fr_dict_t const * dict_ldap_sync
 
static fr_internal_encode_ctx_t encode_ctx = { .allow_name_only = true }
 
fr_app_io_t proto_ldap_sync_child
 
fr_app_io_t proto_ldap_sync_ldap
 
static conf_parser_t const proto_ldap_sync_ldap_config []
 
fr_dict_autoload_t proto_ldap_sync_ldap_dict []
 
fr_dict_attr_autoload_t proto_ldap_sync_ldap_dict_attr []
 
global_lib_autoinst_t const * proto_ldap_sync_ldap_lib []
 
fr_table_num_sorted_t const sync_op_table []
 Operations performed on entries. More...
 
size_t sync_op_table_len = NUM_ELEMENTS(sync_op_table)
 
static fr_ldap_sync_packet_code_t const sync_packet_code_table [4]
 

Detailed Description

LDAP sync handler.

Id
8c0d0e0866b5c80b14aabab813f319048c0e8ea7

Definition in file proto_ldap_sync_ldap.c.


Data Structure Documentation

◆ proto_ldap_cookie_load_retry_ctx

struct proto_ldap_cookie_load_retry_ctx

Context for "load Cookie" retry timed event.

Definition at line 128 of file proto_ldap_sync_ldap.c.

+ Collaboration diagram for proto_ldap_cookie_load_retry_ctx:
Data Fields
proto_ldap_sync_ldap_t const * inst
size_t sync_no
proto_ldap_sync_ldap_thread_t * thread

◆ proto_ldap_dir_ctx

struct proto_ldap_dir_ctx

Context used when looking up Directory types.

Definition at line 119 of file proto_ldap_sync_ldap.c.

+ Collaboration diagram for proto_ldap_dir_ctx:
Data Fields
fr_listen_t * child_listen
connection_t * conn
fr_listen_t * main_listen
int msgid

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   "proto_ldap_sync_ldap"

Definition at line 26 of file proto_ldap_sync_ldap.c.

Function Documentation

◆ _proto_ldap_socket_closed()

static void _proto_ldap_socket_closed ( UNUSED connection_t conn,
connection_state_t  prev,
UNUSED connection_state_t  state,
void *  uctx 
)
static

Callback for closure of LDAP connection.

Schedules re-start of the connection if appropriate

Definition at line 1154 of file proto_ldap_sync_ldap.c.

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

◆ _proto_ldap_socket_init()

static void _proto_ldap_socket_init ( connection_t conn,
UNUSED connection_state_t  prev,
UNUSED connection_state_t  state,
void *  uctx 
)
static

Allocate a child listener.

Called as a watch function when the LDAP connection enters the INIT state

Definition at line 1126 of file proto_ldap_sync_ldap.c.

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

◆ _proto_ldap_socket_open_connected()

static void _proto_ldap_socket_open_connected ( connection_t conn,
UNUSED connection_state_t  prev,
UNUSED connection_state_t  state,
void *  uctx 
)
static

Query an LDAP server to establish its type.

Called as a watch function once the LDAP connection enters the CONNECTED state

There are three different forms of LDAP sync/persistent search - so we need to know what we're dealing with, and whether the relevant options have been enabled.

Definition at line 1181 of file proto_ldap_sync_ldap.c.

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

◆ _proto_ldap_socket_open_error()

static void _proto_ldap_socket_open_error ( UNUSED fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
UNUSED int  fd_errno,
void *  uctx 
)
static

Callback for socket errors when running initial root query.

Definition at line 1044 of file proto_ldap_sync_ldap.c.

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

◆ _proto_ldap_socket_open_read()

static void _proto_ldap_socket_open_read ( fr_event_list_t el,
int  fd,
UNUSED int  flags,
void *  uctx 
)
static

Callback to process results of initial root query, identifying directory type.

Definition at line 1056 of file proto_ldap_sync_ldap.c.

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

◆ ldap_sync_cookie_event()

void ldap_sync_cookie_event ( fr_event_list_t el,
UNUSED fr_time_t  now,
void *  uctx 
)

Event to handle storing of cookies on a timed basis.

Looks at the head of the list of pending sync packets for a cookie. A cookie at the head says that all the previous changes have been completed, so the cookie can be sent.

Definition at line 255 of file proto_ldap_sync_ldap.c.

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

◆ ldap_sync_cookie_send()

int ldap_sync_cookie_send ( sync_packet_ctx_t sync_packet_ctx)

Enqueue a new cookie store packet.

Create a new internal packet containing the cookie we received from the LDAP server. This allows the administrator to store the cookie and provide it on a future call to load Cookie.

Parameters
[in]sync_packet_ctxpacket context containing the cookie to store.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 286 of file proto_ldap_sync_ldap.c.

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

◆ ldap_sync_cookie_store()

int ldap_sync_cookie_store ( sync_state_t sync,
bool  refresh 
)

Add a new cookie packet ctx to the pending list.

Does not actually send the packet.

Parameters
[in]syncthe cookie was received for.
[in]refreshthe sync after storing this cookie.
Returns
  • 0 on success.
  • -1 on failure

Definition at line 228 of file proto_ldap_sync_ldap.c.

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

◆ ldap_sync_entry_send()

int ldap_sync_entry_send ( sync_state_t sync,
uint8_t const  uuid[SYNC_UUID_LENGTH],
struct berval *  orig_dn,
LDAPMessage *  msg,
sync_op_t  op 
)

Enqueue a new entry change packet.

Parameters
[in]syncnotification has arrived for.
[in]uuidof the entry (RFC 4533 only).
[in]orig_dnoriginal DN of the entry - provided by those directories implementing persistent search, when an entry is renamed.
[in]msgcontaining the entry.
[in]opThe type of modification we need to perform to our representation of the entry.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 419 of file proto_ldap_sync_ldap.c.

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

◆ ldap_sync_entry_send_network()

static int ldap_sync_entry_send_network ( sync_packet_ctx_t sync_packet_ctx)
static

Send a change packet to the workers.

Called each time a change packet is received and also from a timer event retrying packets which previously failed to send.

Parameters
sync_packet_ctxPacket to send
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 351 of file proto_ldap_sync_ldap.c.

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

◆ ldap_sync_retry_event()

static void ldap_sync_retry_event ( fr_event_list_t el,
UNUSED fr_time_t  now,
void *  uctx 
)
static

Event to handle sending of any change packets which failed to send.

Looks at the head of the list of pending sync packets for unsent change packets and sends any up to the first cookie.

Definition at line 374 of file proto_ldap_sync_ldap.c.

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

◆ mod_event_list_set()

static void mod_event_list_set ( fr_listen_t li,
fr_event_list_t el,
void *  nr 
)
static

Callback triggered when parent listener app_io has its event list set.

Initiates the actual outbound LDAP connection

Parameters
[in]liThe parent listener.
[in]elEvent list for this listener.
[in]nrNetwork handler.

Definition at line 1258 of file proto_ldap_sync_ldap.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 1278 of file proto_ldap_sync_ldap.c.

+ Here is the call graph for this function:

◆ proto_ldap_child_mod_close()

static int proto_ldap_child_mod_close ( fr_listen_t li)
static

Child listener mod_close.

Ensures the LDAP connection is signalled to close gracefully when the listener is closed.

Definition at line 585 of file proto_ldap_sync_ldap.c.

+ Here is the call graph for this function:

◆ proto_ldap_child_mod_read()

static ssize_t proto_ldap_child_mod_read ( fr_listen_t li,
UNUSED void **  packet_ctx,
UNUSED fr_time_t recv_time_p,
UNUSED uint8_t buffer,
UNUSED size_t  buffer_len,
UNUSED size_t leftover 
)
static

LDAP sync mod_read for child listener.

Called when there is data to read on the LDAP connection

Actual packets are created by the various callbacks since a single LDAP message can result in multiple packets to process e.g.:

  • Sync Info Message with syncInfoValue of syncIdSet can reference multiple directory entries.
  • Various sync related messages can include a new cookie in addition to their other data.

Definition at line 605 of file proto_ldap_sync_ldap.c.

+ Here is the call graph for this function:

◆ proto_ldap_child_mod_write()

static ssize_t proto_ldap_child_mod_write ( fr_listen_t li,
void *  packet_ctx,
UNUSED fr_time_t  request_time,
uint8_t buffer,
size_t  buffer_len,
UNUSED size_t  written 
)
static

LDAP sync mod_write for child listener.

Handle any returned data after the worker has processed the packet and, for packets where tracking structures were used, ensure they are freed.

Definition at line 877 of file proto_ldap_sync_ldap.c.

+ Here is the call graph for this function:

◆ proto_ldap_connection_init()

static void proto_ldap_connection_init ( UNUSED fr_event_list_t el,
UNUSED fr_time_t  now,
void *  user_ctx 
)
static

Attempt to (re)initialise a connection.

Performs complete re-initialization of a connection. Called during socket_open to create the initial connection and again any time we need to reopen the connection.

Parameters
[in]elthe event list managing listen event.
[in]nowcurrent time.
[in]user_ctxListener.

Definition at line 539 of file proto_ldap_sync_ldap.c.

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

◆ proto_ldap_cookie_load_retry()

static void proto_ldap_cookie_load_retry ( fr_event_list_t el,
UNUSED fr_time_t  now,
void *  uctx 
)
static

Timer event to retry running "load Cookie" on failures.

Definition at line 855 of file proto_ldap_sync_ldap.c.

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

◆ proto_ldap_cookie_load_send()

static int proto_ldap_cookie_load_send ( TALLOC_CTX *  ctx,
proto_ldap_sync_ldap_t const *  inst,
size_t  sync_no,
proto_ldap_sync_ldap_thread_t thread 
)
static

Send a fake packet to run the "load Cookie" section.

Parameters
ctxContext to allocate temporary pairs in.
instLDAP sync configuration.
sync_noId of the sync whose.
threadThread specific LDAP sync data.
Returns
  • 0 on success
  • -1 on failure

Definition at line 771 of file proto_ldap_sync_ldap.c.

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

◆ sync_state_alloc()

sync_state_t* sync_state_alloc ( TALLOC_CTX *  ctx,
fr_ldap_connection_t conn,
proto_ldap_sync_t const *  inst,
size_t  sync_no,
sync_config_t const *  config 
)

Allocate a sync state.

Parameters
[in]ctxto allocate the sync state in.
[in]connwhich the sync will run on.
[in]instmodule instance for the sync.
[in]sync_nonumber of the sync in the array of configs.
[in]configfor the sync.
Returns
new sync state.

Definition at line 188 of file proto_ldap_sync_ldap.c.

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

◆ sync_state_cmp()

int8_t sync_state_cmp ( void const *  one,
void const *  two 
)

Compare two sync state structures on msgid.

Parameters
[in]onefirst sync to compare.
[in]twosecond sync to compare.
Returns
CMP(one, two)

Definition at line 140 of file proto_ldap_sync_ldap.c.

+ Here is the caller graph for this function:

◆ sync_state_free()

static int sync_state_free ( sync_state_t sync)
static

Tell the remote server to stop the sync.

Terminates the search informing the remote server that we no longer want to receive results for this sync. A RFC 4511 abandon request is used to inform the server.

This allows individual syncs to be stopped without destroying the underlying connection.

Removes the sync's msgid from the tree of msgids associated with the connection.

Parameters
[in]syncto abandon.
Returns
0

Definition at line 159 of file proto_ldap_sync_ldap.c.

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

Variable Documentation

◆ attr_ldap_sync_base_dn

fr_dict_attr_t const* attr_ldap_sync_base_dn
static

Definition at line 86 of file proto_ldap_sync_ldap.c.

◆ attr_ldap_sync_cookie

fr_dict_attr_t const* attr_ldap_sync_cookie
static

Definition at line 80 of file proto_ldap_sync_ldap.c.

◆ attr_ldap_sync_entry_dn

fr_dict_attr_t const* attr_ldap_sync_entry_dn
static

Definition at line 81 of file proto_ldap_sync_ldap.c.

◆ attr_ldap_sync_entry_uuid

fr_dict_attr_t const* attr_ldap_sync_entry_uuid
static

Definition at line 82 of file proto_ldap_sync_ldap.c.

◆ attr_ldap_sync_orig_dn

fr_dict_attr_t const* attr_ldap_sync_orig_dn
static

Definition at line 83 of file proto_ldap_sync_ldap.c.

◆ attr_ldap_sync_packet_id

fr_dict_attr_t const* attr_ldap_sync_packet_id
static

Definition at line 79 of file proto_ldap_sync_ldap.c.

◆ attr_ldap_sync_root_dn

fr_dict_attr_t const* attr_ldap_sync_root_dn
static

Definition at line 84 of file proto_ldap_sync_ldap.c.

◆ attr_packet_type

fr_dict_attr_t const* attr_packet_type
static

Definition at line 85 of file proto_ldap_sync_ldap.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 70 of file proto_ldap_sync_ldap.c.

◆ dict_ldap_sync

fr_dict_t const* dict_ldap_sync
static

Definition at line 69 of file proto_ldap_sync_ldap.c.

◆ encode_ctx

fr_internal_encode_ctx_t encode_ctx = { .allow_name_only = true }
static

Definition at line 44 of file proto_ldap_sync_ldap.c.

◆ proto_ldap_sync_child

fr_app_io_t proto_ldap_sync_child
Initial value:
= {
.common = {
.name = "ldap_sync_child"
},
.default_message_size = 4096,
.track_duplicates = false,
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
static int proto_ldap_child_mod_close(fr_listen_t *li)
Child listener mod_close.
static ssize_t proto_ldap_child_mod_read(fr_listen_t *li, UNUSED void **packet_ctx, UNUSED fr_time_t *recv_time_p, UNUSED uint8_t *buffer, UNUSED size_t buffer_len, UNUSED size_t *leftover)
LDAP sync mod_read for child listener.
static ssize_t proto_ldap_child_mod_write(fr_listen_t *li, void *packet_ctx, UNUSED fr_time_t request_time, uint8_t *buffer, size_t buffer_len, UNUSED size_t written)
LDAP sync mod_write for child listener.

Definition at line 1315 of file proto_ldap_sync_ldap.c.

◆ proto_ldap_sync_ldap

fr_app_io_t proto_ldap_sync_ldap
Initial value:
= {
.common = {
.name = "ldap_sync_ldap",
.inst_size = sizeof(proto_ldap_sync_ldap_t),
.thread_inst_size = sizeof(proto_ldap_sync_ldap_thread_t),
.instantiate = mod_instantiate
},
.default_message_size = 4096,
.track_duplicates = false,
.event_list_set = mod_event_list_set,
}
static void mod_event_list_set(fr_listen_t *li, fr_event_list_t *el, void *nr)
Callback triggered when parent listener app_io has its event list set.
static conf_parser_t const proto_ldap_sync_ldap_config[]
static int mod_instantiate(module_inst_ctx_t const *mctx)

Definition at line 1328 of file proto_ldap_sync_ldap.c.

◆ proto_ldap_sync_ldap_config

conf_parser_t const proto_ldap_sync_ldap_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("max_outstanding", proto_ldap_sync_ldap_t, max_outstanding), .dflt = "65536" },
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:627
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:268
#define FR_CONF_OFFSET_IS_SET(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct,...
Definition: cf_parse.h:282
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:256
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition: cf_parse.h:405
static int max_outstanding
Definition: channel_test.c:51
#define FR_LDAP_COMMON_CONF(_conf)
Definition: conf.h:19
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99

Definition at line 49 of file proto_ldap_sync_ldap.c.

◆ proto_ldap_sync_ldap_dict

fr_dict_autoload_t proto_ldap_sync_ldap_dict
Initial value:
= {
{ .out = &dict_ldap_sync, .proto = "ldap" },
{ .out = &dict_freeradius, .proto = "freeradius" },
{ NULL }
}
static fr_dict_t const * dict_ldap_sync
static fr_dict_t const * dict_freeradius

Definition at line 73 of file proto_ldap_sync_ldap.c.

◆ proto_ldap_sync_ldap_dict_attr

fr_dict_attr_autoload_t proto_ldap_sync_ldap_dict_attr
Initial value:
= {
{ .out = &attr_ldap_sync_packet_id, .name = "Sync-Packet-ID", .type = FR_TYPE_UINT32, .dict = &dict_ldap_sync },
{ .out = &attr_ldap_sync_cookie, .name = "LDAP-Sync.Cookie", .type = FR_TYPE_OCTETS, .dict = &dict_ldap_sync },
{ .out = &attr_ldap_sync_entry_dn, .name = "LDAP-Sync.Entry-DN", .type = FR_TYPE_STRING, .dict = &dict_ldap_sync },
{ .out = &attr_ldap_sync_entry_uuid, .name = "LDAP-Sync.Entry-UUID", .type = FR_TYPE_OCTETS, .dict = &dict_ldap_sync },
{ .out = &attr_ldap_sync_orig_dn, .name = "LDAP-Sync.Original-DN", .type = FR_TYPE_STRING, .dict = &dict_ldap_sync },
{ .out = &attr_ldap_sync_root_dn, .name = "LDAP-Sync.Directory-Root-DN", .type = FR_TYPE_STRING, .dict = &dict_ldap_sync },
{ .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_ldap_sync },
{ .out = &attr_ldap_sync_base_dn, .name = "LDAP-Sync-Base-DN", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84
static fr_dict_attr_t const * attr_packet_type
static fr_dict_attr_t const * attr_ldap_sync_packet_id
static fr_dict_attr_t const * attr_ldap_sync_entry_dn
static fr_dict_attr_t const * attr_ldap_sync_base_dn
static fr_dict_attr_t const * attr_ldap_sync_orig_dn
static fr_dict_attr_t const * attr_ldap_sync_root_dn
static fr_dict_attr_t const * attr_ldap_sync_entry_uuid
static fr_dict_attr_t const * attr_ldap_sync_cookie

Definition at line 89 of file proto_ldap_sync_ldap.c.

◆ proto_ldap_sync_ldap_lib

global_lib_autoinst_t const * proto_ldap_sync_ldap_lib
Initial value:
= {
}
#define GLOBAL_LIB_TERMINATOR
Definition: global_lib.h:51
global_lib_autoinst_t fr_libldap_global_config
Definition: base.c:134

Definition at line 102 of file proto_ldap_sync_ldap.c.

◆ sync_op_table

fr_table_num_sorted_t const sync_op_table[]
Initial value:
= {
{ L("add"), SYNC_OP_ADD },
{ L("delete"), SYNC_OP_DELETE },
{ L("modify"), SYNC_OP_MODIFY },
{ L("present"), SYNC_OP_PRESENT },
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition: build.h:207
@ 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.
@ SYNC_OP_PRESENT
Entry is present and unchanged on the server.

Operations performed on entries.

Definition at line 109 of file proto_ldap_sync_ldap.c.

◆ sync_op_table_len

size_t sync_op_table_len = NUM_ELEMENTS(sync_op_table)

Definition at line 115 of file proto_ldap_sync_ldap.c.

◆ sync_packet_code_table

fr_ldap_sync_packet_code_t const sync_packet_code_table[4]
static
Initial value:
= {
}
@ FR_LDAP_SYNC_CODE_PRESENT
LDAP server indicates a particular object is present and unchanged.
Definition: sync.h:33
@ FR_LDAP_SYNC_CODE_ADD
Object has been added to the LDAP directory.
Definition: sync.h:36
@ FR_LDAP_SYNC_CODE_DELETE
Object has been deleted.
Definition: sync.h:40
@ FR_LDAP_SYNC_CODE_MODIFY
Object has been modified.
Definition: sync.h:38

Definition at line 399 of file proto_ldap_sync_ldap.c.