more debug output
[linux-2.4.git] / include / net / ipx.h
1 /*
2  *      The following information is in its entirety obtained from:
3  *
4  *      Novell 'IPX Router Specification' Version 1.10 
5  *              Part No. 107-000029-001
6  *
7  *      Which is available from ftp.novell.com
8  */
9
10 #ifndef _NET_INET_IPX_H_
11 #define _NET_INET_IPX_H_
12
13 #include <linux/netdevice.h>
14 #include <net/datalink.h>
15 #include <linux/ipx.h>
16
17 typedef struct
18 {
19         __u32   net;
20         __u8    node[IPX_NODE_LEN]; 
21         __u16   sock;
22 } ipx_address;
23
24 #define ipx_broadcast_node      "\377\377\377\377\377\377"
25 #define ipx_this_node           "\0\0\0\0\0\0"
26
27 #define IPX_MAX_PPROP_HOPS 8
28
29 struct ipxhdr
30 {
31         __u16           ipx_checksum __attribute__ ((packed));
32 #define IPX_NO_CHECKSUM 0xFFFF
33         __u16           ipx_pktsize __attribute__ ((packed));
34         __u8            ipx_tctrl;
35         __u8            ipx_type;
36 #define IPX_TYPE_UNKNOWN        0x00
37 #define IPX_TYPE_RIP            0x01    /* may also be 0 */
38 #define IPX_TYPE_SAP            0x04    /* may also be 0 */
39 #define IPX_TYPE_SPX            0x05    /* SPX protocol */
40 #define IPX_TYPE_NCP            0x11    /* $lots for docs on this (SPIT) */
41 #define IPX_TYPE_PPROP          0x14    /* complicated flood fill brdcast */
42         ipx_address     ipx_dest __attribute__ ((packed));
43         ipx_address     ipx_source __attribute__ ((packed));
44 };
45
46 typedef struct ipx_interface {
47         /* IPX address */
48         __u32           if_netnum;
49         unsigned char   if_node[IPX_NODE_LEN];
50         atomic_t        refcnt;
51
52         /* physical device info */
53         struct net_device       *if_dev;
54         struct datalink_proto   *if_dlink;
55         unsigned short  if_dlink_type;
56
57         /* socket support */
58         unsigned short  if_sknum;
59         struct sock     *if_sklist;
60         spinlock_t      if_sklist_lock;
61
62         /* administrative overhead */
63         int             if_ipx_offset;
64         unsigned char   if_internal;
65         unsigned char   if_primary;
66         
67         struct ipx_interface    *if_next;
68 }       ipx_interface;
69
70 typedef struct ipx_route {
71         __u32         ir_net;
72         ipx_interface *ir_intrfc;
73         unsigned char ir_routed;
74         unsigned char ir_router_node[IPX_NODE_LEN];
75         struct ipx_route *ir_next;
76         atomic_t      refcnt;
77 }       ipx_route;
78
79 #ifdef __KERNEL__
80 struct ipx_cb {
81         u8 ipx_tctrl;
82         u32 ipx_dest_net;
83         u32 ipx_source_net;
84         struct {
85                 u32 netnum;
86                 int index;
87         } last_hop;
88 };
89 #endif
90 #define IPX_MIN_EPHEMERAL_SOCKET        0x4000
91 #define IPX_MAX_EPHEMERAL_SOCKET        0x7fff
92
93 extern int ipx_register_spx(struct proto_ops **, struct net_proto_family *);
94 extern int ipx_unregister_spx(void);
95
96 #endif /* def _NET_INET_IPX_H_ */