From 265261bf600eec6b2ef7da71e4c43036c964d58f Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 22 Jan 2003 14:41:51 +0000 Subject: [PATCH] Added some OpenLDAP extensions for determining ldapi:// sock/peername and whether connection is UDP --- servers/slapd/slapi/slapi.h | 5 ++++- servers/slapd/slapi/slapi_pblock.c | 3 +++ servers/slapd/slapi/slapi_utils.c | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/servers/slapd/slapi/slapi.h b/servers/slapd/slapi/slapi.h index e0c36c1eb4..f367172902 100644 --- a/servers/slapd/slapi/slapi.h +++ b/servers/slapd/slapi/slapi.h @@ -111,9 +111,12 @@ LDAP_BEGIN_DECL #define SLAPI_REQUESTOR_ISUPDATEDN 142 #define SLAPI_IS_REPLICATED_OPERATION SLAPI_REQUESTOR_ISUPDATEDN #define SLAPI_CONN_DN 143 +#define SLAPI_CONN_AUTHTYPE 144 #define SLAPI_CONN_CLIENTIP 145 #define SLAPI_CONN_SERVERIP 146 -#define SLAPI_CONN_AUTHTYPE 144 +#define SLAPI_X_CONN_CLIENTPATH 1300 +#define SLAPI_X_CONN_SERVERPATH 1301 +#define SLAPI_X_CONN_IS_UDP 1302 #define SLAPD_AUTH_NONE "none" #define SLAPD_AUTH_SIMPLE "simple" diff --git a/servers/slapd/slapi/slapi_pblock.c b/servers/slapd/slapi/slapi_pblock.c index 71822447d3..8d20932f09 100644 --- a/servers/slapd/slapi/slapi_pblock.c +++ b/servers/slapd/slapi/slapi_pblock.c @@ -41,6 +41,9 @@ isOkNetscapeParam( int param ) case SLAPI_CONN_AUTHTYPE: case SLAPI_CONN_AUTHMETHOD: case SLAPI_CONN_CERT: + case SLAPI_X_CONN_IS_UDP: + case SLAPI_X_CONN_CLIENTPATH: + case SLAPI_X_CONN_SERVERPATH: case SLAPI_IBM_CONN_DN_ALT: case SLAPI_IBM_CONN_DN_ORIG: case SLAPI_IBM_GSSAPI_CONTEXT: diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index b8356898ea..f61d8b38a4 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -1499,14 +1499,28 @@ int slapi_x_connection_set_pb( Slapi_PBlock *pb, Connection *conn ) rc = slapi_pblock_set( pb, SLAPI_CONN_CLIENTIP, (void *)&conn->c_peer_name.bv_val[3] ); if ( rc != LDAP_SUCCESS ) return rc; + } else if ( strncmp( conn->c_peer_name.bv_val, "PATH=", 5 ) == 0 ) { + rc = slapi_pblock_set( pb, SLAPI_X_CONN_CLIENTPATH, (void *)&conn->c_peer_name.bv_val[5] ); + if ( rc != LDAP_SUCCESS ) + return rc; } if ( strncmp( conn->c_sock_name.bv_val, "IP=", 3 ) == 0 ) { rc = slapi_pblock_set( pb, SLAPI_CONN_SERVERIP, (void *)&conn->c_sock_name.bv_val[3] ); if ( rc != LDAP_SUCCESS ) return rc; + } else if ( strncmp( conn->c_sock_name.bv_val, "PATH=", 5 ) == 0 ) { + rc = slapi_pblock_set( pb, SLAPI_X_CONN_SERVERPATH, (void *)&conn->c_sock_name.bv_val[5] ); + if ( rc != LDAP_SUCCESS ) + return rc; } +#ifdef LDAP_CONNECTIONLESS + rc = slapi_pblock_set( pb, SLAPI_X_CONN_IS_UDP, (void *)conn->c_is_udp ); + if ( rc != LDAP_SUCCESS ) + return rc; +#endif + rc = slapi_pblock_set( pb, SLAPI_CONN_ID, (void *)conn->c_connid ); if ( rc != LDAP_SUCCESS ) return rc; -- 2.39.5