Start development on 386BSD 0.0
[unix-history] / .ref-BSD-4_3_Net_2 / usr / src / contrib / isode / quipu / conn_dispatch.c
CommitLineData
9e8e5516
C
1/* conn_dispatch.c - deal with an event on an open connection */
2
3#ifndef lint
4static char *rcsid = "$Header: /f/osi/quipu/RCS/conn_dispatch.c,v 7.2 91/02/22 09:38:28 mrose Interim $";
5#endif
6
7/*
8 * $Header: /f/osi/quipu/RCS/conn_dispatch.c,v 7.2 91/02/22 09:38:28 mrose Interim $
9 *
10 *
11 * $Log: conn_dispatch.c,v $
12 * Revision 7.2 91/02/22 09:38:28 mrose
13 * Interim 6.8
14 *
15 * Revision 7.1 90/10/17 11:53:20 mrose
16 * sync
17 *
18 * Revision 7.0 89/11/23 22:16:44 mrose
19 * Release 6.0
20 *
21 */
22
23/*
24 * NOTICE
25 *
26 * Acquisition, use, and distribution of this module and related
27 * materials are subject to the restrictions of a license agreement.
28 * Consult the Preface in the User's Manual for the full terms of
29 * this agreement.
30 *
31 */
32
33
34#include "quipu/dsap.h"
35#include "tsap.h"
36#include "quipu/util.h"
37#include "quipu/connection.h"
38
39extern LLog * log_dsap;
40
41/*
42* Something has happened on the association with descriptor "ad".
43* Check what type of activity it is and dispatch to an appropriate
44* routine to handle the activity.
45*/
46conn_dispatch(cn)
47struct connection * cn;
48{
49 int result;
50 struct DSAPindication di_s;
51 struct DSAPindication *di = &di_s;
52 struct DSAPabort *da = &(di->di_abort);
53 extern void ds_log();
54
55 DLOG (log_dsap,LLOG_TRACE,( "conn_dispatch()"));
56
57 bzero ((char *)di, sizeof di_s);
58
59 result = DWaitRequest(cn->cn_ctx, cn->cn_ad, OK, di);
60
61 if (result == DONE)
62 {
63 /* TIMER expired */
64 return;
65 }
66
67 if (result == NOTOK)
68 {
69 switch(di->di_type)
70 {
71 case DI_PREJECT:
72 DLOG(log_dsap, LLOG_DEBUG, ("conn_dispatch calling oper_preject"));
73 oper_preject(cn, &(di->di_preject));
74 return;
75
76 case DI_ABORT:
77/*
78 ds_log(da, "DWaitRequest");
79*/
80 LLOG(log_dsap, LLOG_NOTICE, ("DWaitRequest - abort"));
81 do_ds_unbind (cn);
82 conn_extract(cn);
83 return;
84
85 default:
86 LLOG (log_dsap,LLOG_EXCEPTIONS,( "Unknown indication type : %d", di->di_type));
87 return;
88 }
89 }
90
91 switch(di->di_type)
92 {
93 case DI_INVOKE:
94 if (task_invoke(cn, &(di->di_invoke)) != OK)
95 {
96 LLOG (log_dsap,LLOG_EXCEPTIONS,("task_invoke failed in conn_dispatch"));
97 }
98 break;
99
100 case DI_RESULT:
101 oper_result(cn, di);
102 break;
103
104 case DI_ERROR:
105 oper_error(cn, di);
106 break;
107
108 case DI_FINISH:
109 conn_finish(cn, &(di->di_finish));
110 break;
111
112 default:
113 LLOG (log_dsap,LLOG_EXCEPTIONS,( "Unknown indication type : %d", di->di_type));
114 break;
115 }
116}
117