Annotation of Net2/netiso/iso_proto.c, revision 1.1.1.3

1.1       root        1: /*-
                      2:  * Copyright (c) 1991 The Regents of the University of California.
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms, with or without
                      6:  * modification, are permitted provided that the following conditions
                      7:  * are met:
                      8:  * 1. Redistributions of source code must retain the above copyright
                      9:  *    notice, this list of conditions and the following disclaimer.
                     10:  * 2. Redistributions in binary form must reproduce the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer in the
                     12:  *    documentation and/or other materials provided with the distribution.
                     13:  * 3. All advertising materials mentioning features or use of this software
                     14:  *    must display the following acknowledgement:
                     15:  *     This product includes software developed by the University of
                     16:  *     California, Berkeley and its contributors.
                     17:  * 4. Neither the name of the University nor the names of its contributors
                     18:  *    may be used to endorse or promote products derived from this software
                     19:  *    without specific prior written permission.
                     20:  *
                     21:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     22:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     23:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     24:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     25:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     26:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     27:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     28:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     29:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     30:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     31:  * SUCH DAMAGE.
                     32:  *
1.1.1.3 ! root       33:  *     from: @(#)iso_proto.c   7.8 (Berkeley) 5/6/91
        !            34:  *     iso_proto.c,v 1.2 1993/05/20 05:27:21 cgd Exp
1.1       root       35:  */
                     36: 
                     37: /***********************************************************
                     38:                Copyright IBM Corporation 1987
                     39: 
                     40:                       All Rights Reserved
                     41: 
                     42: Permission to use, copy, modify, and distribute this software and its 
                     43: documentation for any purpose and without fee is hereby granted, 
                     44: provided that the above copyright notice appear in all copies and that
                     45: both that copyright notice and this permission notice appear in 
                     46: supporting documentation, and that the name of IBM not be
                     47: used in advertising or publicity pertaining to distribution of the
                     48: software without specific, written prior permission.  
                     49: 
                     50: IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
                     51: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
                     52: IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
                     53: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
                     54: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
                     55: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
                     56: SOFTWARE.
                     57: 
                     58: ******************************************************************/
                     59: 
                     60: /*
                     61:  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
                     62:  */
