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