1 /* 2 * Copyright (c) University of British Columbia, 1984 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Laboratory for Computation Vision and the Computer Science Department 8 * of the University of British Columbia. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)ccitt_proto.c 7.8 (Berkeley) 12/08/92 13 */ 14 15 #include <sys/param.h> 16 #include <sys/socket.h> 17 #include <sys/protosw.h> 18 #include <sys/domain.h> 19 20 #include <netccitt/x25.h> 21 22 #include <net/radix.h> 23 24 /* 25 * Definitions of protocols supported in the CCITT domain. 26 */ 27 28 extern struct domain ccittdomain; 29 #define DOMAIN &ccittdomain 30 31 #ifdef LLC 32 int llc_output(), llc_ctlinput(), llc_init(), llc_timer(); 33 #endif 34 #ifdef HDLC 35 int hd_output(), hd_ctlinput(), hd_init(), hd_timer(); 36 #endif 37 int pk_usrreq(), pk_timer(), pk_init(), pk_ctloutput(); 38 int pk_input(), pk_ctlinput(); 39 40 struct protosw ccittsw[] = { 41 #ifdef LLC 42 { 0, DOMAIN, IEEEPROTO_802LLC,0, 43 0, llc_output, llc_ctlinput, 0, 44 0, 45 llc_init, 0, llc_timer, 0, 46 }, 47 #endif 48 #ifdef HDLC 49 { 0, DOMAIN, CCITTPROTO_HDLC,0, 50 0, hd_output, hd_ctlinput, 0, 51 0, 52 hd_init, 0, hd_timer, 0, 53 }, 54 #endif 55 { SOCK_STREAM, DOMAIN, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD, 56 pk_input, 0, pk_ctlinput, pk_ctloutput, 57 pk_usrreq, 58 pk_init, 0, pk_timer, 0, 59 } 60 }; 61 62 struct domain ccittdomain = 63 { AF_CCITT, "ccitt", 0, 0, 0, ccittsw, 64 &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])], 0, 65 rn_inithead, 32, sizeof (struct sockaddr_x25) }; 66