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