]> git.sur5r.net Git - openldap/blob - servers/ldapd/abandon.c
ITS#2762: header include fix
[openldap] / servers / ldapd / abandon.c
1 /*
2  * Copyright (c) 1990 Regents of the University of Michigan.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of Michigan at Ann Arbor. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  */
12
13 #include <stdio.h>
14 #include <quipu/commonarg.h>
15 #include <quipu/attrvalue.h>
16 #include <quipu/ds_error.h>
17 #include <quipu/abandon.h>
18 #include <quipu/dap2.h>
19 #include <quipu/dua.h>
20 #include <sys/types.h>
21 #include <sys/socket.h>
22 #include "lber.h"
23 #include "ldap.h"
24 #include "common.h"
25
26 do_abandon(
27     struct conn *dsaconn,
28     BerElement  *ber,
29     int         msgid
30 )
31 {
32         int                     id;
33         struct ds_abandon_arg   aa;
34         struct DAPindication    di;
35
36         Debug( LDAP_DEBUG_TRACE, "do_abandon\n", 0, 0 ,0 );
37
38         /*
39          * Parse the abandon request.  It looks like this:
40          *      AbandonRequest := MessageID
41          */
42
43         if ( ber_scanf( ber, "i", &id ) == LBER_ERROR ) {
44                 Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0 ,0 );
45                 return( 0 );
46         }
47
48         Debug( LDAP_DEBUG_ARGS, "do_abandin: id %d\n", id, 0 ,0 );
49
50         aa.aba_invokeid = id;
51
52         Debug( LDAP_DEBUG_TRACE, "DapAbandon...\n", 0, 0 ,0 );
53         if ( DapAbandon( dsaconn->c_ad, msgid, &aa, &di, ROS_ASYNC )
54             == NOTOK ) {
55                 Debug( LDAP_DEBUG_ANY, "DapAbandon failed\n", 0, 0 ,0 );
56                 return( 0 );
57         }
58         Debug( LDAP_DEBUG_TRACE, "DapAbandon completed\n", 0, 0 ,0 );
59
60         return( 0 );
61 }