Annotation of kernel/bsd/netat/at/ddp.h, revision 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:  *
        !            27:  * ORIGINS: 82
        !            28:  *
        !            29:  * APPLE CONFIDENTIAL
        !            30:  * (C) COPYRIGHT Apple Computer, Inc. 1992-1996
        !            31:  * All Rights Reserved
        !            32:  *
        !            33:  */                                                                   
        !            34: 
        !            35: #ifndef __DDP__
        !            36: #define __DDP__
        !            37: 
        !            38: /* Header and data sizes */
        !            39: 
        !            40: #define  DDP_HDR_SIZE                 5  /* DDP (short) header size */
        !            41: #define  DDP_X_HDR_SIZE              13  /* DDP extended header size */
        !            42: #define  DDP_DATA_SIZE              586  /* Maximum DataGram data size */
        !            43: #define  DDP_DATAGRAM_SIZE          599  /* Maximum DataGram size */
        !            44: 
        !            45: 
        !            46: /* DDP socket definitions */
        !            47: 
        !            48: #define  DDP_SOCKET_1st_RESERVED      1  /* First in reserved range */
        !            49: #define  DDP_SOCKET_1st_EXPERIMENTAL 64  /* First in experimental range */
        !            50: #define  DDP_SOCKET_1st_DYNAMIC     128  /* First in dynamic range */
        !            51: #define  DDP_SOCKET_LAST            253  /* Last socket in any range */
        !            52: 
        !            53: 
        !            54: /* DDP extended header packet format */
        !            55: 
        !            56: typedef struct {
        !            57:         unsigned   unused:2,
        !            58:                   hopcount:4,
        !            59:                   length:10;           /* Datagram length */
        !            60:         ua_short   checksum;           /* Checksum */
        !            61:         at_net     dst_net;            /* Destination network number */
        !            62:         at_net     src_net;            /* Source network number */
        !            63:         at_node    dst_node;           /* Destination node ID */
        !            64:         at_node    src_node;           /* Source node ID */
        !            65:         at_socket  dst_socket;                 /* Destination socket number */
        !            66:         at_socket  src_socket;                 /* Source socket number */
        !            67:         u_char    type;                /* Protocol type */
        !            68:         char       data[DDP_DATA_SIZE];
        !            69: } at_ddp_t;
        !            70: 
        !            71: 
        !            72: #define        DDPLEN_ASSIGN(ddp, len)         ddp->length = len
        !            73: #define        DDPLEN_VALUE(ddp)               ddp->length
        !            74: 
        !            75: 
        !            76: /* DDP module statistics and configuration */
        !            77: 
        !            78: typedef struct {
        !            79:        /* General */
        !            80: 
        !            81:        /* Receive stats */
        !            82:        u_int   rcv_bytes;
        !            83:        u_int   rcv_packets;
        !            84:        u_int   rcv_bad_length;
        !            85:        u_int   rcv_unreg_socket;
        !            86:        u_int   rcv_bad_socket;
        !            87:        u_int   rcv_bad_checksum;
        !            88:        u_int   rcv_dropped_nobuf;
        !            89: 
        !            90:        /* Transmit stats */
        !            91:        u_int   xmit_bytes;
        !            92:        u_int   xmit_packets;
        !            93:        u_int   xmit_BRT_used;
        !            94:        u_int   xmit_bad_length;
        !            95:        u_int   xmit_bad_addr;
        !            96:        u_int   xmit_dropped_nobuf;
        !            97: } at_ddp_stats_t;
        !            98: 
        !            99: typedef struct {
        !           100:         u_short        network_up;
        !           101:        u_short         filler;
        !           102:        int             flags;          /* to indicate what type
        !           103:                                         * of network interface the
        !           104:                                         * default net is (ethertalk/
        !           105:                                         * localtalk?)
        !           106:                                         */
        !           107:        at_inet_t       node_addr;
        !           108:        at_inet_t       router_addr;
        !           109:        int             netlo;
        !           110:        int             nethi;
        !           111: } at_ddp_cfg_t;
        !           112: 
        !           113: union at_ddpopt {
        !           114:     struct {
        !           115:         unsigned char checksum; /* do checksum */
        !           116:         unsigned char type;     /* ddp type */
        !           117:     } ct;
        !           118: };
        !           119: 
        !           120: union at_adspopt {
        !           121:     struct {
        !           122:     u_short sendBlocking;      /* quantum for data packets */
        !           123:     u_char sendTimer;          /* send timer in 10-tick intervals */
        !           124:     u_char rtmtTimer;          /* retransmit timer in 10-tick intervals */
        !           125:     u_char badSeqMax;          /* threshold for sending retransmit advice */
        !           126:     u_char useCheckSum;                /* use ddp packet checksum */
        !           127:     u_short filler;
        !           128:     int newPID;                                /* ### Temp for backward compatibility 02/11/94 */
        !           129:     } c;
        !           130: };
        !           131: 
        !           132: #endif /* __DDP__ */

unix.superglobalmegacorp.com

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