spx.h revision 11819
1/* 2 * Copyright (c) 1995, Mike Mitchell 3 * Copyright (c) 1984, 1985, 1986, 1987, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by the University of 17 * California, Berkeley and its contributors. 18 * 4. Neither the name of the University nor the names of its contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)spx.h 35 */ 36 37#ifndef _NETIPX_SPX_H_ 38#define _NETIPX_SPX_H_ 39 40/* 41 * Definitions for IPX style Sequenced Packet Protocol 42 */ 43 44struct spxhdr { 45 u_char spx_cc; /* connection control */ 46 u_char spx_dt; /* datastream type */ 47#define SPX_SP 0x80 /* system packet */ 48#define SPX_SA 0x40 /* send acknowledgement */ 49#define SPX_OB 0x20 /* attention (out of band data) */ 50#define SPX_EM 0x10 /* end of message */ 51 u_short spx_sid; /* source connection identifier */ 52 u_short spx_did; /* destination connection identifier */ 53 u_short spx_seq; /* sequence number */ 54 u_short spx_ack; /* acknowledge number */ 55 u_short spx_alo; /* allocation number */ 56}; 57 58/* 59 * Definitions for NS(tm) Internet Datagram Protocol 60 * containing a Sequenced Packet Protocol packet. 61 */ 62struct spx { 63 struct ipx si_i; 64 struct spxhdr si_s; 65}; 66struct spx_q { 67 struct spx_q *si_next; 68 struct spx_q *si_prev; 69}; 70#define SI(x) ((struct spx *)x) 71#define si_sum si_i.ipx_sum 72#define si_len si_i.ipx_len 73#define si_tc si_i.ipx_tc 74#define si_pt si_i.ipx_pt 75#define si_dna si_i.ipx_dna 76#define si_sna si_i.ipx_sna 77#define si_sport si_i.ipx_sna.x_port 78#define si_cc si_s.spx_cc 79#define si_dt si_s.spx_dt 80#define si_sid si_s.spx_sid 81#define si_did si_s.spx_did 82#define si_seq si_s.spx_seq 83#define si_ack si_s.spx_ack 84#define si_alo si_s.spx_alo 85 86#ifdef KERNEL 87int spx_reass(), spx_output(); 88int spx_usrreq(), spx_usrreq_sp(), spx_ctloutput(); 89void spx_input(), spx_ctlinput(); 90void spx_init(), spx_fasttimo(), spx_slowtimo(); 91void spx_quench(), spx_setpersist(), spx_template(), spx_abort(); 92struct spxpcb *spx_close(), *spx_usrclosed(); 93struct spxpcb *spx_disconnect(), *spx_drop(); 94struct spxpcb *spx_timers(); 95#endif 96 97#endif 98