Commit be9ca388 authored by David S. Miller's avatar David S. Miller

Merge master.kernel.org:/home/acme/BK/appletalk-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents 43bd3834 f1bbf6ab
#ifndef __LINUX_ATALK_H__
#define __LINUX_ATALK_H__
/*
* AppleTalk networking structures
*
* The following are directly referenced from the University Of Michigan
* netatalk for compatibility reasons.
*/
#ifndef __LINUX_ATALK_H__
#define __LINUX_ATALK_H__
#define ATPORT_FIRST 1
#define ATPORT_RESERVED 128
#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
......@@ -20,49 +18,51 @@
#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
struct at_addr
{
struct atalk_addr {
__u16 s_net;
__u8 s_node;
};
struct sockaddr_at
{
struct sockaddr_at {
sa_family_t sat_family;
__u8 sat_port;
struct at_addr sat_addr;
char sat_zero[ 8 ];
struct atalk_addr sat_addr;
char sat_zero[8];
};
struct netrange
{
struct atalk_netrange {
__u8 nr_phase;
__u16 nr_firstnet;
__u16 nr_lastnet;
};
struct atalk_route
{
struct atalk_route {
struct net_device *dev;
struct at_addr target;
struct at_addr gateway;
struct atalk_addr target;
struct atalk_addr gateway;
int flags;
struct atalk_route *next;
};
struct atalk_iface
{
/**
* struct atalk_iface - AppleTalk Interface
* @dev - Network device associated with this interface
* @address - Our address
* @status - What are we doing?
* @nets - Associated direct netrange
* @next - next element in the list of interfaces
*/
struct atalk_iface {
struct net_device *dev;
struct at_addr address; /* Our address */
int status; /* What are we doing? */
struct atalk_addr address;
int status;
#define ATIF_PROBE 1 /* Probing for an address */
#define ATIF_PROBE_FAIL 2 /* Probe collided */
struct netrange nets; /* Associated direct netrange */
struct atalk_netrange nets;
struct atalk_iface *next;
};
struct atalk_sock
{
struct atalk_sock {
unsigned short dest_net;
unsigned short src_net;
unsigned char dest_node;
......@@ -75,12 +75,15 @@ struct atalk_sock
#include <asm/byteorder.h>
struct ddpehdr
{
struct ddpehdr {
#ifdef __LITTLE_ENDIAN_BITFIELD
__u16 deh_len:10, deh_hops:4, deh_pad:2;
__u16 deh_len:10,
deh_hops:4,
deh_pad:2;
#else
__u16 deh_pad:2, deh_hops:4, deh_len:10;
__u16 deh_pad:2,
deh_hops:4,
deh_len:10;
#endif
__u16 deh_sum;
__u16 deh_dnet;
......@@ -92,30 +95,35 @@ struct ddpehdr
/* And netatalk apps expect to stick the type in themselves */
};
static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb)
{
return (struct ddpehdr *)skb->h.raw;
}
/*
* Don't drop the struct into the struct above. You'll get some
* surprise padding.
*/
struct ddpebits
{
struct ddpebits {
#ifdef __LITTLE_ENDIAN_BITFIELD
__u16 deh_len:10, deh_hops:4, deh_pad:2;
__u16 deh_len:10,
deh_hops:4,
deh_pad:2;
#else
__u16 deh_pad:2, deh_hops:4, deh_len:10;
__u16 deh_pad:2,
deh_hops:4,
deh_len:10;
#endif
};
/*
* Short form header
*/
struct ddpshdr
{
/* Short form header */
struct ddpshdr {
#ifdef __LITTLE_ENDIAN_BITFIELD
__u16 dsh_len:10, dsh_pad:6;
__u16 dsh_len:10,
dsh_pad:6;
#else
__u16 dsh_pad:6, dsh_len:10;
__u16 dsh_pad:6,
dsh_len:10;
#endif
__u8 dsh_dport;
__u8 dsh_sport;
......@@ -123,9 +131,7 @@ struct ddpshdr
};
/* AppleTalk AARP headers */
struct elapaarp
{
struct elapaarp {
__u16 hw_type;
#define AARP_HW_TYPE_ETHERNET 1
#define AARP_HW_TYPE_TOKENRING 2
......@@ -147,29 +153,43 @@ struct elapaarp
__u8 pa_dst_node __attribute__ ((packed));
};
#define AARP_EXPIRY_TIME (5*60*HZ) /* Not specified - how long till we drop a resolved entry */
#define AARP_HASH_SIZE 16 /* Size of hash table */
#define AARP_TICK_TIME (HZ/5) /* Fast retransmission timer when resolving */
#define AARP_RETRANSMIT_LIMIT 10 /* Send 10 requests then give up (2 seconds) */
#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 */
static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb)
{
return (struct elapaarp *)skb->h.raw;
}
/* Not specified - how long till we drop a resolved entry */
#define AARP_EXPIRY_TIME (5 * 60 * HZ)
/* Size of hash table */
#define AARP_HASH_SIZE 16
/* Fast retransmission timer when resolving */
#define AARP_TICK_TIME (HZ / 5)
/* Send 10 requests then give up (2 seconds) */
#define AARP_RETRANSMIT_LIMIT 10
/*
* Some value bigger than total retransmit time + a bit for last reply to
* appear and to stop continual requests
*/
#define AARP_RESOLVE_TIME (10 * HZ)
extern struct datalink_proto *ddp_dl, *aarp_dl;
extern void aarp_proto_init(void);
/* Inter module exports */
/*
* Give a device find its atif control structure
*/
/* Inter module exports */
/* Give a device find its atif control structure */
static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
{
return dev->atalk_ptr;
}
extern struct at_addr *atalk_find_dev_addr(struct net_device *dev);
extern struct net_device *atrtr_get_dev(struct at_addr *sa);
extern int aarp_send_ddp(struct net_device *dev,struct sk_buff *skb, struct at_addr *sa, void *hwaddr);
extern void aarp_send_probe(struct net_device *dev, struct at_addr *addr);
extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
extern int aarp_send_ddp(struct net_device *dev,
struct sk_buff *skb,
struct atalk_addr *sa, void *hwaddr);
extern void aarp_send_probe(struct net_device *dev,
struct atalk_addr *addr);
extern void aarp_device_down(struct net_device *dev);
#ifdef MODULE
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment