* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/syslog.h>
+
#include <quipu/dsap.h>
#include <quipu/dap2.h>
#include <quipu/dua.h>
-#ifdef __hpux
-#include <syslog.h>
-#else
-#include <sys/syslog.h>
-#endif
+
#include "lber.h"
+#include "../../libraries/liblber/lber-int.h" /* get struct berelement */
#include "ldap.h"
#include "common.h"
-extern int dosyslog;
-#ifdef COMPAT
-extern int ldap_compat;
-#endif
-
/*
* dsa_response - called by do_queries() when there is activity on one of
* the DSA associations. It is passed the association descriptor on which
return;
}
if ( m->m_msgtype == LDAP_REQ_SEARCH
-#ifdef COMPAT20
+#ifdef LDAP_COMPAT20
|| m->m_msgtype == OLD_LDAP_REQ_SEARCH
#endif
)
int bound, rc;
switch ( m->m_msgtype ) {
-#ifdef COMPAT20
+#ifdef LDAP_COMPAT20
case OLD_LDAP_REQ_ADD:
case OLD_LDAP_REQ_MODIFY:
case OLD_LDAP_REQ_MODRDN:
case OLD_LDAP_REQ_COMPARE:
case OLD_LDAP_REQ_SEARCH:
#endif
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
case LDAP_REQ_DELETE_30:
#endif
case LDAP_REQ_ADD:
char *text
)
{
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
if ( m->m_cldap ) {
- SAFEMEMCPY( (char *)sb->sb_useaddr, &m->m_clientaddr,
- sizeof( struct sockaddr ));
+ lber_pvt_sb_udp_set_dst( &sb, &m->m_clientaddr );
+
Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n",
inet_ntoa(((struct sockaddr_in *)
- sb->sb_useaddr)->sin_addr ),
- ((struct sockaddr_in *)sb->sb_useaddr)->sin_port, 0 );
+ &m->m_clientaddr)->sin_addr ),
+ ((struct sockaddr_in *)&m->m_clientaddr)->sin_port, 0 );
}
#endif
return( send_ldap_result( sb, tag, m->m_msgid, err, matched, text ) );
{
BerElement *ber;
int rc;
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
int cldap;
-#endif
- extern int version;
-
-#ifdef CLDAP
- cldap = ( sb->sb_naddr > 0 );
+ cldap = ( sb->sb_io == &lber_pvt_sb_io_udp );
#endif
Debug( LDAP_DEBUG_TRACE, "send_ldap_result\n", 0, 0, 0 );
if ( tag == LBER_DEFAULT )
-#ifdef COMPAT20
+#ifdef LDAP_COMPAT20
tag = ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE;
#else
tag = LBER_SEQUENCE;
}
if ( version != 1 ) {
-#ifdef COMPAT20
+#ifdef LDAP_COMPAT20
if ( ldap_compat == 20 ) {
rc = ber_printf( ber, "t{it{tess}}", OLD_LBER_SEQUENCE,
msgid, tag, LBER_INTEGER, err,
matched ? matched : "", text );
} else
#endif
-#ifdef COMPAT30
+#ifdef LDAP_COMPAT30
if ( ldap_compat == 30 ) {
rc = ber_printf( ber, "{it{{ess}}}", msgid, tag, err,
matched ? matched : "", text );
} else
#endif
-#ifdef CLDAP
+#ifdef LDAP_CONNECTIONLESS
if ( cldap ) {
rc = ber_printf( ber, "{is{t{ess}}}", msgid, "", tag,
err, matched ? matched : "", text );