OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [atalk.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 *      Appletalk networking structures
3
 *
4
 *      The following are directly referenced from the University Of Michigan
5
 *      netatalk for compatibility reasons.
6
 */
7
 
8
#ifndef __LINUX_ATALK_H__
9
#define __LINUX_ATALK_H__
10
 
11
#define SIOCATALKDIFADDR      (SIOCPROTOPRIVATE + 0)
12
 
13
#define ATPORT_FIRST    1
14
#define ATPORT_RESERVED 128
15
#define ATPORT_LAST     255
16
#define ATADDR_ANYNET   (__u16)0
17
#define ATADDR_ANYNODE  (__u8)0
18
#define ATADDR_ANYPORT  (__u8)0
19
#define ATADDR_BCAST    (__u8)255
20
#define DDP_MAXSZ       587
21
 
22
struct at_addr
23
{
24
        __u16   s_net;
25
        __u8    s_node;
26
};
27
 
28
struct sockaddr_at
29
{
30
        short           sat_family;
31
        __u8            sat_port;
32
        struct at_addr  sat_addr;
33
        char            sat_zero[ 8 ];
34
};
35
 
36
struct netrange
37
{
38
        __u8    nr_phase;
39
        __u16   nr_firstnet;
40
        __u16   nr_lastnet;
41
};
42
 
43
struct atalk_route
44
{
45
        struct device *dev;
46
        struct at_addr target;
47
        struct at_addr gateway;
48
        int flags;
49
        struct atalk_route *next;
50
};
51
 
52
struct atalk_iface
53
{
54
        struct device *dev;
55
        struct at_addr address;         /* Our address */
56
        int status;                     /* What are we doing ?? */
57
#define ATIF_PROBE      1               /* Probing for an address */
58
#define ATIF_PROBE_FAIL 2               /* Probe collided */
59
        struct netrange nets;           /* Associated direct netrange */
60
        struct atalk_iface *next;
61
};
62
 
63
struct atalk_sock
64
{
65
        unsigned short dest_net;
66
        unsigned short src_net;
67
        unsigned char dest_node;
68
        unsigned char src_node;
69
        unsigned char dest_port;
70
        unsigned char src_port;
71
};
72
 
73
#define DDP_MAXHOPS     15      /* 4 bits of hop counter */
74
 
75
#ifdef __KERNEL__
76
 
77
#include <asm/byteorder.h>
78
 
79
struct ddpehdr
80
{
81
#ifdef __LITTLE_ENDIAN_BITFIELD
82
        __u16   deh_len:10, deh_hops:4, deh_pad:2;
83
#else
84
        __u16   deh_pad:2, deh_hops:4, deh_len:10;
85
#endif
86
        __u16   deh_sum;
87
        __u16   deh_dnet;
88
        __u16   deh_snet;
89
        __u8    deh_dnode;
90
        __u8    deh_snode;
91
        __u8    deh_dport;
92
        __u8    deh_sport;
93
        /* And netatalk apps expect to stick the type in themselves */
94
};
95
 
96
/*
97
 *      Unused (and currently unsupported)
98
 */
99
 
100
struct ddpshdr
101
{
102
#ifdef __LITTLE_ENDIAN_BITFIELD
103
        __u16   dsh_len:10, dsh_pad:6;
104
#else
105
        __u16   dsh_pad:6, dsh_len:10;
106
#endif
107
        __u8    dsh_dport;
108
        __u8    dsh_sport;
109
        /* And netatalk apps expect to stick the type in themselves */
110
};
111
 
112
/* Appletalk AARP headers */
113
 
114
struct elapaarp
115
{
116
        __u16   hw_type;
117
#define AARP_HW_TYPE_ETHERNET           1
118
#define AARP_HW_TYPE_TOKENRING          2
119
        __u16   pa_type;
120
        __u8    hw_len;
121
        __u8    pa_len;
122
#define AARP_PA_ALEN                    4
123
        __u16   function;
124
#define AARP_REQUEST                    1
125
#define AARP_REPLY                      2
126
#define AARP_PROBE                      3
127
        __u8    hw_src[ETH_ALEN]        __attribute__ ((packed));
128
        __u8    pa_src_zero             __attribute__ ((packed));
129
        __u16   pa_src_net              __attribute__ ((packed));
130
        __u8    pa_src_node             __attribute__ ((packed));
131
        __u8    hw_dst[ETH_ALEN]        __attribute__ ((packed));
132
        __u8    pa_dst_zero             __attribute__ ((packed));
133
        __u16   pa_dst_net              __attribute__ ((packed));
134
        __u8    pa_dst_node             __attribute__ ((packed));
135
};
136
 
137
typedef struct sock     atalk_socket;
138
 
139
#define AARP_EXPIRY_TIME        (5*60*HZ)       /* Not specified - how long till we drop a resolved entry */
140
#define AARP_HASH_SIZE          16              /* Size of hash table */
141
#define AARP_TICK_TIME          (HZ/5)          /* Fast retransmission timer when resolving */
142
#define AARP_RETRANSMIT_LIMIT   10              /* Send 10 requests then give up (2 seconds) */
143
#define AARP_RESOLVE_TIME       (10*HZ)         /* Some value bigger than total retransmit time + a bit for last reply to appear and to stop continual requests */
144
 
145
extern struct datalink_proto *ddp_dl, *aarp_dl;
146
extern void aarp_proto_init(void);
147
/* Inter module exports */
148
extern struct atalk_iface *atalk_find_dev(struct device *dev);
149
extern struct at_addr *atalk_find_dev_addr(struct device *dev);
150
extern int aarp_send_ddp(struct device *dev,struct sk_buff *skb, struct at_addr *sa, void *hwaddr);
151
extern void aarp_send_probe(struct device *dev, struct at_addr *addr);
152
#ifdef MODULE
153
extern void aarp_cleanup_module(void);
154
#endif
155
 
156
#endif
157
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.