1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Bull Inc., 1987                *
 4    *                                                         *
 5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
 6    *                                                         *
 7    *********************************************************** */
 8 
 9 /* HISTORY COMMENTS:
10   1) change(86-07-06,Westcott), approve(87-07-13,MCR7580),
11      audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
12      Created.
13                                                    END HISTORY COMMENTS */
14 
15 /* : PROCEDURE FUNCTION (conresp)
16 
17 Sends a "CONNECT_REPONSE" minor capability message to the addressed major
18 capability. This message is used by the major capability to either accept
19 or reject a requested connection.
20 */
21 
22 #include <stdio.h>
23 #include <ws.h>
24 #include <wsmincap.h>
25 #include <ws_mcb.h>
26 #include <ws_error.h>
27 
28 conresp (p_status, p_cap_num, p_mcb_ptr)
29 
30 int p_status;                          /* WSACCEPT or WSREJECT */
31 int p_cap_num;                         /* Capability number to respond to */
32 mcb *p_mcb_ptr;                        /* MCB of caller */
33 {
34 int sysid;
35 int major;
36 
37 /* : call execap to send message to application */
38 
39    sysid = ((p_cap_num & 0xff00) >> 8);
40    major = (p_cap_num & 0xff);
41 
42    if (p_mcb_ptr == NULL)
43       return (WSINVMCB);
44 
45    if ((sysid != WSIBMPC) && (sysid != WSMULTICS))
46       return(WSINVSYS);
47 
48    if ((major < WSMAJCAP) && (major > MAX_CAPABILITY_NUMBER))
49       return(WSINVNUM);
50 
51    if ((p_status != WSACCEPT) && (p_status != WSREJECT))
52       return (WSINVCON);
53 
54    return (execap (p_cap_num, RESPONSE_CONNECT, &p_status, 1, p_mcb_ptr));
55 }
56 ^Z