MFC r1.27:
[dragonfly.git] / sys / netproto / atalk / at.h
blob84508f8aeb6b1bd726a3d9e5f9f8b56aa057b248
1 /*
2 * Copyright (c) 1990,1991 Regents of The University of Michigan.
3 * All Rights Reserved.
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.
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
23 * $FreeBSD: src/sys/netatalk/at.h,v 1.5.6.1 2002/12/01 14:03:09 sobomax Exp $
24 * $DragonFly: src/sys/netproto/atalk/at.h,v 1.2 2003/06/17 04:28:48 dillon Exp $
27 #ifndef __AT_HEADER__
28 #define __AT_HEADER__
30 * Supported protocols
32 #define ATPROTO_DDP 0
33 #define ATPROTO_AARP 254
35 #define DDP_MAXSZ 587
38 * If ATPORT_FIRST <= Port < ATPORT_RESERVED,
39 * Port was created by a privileged process.
40 * If ATPORT_RESERVED <= Port < ATPORT_LAST,
41 * Port was not necessarily created by a
42 * privileged process.
44 #define ATPORT_FIRST 1
45 #define ATPORT_RESERVED 128
46 #define ATPORT_LAST 255
49 * AppleTalk address.
51 struct at_addr {
52 u_short s_net;
53 u_char s_node;
56 #define ATADDR_ANYNET (u_short)0x0000
57 #define ATADDR_ANYNODE (u_char)0x00
58 #define ATADDR_ANYPORT (u_char)0x00
59 #define ATADDR_BCAST (u_char)0xff /* There is no BCAST for NET */
61 struct netrange {
62 u_char nr_phase;
63 u_short nr_firstnet;
64 u_short nr_lastnet;
68 * Socket address, AppleTalk style. We keep magic information in the
69 * zero bytes. There are three types, NONE, CONFIG which has the phase
70 * and a net range, and IFACE which has the network address of an
71 * interface. IFACE may be filled in by the client, and is filled in
72 * by the kernel.
74 struct sockaddr_at {
75 u_char sat_len;
76 u_char sat_family;
77 u_char sat_port;
78 struct at_addr sat_addr;
79 union {
80 struct netrange r_netrange;
81 char r_zero[ 8 ]; /* Hide a struct netrange in here */
82 } sat_range;
85 #define sat_zero sat_range.r_zero
87 #endif /* !__AT_HEADER__ */