1 #ifndef _NET_INET_IPX_H_
2 #define _NET_INET_IPX_H_
4 * The following information is in its entirety obtained from:
6 * Novell 'IPX Router Specification' Version 1.10
7 * Part No. 107-000029-001
9 * Which is available from ftp.novell.com
12 #include <linux/netdevice.h>
13 #include <net/datalink.h>
14 #include <linux/ipx.h>
15 #include <linux/list.h>
19 __u8 node
[IPX_NODE_LEN
];
23 #define ipx_broadcast_node "\377\377\377\377\377\377"
24 #define ipx_this_node "\0\0\0\0\0\0"
26 #define IPX_MAX_PPROP_HOPS 8
29 __u16 ipx_checksum
__attribute__ ((packed
));
30 #define IPX_NO_CHECKSUM 0xFFFF
31 __u16 ipx_pktsize
__attribute__ ((packed
));
34 #define IPX_TYPE_UNKNOWN 0x00
35 #define IPX_TYPE_RIP 0x01 /* may also be 0 */
36 #define IPX_TYPE_SAP 0x04 /* may also be 0 */
37 #define IPX_TYPE_SPX 0x05 /* SPX protocol */
38 #define IPX_TYPE_NCP 0x11 /* $lots for docs on this (SPIT) */
39 #define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast */
40 struct ipx_address ipx_dest
__attribute__ ((packed
));
41 struct ipx_address ipx_source
__attribute__ ((packed
));
44 static __inline__
struct ipxhdr
*ipx_hdr(struct sk_buff
*skb
)
46 return (struct ipxhdr
*)skb
->h
.raw
;
49 struct ipx_interface
{
52 unsigned char if_node
[IPX_NODE_LEN
];
55 /* physical device info */
56 struct net_device
*if_dev
;
57 struct datalink_proto
*if_dlink
;
58 unsigned short if_dlink_type
;
61 unsigned short if_sknum
;
62 struct hlist_head if_sklist
;
63 spinlock_t if_sklist_lock
;
65 /* administrative overhead */
67 unsigned char if_internal
;
68 unsigned char if_primary
;
70 struct list_head node
; /* node in ipx_interfaces list */
75 struct ipx_interface
*ir_intrfc
;
76 unsigned char ir_routed
;
77 unsigned char ir_router_node
[IPX_NODE_LEN
];
78 struct list_head node
; /* node in ipx_routes list */
94 struct ipx_address dest_addr
;
95 struct ipx_interface
*intrfc
;
97 #ifdef CONFIG_IPX_INTERN
98 unsigned char node
[IPX_NODE_LEN
];
102 * To handle special ncp connection-handling sockets for mars_nwe,
103 * the connection number must be stored in the socket.
105 unsigned short ipx_ncp_conn
;
108 #define ipx_sk(__sk) ((struct ipx_opt *)(__sk)->sk_protinfo)
109 #define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0]))
111 #define IPX_MIN_EPHEMERAL_SOCKET 0x4000
112 #define IPX_MAX_EPHEMERAL_SOCKET 0x7fff
114 extern struct list_head ipx_routes
;
115 extern rwlock_t ipx_routes_lock
;
117 extern struct list_head ipx_interfaces
;
118 extern struct ipx_interface
*ipx_interfaces_head(void);
119 extern spinlock_t ipx_interfaces_lock
;
121 extern struct ipx_interface
*ipx_primary_net
;
123 extern int ipx_proc_init(void);
124 extern void ipx_proc_exit(void);
126 extern const char *ipx_frame_name(unsigned short);
127 extern const char *ipx_device_name(struct ipx_interface
*intrfc
);
129 static __inline__
void ipxitf_hold(struct ipx_interface
*intrfc
)
131 atomic_inc(&intrfc
->refcnt
);
134 extern void ipxitf_down(struct ipx_interface
*intrfc
);
136 static __inline__
void ipxitf_put(struct ipx_interface
*intrfc
)
138 if (atomic_dec_and_test(&intrfc
->refcnt
))
142 extern void __ipxitf_down(struct ipx_interface
*intrfc
);
144 static __inline__
void __ipxitf_put(struct ipx_interface
*intrfc
)
146 if (atomic_dec_and_test(&intrfc
->refcnt
))
147 __ipxitf_down(intrfc
);
150 static __inline__
void ipxrtr_hold(struct ipx_route
*rt
)
152 atomic_inc(&rt
->refcnt
);
155 static __inline__
void ipxrtr_put(struct ipx_route
*rt
)
157 if (atomic_dec_and_test(&rt
->refcnt
))
160 #endif /* _NET_INET_IPX_H_ */