1 /* $NetBSD: ddp.h,v 1.1 1997/04/02 21:31:08 christos Exp $ */
4 * Copyright (c) 1990,1991 Regents of The University of Michigan.
7 * Permission to use, copy, modify, and distribute this software and
8 * its documentation for any purpose and without fee is hereby granted,
9 * provided that the above copyright notice appears in all copies and
10 * that both that copyright notice and this permission notice appear
11 * in supporting documentation, and that the name of The University
12 * of Michigan not be used in advertising or publicity pertaining to
13 * distribution of the software without specific, written prior
14 * permission. This software is supplied as is without expressed or
15 * implied warranties of any kind.
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
20 * Research Systems Unix Group
21 * The University of Michigan
23 * 535 W. William Street
29 #ifndef _NETATALK_DDP_H_
30 #define _NETATALK_DDP_H_
33 #error "Undefined Byte order"
64 * On Apples, there is also a ddp_type field, after src_port. However,
65 * under this unix implementation, user level processes need to be able
66 * to set the ddp_type. In later revisions, the ddp_type may only be
67 * available in a raw_appletalk interface.
78 #define ELAP_DDPSHORT 0x01
79 #define ELAP_DDPEXTEND 0x02
82 * Extended DDP header. Includes sickness for dealing with arbitrary
83 * bitfields on a little-endian arch.
88 #if BYTE_ORDER == BIG_ENDIAN
94 #if BYTE_ORDER == LITTLE_ENDIAN
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
116 #define DDP_MAXHOPS 15
121 #if BYTE_ORDER == BIG_ENDIAN
124 unsigned dub_dport
:8;
125 unsigned dub_sport
:8;
127 #if BYTE_ORDER == LITTLE_ENDIAN
128 unsigned dub_sport
:8;
129 unsigned dub_dport
:8;
136 #define dsh_pad dsh_u.du_bits.dub_pad
137 #define dsh_len dsh_u.du_bits.dub_len
138 #define dsh_dport dsh_u.du_bits.dub_dport
139 #define dsh_sport dsh_u.du_bits.dub_sport
140 #define dsh_bytes dsh_u.du_bytes
143 #endif /* !_NETATALK_DDP_H_ */