|
|
1.1 root 1: /***********************************************************
2: Copyright IBM Corporation 1987
3:
4: All Rights Reserved
5:
6: Permission to use, copy, modify, and distribute this software and its
7: documentation for any purpose and without fee is hereby granted,
8: provided that the above copyright notice appear in all copies and that
9: both that copyright notice and this permission notice appear in
10: supporting documentation, and that the name of IBM not be
11: used in advertising or publicity pertaining to distribution of the
12: software without specific, written prior permission.
13:
14: IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16: IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20: SOFTWARE.
21:
22: ******************************************************************/
23:
24: /*
25: * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
26: */
27: /* $Header: iso_proto.c,v 4.4 88/09/08 08:38:42 hagens Exp $
28: * $Source: /usr/argo/sys/netiso/RCS/iso_proto.c,v $
29: * @(#)iso_proto.c 7.6 (Berkeley) 6/22/90 *
30: *
31: * iso_proto.c : protocol switch tables in the ISO domain
32: *
33: * ISO protocol family includes TP, CLTP, CLNP, 8208
34: * TP and CLNP are implemented here.
35: */
36:
37: #ifndef lint
38: static char *rcsid = "$Header: iso_proto.c,v 4.4 88/09/08 08:38:42 hagens Exp $";
39: #endif
40:
41: #ifdef ISO
42: #include "types.h"
43: #include "param.h"
44: #include "socket.h"
45: #include "protosw.h"
46: #include "domain.h"
47: #include "mbuf.h"
48:
49: #include "iso.h"
50:
51: int clnp_output(), clnp_init(),clnp_slowtimo(),clnp_drain();
52: int rclnp_input(), rclnp_output(), rclnp_ctloutput(), raw_usrreq();
53: int clnp_usrreq();
54:
55: int tp_ctloutput();
56: int tpclnp_ctlinput();
57: int tpclnp_input();
58: int tp_usrreq();
59: int tp_init(),tp_slowtimo(),tp_drain();
60:
61: int esis_input(), esis_ctlinput(), esis_init(), esis_usrreq();
62: int cltp_input(), cltp_ctlinput(), cltp_init(), cltp_usrreq(), cltp_output();
63: int isis_input();
64:
65: struct protosw isosw[] = {
66: /*
67: * We need a datagram entry through which net mgmt programs can get
68: * to the iso_control procedure (iso ioctls). Thus, a minimal
69: * SOCK_DGRAM interface is provided here.
70: * THIS ONE MUST BE FIRST: Kludge city : socket() says if(!proto) call
71: * pffindtype, which gets the first entry that matches the type.
72: * sigh.
73: */
74: { SOCK_DGRAM, &isodomain, ISOPROTO_CLTP, PR_ATOMIC|PR_ADDR,
75: 0, cltp_output, 0, 0,
76: cltp_usrreq,
77: cltp_init, 0, 0, 0
78: },
79:
80: /*
81: * A datagram interface for clnp cannot co-exist with TP/CLNP
82: * because CLNP has no way to discriminate incoming TP packets from
83: * packets coming in for any other higher layer protocol.
84: * Old way: set it up so that pffindproto(... dgm, clnp) fails.
85: * New way: let pffindproto work (for x.25, thank you) but create
86: * a clnp_usrreq() that returns error on PRU_ATTACH.
87: */
88: {SOCK_DGRAM, &isodomain, ISOPROTO_CLNP, 0,
89: 0, clnp_output, 0, 0,
90: clnp_usrreq,
91: clnp_init, 0, clnp_slowtimo, clnp_drain,
92: },
93:
94: /* raw clnp */
95: { SOCK_RAW, &isodomain, ISOPROTO_RAW, PR_ATOMIC|PR_ADDR,
96: rclnp_input, rclnp_output, 0, rclnp_ctloutput,
97: clnp_usrreq,
98: 0, 0, 0, 0
99: },
100:
101: /* ES-IS protocol */
102: { SOCK_DGRAM, &isodomain, ISOPROTO_ESIS, PR_ATOMIC|PR_ADDR,
103: esis_input, 0, esis_ctlinput, 0,
104: esis_usrreq,
105: esis_init, 0, 0, 0
106: },
107:
108: /* ISOPROTO_INTRAISIS */
109: { SOCK_DGRAM, &isodomain, ISOPROTO_INTRAISIS, PR_ATOMIC|PR_ADDR,
110: isis_input, 0, 0, 0,
111: esis_usrreq,
112: 0, 0, 0, 0
113: },
114:
115: /* ISOPROTO_TP */
116: { SOCK_SEQPACKET, &isodomain, ISOPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
117: tpclnp_input, 0, tpclnp_ctlinput, tp_ctloutput,
118: tp_usrreq,
119: tp_init, 0, tp_slowtimo, tp_drain,
120: },
121:
122: };
123:
124: int iso_init();
125:
126: struct domain isodomain = {
127: AF_ISO, /* family */
128: "iso-domain", /* name */
129: iso_init, /* initialize routine */
130: 0, /* externalize access rights */
131: 0, /* dispose of internalized rights */
132: isosw, /* protosw */
133: &isosw[sizeof(isosw)/sizeof(isosw[0])] /* NPROTOSW */
134: };
135: #endif ISO
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.