1.1.1.3 ! root       63: /* iso_proto.c : protocol switch tables in the ISO domain
1.1       root       64:  *
                     65:  * ISO protocol family includes TP, CLTP, CLNP, 8208
                     66:  * TP and CLNP are implemented here.
                     67:  */
                     68: 
                     69: #ifdef ISO
                     70: #include "types.h"
                     71: #include "param.h"
                     72: #include "socket.h"
                     73: #include "protosw.h"
                     74: #include "domain.h"
                     75: #include "mbuf.h"
                     76: 
                     77: #include "iso.h"
                     78: 
                     79: int clnp_output(), clnp_init(),clnp_slowtimo(),clnp_drain();
                     80: int rclnp_input(), rclnp_output(), rclnp_ctloutput(), raw_usrreq();
                     81: int    clnp_usrreq();
                     82: 
                     83: int    tp_ctloutput();
                     84: int    tpclnp_ctlinput();
                     85: int    tpclnp_input();
                     86: int    tp_usrreq();
                     87: int    tp_init(), tp_slowtimo(), tp_drain();
                     88: int    cons_init(), tpcons_input();
                     89: 
                     90: int    esis_input(), esis_ctlinput(), esis_init(), esis_usrreq();
                     91: int    cltp_input(), cltp_ctlinput(), cltp_init(), cltp_usrreq(), cltp_output();
                     92: int isis_input();
                     93: 
                     94: struct protosw isosw[] = {
                     95: /*
                     96:  *  We need a datagram entry through which net mgmt programs can get
                     97:  *     to the iso_control procedure (iso ioctls). Thus, a minimal
                     98:  *     SOCK_DGRAM interface is provided here.
                     99:  *  THIS ONE MUST BE FIRST: Kludge city : socket() says if(!proto) call
                    100:  *  pffindtype, which gets the first entry that matches the type.
                    101:  *  sigh.
                    102:  */
                    103: { SOCK_DGRAM,  &isodomain,             ISOPROTO_CLTP,          PR_ATOMIC|PR_ADDR,
                    104:        0,                      cltp_output,    0,                                      0,
                    105:        cltp_usrreq,
                    106:        cltp_init,      0,                              0,                                      0
                    107: },
                    108: 
                    109: /*
                    110:  *     A datagram interface for clnp cannot co-exist with TP/CLNP
                    111:  *  because CLNP has no way to discriminate incoming TP packets from
                    112:  *  packets coming in for any other higher layer protocol.
                    113:  *  Old way: set it up so that pffindproto(... dgm, clnp) fails.
                    114:  *  New way: let pffindproto work (for x.25, thank you) but create
                    115:  *     a clnp_usrreq() that returns error on PRU_ATTACH.
                    116:  */
                    117: {SOCK_DGRAM,   &isodomain,             ISOPROTO_CLNP,          0,
                    118:  0,                            clnp_output,    0,                                      0,
                    119:  clnp_usrreq,
                    120:  clnp_init,            0,                              clnp_slowtimo,          clnp_drain,
                    121: },
                    122: 
                    123: /* raw clnp */
                    124: { SOCK_RAW,            &isodomain,             ISOPROTO_RAW,           PR_ATOMIC|PR_ADDR,
                    125:   rclnp_input, rclnp_output,   0,                                      rclnp_ctloutput,
                    126:   clnp_usrreq,
                    127:   0,                   0,                              0,                                      0
                    128: },
                    129: 
                    130: /* ES-IS protocol */
                    131: { SOCK_DGRAM,  &isodomain,             ISOPROTO_ESIS,          PR_ATOMIC|PR_ADDR,
                    132:   esis_input,  0,                              esis_ctlinput,          0,
                    133:   esis_usrreq,
                    134:   esis_init,   0,                              0,                                      0
                    135: },
                    136: 
                    137: /* ISOPROTO_INTRAISIS */
                    138: { SOCK_DGRAM,  &isodomain,             ISOPROTO_INTRAISIS,     PR_ATOMIC|PR_ADDR,
                    139:   isis_input,  0,                              0,                                      0,
                    140:   esis_usrreq,
                    141:   0,                   0,                              0,                                      0
                    142: },
                    143: 
                    144: /* ISOPROTO_TP */
                    145: { SOCK_SEQPACKET,      &isodomain,     ISOPROTO_TP,            PR_CONNREQUIRED|PR_WANTRCVD,
                    146:   tpclnp_input,                0,                      tpclnp_ctlinput,        tp_ctloutput,
                    147:   tp_usrreq,
                    148:   tp_init,                     0,                      tp_slowtimo,            tp_drain,
                    149: },
                    150: 
                    151: #ifdef TPCONS
                    152: /* ISOPROTO_TP */
                    153: { SOCK_SEQPACKET,      &isodomain,     ISOPROTO_TP0,           PR_CONNREQUIRED|PR_WANTRCVD,
                    154:   tpcons_input,                0,                      0,                                      tp_ctloutput,
                    155:   tp_usrreq,
                    156:   cons_init,           0,                      0,                                      0,
                    157: },
                    158: #endif
                    159: 
                    160: };
                    161: 
                    162: int    iso_init();
                    163: 
                    164: struct domain isodomain = {
                    165:     AF_ISO,                    /* family */
                    166:        "iso-domain",           /* name */
                    167:        iso_init,                       /* initialize routine */
                    168:        0,                                      /* externalize access rights */
                    169:        0,                                      /* dispose of internalized rights */
                    170:        isosw,                          /* protosw */
                    171:        &isosw[sizeof(isosw)/sizeof(isosw[0])] /* NPROTOSW */
                    172: };
                    173: #endif ISO

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.