]> arthur.barton.de Git - netatalk.git/blob - sys/netatalk/at.h
Initial revision
[netatalk.git] / sys / netatalk / at.h
1 /*
2  * Copyright (c) 1990,1991 Regents of The University of Michigan.
3  *
4  * All Rights Reserved.  See COPYRIGHT.
5  */
6
7 #ifndef __AT_HEADER__
8 #define __AT_HEADER__
9
10 #ifdef linux /* pull in the linux header */
11 #include <sys/socket.h>
12 #include <asm/types.h>
13 #include <linux/atalk.h>
14 #else
15
16 #include <sys/types.h>
17 #include <netinet/in.h> /* so that we can deal with sun's s_net #define */
18
19 /*
20  * Supported protocols
21  */
22 #ifdef ATPROTO_DDP
23 #undef ATPROTO_DDP
24 #endif
25 #define ATPROTO_DDP     0
26 #define ATPROTO_AARP    254
27
28 /*
29  * Ethernet types, for DIX.
30  * These should really be in some global header file, but we can't
31  * count on them being there, and it's annoying to patch system files.
32  */
33 #define ETHERTYPE_AT    0x809B          /* AppleTalk protocol */
34 #define ETHERTYPE_AARP  0x80F3          /* AppleTalk ARP */
35
36 #define DDP_MAXSZ       587
37
38 /*
39  * If ATPORT_FIRST <= Port < ATPORT_RESERVED,
40  * Port was created by a privileged process.
41  * If ATPORT_RESERVED <= Port < ATPORT_LAST,
42  * Port was not necessarily created by a
43  * privileged process.
44  */
45 #define ATPORT_FIRST    1
46 #define ATPORT_RESERVED 128
47 #define ATPORT_LAST     254 /* 254 is reserved on ether/tokentalk networks */
48
49 /*
50  * AppleTalk address.
51  */
52 struct at_addr {
53 #ifdef s_net
54 #undef s_net
55 #endif
56     u_short     s_net;
57     u_char      s_node;
58 };
59
60 #define ATADDR_ANYNET   (u_short)0x0000
61 #define ATADDR_ANYNODE  (u_char)0x00
62 #define ATADDR_ANYPORT  (u_char)0x00
63 #define ATADDR_BCAST    (u_char)0xff            /* There is no BCAST for NET */
64
65 /*
66  * Socket address, AppleTalk style.  We keep magic information in the 
67  * zero bytes.  There are three types, NONE, CONFIG which has the phase
68  * and a net range, and IFACE which has the network address of an
69  * interface.  IFACE may be filled in by the client, and is filled in
70  * by the kernel.
71  */
72 struct sockaddr_at {
73 #ifdef BSD4_4
74     u_char              sat_len;
75     u_char              sat_family;
76 #else BSD4_4
77     short               sat_family;
78 #endif BSD4_4
79     u_char              sat_port;
80     struct at_addr      sat_addr;
81 #ifdef notdef
82     struct {
83         u_char          sh_type;
84 # define SATHINT_NONE   0
85 # define SATHINT_CONFIG 1
86 # define SATHINT_IFACE  2
87         union {
88             char                su_zero[ 7 ];   /* XXX check size */
89             struct {
90                 u_char          sr_phase;
91                 u_short         sr_firstnet, sr_lastnet;
92             } su_range;
93             u_short             su_interface;
94         } sh_un;
95     } sat_hints;
96 #else notdef
97     char                sat_zero[ 8 ];
98 #endif notdef
99 };
100
101 struct netrange {
102     u_char              nr_phase;
103     u_short             nr_firstnet;
104     u_short             nr_lastnet;
105 };
106
107 #ifdef KERNEL
108 extern struct domain    atalkdomain;
109 extern struct protosw   atalksw[];
110 #endif
111
112 #endif /* linux */
113 #endif __AT_HEADER__