|
|
1.1 root 1: /* plog.c - lower-layer logging routines */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/dsap/net/RCS/plog.c,v 7.0 90/07/26 14:46:10 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/dsap/net/RCS/plog.c,v 7.0 90/07/26 14:46:10 mrose Exp $
9: *
10: *
11: * $Log: plog.c,v $
12: * Revision 7.0 90/07/26 14:46:10 mrose
13: * *** empty log message ***
14: *
15: * Revision 7.1 90/03/15 11:17:45 mrose
16: * quipu-sync
17: *
18: * Revision 7.0 89/11/23 21:48:24 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: /* LINTLIBRARY */
35:
36: #include "quipu/util.h"
37: #include "quipu/dsap.h"
38: #include "tsap.h"
39:
40: extern LLog * log_dsap;
41:
42: SFP abort_vector = NULL;
43:
44:
45: void ros_log(rop, event)
46: register struct RoSAPpreject *rop;
47: char *event;
48: {
49: int level = LLOG_EXCEPTIONS;
50:
51: if ((rop->rop_reason == ROS_TIMER) || (rop->rop_reason == ROS_ACS))
52: level = LLOG_DEBUG;
53:
54: if(rop->rop_cc > 0)
55: LLOG(log_dsap, level, ("%s: [%s] %*.*s", event,
56: RoErrString(rop->rop_reason), rop->rop_cc, rop->rop_cc,
57: rop->rop_data));
58: else
59: LLOG(log_dsap, level, ("%s: [%s]", event, RoErrString(rop->rop_reason)));
60:
61: if (rop -> rop_reason == ROS_CONGEST && abort_vector)
62: (*abort_vector) (-2);
63: }
64:
65: void acs_log(aca, event)
66: register struct AcSAPabort *aca;
67: char *event;
68: {
69: if(aca->aca_cc > 0)
70: LLOG(log_dsap, LLOG_EXCEPTIONS, ("%s: [%s] %*.*s", event,
71: AcErrString(aca->aca_reason),
72: aca->aca_cc, aca->aca_cc, aca->aca_data));
73: else
74: LLOG(log_dsap, LLOG_EXCEPTIONS, ("%s: [%s]", event, AcErrString(aca->aca_reason)));
75:
76: if (aca -> aca_reason == ACS_CONGEST && abort_vector)
77: (*abort_vector) (-2);
78: }
79:
80: td_log(td, event)
81: struct TSAPdisconnect *td;
82: char *event;
83: {
84: if(td->td_cc > 0)
85: {
86: LLOG(log_dsap, LLOG_EXCEPTIONS, ("%s: [%s] %*.*s", event,
87: TErrString(td->td_reason),
88: td->td_cc, td->td_cc, td->td_data));
89: }
90: else
91: {
92: LLOG(log_dsap, LLOG_EXCEPTIONS, ("%s: [%s]", event, TErrString(td->td_reason)));
93: }
94: }
95:
96: int SetROPS(ad)
97: int ad;
98: {
99: struct RoSAPindication roi_s;
100: struct RoSAPindication *roi = &(roi_s);
101: struct RoSAPpreject *rop = &(roi->roi_preject);
102:
103: if(RoSetService(ad, RoPService, roi) != OK)
104: {
105: (void) ros_log(rop, "RoSetService");
106: return NOTOK;
107: }
108: return(OK);
109: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.