aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dn_nsp.h
diff options
context:
space:
mode:
authorSteven Whitehouse <steve@chygwyn.com>2006-03-20 22:42:39 -0800
committerDavid S. Miller <davem@davemloft.net>2006-03-20 22:42:39 -0800
commitc4ea94ab3710eb2434abe2eab1a479c2dc01f8ac (patch)
tree72e07ca7d2d5fe2de31b3f5a4e64fa411efdf18d /include/net/dn_nsp.h
parent[SECURITY]: TCP/UDP getpeersec (diff)
downloadlinux-dev-c4ea94ab3710eb2434abe2eab1a479c2dc01f8ac.tar.xz
linux-dev-c4ea94ab3710eb2434abe2eab1a479c2dc01f8ac.zip
[DECnet]: Endian annotation and fixes for DECnet.
The typedef for dn_address has been removed in favour of using __le16 or __u16 directly as appropriate. All the DECnet header files are updated accordingly. The byte ordering of dn_eth2dn() and dn_dn2eth() are both changed since just about all their callers wanted network order rather than host order, so the conversion is now done in the functions themselves. Several missed endianess conversions have been picked up during the conversion process. The nh_gw field in struct dn_fib_info has been changed from a 32 bit field to 16 bits as it ought to be. One or two cases of using htons rather than dn_htons in the routing code have been found and fixed. There are still a few warnings to fix, but this patch deals with the important cases. Signed-off-by: Steven Whitehouse <steve@chygwyn.com> Signed-off-by: Patrick Caulfield <patrick@tykepenguin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dn_nsp.h')
-rw-r--r--include/net/dn_nsp.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h
index e6182b86262b..96e816b6974d 100644
--- a/include/net/dn_nsp.h
+++ b/include/net/dn_nsp.h
@@ -72,77 +72,77 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl
struct nsp_data_seg_msg
{
- unsigned char msgflg;
- unsigned short dstaddr;
- unsigned short srcaddr;
+ __u8 msgflg;
+ __le16 dstaddr;
+ __le16 srcaddr;
} __attribute__((packed));
struct nsp_data_opt_msg
{
- unsigned short acknum;
- unsigned short segnum;
- unsigned short lsflgs;
+ __le16 acknum;
+ __le16 segnum;
+ __le16 lsflgs;
} __attribute__((packed));
struct nsp_data_opt_msg1
{
- unsigned short acknum;
- unsigned short segnum;
+ __le16 acknum;
+ __le16 segnum;
} __attribute__((packed));
/* Acknowledgment Message (data/other data) */
struct nsp_data_ack_msg
{
- unsigned char msgflg;
- unsigned short dstaddr;
- unsigned short srcaddr;
- unsigned short acknum;
+ __u8 msgflg;
+ __le16 dstaddr;
+ __le16 srcaddr;
+ __le16 acknum;
} __attribute__((packed));
/* Connect Acknowledgment Message */
struct nsp_conn_ack_msg
{
- unsigned char msgflg;
- unsigned short dstaddr;
+ __u8 msgflg;
+ __le16 dstaddr;
} __attribute__((packed));
/* Connect Initiate/Retransmit Initiate/Connect Confirm */
struct nsp_conn_init_msg
{
- unsigned char msgflg;
+ __u8 msgflg;
#define NSP_CI 0x18 /* Connect Initiate */
#define NSP_RCI 0x68 /* Retrans. Conn Init */
- unsigned short dstaddr;
- unsigned short srcaddr;
- unsigned char services;
+ __le16 dstaddr;
+ __le16 srcaddr;
+ __u8 services;
#define NSP_FC_NONE 0x00 /* Flow Control None */
#define NSP_FC_SRC 0x04 /* Seg Req. Count */
#define NSP_FC_SCMC 0x08 /* Sess. Control Mess */
#define NSP_FC_MASK 0x0c /* FC type mask */
- unsigned char info;
- unsigned short segsize;
+ __u8 info;
+ __le16 segsize;
} __attribute__((packed));
/* Disconnect Initiate/Disconnect Confirm */
struct nsp_disconn_init_msg
{
- unsigned char msgflg;
- unsigned short dstaddr;
- unsigned short srcaddr;
- unsigned short reason;
+ __u8 msgflg;
+ __le16 dstaddr;
+ __le16 srcaddr;
+ __le16 reason;
} __attribute__((packed));
struct srcobj_fmt
{
- char format;
- unsigned char task;
- unsigned short grpcode;
- unsigned short usrcode;
- char dlen;
+ __u8 format;
+ __u8 task;
+ __le16 grpcode;
+ __le16 usrcode;
+ __u8 dlen;
} __attribute__((packed));
/*
@@ -150,7 +150,7 @@ struct srcobj_fmt
* numbers used in NSP. Similar in operation to the functions
* of the same name in TCP.
*/
-static __inline__ int dn_before(unsigned short seq1, unsigned short seq2)
+static __inline__ int dn_before(__u16 seq1, __u16 seq2)
{
seq1 &= 0x0fff;
seq2 &= 0x0fff;
@@ -159,7 +159,7 @@ static __inline__ int dn_before(unsigned short seq1, unsigned short seq2)
}
-static __inline__ int dn_after(unsigned short seq1, unsigned short seq2)
+static __inline__ int dn_after(__u16 seq1, __u16 seq2)
{
seq1 &= 0x0fff;
seq2 &= 0x0fff;
@@ -167,23 +167,23 @@ static __inline__ int dn_after(unsigned short seq1, unsigned short seq2)
return (int)((seq2 - seq1) & 0x0fff) > 2048;
}
-static __inline__ int dn_equal(unsigned short seq1, unsigned short seq2)
+static __inline__ int dn_equal(__u16 seq1, __u16 seq2)
{
return ((seq1 ^ seq2) & 0x0fff) == 0;
}
-static __inline__ int dn_before_or_equal(unsigned short seq1, unsigned short seq2)
+static __inline__ int dn_before_or_equal(__u16 seq1, __u16 seq2)
{
return (dn_before(seq1, seq2) || dn_equal(seq1, seq2));
}
-static __inline__ void seq_add(unsigned short *seq, unsigned short off)
+static __inline__ void seq_add(__u16 *seq, __u16 off)
{
(*seq) += off;
(*seq) &= 0x0fff;
}
-static __inline__ int seq_next(unsigned short seq1, unsigned short seq2)
+static __inline__ int seq_next(__u16 seq1, __u16 seq2)
{
return dn_equal(seq1 + 1, seq2);
}
@@ -191,7 +191,7 @@ static __inline__ int seq_next(unsigned short seq1, unsigned short seq2)
/*
* Can we delay the ack ?
*/
-static __inline__ int sendack(unsigned short seq)
+static __inline__ int sendack(__u16 seq)
{
return (int)((seq & 0x1000) ? 0 : 1);
}