Annotation of kernel/bsd/netccitt/x25.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) University of British Columbia, 1984
                     27:  * Copyright (c) 1990, 1992, 1993
                     28:  *     The Regents of the University of California.  All rights reserved.
                     29:  *              University of Erlangen-Nuremberg, Germany, 1992
                     30:  * 
                     31:  * This code is derived from software contributed to Berkeley by the
                     32:  * Laboratory for Computation Vision and the Computer Science Department
                     33:  * of the the University of British Columbia and the Computer Science
                     34:  * Department (IV) of the University of Erlangen-Nuremberg, Germany.
                     35:  *
                     36:  * Redistribution and use in source and binary forms, with or without
                     37:  * modification, are permitted provided that the following conditions
                     38:  * are met:
                     39:  * 1. Redistributions of source code must retain the above copyright
                     40:  *    notice, this list of conditions and the following disclaimer.
                     41:  * 2. Redistributions in binary form must reproduce the above copyright
                     42:  *    notice, this list of conditions and the following disclaimer in the
                     43:  *    documentation and/or other materials provided with the distribution.
                     44:  * 3. All advertising materials mentioning features or use of this software
                     45:  *    must display the following acknowledgement:
                     46:  *     This product includes software developed by the University of
                     47:  *     California, Berkeley and its contributors.
                     48:  * 4. Neither the name of the University nor the names of its contributors
                     49:  *    may be used to endorse or promote products derived from this software
                     50:  *    without specific prior written permission.
                     51:  *
                     52:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     53:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     54:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     55:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     56:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     57:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     58:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     59:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     60:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     61:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     62:  * SUCH DAMAGE.
                     63:  *
                     64:  *     @(#)x25.h       8.1 (Berkeley) 6/10/93
                     65:  */
                     66: 
                     67: #ifdef _KERNEL
                     68: #define PRC_IFUP       3
                     69: #define PRC_LINKUP     4
                     70: #define PRC_LINKDOWN   5
                     71: #define PRC_LINKRESET  6
                     72: #define PRC_LINKDONTCOPY       7
                     73: #ifndef PRC_DISCONNECT_REQUEST  
                     74: #define PRC_DISCONNECT_REQUEST 10
                     75: #endif
                     76: #endif
                     77: 
                     78: #define CCITTPROTO_HDLC                1
                     79: #define CCITTPROTO_X25         2       /* packet level protocol */
                     80: #define IEEEPROTO_802LLC       3       /* doesn't belong here */
                     81: 
                     82: #define HDLCPROTO_LAP          1
                     83: #define HDLCPROTO_LAPB         2
                     84: #define HDLCPROTO_UNSET                3
                     85: #define HDLCPROTO_LAPD         4
                     86: 
                     87: /* socket options */
                     88: #define PK_ACCTFILE            1       /* use level = CCITTPROTO_X25 */
                     89: #define PK_FACILITIES          2       /* use level = CCITTPROTO_X25 */
                     90: #define PK_RTATTACH            3       /* use level = CCITTPROTO_X25 */
                     91: #define PK_PRLISTEN            4       /* use level = CCITTPROTO_X25 */
                     92: 
                     93: #define MAX_FACILITIES         109     /* maximum size for facilities */
                     94: 
                     95: /*
                     96:  *  X.25 Socket address structure.  It contains the  X.121 or variation of
                     97:  *  X.121, facilities information, higher level protocol value (first four
                     98:  *  bytes of the User Data field), and the last  12 characters of the User
                     99:  *  Data field.
                    100:  */
                    101: 
                    102: struct x25_sockaddr {          /* obsolete - use sockaddr_x25 */
                    103:     short  xaddr_len;          /* Length of xaddr_addr.                */
                    104:     u_char xaddr_addr[15];     /* Network dependent or X.121 address.  */
                    105:     u_char xaddr_facilities;   /* Facilities information.              */
                    106: #define XS_REVERSE_CHARGE      0x01
                    107: #define XS_HIPRIO              0x02
                    108:     u_char xaddr_proto[4];     /* Protocol ID (4 bytes of user data).  */
                    109:     u_char xaddr_userdata[12]; /* Remaining User data field.           */
                    110: };
                    111: 
                    112: /*
                    113:  *  X.25 Socket address structure.  It contains the network id, X.121
                    114:  *  address, facilities information, higher level protocol value (first four
                    115:  *  bytes of the User Data field), and up to 12 characters of User Data.
                    116:  */
                    117: 
                    118: struct sockaddr_x25 {
                    119:        u_char  x25_len;
                    120:        u_char  x25_family;     /* must be AF_CCITT */
                    121:        short   x25_net;        /* network id code (usually a dnic) */
                    122:        char    x25_addr[16];   /* X.121 address (null terminated) */
                    123:        struct  x25opts {
                    124:                char    op_flags;       /* miscellaneous options */
                    125:                                        /* pk_var.h defines other lcd_flags */
                    126: #define X25_REVERSE_CHARGE     0x01    /* remote DTE pays for call */
                    127: #define X25_DBIT               0x02    /* not yet supported */
                    128: #define X25_MQBIT              0x04    /* prepend M&Q bit status byte to packet data */
                    129: #define X25_OLDSOCKADDR                0x08    /* uses old sockaddr structure */
                    130: #define X25_DG_CIRCUIT         0x10    /* lcd_flag: used for datagrams */
                    131: #define X25_DG_ROUTING         0x20    /* lcd_flag: peer addr not yet known */
                    132: #define X25_MBS_HOLD           0x40    /* lcd_flag: collect m-bit sequences */
                    133:                char    op_psize;       /* requested packet size */
                    134: #define X25_PS128              7
                    135: #define X25_PS256              8
                    136: #define X25_PS512              9
                    137:                char    op_wsize;       /* window size (1 .. 7) */
                    138:                char    op_speed;       /* throughput class */
                    139:        } x25_opts;
                    140:        short   x25_udlen;      /* user data field length */
                    141:        char    x25_udata[16];  /* user data field */
                    142: };
                    143: 
                    144: /*
                    145:  * network configuration info
                    146:  * this structure must be 16 bytes long
                    147:  */
                    148: 
                    149: struct x25config {
                    150:        struct  sockaddr_x25 xc_addr;
                    151:        /* link level parameters */
                    152:        u_short xc_lproto:4,    /* link level protocol eg. CCITTPROTO_HDLC */
                    153:                xc_lptype:4,    /* protocol type eg. HDLCPROTO_LAPB */
                    154:                xc_ltrace:1,    /* link level tracing flag */
                    155:                xc_lwsize:7;    /* link level window size */
                    156:        u_short xc_lxidxchg:1,  /* link level XID exchange flag - NOT YET */
                    157:        /* packet level parameters */
                    158:                xc_rsvd1:2,
                    159:                 xc_pwsize:3,   /* default window size */
                    160:                xc_psize:4,     /* default packet size 7=128, 8=256, ... */
                    161:                xc_type:3,      /* network type */
                    162: #define X25_1976       0
                    163: #define X25_1980       1
                    164: #define X25_1984       2
                    165: #define X25_DDN                3
                    166: #define X25_BASIC      4
                    167:                xc_ptrace:1,    /* packet level tracing flag */
                    168:                xc_nodnic:1,    /* remove our dnic when calling on net */
                    169:                xc_prepnd0:1;   /* prepend 0 when making offnet calls */
                    170:        u_short xc_maxlcn;      /* max logical channels */
                    171:        u_short xc_dg_idletimo; /* timeout for idle datagram circuits. */
                    172: };
                    173: 
                    174: #ifdef IFNAMSIZ
                    175: struct ifreq_x25 {
                    176:        char    ifr_name[IFNAMSIZ];             /* if name, e.g. "en0" */
                    177:        struct  x25config ifr_xc;
                    178: };
                    179: #define        SIOCSIFCONF_X25 _IOW('i', 12, struct ifreq_x25) /* set ifnet config */
                    180: #define        SIOCGIFCONF_X25 _IOWR('i',13, struct ifreq_x25) /* get ifnet config */
                    181: #endif

unix.superglobalmegacorp.com

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