fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / net / ipx.h
index 064e5f7..c6b2ee6 100644 (file)
@@ -15,9 +15,9 @@
 #include <linux/list.h>
 
 struct ipx_address {
-       __u32   net;
+       __be32  net;
        __u8    node[IPX_NODE_LEN]; 
-       __u16   sock;
+       __be16  sock;
 };
 
 #define ipx_broadcast_node     "\377\377\377\377\377\377"
@@ -26,9 +26,9 @@ struct ipx_address {
 #define IPX_MAX_PPROP_HOPS 8
 
 struct ipxhdr {
-       __u16                   ipx_checksum __attribute__ ((packed));
-#define IPX_NO_CHECKSUM        0xFFFF
-       __u16                   ipx_pktsize __attribute__ ((packed));
+       __be16                  ipx_checksum __attribute__ ((packed));
+#define IPX_NO_CHECKSUM        __constant_htons(0xFFFF)
+       __be16                  ipx_pktsize __attribute__ ((packed));
        __u8                    ipx_tctrl;
        __u8                    ipx_type;
 #define IPX_TYPE_UNKNOWN       0x00
@@ -48,14 +48,14 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb)
 
 struct ipx_interface {
        /* IPX address */
-       __u32                   if_netnum;
+       __be32                  if_netnum;
        unsigned char           if_node[IPX_NODE_LEN];
        atomic_t                refcnt;
 
        /* physical device info */
        struct net_device       *if_dev;
        struct datalink_proto   *if_dlink;
-       unsigned short          if_dlink_type;
+       __be16                  if_dlink_type;
 
        /* socket support */
        unsigned short          if_sknum;
@@ -71,7 +71,7 @@ struct ipx_interface {
 };
 
 struct ipx_route {
-       __u32                   ir_net;
+       __be32                  ir_net;
        struct ipx_interface    *ir_intrfc;
        unsigned char           ir_routed;
        unsigned char           ir_router_node[IPX_NODE_LEN];
@@ -82,18 +82,22 @@ struct ipx_route {
 #ifdef __KERNEL__
 struct ipx_cb {
        u8      ipx_tctrl;
-       u32     ipx_dest_net;
-       u32     ipx_source_net;
+       __be32  ipx_dest_net;
+       __be32  ipx_source_net;
        struct {
-               u32 netnum;
+               __be32 netnum;
                int index;
        } last_hop;
 };
 
-struct ipx_opt {
+#include <net/sock.h>
+
+struct ipx_sock {
+       /* struct sock has to be the first member of ipx_sock */
+       struct sock             sk;
        struct ipx_address      dest_addr;
        struct ipx_interface    *intrfc;
-       unsigned short          port;
+       __be16                  port;
 #ifdef CONFIG_IPX_INTERN
        unsigned char           node[IPX_NODE_LEN];
 #endif
@@ -105,9 +109,14 @@ struct ipx_opt {
        unsigned short          ipx_ncp_conn;
 };
 
-#define ipx_sk(__sk) ((struct ipx_opt *)(__sk)->sk_protinfo)
+static inline struct ipx_sock *ipx_sk(struct sock *sk)
+{
+       return (struct ipx_sock *)sk;
+}
+
 #define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0]))
 #endif
+
 #define IPX_MIN_EPHEMERAL_SOCKET       0x4000
 #define IPX_MAX_EPHEMERAL_SOCKET       0x7fff
 
@@ -123,7 +132,7 @@ extern struct ipx_interface *ipx_primary_net;
 extern int ipx_proc_init(void);
 extern void ipx_proc_exit(void);
 
-extern const char *ipx_frame_name(unsigned short);
+extern const char *ipx_frame_name(__be16);
 extern const char *ipx_device_name(struct ipx_interface *intrfc);
 
 static __inline__ void ipxitf_hold(struct ipx_interface *intrfc)
@@ -139,14 +148,6 @@ static __inline__ void ipxitf_put(struct ipx_interface *intrfc)
                ipxitf_down(intrfc);
 }
 
-extern void __ipxitf_down(struct ipx_interface *intrfc);
-
-static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
-{
-       if (atomic_dec_and_test(&intrfc->refcnt))
-               __ipxitf_down(intrfc);
-}
-
 static __inline__ void ipxrtr_hold(struct ipx_route *rt)
 {
                atomic_inc(&rt->refcnt);