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  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
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  * $FreeBSD: releng/9.1/sys/netatalk/ddp.h 171078 2007-06-28 12:54:58Z rwatson $
   24  */
   25 
   26 #ifndef _NETATALK_DDP_H_
   27 #define _NETATALK_DDP_H_
   28 
   29 /*-
   30  * <-1byte(8bits) ->
   31  * +---------------+
   32  * | 0 | hopc  |len|
   33  * +---------------+
   34  * | len (cont)    |
   35  * +---------------+
   36  * |               |
   37  * +- DDP csum    -+
   38  * |               |
   39  * +---------------+
   40  * |               |
   41  * +- Dest NET    -+
   42  * |               |
   43  * +---------------+
   44  * |               |
   45  * +- Src NET     -+
   46  * |               |
   47  * +---------------+
   48  * | Dest NODE     |
   49  * +---------------+
   50  * | Src NODE      |
   51  * +---------------+
   52  * | Dest PORT     |
   53  * +---------------+
   54  * | Src PORT      |
   55  * +---------------+
   56  *
   57  * On Apples, there is also a ddp_type field, after src_port.  However, under
   58  * this unix implementation, user level processes need to be able to set the
   59  * ddp_type.  In later revisions, the ddp_type may only be available in a
   60  * raw_appletalk interface.
   61  */
   62 
   63 struct elaphdr {
   64         u_char  el_dnode;
   65         u_char  el_snode;
   66         u_char  el_type;
   67 } __packed;
   68 
   69 #define SZ_ELAPHDR      3
   70 
   71 #define ELAP_DDPSHORT   0x01
   72 #define ELAP_DDPEXTEND  0x02
   73 
   74 /*
   75  * Extended DDP header. Includes sickness for dealing with arbitrary
   76  * bitfields on a little-endian arch.
   77  */
   78 struct ddpehdr {
   79         union {
   80                 struct {
   81 #if BYTE_ORDER == BIG_ENDIAN
   82                         unsigned        dub_pad:2;
   83                         unsigned        dub_hops:4;
   84                         unsigned        dub_len:10;
   85                         unsigned        dub_sum:16;
   86 #endif
   87 #if BYTE_ORDER == LITTLE_ENDIAN
   88                         unsigned        dub_sum:16;
   89                         unsigned        dub_len:10;
   90                         unsigned        dub_hops:4;
   91                         unsigned        dub_pad:2;
   92 #endif
   93                 } __packed du_bits;
   94                 unsigned        du_bytes;
   95         } deh_u;
   96         u_short deh_dnet;
   97         u_short deh_snet;
   98         u_char  deh_dnode;
   99         u_char  deh_snode;
  100         u_char  deh_dport;
  101         u_char  deh_sport;
  102 } __packed;
  103 #define deh_pad         deh_u.du_bits.dub_pad
  104 #define deh_hops        deh_u.du_bits.dub_hops
  105 #define deh_len         deh_u.du_bits.dub_len
  106 #define deh_sum         deh_u.du_bits.dub_sum
  107 #define deh_bytes       deh_u.du_bytes
  108 
  109 #define DDP_MAXHOPS     15
  110 
  111 struct ddpshdr {
  112         union {
  113                 struct {
  114 #if BYTE_ORDER == BIG_ENDIAN
  115                         unsigned        dub_pad:6;
  116                         unsigned        dub_len:10;
  117                         unsigned        dub_dport:8;
  118                         unsigned        dub_sport:8;
  119 #endif
  120 #if BYTE_ORDER == LITTLE_ENDIAN
  121                         unsigned        dub_sport:8;
  122                         unsigned        dub_dport:8;
  123                         unsigned        dub_len:10;
  124                         unsigned        dub_pad:6;
  125 #endif
  126                 } __packed du_bits;
  127                 unsigned        du_bytes;
  128         } dsh_u;
  129 } __packed;
  130 
  131 #define dsh_pad         dsh_u.du_bits.dub_pad
  132 #define dsh_len         dsh_u.du_bits.dub_len
  133 #define dsh_dport       dsh_u.du_bits.dub_dport
  134 #define dsh_sport       dsh_u.du_bits.dub_sport
  135 #define dsh_bytes       dsh_u.du_bytes
  136 
  137 #endif /* _NETATALK_DDP_H_ */

Cache object: 2861d3f96ebcc38e0f1fc53e4b4af084


[ 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.