|
|
1.1 root 1: /* tp4.h - TP4 abstractions */
2:
3: /*
4: * $Header: /f/osi/h/RCS/tp4.h,v 7.4 90/07/27 08:44:49 mrose Exp $
5: *
6: *
7: * $Log: tp4.h,v $
8: * Revision 7.4 90/07/27 08:44:49 mrose
9: * update
10: *
11: * Revision 7.3 90/02/19 13:09:27 mrose
12: * update
13: *
14: * Revision 7.2 89/12/19 22:26:13 mrose
15: * touch-up
16: *
17: * Revision 7.1 89/12/19 16:18:02 mrose
18: * dgram
19: *
20: * Revision 7.0 89/11/23 21:56:06 mrose
21: * Release 6.0
22: *
23: */
24:
25: /*
26: * NOTICE
27: *
28: * Acquisition, use, and distribution of this module and related
29: * materials are subject to the restrictions of a license agreement.
30: * Consult the Preface in the User's Manual for the full terms of
31: * this agreement.
32: *
33: */
34:
35:
36: #ifndef _TP4_
37: #define _TP4_
38:
39: /* */
40:
41: #ifdef BSD_TP4
42: #ifndef SOCK_STREAM
43: #include <sys/socket.h>
44: #endif
45: #include <netiso/iso.h>
46: #include <netiso/iso_errno.h>
47: #include <netiso/tp_user.h>
48:
49: union sockaddr_osi {
50: struct sockaddr_iso osi_sockaddr;
51: char osi_bigaddr[104];
52: };
53:
54: union osi_control_msg {
55: struct {
56: struct cmsghdr ocm_cmhdr;
57: char ocm_cmdata[128 - sizeof (struct cmsghdr)];
58: } ocm_control;
59:
60: char ocm_data[128];
61: };
62:
63: int gen2tp4 (), tp42gen ();
64:
65:
66: #define CLTS /* have CL-mode transport service */
67:
68: #ifndef _DGRAM_
69: #include "dgram.h"
70: #endif
71:
72: int start_clts_server ();
73: #define start_clts_client start_clts_server
74:
75: #define join_clts_server(fd,sock) \
76: join_dgram_aux ((fd), (struct sockaddr *) (sock), 0)
77: #define join_clts_client(fd,sock) \
78: join_dgram_aux ((fd), (struct sockaddr *) (sock), 1)
79:
80: #define read_clts_socket read_dgram_socket
81: #define write_clts_socket write_dgram_socket
82: #define close_clts_socket close_dgram_socket
83:
84: #define select_clts_socket select_dgram_socket
85: #endif
86:
87: /* SunLink OSI */
88:
89: #ifdef SUN_TP4
90: #if defined(SUNLINK_6_0) && !defined(SUNLINK_5_2)
91: #define SUNLINK_5_2
92: #endif
93:
94: #ifndef SUNLINK_6_0
95: #include <sys/ieee802.h>
96: #else
97: #include <net/if_ieee802.h>
98: #endif
99: #ifndef SOCK_STREAM
100: #include <sys/socket.h>
101: #endif
102: #include <netosi/osi.h>
103: #ifdef SUNLINK_5_2
104: #include <netosi/osi_profile.h>
105: #endif
106: #include <netosi/osi_addr.h>
107: #include <netosi/osi_error.h>
108: #include <netosi/tp_event.h>
109:
110:
111: #define MSG_OOB 0x1 /* process out-of-band data */
112:
113:
114: struct tp4pkt {
115: union {
116: TP_MSG tp_msg;
117: TP_MSG_CONNECT tp_connect;
118: TP_MSG_DATA tp_data;
119: TP_MSG_X_DATA tp_x_data;
120: TP_MSG_DISCONNECT tp_disconnect;
121: } tp_un;
122: #define tp4_event tp_un.tp_msg.tp_event
123: #define tp4_called tp_un.tp_connect.dst_address
124: #define tp4_calling tp_un.tp_connect.src_address
125: #define tp4_expedited tp_un.tp_connect.expedited_selected
126: #define tp4_qos tp_un.tp_connect.tp_qos
127: #define tp4_eot tp_un.tp_data.eot
128: #define tp4_reason tp_un.tp_disconnect.reason
129: };
130:
131: struct tp4pkt *newtp4pkt ();
132: #define freetp4pkt(tp) cfree ((char *) (tp))
133:
134: int gen2tp4 (), tp42gen ();
135: #endif
136:
137: /* */
138:
139: #ifdef BSD_TP4
140: #define close_tp4_socket close
141: #define select_tp4_socket selsocket
142: #endif
143:
144: #ifdef SUN_TP4
145: #define close_tp4_socket close
146: #define select_tp4_socket selsocket
147: #endif
148:
149: int close_tp4_socket ();
150: int select_tp4_socket ();
151:
152: #endif
153:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.