No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / openldap / dist / libraries / libldap / cancel.c
blob3d567fc44d99f760a3ee669d50a7460730d09209
1 /* $OpenLDAP: pkg/ldap/libraries/libldap/cancel.c,v 1.10.2.4 2008/02/11 23:26:41 kurt Exp $ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2008 The OpenLDAP Foundation.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
9 * Public License.
11 * A copy of this license is available in the file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
15 /* ACKNOWLEDGEMENTS:
16 * This program was originally developed by Kurt D. Zeilenga for inclusion
17 * in OpenLDAP Software.
21 * LDAPv3 Cancel Operation Request
24 #include "portable.h"
26 #include <stdio.h>
27 #include <ac/stdlib.h>
29 #include <ac/socket.h>
30 #include <ac/string.h>
31 #include <ac/time.h>
33 #include "ldap-int.h"
34 #include "ldap_log.h"
36 int
37 ldap_cancel(
38 LDAP *ld,
39 int cancelid,
40 LDAPControl **sctrls,
41 LDAPControl **cctrls,
42 int *msgidp )
44 BerElement *cancelidber = NULL;
45 struct berval *cancelidvalp = NULL;
46 int rc;
48 cancelidber = ber_alloc_t( LBER_USE_DER );
49 ber_printf( cancelidber, "{i}", cancelid );
50 ber_flatten( cancelidber, &cancelidvalp );
51 rc = ldap_extended_operation( ld, LDAP_EXOP_CANCEL,
52 cancelidvalp, sctrls, cctrls, msgidp );
53 ber_free( cancelidber, 1 );
54 return rc;
57 int
58 ldap_cancel_s(
59 LDAP *ld,
60 int cancelid,
61 LDAPControl **sctrls,
62 LDAPControl **cctrls )
64 BerElement *cancelidber = NULL;
65 struct berval *cancelidvalp = NULL;
66 int rc;
68 cancelidber = ber_alloc_t( LBER_USE_DER );
69 ber_printf( cancelidber, "{i}", cancelid );
70 ber_flatten( cancelidber, &cancelidvalp );
71 rc = ldap_extended_operation_s( ld, LDAP_EXOP_CANCEL,
72 cancelidvalp, sctrls, cctrls, NULL, NULL );
73 ber_free( cancelidber, 1 );
74 return rc;