netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
at.h
Go to the documentation of this file.
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 HAVE_CONFIG_H
11#include "config.h"
12#endif /* HAVE_CONFIG_H */
13
14#ifndef NO_DDP
15
16#if defined(__linux__) /* pull in the linux header */
17#include <sys/socket.h>
18#include <asm/types.h>
19#include <linux/atalk.h>
20
21#ifdef HAVE_ATALK_ADDR
22#define at_addr atalk_addr
23#define netrange atalk_netrange
24#endif /* HAVE_ATALK_ADDR */
25
26#else /* __linux__ */
27
28#include <sys/types.h>
29#include <netinet/in.h> /* so that we can deal with sun's s_net #define */
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
47#endif
48#ifndef ETHERTYPE_AARP
49#define ETHERTYPE_AARP 0x80F3
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
64
65/*
66 * AppleTalk address.
67 */
68 struct at_addr {
69#ifdef s_net
70#undef s_net
71#endif /* s_net */
72 unsigned short s_net;
73 unsigned char s_node;
74};
75
76#define ATADDR_ANYNET (unsigned short)0x0000
77#define ATADDR_ANYNODE (unsigned char)0x00
78#define ATADDR_ANYPORT (unsigned char)0x00
79#define ATADDR_BCAST (unsigned char)0xff
80
81/*
82 * Socket address, AppleTalk style. We keep magic information in the
83 * zero bytes. There are three types, NONE, CONFIG which has the phase
84 * and a net range, and IFACE which has the network address of an
85 * interface. IFACE may be filled in by the client, and is filled in
86 * by the kernel.
87 */
88 struct sockaddr_at {
89#ifdef BSD4_4
90 unsigned char sat_len;
91 unsigned char sat_family;
92#else /* BSD4_4 */
93 short sat_family;
94#endif /* BSD4_4 */
95 unsigned char sat_port;
96 struct at_addr sat_addr;
97#ifdef notdef
98 struct {
99 unsigned char sh_type;
100# define SATHINT_NONE 0
101# define SATHINT_CONFIG 1
102# define SATHINT_IFACE 2
103 union {
104 /* XXX check size */
105 char su_zero[7];
106 struct {
107 unsigned char sr_phase;
108 unsigned short sr_firstnet, sr_lastnet;
109 } su_range;
110 unsigned short su_interface;
111 } sh_un;
112 } sat_hints;
113#else /* notdef */
114 char sat_zero[8];
115#endif /* notdef */
116};
117
118 struct netrange {
119 unsigned char nr_phase;
120 unsigned short nr_firstnet;
121 unsigned short nr_lastnet;
122};
123
124#ifdef KERNEL
125 extern struct domain atalkdomain;
126 extern struct protosw atalksw[];
127#endif /* KERNEL */
128
129#endif /* __linux__ */
130#endif /* NO_DDP */
131#endif /* __AT_HEADER__ */
132
atalksw
struct protosw atalksw[]
Definition at_proto.c:23
atalkdomain
struct domain atalkdomain
Definition at_proto.c:43
config.h
at_addr
Definition at.h:68
at_addr::s_net
unsigned short s_net
Definition at.h:72
at_addr::s_node
unsigned char s_node
Definition at.h:73
netrange
Definition at.h:118
netrange::nr_lastnet
unsigned short nr_lastnet
Definition at.h:121
netrange::nr_phase
unsigned char nr_phase
Definition at.h:119
netrange::nr_firstnet
unsigned short nr_firstnet
Definition at.h:120
sockaddr_at
Definition at.h:88
sockaddr_at::sat_family
short sat_family
Definition at.h:93
sockaddr_at::sat_port
unsigned char sat_port
Definition at.h:95
sockaddr_at::sat_zero
char sat_zero[8]
Definition at.h:114
sockaddr_at::sat_addr
struct at_addr sat_addr
Definition at.h:96