2 * $Id: ddp.h,v 1.2 2001-06-29 14:14:47 rufustfirefly Exp $
4 * Copyright (c) 1990,1991 Regents of The University of Michigan.
5 * All Rights Reserved. See COPYRIGHT.
37 * On Apples, there is also a ddp_type field, after src_port. However,
38 * under this unix implementation, user level processes need to be able
39 * to set the ddp_type. In later revisions, the ddp_type may only be
40 * available in a raw_appletalk interface.
43 #ifndef _NETATALK_DDP_H
44 #define _NETATALK_DDP_H 1
46 #include <netatalk/endian.h>
56 #define ELAP_DDPSHORT 0x01
57 #define ELAP_DDPEXTEND 0x02
60 * Extended DDP header. Includes sickness for dealing with arbitrary
61 * bitfields on a little-endian arch.
66 #if BYTE_ORDER == BIG_ENDIAN
71 #else /* BYTE_ORDER == BIG_ENDIAN */
72 #if BYTE_ORDER == LITTLE_ENDIAN
77 #else /* BYTE_ORDER == LITTLE_ENDIAN */
79 #endif /* BYTE_ORDER == LITTLE_ENDIAN */
80 #endif /* BYTE_ORDER == BIG_ENDIAN */
84 #define deh_pad deh_u.du_bits.dub_pad
85 #define deh_hops deh_u.du_bits.dub_hops
86 #define deh_len deh_u.du_bits.dub_len
87 #define deh_sum deh_u.du_bits.dub_sum
88 #define deh_bytes deh_u.du_bytes
99 #define DDP_MAXHOPS 15
104 #if BYTE_ORDER == BIG_ENDIAN
107 unsigned dub_dport:8;
108 unsigned dub_sport:8;
109 #endif /* BYTE_ORDER == BIG_ENDIAN */
110 #if BYTE_ORDER == LITTLE_ENDIAN
111 unsigned dub_sport:8;
112 unsigned dub_dport:8;
115 #endif /* BYTE_ORDER == LITTLE_ENDIAN */
119 #define dsh_pad dsh_u.du_bits.dub_pad
120 #define dsh_len dsh_u.du_bits.dub_len
121 #define dsh_dport dsh_u.du_bits.dub_dport
122 #define dsh_sport dsh_u.du_bits.dub_sport
123 #define dsh_bytes dsh_u.du_bytes
127 #endif /* netatalk/ddp.h */