root/include/linux/atalk.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


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

/* [previous][next][first][last][top][bottom][index][help] */