Annotation of XNU/bsd/netiso/iso.h, revision 1.1

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

unix.superglobalmegacorp.com

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