diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-01-12 15:07:51 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-01-12 15:07:51 +0000 |
commit | 3f89da14403203e909a8cc15129f552d6d3ef3dc (patch) | |
tree | 0c7da38e01fe89ae2fb1dd585f10f4540df68ca0 /sys/netatalk/ddp.h | |
parent | 80c43bc68bbcfdb98c932aa8b59f81f7eb3f7e10 (diff) | |
download | FreeBSD-src-3f89da14403203e909a8cc15129f552d6d3ef3dc.zip FreeBSD-src-3f89da14403203e909a8cc15129f552d6d3ef3dc.tar.gz |
Clean up DDP layer netatalk code:
- General style(9) cleanup -- white space, braces, line wraps, etc.
- Annotate a lack of synchronization the global route cache if the input
routine is invoked with parallelism.
- Remove unused debugging code.
Diffstat (limited to 'sys/netatalk/ddp.h')
-rw-r--r-- | sys/netatalk/ddp.h | 111 |
1 files changed, 56 insertions, 55 deletions
diff --git a/sys/netatalk/ddp.h b/sys/netatalk/ddp.h index 702c3f4..55b55c8 100644 --- a/sys/netatalk/ddp.h +++ b/sys/netatalk/ddp.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1990,1991 Regents of The University of Michigan. + * Copyright (c) 1990, 1991 Regents of The University of Michigan. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and @@ -22,10 +22,11 @@ * * $FreeBSD$ */ + #ifndef _NETATALK_DDP_H_ -#define _NETATALK_DDP_H_ 1 +#define _NETATALK_DDP_H_ -/* +/*- * <-1byte(8bits) -> * +---------------+ * | 0 | hopc |len| @@ -53,83 +54,83 @@ * | Src PORT | * +---------------+ * - * On Apples, there is also a ddp_type field, after src_port. However, - * under this unix implementation, user level processes need to be able - * to set the ddp_type. In later revisions, the ddp_type may only be - * available in a raw_appletalk interface. + * On Apples, there is also a ddp_type field, after src_port. However, under + * this unix implementation, user level processes need to be able to set the + * ddp_type. In later revisions, the ddp_type may only be available in a + * raw_appletalk interface. */ struct elaphdr { - u_char el_dnode; - u_char el_snode; - u_char el_type; + u_char el_dnode; + u_char el_snode; + u_char el_type; }; #define SZ_ELAPHDR 3 -#define ELAP_DDPSHORT 0x01 -#define ELAP_DDPEXTEND 0x02 +#define ELAP_DDPSHORT 0x01 +#define ELAP_DDPEXTEND 0x02 /* * Extended DDP header. Includes sickness for dealing with arbitrary * bitfields on a little-endian arch. */ struct ddpehdr { - union { - struct { + union { + struct { #if BYTE_ORDER == BIG_ENDIAN - unsigned dub_pad:2; - unsigned dub_hops:4; - unsigned dub_len:10; - unsigned dub_sum:16; + unsigned dub_pad:2; + unsigned dub_hops:4; + unsigned dub_len:10; + unsigned dub_sum:16; #endif #if BYTE_ORDER == LITTLE_ENDIAN - unsigned dub_sum:16; - unsigned dub_len:10; - unsigned dub_hops:4; - unsigned dub_pad:2; + unsigned dub_sum:16; + unsigned dub_len:10; + unsigned dub_hops:4; + unsigned dub_pad:2; #endif - } du_bits; - unsigned du_bytes; - } deh_u; -#define deh_pad deh_u.du_bits.dub_pad -#define deh_hops deh_u.du_bits.dub_hops -#define deh_len deh_u.du_bits.dub_len -#define deh_sum deh_u.du_bits.dub_sum -#define deh_bytes deh_u.du_bytes - u_short deh_dnet; - u_short deh_snet; - u_char deh_dnode; - u_char deh_snode; - u_char deh_dport; - u_char deh_sport; + } du_bits; + unsigned du_bytes; + } deh_u; + u_short deh_dnet; + u_short deh_snet; + u_char deh_dnode; + u_char deh_snode; + u_char deh_dport; + u_char deh_sport; }; +#define deh_pad deh_u.du_bits.dub_pad +#define deh_hops deh_u.du_bits.dub_hops +#define deh_len deh_u.du_bits.dub_len +#define deh_sum deh_u.du_bits.dub_sum +#define deh_bytes deh_u.du_bytes -#define DDP_MAXHOPS 15 +#define DDP_MAXHOPS 15 struct ddpshdr { - union { - struct { + union { + struct { #if BYTE_ORDER == BIG_ENDIAN - unsigned dub_pad:6; - unsigned dub_len:10; - unsigned dub_dport:8; - unsigned dub_sport:8; + unsigned dub_pad:6; + unsigned dub_len:10; + unsigned dub_dport:8; + unsigned dub_sport:8; #endif #if BYTE_ORDER == LITTLE_ENDIAN - unsigned dub_sport:8; - unsigned dub_dport:8; - unsigned dub_len:10; - unsigned dub_pad:6; + unsigned dub_sport:8; + unsigned dub_dport:8; + unsigned dub_len:10; + unsigned dub_pad:6; #endif - } du_bits; - unsigned du_bytes; - } dsh_u; -#define dsh_pad dsh_u.du_bits.dub_pad -#define dsh_len dsh_u.du_bits.dub_len -#define dsh_dport dsh_u.du_bits.dub_dport -#define dsh_sport dsh_u.du_bits.dub_sport -#define dsh_bytes dsh_u.du_bytes + } du_bits; + unsigned du_bytes; + } dsh_u; }; +#define dsh_pad dsh_u.du_bits.dub_pad +#define dsh_len dsh_u.du_bits.dub_len +#define dsh_dport dsh_u.du_bits.dub_dport +#define dsh_sport dsh_u.du_bits.dub_sport +#define dsh_bytes dsh_u.du_bytes #endif /* _NETATALK_DDP_H_ */ |