The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netatalk/ddp.h

Version: -  FREEBSD  -  FREEBSD11  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1990,1991 Regents of The University of Michigan.
    3  * All Rights Reserved.
    4  *
    5  * Permission to use, copy, modify, and distribute this software and
    6  * its documentation for any purpose and without fee is hereby granted,
    7  * provided that the above copyright notice appears in all copies and
    8  * that both that copyright notice and this permission notice appear
    9  * in supporting documentation, and that the name of The University
   10  * of Michigan not be used in advertising or publicity pertaining to
   11  * distribution of the software without specific, written prior
   12  * permission. This software is supplied as is without expressed or
   13  * implied warranties of any kind.
   14  *
   15  *      Research Systems Unix Group
   16  *      The University of Michigan
   17  *      c/o Mike Clark
   18  *      535 W. William Street
   19  *      Ann Arbor, Michigan
   20  *      +1-313-763-0525
   21  *      netatalk@itd.umich.edu
   22  */
   23 #ifndef _NETATALK_DDP_H_
   24 #define _NETATALK_DDP_H_ 1
   25 
   26 /*
   27  * <-1byte(8bits) ->
   28  * +---------------+
   29  * | 0 | hopc  |len|
   30  * +---------------+
   31  * | len (cont)    |
   32  * +---------------+
   33  * |               |
   34  * +- DDP csum    -+
   35  * |               |
   36  * +---------------+
   37  * |               |
   38  * +- Dest NET    -+
   39  * |               |
   40  * +---------------+
   41  * |               |
   42  * +- Src NET     -+
   43  * |               |
   44  * +---------------+
   45  * | Dest NODE     |
   46  * +---------------+
   47  * | Src NODE      |
   48  * +---------------+
   49  * | Dest PORT     |
   50  * +---------------+
   51  * | Src PORT      |
   52  * +---------------+
   53  *
   54  * On Apples, there is also a ddp_type field, after src_port. However,
   55  * under this unix implementation, user level processes need to be able
   56  * to set the ddp_type. In later revisions, the ddp_type may only be
   57  * available in a raw_appletalk interface.
   58  */
   59 
   60 struct elaphdr {
   61     u_char      el_dnode;
   62     u_char      el_snode;
   63     u_char      el_type;
   64 };
   65 
   66 #define SZ_ELAPHDR      3
   67 
   68 #define ELAP_DDPSHORT   0x01
   69 #define ELAP_DDPEXTEND  0x02
   70 
   71 /*
   72  * Extended DDP header. Includes sickness for dealing with arbitrary
   73  * bitfields on a little-endian arch.
   74  */
   75 struct ddpehdr {
   76     union {
   77         struct {
   78 #if BYTE_ORDER == BIG_ENDIAN
   79     unsigned            dub_pad:2;
   80     unsigned            dub_hops:4;
   81     unsigned            dub_len:10;
   82     unsigned            dub_sum:16;
   83 #endif
   84 #if BYTE_ORDER == LITTLE_ENDIAN
   85     unsigned            dub_sum:16;
   86     unsigned            dub_len:10;
   87     unsigned            dub_hops:4;
   88     unsigned            dub_pad:2;
   89 #endif
   90         } du_bits;
   91         unsigned        du_bytes;
   92     } deh_u;
   93 #define deh_pad         deh_u.du_bits.dub_pad
   94 #define deh_hops        deh_u.du_bits.dub_hops
   95 #define deh_len         deh_u.du_bits.dub_len
   96 #define deh_sum         deh_u.du_bits.dub_sum
   97 #define deh_bytes       deh_u.du_bytes
   98     u_short             deh_dnet;
   99     u_short             deh_snet;
  100     u_char              deh_dnode;
  101     u_char              deh_snode;
  102     u_char              deh_dport;
  103     u_char              deh_sport;
  104 };
  105 
  106 #define DDP_MAXHOPS     15
  107 
  108 struct ddpshdr {
  109     union {
  110         struct {
  111 #if BYTE_ORDER == BIG_ENDIAN
  112     unsigned            dub_pad:6;
  113     unsigned            dub_len:10;
  114     unsigned            dub_dport:8;
  115     unsigned            dub_sport:8;
  116 #endif
  117 #if BYTE_ORDER == LITTLE_ENDIAN
  118     unsigned            dub_sport:8;
  119     unsigned            dub_dport:8;
  120     unsigned            dub_len:10;
  121     unsigned            dub_pad:6;
  122 #endif
  123         } du_bits;
  124         unsigned        du_bytes;
  125     } dsh_u;
  126 #define dsh_pad         dsh_u.du_bits.dub_pad
  127 #define dsh_len         dsh_u.du_bits.dub_len
  128 #define dsh_dport       dsh_u.du_bits.dub_dport
  129 #define dsh_sport       dsh_u.du_bits.dub_sport
  130 #define dsh_bytes       dsh_u.du_bytes
  131 };
  132 
  133 #endif /* _NETATALK_DDP_H_ */

Cache object: 57ce0d82142c6211b1782317ca3cd82e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.