Annotation of kernel/bsd/netiso/iso.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /*-
                     26:  * Copyright (c) 1991, 1993, 1994
                     27:  *     The Regents of the University of California.  All rights reserved.
                     28:  *
                     29:  * Redistribution and use in source and binary forms, with or without
                     30:  * modification, are permitted provided that the following conditions
                     31:  * are met:
                     32:  * 1. Redistributions of source code must retain the above copyright
                     33:  *    notice, this list of conditions and the following disclaimer.
                     34:  * 2. Redistributions in binary form must reproduce the above copyright
                     35:  *    notice, this list of conditions and the following disclaimer in the
                     36:  *    documentation and/or other materials provided with the distribution.
                     37:  * 3. All advertising materials mentioning features or use of this software
                     38:  *    must display the following acknowledgement:
                     39:  *     This product includes software developed by the University of
                     40:  *     California, Berkeley and its contributors.
                     41:  * 4. Neither the name of the University nor the names of its contributors
                     42:  *    may be used to endorse or promote products derived from this software
                     43:  *    without specific prior written permission.
                     44:  *
                     45:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     46:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     47:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     48:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     49:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     50:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     51:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     52:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     53:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     54:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     55:  * SUCH DAMAGE.
                     56:  *
                     57:  *     @(#)iso.h       8.2 (Berkeley) 6/30/94
                     58:  */
                     59: 
                     60: /***********************************************************
                     61:                Copyright IBM Corporation 1987
                     62: 
                     63:                       All Rights Reserved
                     64: 
                     65: Permission to use, copy, modify, and distribute this software and its 
                     66: documentation for any purpose and without fee is hereby granted, 
                     67: provided that the above copyright notice appear in all copies and that
                     68: both that copyright notice and this permission notice appear in 
                     69: supporting documentation, and that the name of IBM not be
                     70: used in advertising or publicity pertaining to distribution of the
                     71: software without specific, written prior permission.  
                     72: 
                     73: IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
                     74: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
                     75: IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
                     76: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
                     77: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
                     78: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
                     79: SOFTWARE.
                     80: 
                     81: ******************************************************************/
                     82: 
                     83: /*
                     84:  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
                     85:  */
                     86: 
                     87: #ifndef __ISO__
                     88: #define __ISO__
                     89: 
                     90: /*
                     91:  *     Return true if this is a multicast address
                     92:  *     This assumes that the bit transmission is lsb first. This 
                     93:  *     assumption is valid for 802.3 but not 802.5. There is a
                     94:  *     kludge to get around this for 802.5 -- see if_lan.c
                     95:  *     where subnetwork header is setup.
                     96:  */
                     97: #define        IS_MULTICAST(snpa)\
                     98:        ((snpa)[0] & 0x01)
                     99:        
                    100: /*
                    101:  * Protocols
                    102:  */
                    103: #define        ISOPROTO_TCP    6               /* IETF experiment */
                    104: #define        ISOPROTO_UDP    17              /* IETF experiment */
                    105: #define        ISOPROTO_TP0    25              /* connection oriented transport protocol */
                    106: #define        ISOPROTO_TP1    26              /* not implemented */
                    107: #define        ISOPROTO_TP2    27              /* not implemented */
                    108: #define        ISOPROTO_TP3    28              /* not implemented */
                    109: #define        ISOPROTO_TP4    29              /* connection oriented transport protocol */
                    110: #define        ISOPROTO_TP             ISOPROTO_TP4     /* tp-4 with negotiation */
                    111: #define        ISOPROTO_CLTP   30              /* connectionless transport (not yet impl.) */
                    112: #define        ISOPROTO_CLNP   31              /* connectionless internetworking protocol */
                    113: #define        ISOPROTO_X25    32              /* cons */
                    114: #define        ISOPROTO_INACT_NL       33      /* inactive network layer! */
                    115: #define        ISOPROTO_ESIS   34              /* ES-IS protocol */
                    116: #define        ISOPROTO_INTRAISIS      35              /* IS-IS protocol */
                    117: #define        ISOPROTO_IDRP   36              /* Interdomain Routing Protocol */
                    118: 
                    119: #define        ISOPROTO_RAW    255             /* raw clnp */
                    120: #define        ISOPROTO_MAX    256
                    121: 
                    122: #define        ISO_PORT_RESERVED               1024
                    123: #define        ISO_PORT_USERRESERVED   5000
                    124: /*
                    125:  * Port/socket numbers: standard network functions
                    126:  * NOT PRESENTLY USED
                    127:  */
                    128: #define        ISO_PORT_MAINT          501
                    129: #define        ISO_PORT_ECHO           507
                    130: #define        ISO_PORT_DISCARD        509
                    131: #define        ISO_PORT_SYSTAT         511
                    132: #define        ISO_PORT_NETSTAT        515
                    133: /*
                    134:  * Port/socket numbers: non-standard application functions
                    135:  */
                    136: #define ISO_PORT_LOGIN         513
                    137: /*
                    138:  * Port/socket numbers: public use
                    139:  */
                    140: #define ISO_PORT_PUBLIC                1024            /* high bit set --> public */
                    141: 
                    142: /*
                    143:  *     Network layer protocol identifiers
                    144:  */
                    145: #define ISO8473_CLNP   0x81
                    146: #define        ISO9542_ESIS    0x82
                    147: #define ISO9542X25_ESIS        0x8a
                    148: #define ISO10589_ISIS          0x83
                    149: #define ISO8878A_CONS          0x84
                    150: #define ISO10747_IDRP          0x85
                    151: 
                    152: 
                    153: #ifndef IN_CLASSA_NET
                    154: #include <netinet/in.h>
                    155: #endif /* IN_CLASSA_NET */
                    156: 
                    157: 
                    158: 
                    159: /* The following looks like a sockaddr
                    160:  * to facilitate using tree lookup routines */
                    161: struct iso_addr {
                    162:        u_char  isoa_len;                                               /* length (in bytes) */
                    163:        char    isoa_genaddr[20];                               /* general opaque address */
                    164: };
                    165: 
                    166: struct sockaddr_iso {
                    167:        u_char                          siso_len;                       /* length */
                    168:        u_char                          siso_family;            /* family */
                    169:        u_char                          siso_plen;                      /* presentation selector length */
                    170:        u_char                          siso_slen;                      /* session selector length */
                    171:        u_char                          siso_tlen;                      /* transport selector length */
                    172:        struct  iso_addr        siso_addr;                      /* network address */
                    173:        u_char                          siso_pad[6];            /* space for gosip v2 sels */
                    174:                                                                                        /* makes struct 32 bytes long */
                    175: };
                    176: #define siso_nlen siso_addr.isoa_len
                    177: #define siso_data siso_addr.isoa_genaddr
                    178: 
                    179: #define TSEL(s) ((caddr_t)((s)->siso_data + (s)->siso_nlen))
                    180: 
                    181: #define SAME_ISOADDR(a, b) \
                    182:        (bcmp((a)->siso_data, (b)->siso_data, (unsigned)(a)->siso_nlen)==0)
                    183: /*
                    184:  * The following are specific values for siso->siso_data[0],
                    185:  * otherwise known as the AFI:
                    186:  */
                    187: #define        AFI_37          0x37    /* bcd of "37" */
                    188: #define AFI_OSINET     0x47    /* bcd of "47" */
                    189: #define AFI_RFC986     0x47    /* bcd of "47" */
                    190: #define        AFI_SNA         0x00    /* SubNetwork Address; invalid really...*/
                    191: 
                    192: #ifdef _KERNEL
                    193: 
                    194: extern int iso_netmatch();
                    195: extern int iso_hash(); 
                    196: extern int iso_addrmatch();
                    197: extern struct iso_ifaddr *iso_iaonnetof();
                    198: extern struct domain isodomain;
                    199: extern struct protosw isosw[];
                    200: 
                    201: #else
                    202: /* user utilities definitions from the iso library */
                    203: 
                    204: #include <sys/cdefs.h>
                    205: 
                    206: __BEGIN_DECLS
                    207: struct iso_addr *iso_addr __P((const char *));
                    208: char *iso_ntoa __P((const struct iso_addr *));
                    209: 
                    210: /* THESE DON'T EXIST YET */
                    211: struct hostent *iso_gethostbyname(), *iso_gethostbyaddr();
                    212: __END_DECLS
                    213: 
                    214: #endif /* KERNEL */
                    215: 
                    216: #define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m))
                    217: #endif /* __ISO__ */

unix.superglobalmegacorp.com

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