Annotation of kernel/bsd/netat/h/adsp_frames.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:  * LAP Frame Information
                     27:  */
                     28: 
                     29: typedef struct {
                     30:   u_char     lap_dest;
                     31:   u_char     lap_src;
                     32:   u_char     lap_type;
                     33:   u_char     lap_data[1];
                     34: } LAP_FRAME;
                     35: 
                     36: #define LAP_FRAME_LEN     3
                     37: 
                     38: #define MAX_FRAME_SIZE    603
                     39: 
                     40: #define LAP_DDP           0x01
                     41: #define LAP_DDPX          0x02
                     42: 
                     43: typedef struct {
                     44:   ua_short   ddp_length;             /* length of ddp fields        */
                     45:   u_char     ddp_dest;               /* destination socket          */
                     46:   u_char     ddp_source;             /* source socket               */
                     47:   u_char     ddp_type;               /* protocol type               */
                     48:   u_char     ddp_data[1];            /* data field                  */
                     49: } DDP_FRAME;
                     50: 
                     51: #define DDPS_FRAME_LEN     5
                     52: 
                     53: typedef struct {
                     54:   ua_short   ddpx_length;            /* length and hop count        */
                     55:   ua_short   ddpx_cksm;              /* checksum                    */
                     56:   at_net     ddpx_dnet;              /* destination network number  */
                     57:   at_net     ddpx_snet;              /* source network number       */
                     58:   u_char     ddpx_dnode;             /* destination node            */
                     59:   u_char     ddpx_snode;             /* source node                 */
                     60:   u_char     ddpx_dest;              /* destination socket          */
                     61:   u_char     ddpx_source;            /* source socket               */
                     62:   u_char     ddpx_type;              /* protocol type               */
                     63:   u_char     ddpx_data[1];           /* data field                  */
                     64: } DDPX_FRAME;
                     65: 
                     66: #define DDPL_FRAME_LEN     13
                     67: 
                     68: #define DDP_RTMP          0x01
                     69: #define DDP_NBP           0x02
                     70: #define DDP_ATP           0x03
                     71: #define DDP_ECHO          0x04
                     72: #define DDP_RTMP_REQ      0x05
                     73: #define DDP_ZIP           0x06
                     74: #define DDP_ADSP          0x07
                     75: 
                     76: #define RESPONDER_SOCKET  254
                     77: 
                     78: #define ECHO_REQUEST      1
                     79: #define ECHO_RESPONSE     2
                     80: 
                     81: typedef struct {
                     82:   u_char     nbp_ctrl_cnt;           /* control and tuple count     */
                     83:   u_char     nbp_id;                 /* enquiry/reply id            */
                     84:   u_char     nbp_data[1];            /* tuple space                 */
                     85: } NBP_FRAME;
                     86: 
                     87: #define NBP_TYPE_MASK     0xf0     /* mask of ctrl_cnt field      */
                     88: #define NBP_CNT_MASK      0x0f     /* mask for number of tuples   */
                     89: #define NBP_BROADCAST     0x10     /* internet lookup             */
                     90: #define NBP_LOOKUP        0x20     /* lookup request              */
                     91: #define NBP_REPLY         0x30     /* response to lookup          */
                     92: 
                     93: typedef struct {
                     94:   u_char     atp_control;            /* control field               */
                     95:   u_char     atp_map;                /* bitmap for acknowlegement   */
                     96:   ua_short   atp_tid;                /* transaction id              */
                     97:   union
                     98:   {
                     99:       u_char     b[4];               /* user u_chars                  */
                    100:       ua_long    dw;
                    101:   } atp_ub;
                    102:   u_char     atp_data[1];            /* data field                  */
                    103: } ATP_FRAME;
                    104: 
                    105: #define ATP_FRAME_LEN      8
                    106: 
                    107: #define ATP_TREQ          0x40     /* transaction request         */
                    108: #define ATP_TRESP         0x80     /* response packet             */
                    109: #define ATP_TREL          0xc0     /* transaction release packet  */
                    110: #define ATP_XO            0x20     /* exactly once flag           */
                    111: #define ATP_EOM           0x10     /* end of message flag         */
                    112: #define ATP_STS           0x08     /* send transaction status     */
                    113: 
                    114: #define ATP_TYPE(x)       ((x)->atp_control & 0xc0)
                    115: 
                    116: typedef struct {
                    117:   at_net     net1;
                    118:   u_char     zonename[33];
                    119: } ZIP_1;
                    120: 
                    121: typedef struct {
                    122:   at_net     net1;
                    123:   at_net     net2;
                    124:   u_char     zonename[33];
                    125: } ZIP_2;
                    126: 
                    127: typedef struct {
                    128:   u_char     zip_command;             /* zip command number          */
                    129:   u_char     flags;                   /* Bit-mapped                  */
                    130:   union
                    131:   {
                    132:      ZIP_1 o;                       /* Packet has one net number   */
                    133:      ZIP_2 r;                       /* Packet has cable range      */
                    134:   } u;
                    135: } ZIP_FRAME;
                    136: 
                    137: /* Flags in the ZIP GetNetInfo & NetInfoReply buffer  */
                    138: 
                    139: #define ZIPF_BROADCAST     0x80
                    140: #define ZIPF_ZONE_INVALID  0x80
                    141: #define ZIPF_USE_BROADCAST 0x40
                    142: #define ZIPF_ONE_ZONE      0x20
                    143: 
                    144: #define ZIP_QUERY          1        /* ZIP Commands in zip frames  */
                    145: #define ZIP_REPLY          2
                    146: #define ZIP_TAKEDOWN       3
                    147: #define ZIP_BRINGUP        4
                    148: #define ZIP_GETNETINFO     5
                    149: #define ZIP_NETINFOREPLY   6
                    150: #define ZIP_NOTIFY         7
                    151: 
                    152: #define ZIP_GETMYZONE      7        /* ZIP commands in atp user u_chars[0]  */
                    153: #define ZIP_GETZONELIST    8
                    154: #define ZIP_GETLOCALZONES  9
                    155: #define ZIP_GETYOURZONE    10       
                    156: 
                    157: /*
                    158:  * Response to Reponder Request type #1.
                    159:  *
                    160:  * The first 4 u_chars are actually the 4 ATP user u_chars
                    161:  * Following this structure are 4 PASCAL strings:
                    162:  *    System Version String. (max 127)
                    163:  *    Finder Version String. (max 127)
                    164:  *    LaserWriter Version String. (max 127)
                    165:  *    AppleShare Version String. (max 24)
                    166:  */
                    167: typedef struct
                    168: {
                    169:    u_char  UserU_Chars[2];
                    170:    ua_short  ResponderVersion;
                    171:    ua_short  AtalkVersion;
                    172:    u_char  ROMVersion;
                    173:    u_char  SystemType;
                    174:    u_char  SystemClass;
                    175:    u_char  HdwrConfig;
                    176:    ua_short  ROM85Version;
                    177:    u_char  ResponderLevel;
                    178:    u_char  ResponderLink;
                    179:    u_char  data[1];
                    180: } RESPONDER_FRAME;
                    181: 
                    182: 
                    183: /*
                    184:  * ADSP Frame
                    185:  */
                    186: typedef struct {
                    187:    ua_short CID;
                    188:    ua_long pktFirstByteSeq;
                    189:    ua_long pktNextRecvSeq;
                    190:    ua_short  pktRecvWdw;
                    191:    u_char descriptor;          /* Bit-Mapped */
                    192:    u_char data[1];
                    193: } ADSP_FRAME, *ADSP_FRAMEPtr;
                    194: 
                    195: #define ADSP_FRAME_LEN     13
                    196: 
                    197: #define ADSP_CONTROL_BIT   0x80
                    198: #define ADSP_ACK_REQ_BIT   0x40
                    199: #define ADSP_EOM_BIT       0x20
                    200: #define ADSP_ATTENTION_BIT 0x10
                    201: #define ADSP_CONTROL_MASK  0x0F
                    202: 
                    203: #define ADSP_CTL_PROBE        0x00 /* Probe or acknowledgement */
                    204: #define ADSP_CTL_OREQ         0x01 /* Open Connection Request */
                    205: #define ADSP_CTL_OACK         0x02 /* Open Request acknowledgment */
                    206: #define ADSP_CTL_OREQACK      0x03 /* Open Request and acknowledgement */
                    207: #define ADSP_CTL_ODENY        0x04 /* Open Request denial */
                    208: #define ADSP_CTL_CLOSE        0x05 /* Close connection advice */
                    209: #define ADSP_CTL_FRESET       0x06 /* Forward Reset */
                    210: #define ADSP_CTL_FRESET_ACK   0x07 /* Forward Reset Acknowledgement */
                    211: #define ADSP_CTL_RETRANSMIT   0x08 /* Retransmit advice        */
                    212: 
                    213: typedef struct {
                    214:    ua_short  version;          /* Must be in network byte order */
                    215:    ua_short  dstCID;           /* */
                    216:    ua_long pktAttnRecvSeq;             /* Must be in network byte order */
                    217: } ADSP_OPEN_DATA, *ADSP_OPEN_DATAPtr;
                    218: 
                    219: #define ADSP_OPEN_FRAME_LEN   8
                    220: 
                    221: #define ADSP_MAX_DATA_LEN              572
                    222: 
                    223: /* END FRAMES.H  */

unix.superglobalmegacorp.com

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