X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmain.c;h=b18b8e0e07fd1c11cfff66556160bab076c48ea5;hb=5ed0fc37494b835aeeb39bd55ee6d71cedad8143;hp=97ca93576ee81f3393328814476be3fcf30d8608;hpb=7b65d46b1baa8ceead8c580988be74c1caef7a4b;p=openldap
diff --git a/servers/slapd/main.c b/servers/slapd/main.c
index 97ca93576e..b18b8e0e07 100644
--- a/servers/slapd/main.c
+++ b/servers/slapd/main.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,6 +27,7 @@
#include
+#include
#include
#include
#include
@@ -34,8 +35,6 @@
#include
#include
-#include "ldap_pvt.h"
-
#include "slap.h"
#include "lutil.h"
#include "ldif.h"
@@ -99,38 +98,194 @@ const char Versionstr[] =
OPENLDAP_PACKAGE " " OPENLDAP_VERSION " Standalone LDAP Server (slapd)";
#endif
-#ifdef LOG_LOCAL4
+#define CHECK_NONE 0x00
+#define CHECK_CONFIG 0x01
+#define CHECK_LOGLEVEL 0x02
+static int check = CHECK_NONE;
+static int version = 0;
+
+void *slap_tls_ctx;
+LDAP *slap_tls_ld;
+
+static int
+slapd_opt_slp( const char *val, void *arg )
+{
+#ifdef HAVE_SLP
+ /* NULL is default */
+ if ( val == NULL || *val == '(' || strcasecmp( val, "on" ) == 0 ) {
+ slapd_register_slp = 1;
+ slapd_slp_attrs = (val != NULL && *val == '(') ? val : NULL;
+
+ } else if ( strcasecmp( val, "off" ) == 0 ) {
+ slapd_register_slp = 0;
+
+ /* NOTE: add support for URL specification? */
+
+ } else {
+ fprintf(stderr, "unrecognized value \"%s\" for SLP option\n", val );
+ return -1;
+ }
+
+ return 0;
+
+#else
+ fputs( "slapd: SLP support is not available\n", stderr );
+ return 0;
+#endif
+}
-#define DEFAULT_SYSLOG_USER LOG_LOCAL4
-
-typedef struct _str2intDispatch {
- char *stringVal;
- int abbr;
- int intVal;
-} STRDISP, *STRDISP_P;
-
-
-/* table to compute syslog-options to integer */
-static STRDISP syslog_types[] = {
- { "LOCAL0", sizeof("LOCAL0"), LOG_LOCAL0 },
- { "LOCAL1", sizeof("LOCAL1"), LOG_LOCAL1 },
- { "LOCAL2", sizeof("LOCAL2"), LOG_LOCAL2 },
- { "LOCAL3", sizeof("LOCAL3"), LOG_LOCAL3 },
- { "LOCAL4", sizeof("LOCAL4"), LOG_LOCAL4 },
- { "LOCAL5", sizeof("LOCAL5"), LOG_LOCAL5 },
- { "LOCAL6", sizeof("LOCAL6"), LOG_LOCAL6 },
- { "LOCAL7", sizeof("LOCAL7"), LOG_LOCAL7 },
- { NULL, 0, 0 }
+/*
+ * Option helper structure:
+ *
+ * oh_nam is left-hand part of