diff options
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/af_unix.h | 3 | ||||
| -rw-r--r-- | include/net/compat.h | 4 | ||||
| -rw-r--r-- | include/net/dn.h | 105 | ||||
| -rw-r--r-- | include/net/dn_dev.h | 88 | ||||
| -rw-r--r-- | include/net/dn_fib.h | 22 | ||||
| -rw-r--r-- | include/net/dn_neigh.h | 4 | ||||
| -rw-r--r-- | include/net/dn_nsp.h | 72 | ||||
| -rw-r--r-- | include/net/dn_route.h | 12 | ||||
| -rw-r--r-- | include/net/flow.h | 8 | ||||
| -rw-r--r-- | include/net/ieee80211softmac.h | 292 | ||||
| -rw-r--r-- | include/net/ieee80211softmac_wx.h | 94 | ||||
| -rw-r--r-- | include/net/if_inet6.h | 3 | ||||
| -rw-r--r-- | include/net/inet_connection_sock.h | 26 | ||||
| -rw-r--r-- | include/net/ip.h | 4 | ||||
| -rw-r--r-- | include/net/ip6_route.h | 24 | ||||
| -rw-r--r-- | include/net/ipv6.h | 22 | ||||
| -rw-r--r-- | include/net/iw_handler.h | 12 | ||||
| -rw-r--r-- | include/net/llc.h | 2 | ||||
| -rw-r--r-- | include/net/ndisc.h | 2 | ||||
| -rw-r--r-- | include/net/neighbour.h | 2 | ||||
| -rw-r--r-- | include/net/netfilter/nf_conntrack.h | 60 | ||||
| -rw-r--r-- | include/net/scm.h | 10 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 10 | ||||
| -rw-r--r-- | include/net/sock.h | 12 | ||||
| -rw-r--r-- | include/net/tc_act/tc_ipt.h | 4 | ||||
| -rw-r--r-- | include/net/tcp.h | 16 | ||||
| -rw-r--r-- | include/net/x25.h | 21 | ||||
| -rw-r--r-- | include/net/xfrm.h | 62 |
28 files changed, 794 insertions, 202 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index bfc1779fc753..427dac94bc7e 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
| 5 | #include <linux/socket.h> | 5 | #include <linux/socket.h> |
| 6 | #include <linux/un.h> | 6 | #include <linux/un.h> |
| 7 | #include <linux/mutex.h> | ||
| 7 | #include <net/sock.h> | 8 | #include <net/sock.h> |
| 8 | 9 | ||
| 9 | extern void unix_inflight(struct file *fp); | 10 | extern void unix_inflight(struct file *fp); |
| @@ -71,7 +72,7 @@ struct unix_sock { | |||
| 71 | struct unix_address *addr; | 72 | struct unix_address *addr; |
| 72 | struct dentry *dentry; | 73 | struct dentry *dentry; |
| 73 | struct vfsmount *mnt; | 74 | struct vfsmount *mnt; |
| 74 | struct semaphore readsem; | 75 | struct mutex readlock; |
| 75 | struct sock *peer; | 76 | struct sock *peer; |
| 76 | struct sock *other; | 77 | struct sock *other; |
| 77 | struct sock *gc_tree; | 78 | struct sock *gc_tree; |
diff --git a/include/net/compat.h b/include/net/compat.h index 290bab46d457..8662b8f43df5 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
| @@ -23,6 +23,9 @@ struct compat_cmsghdr { | |||
| 23 | compat_int_t cmsg_type; | 23 | compat_int_t cmsg_type; |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | struct sock; | ||
| 27 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | ||
| 28 | |||
| 26 | #else /* defined(CONFIG_COMPAT) */ | 29 | #else /* defined(CONFIG_COMPAT) */ |
| 27 | #define compat_msghdr msghdr /* to avoid compiler warnings */ | 30 | #define compat_msghdr msghdr /* to avoid compiler warnings */ |
| 28 | #endif /* defined(CONFIG_COMPAT) */ | 31 | #endif /* defined(CONFIG_COMPAT) */ |
| @@ -34,7 +37,6 @@ extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsi | |||
| 34 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 37 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); |
| 35 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); | 38 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); |
| 36 | 39 | ||
| 37 | struct sock; | ||
| 38 | extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); | 40 | extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); |
| 39 | 41 | ||
| 40 | #endif /* NET_COMPAT_H */ | 42 | #endif /* NET_COMPAT_H */ |
diff --git a/include/net/dn.h b/include/net/dn.h index a4b6168e1e25..465b78302782 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
| @@ -6,10 +6,8 @@ | |||
| 6 | #include <net/tcp.h> | 6 | #include <net/tcp.h> |
| 7 | #include <asm/byteorder.h> | 7 | #include <asm/byteorder.h> |
| 8 | 8 | ||
| 9 | typedef unsigned short dn_address; | 9 | #define dn_ntohs(x) le16_to_cpu(x) |
| 10 | 10 | #define dn_htons(x) cpu_to_le16(x) | |
| 11 | #define dn_ntohs(x) le16_to_cpu((unsigned short)(x)) | ||
| 12 | #define dn_htons(x) cpu_to_le16((unsigned short)(x)) | ||
| 13 | 11 | ||
| 14 | struct dn_scp /* Session Control Port */ | 12 | struct dn_scp /* Session Control Port */ |
| 15 | { | 13 | { |
| @@ -31,36 +29,36 @@ struct dn_scp /* Session Control Port */ | |||
| 31 | #define DN_CL 15 /* Closed */ | 29 | #define DN_CL 15 /* Closed */ |
| 32 | #define DN_CN 16 /* Closed Notification */ | 30 | #define DN_CN 16 /* Closed Notification */ |
| 33 | 31 | ||
| 34 | unsigned short addrloc; | 32 | __le16 addrloc; |
| 35 | unsigned short addrrem; | 33 | __le16 addrrem; |
| 36 | unsigned short numdat; | 34 | __u16 numdat; |
| 37 | unsigned short numoth; | 35 | __u16 numoth; |
| 38 | unsigned short numoth_rcv; | 36 | __u16 numoth_rcv; |
| 39 | unsigned short numdat_rcv; | 37 | __u16 numdat_rcv; |
| 40 | unsigned short ackxmt_dat; | 38 | __u16 ackxmt_dat; |
| 41 | unsigned short ackxmt_oth; | 39 | __u16 ackxmt_oth; |
| 42 | unsigned short ackrcv_dat; | 40 | __u16 ackrcv_dat; |
| 43 | unsigned short ackrcv_oth; | 41 | __u16 ackrcv_oth; |
| 44 | unsigned char flowrem_sw; | 42 | __u8 flowrem_sw; |
| 45 | unsigned char flowloc_sw; | 43 | __u8 flowloc_sw; |
| 46 | #define DN_SEND 2 | 44 | #define DN_SEND 2 |
| 47 | #define DN_DONTSEND 1 | 45 | #define DN_DONTSEND 1 |
| 48 | #define DN_NOCHANGE 0 | 46 | #define DN_NOCHANGE 0 |
| 49 | unsigned short flowrem_dat; | 47 | __u16 flowrem_dat; |
| 50 | unsigned short flowrem_oth; | 48 | __u16 flowrem_oth; |
| 51 | unsigned short flowloc_dat; | 49 | __u16 flowloc_dat; |
| 52 | unsigned short flowloc_oth; | 50 | __u16 flowloc_oth; |
| 53 | unsigned char services_rem; | 51 | __u8 services_rem; |
| 54 | unsigned char services_loc; | 52 | __u8 services_loc; |
| 55 | unsigned char info_rem; | 53 | __u8 info_rem; |
| 56 | unsigned char info_loc; | 54 | __u8 info_loc; |
| 57 | 55 | ||
| 58 | unsigned short segsize_rem; | 56 | __u16 segsize_rem; |
| 59 | unsigned short segsize_loc; | 57 | __u16 segsize_loc; |
| 60 | 58 | ||
| 61 | unsigned char nonagle; | 59 | __u8 nonagle; |
| 62 | unsigned char multi_ireq; | 60 | __u8 multi_ireq; |
| 63 | unsigned char accept_mode; | 61 | __u8 accept_mode; |
| 64 | unsigned long seg_total; /* Running total of current segment */ | 62 | unsigned long seg_total; /* Running total of current segment */ |
| 65 | 63 | ||
| 66 | struct optdata_dn conndata_in; | 64 | struct optdata_dn conndata_in; |
| @@ -160,40 +158,41 @@ static inline struct dn_scp *DN_SK(struct sock *sk) | |||
| 160 | */ | 158 | */ |
| 161 | #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb) | 159 | #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb) |
| 162 | struct dn_skb_cb { | 160 | struct dn_skb_cb { |
| 163 | unsigned short dst; | 161 | __le16 dst; |
| 164 | unsigned short src; | 162 | __le16 src; |
| 165 | unsigned short hops; | 163 | __u16 hops; |
| 166 | unsigned short dst_port; | 164 | __le16 dst_port; |
| 167 | unsigned short src_port; | 165 | __le16 src_port; |
| 168 | unsigned char services; | 166 | __u8 services; |
| 169 | unsigned char info; | 167 | __u8 info; |
| 170 | unsigned char rt_flags; | 168 | __u8 rt_flags; |
| 171 | unsigned char nsp_flags; | 169 | __u8 nsp_flags; |
| 172 | unsigned short segsize; | 170 | __u16 segsize; |
| 173 | unsigned short segnum; | 171 | __u16 segnum; |
| 174 | unsigned short xmit_count; | 172 | __u16 xmit_count; |
| 175 | unsigned long stamp; | 173 | unsigned long stamp; |
| 176 | int iif; | 174 | int iif; |
| 177 | }; | 175 | }; |
| 178 | 176 | ||
| 179 | static inline dn_address dn_eth2dn(unsigned char *ethaddr) | 177 | static inline __le16 dn_eth2dn(unsigned char *ethaddr) |
| 180 | { | 178 | { |
| 181 | return ethaddr[4] | (ethaddr[5] << 8); | 179 | return dn_htons(ethaddr[4] | (ethaddr[5] << 8)); |
| 182 | } | 180 | } |
| 183 | 181 | ||
| 184 | static inline dn_address dn_saddr2dn(struct sockaddr_dn *saddr) | 182 | static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr) |
| 185 | { | 183 | { |
| 186 | return *(dn_address *)saddr->sdn_nodeaddr; | 184 | return *(__le16 *)saddr->sdn_nodeaddr; |
| 187 | } | 185 | } |
| 188 | 186 | ||
| 189 | static inline void dn_dn2eth(unsigned char *ethaddr, dn_address addr) | 187 | static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr) |
| 190 | { | 188 | { |
| 189 | __u16 a = dn_ntohs(addr); | ||
| 191 | ethaddr[0] = 0xAA; | 190 | ethaddr[0] = 0xAA; |
| 192 | ethaddr[1] = 0x00; | 191 | ethaddr[1] = 0x00; |
| 193 | ethaddr[2] = 0x04; | 192 | ethaddr[2] = 0x04; |
| 194 | ethaddr[3] = 0x00; | 193 | ethaddr[3] = 0x00; |
| 195 | ethaddr[4] = (unsigned char)(addr & 0xff); | 194 | ethaddr[4] = (__u8)(a & 0xff); |
| 196 | ethaddr[5] = (unsigned char)(addr >> 8); | 195 | ethaddr[5] = (__u8)(a >> 8); |
| 197 | } | 196 | } |
| 198 | 197 | ||
| 199 | static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | 198 | static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) |
| @@ -202,7 +201,7 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | |||
| 202 | fl->uli_u.dnports.dport = scp->addrrem; | 201 | fl->uli_u.dnports.dport = scp->addrrem; |
| 203 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; | 202 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; |
| 204 | if (fl->uli_u.dnports.objnum == 0) { | 203 | if (fl->uli_u.dnports.objnum == 0) { |
| 205 | fl->uli_u.dnports.objnamel = scp->addr.sdn_objnamel; | 204 | fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel); |
| 206 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); | 205 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); |
| 207 | } | 206 | } |
| 208 | } | 207 | } |
| @@ -217,7 +216,7 @@ extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); | |||
| 217 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); | 216 | extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr); |
| 218 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); | 217 | extern struct sock *dn_find_by_skb(struct sk_buff *skb); |
| 219 | #define DN_ASCBUF_LEN 9 | 218 | #define DN_ASCBUF_LEN 9 |
| 220 | extern char *dn_addr2asc(dn_address, char *); | 219 | extern char *dn_addr2asc(__u16, char *); |
| 221 | extern int dn_destroy_timer(struct sock *sk); | 220 | extern int dn_destroy_timer(struct sock *sk); |
| 222 | 221 | ||
| 223 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); | 222 | extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type); |
| @@ -226,7 +225,7 @@ extern int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn | |||
| 226 | extern void dn_start_slow_timer(struct sock *sk); | 225 | extern void dn_start_slow_timer(struct sock *sk); |
| 227 | extern void dn_stop_slow_timer(struct sock *sk); | 226 | extern void dn_stop_slow_timer(struct sock *sk); |
| 228 | 227 | ||
| 229 | extern dn_address decnet_address; | 228 | extern __le16 decnet_address; |
| 230 | extern int decnet_debug_level; | 229 | extern int decnet_debug_level; |
| 231 | extern int decnet_time_wait; | 230 | extern int decnet_time_wait; |
| 232 | extern int decnet_dn_count; | 231 | extern int decnet_dn_count; |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 5a86e78081bf..cee46821dc53 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
| @@ -7,11 +7,11 @@ struct dn_dev; | |||
| 7 | struct dn_ifaddr { | 7 | struct dn_ifaddr { |
| 8 | struct dn_ifaddr *ifa_next; | 8 | struct dn_ifaddr *ifa_next; |
| 9 | struct dn_dev *ifa_dev; | 9 | struct dn_dev *ifa_dev; |
| 10 | dn_address ifa_local; | 10 | __le16 ifa_local; |
| 11 | dn_address ifa_address; | 11 | __le16 ifa_address; |
| 12 | unsigned char ifa_flags; | 12 | __u8 ifa_flags; |
| 13 | unsigned char ifa_scope; | 13 | __u8 ifa_scope; |
| 14 | char ifa_label[IFNAMSIZ]; | 14 | char ifa_label[IFNAMSIZ]; |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | #define DN_DEV_S_RU 0 /* Run - working normally */ | 17 | #define DN_DEV_S_RU 0 /* Run - working normally */ |
| @@ -91,7 +91,7 @@ struct dn_dev { | |||
| 91 | struct timer_list timer; | 91 | struct timer_list timer; |
| 92 | unsigned long t3; | 92 | unsigned long t3; |
| 93 | struct neigh_parms *neigh_parms; | 93 | struct neigh_parms *neigh_parms; |
| 94 | unsigned char addr[ETH_ALEN]; | 94 | __u8 addr[ETH_ALEN]; |
| 95 | struct neighbour *router; /* Default router on circuit */ | 95 | struct neighbour *router; /* Default router on circuit */ |
| 96 | struct neighbour *peer; /* Peer on pointopoint links */ | 96 | struct neighbour *peer; /* Peer on pointopoint links */ |
| 97 | unsigned long uptime; /* Time device went up in jiffies */ | 97 | unsigned long uptime; /* Time device went up in jiffies */ |
| @@ -99,56 +99,56 @@ struct dn_dev { | |||
| 99 | 99 | ||
| 100 | struct dn_short_packet | 100 | struct dn_short_packet |
| 101 | { | 101 | { |
| 102 | unsigned char msgflg; | 102 | __u8 msgflg; |
| 103 | unsigned short dstnode; | 103 | __le16 dstnode; |
| 104 | unsigned short srcnode; | 104 | __le16 srcnode; |
| 105 | unsigned char forward; | 105 | __u8 forward; |
| 106 | } __attribute__((packed)); | 106 | } __attribute__((packed)); |
| 107 | 107 | ||
| 108 | struct dn_long_packet | 108 | struct dn_long_packet |
| 109 | { | 109 | { |
| 110 | unsigned char msgflg; | 110 | __u8 msgflg; |
| 111 | unsigned char d_area; | 111 | __u8 d_area; |
| 112 | unsigned char d_subarea; | 112 | __u8 d_subarea; |
| 113 | unsigned char d_id[6]; | 113 | __u8 d_id[6]; |
| 114 | unsigned char s_area; | 114 | __u8 s_area; |
| 115 | unsigned char s_subarea; | 115 | __u8 s_subarea; |
| 116 | unsigned char s_id[6]; | 116 | __u8 s_id[6]; |
| 117 | unsigned char nl2; | 117 | __u8 nl2; |
| 118 | unsigned char visit_ct; | 118 | __u8 visit_ct; |
| 119 | unsigned char s_class; | 119 | __u8 s_class; |
| 120 | unsigned char pt; | 120 | __u8 pt; |
| 121 | } __attribute__((packed)); | 121 | } __attribute__((packed)); |
| 122 | 122 | ||
| 123 | /*------------------------- DRP - Routing messages ---------------------*/ | 123 | /*------------------------- DRP - Routing messages ---------------------*/ |
| 124 | 124 | ||
| 125 | struct endnode_hello_message | 125 | struct endnode_hello_message |
| 126 | { | 126 | { |
| 127 | unsigned char msgflg; | 127 | __u8 msgflg; |
| 128 | unsigned char tiver[3]; | 128 | __u8 tiver[3]; |
| 129 | unsigned char id[6]; | 129 | __u8 id[6]; |
| 130 | unsigned char iinfo; | 130 | __u8 iinfo; |
| 131 | unsigned short blksize; | 131 | __le16 blksize; |
| 132 | unsigned char area; | 132 | __u8 area; |
| 133 | unsigned char seed[8]; | 133 | __u8 seed[8]; |
| 134 | unsigned char neighbor[6]; | 134 | __u8 neighbor[6]; |
| 135 | unsigned short timer; | 135 | __le16 timer; |
| 136 | unsigned char mpd; | 136 | __u8 mpd; |
| 137 | unsigned char datalen; | 137 | __u8 datalen; |
| 138 | unsigned char data[2]; | 138 | __u8 data[2]; |
| 139 | } __attribute__((packed)); | 139 | } __attribute__((packed)); |
| 140 | 140 | ||
| 141 | struct rtnode_hello_message | 141 | struct rtnode_hello_message |
| 142 | { | 142 | { |
| 143 | unsigned char msgflg; | 143 | __u8 msgflg; |
| 144 | unsigned char tiver[3]; | 144 | __u8 tiver[3]; |
| 145 | unsigned char id[6]; | 145 | __u8 id[6]; |
| 146 | unsigned char iinfo; | 146 | __u8 iinfo; |
| 147 | unsigned short blksize; | 147 | __le16 blksize; |
| 148 | unsigned char priority; | 148 | __u8 priority; |
| 149 | unsigned char area; | 149 | __u8 area; |
| 150 | unsigned short timer; | 150 | __le16 timer; |
| 151 | unsigned char mpd; | 151 | __u8 mpd; |
| 152 | } __attribute__((packed)); | 152 | } __attribute__((packed)); |
| 153 | 153 | ||
| 154 | 154 | ||
| @@ -169,12 +169,12 @@ extern void dn_dev_down(struct net_device *); | |||
| 169 | 169 | ||
| 170 | extern int dn_dev_set_default(struct net_device *dev, int force); | 170 | extern int dn_dev_set_default(struct net_device *dev, int force); |
| 171 | extern struct net_device *dn_dev_get_default(void); | 171 | extern struct net_device *dn_dev_get_default(void); |
| 172 | extern int dn_dev_bind_default(dn_address *addr); | 172 | extern int dn_dev_bind_default(__le16 *addr); |
| 173 | 173 | ||
| 174 | extern int register_dnaddr_notifier(struct notifier_block *nb); | 174 | extern int register_dnaddr_notifier(struct notifier_block *nb); |
| 175 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); | 175 | extern int unregister_dnaddr_notifier(struct notifier_block *nb); |
| 176 | 176 | ||
| 177 | static inline int dn_dev_islocal(struct net_device *dev, dn_address addr) | 177 | static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) |
| 178 | { | 178 | { |
| 179 | struct dn_dev *dn_db = dev->dn_ptr; | 179 | struct dn_dev *dn_db = dev->dn_ptr; |
| 180 | struct dn_ifaddr *ifa; | 180 | struct dn_ifaddr *ifa; |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index cd3c96d9601b..a15dcf0d5c1e 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
| @@ -37,7 +37,7 @@ struct dn_fib_nh { | |||
| 37 | int nh_weight; | 37 | int nh_weight; |
| 38 | int nh_power; | 38 | int nh_power; |
| 39 | int nh_oif; | 39 | int nh_oif; |
| 40 | u32 nh_gw; | 40 | __le16 nh_gw; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | struct dn_fib_info { | 43 | struct dn_fib_info { |
| @@ -48,7 +48,7 @@ struct dn_fib_info { | |||
| 48 | int fib_dead; | 48 | int fib_dead; |
| 49 | unsigned fib_flags; | 49 | unsigned fib_flags; |
| 50 | int fib_protocol; | 50 | int fib_protocol; |
| 51 | dn_address fib_prefsrc; | 51 | __le16 fib_prefsrc; |
| 52 | __u32 fib_priority; | 52 | __u32 fib_priority; |
| 53 | __u32 fib_metrics[RTAX_MAX]; | 53 | __u32 fib_metrics[RTAX_MAX]; |
| 54 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] | 54 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] |
| @@ -71,15 +71,15 @@ struct dn_fib_info { | |||
| 71 | #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) | 71 | #define DN_FIB_RES_OIF(res) (DN_FIB_RES_NH(res).nh_oif) |
| 72 | 72 | ||
| 73 | typedef struct { | 73 | typedef struct { |
| 74 | u16 datum; | 74 | __le16 datum; |
| 75 | } dn_fib_key_t; | 75 | } dn_fib_key_t; |
| 76 | 76 | ||
| 77 | typedef struct { | 77 | typedef struct { |
| 78 | u16 datum; | 78 | __le16 datum; |
| 79 | } dn_fib_hash_t; | 79 | } dn_fib_hash_t; |
| 80 | 80 | ||
| 81 | typedef struct { | 81 | typedef struct { |
| 82 | u16 datum; | 82 | __u16 datum; |
| 83 | } dn_fib_idx_t; | 83 | } dn_fib_idx_t; |
| 84 | 84 | ||
| 85 | struct dn_fib_node { | 85 | struct dn_fib_node { |
| @@ -126,11 +126,11 @@ extern int dn_fib_semantic_match(int type, struct dn_fib_info *fi, | |||
| 126 | const struct flowi *fl, | 126 | const struct flowi *fl, |
| 127 | struct dn_fib_res *res); | 127 | struct dn_fib_res *res); |
| 128 | extern void dn_fib_release_info(struct dn_fib_info *fi); | 128 | extern void dn_fib_release_info(struct dn_fib_info *fi); |
| 129 | extern u16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type); | 129 | extern __le16 dn_fib_get_attr16(struct rtattr *attr, int attrlen, int type); |
| 130 | extern void dn_fib_flush(void); | 130 | extern void dn_fib_flush(void); |
| 131 | extern void dn_fib_select_multipath(const struct flowi *fl, | 131 | extern void dn_fib_select_multipath(const struct flowi *fl, |
| 132 | struct dn_fib_res *res); | 132 | struct dn_fib_res *res); |
| 133 | extern int dn_fib_sync_down(dn_address local, struct net_device *dev, | 133 | extern int dn_fib_sync_down(__le16 local, struct net_device *dev, |
| 134 | int force); | 134 | int force); |
| 135 | extern int dn_fib_sync_up(struct net_device *dev); | 135 | extern int dn_fib_sync_up(struct net_device *dev); |
| 136 | 136 | ||
| @@ -148,8 +148,8 @@ extern void dn_fib_table_cleanup(void); | |||
| 148 | extern void dn_fib_rules_init(void); | 148 | extern void dn_fib_rules_init(void); |
| 149 | extern void dn_fib_rules_cleanup(void); | 149 | extern void dn_fib_rules_cleanup(void); |
| 150 | extern void dn_fib_rule_put(struct dn_fib_rule *); | 150 | extern void dn_fib_rule_put(struct dn_fib_rule *); |
| 151 | extern __u16 dn_fib_rules_policy(__u16 saddr, struct dn_fib_res *res, unsigned *flags); | 151 | extern __le16 dn_fib_rules_policy(__le16 saddr, struct dn_fib_res *res, unsigned *flags); |
| 152 | extern unsigned dnet_addr_type(__u16 addr); | 152 | extern unsigned dnet_addr_type(__le16 addr); |
| 153 | extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); | 153 | extern int dn_fib_lookup(const struct flowi *fl, struct dn_fib_res *res); |
| 154 | 154 | ||
| 155 | /* | 155 | /* |
| @@ -194,10 +194,10 @@ extern struct dn_fib_table *dn_fib_tables[]; | |||
| 194 | 194 | ||
| 195 | #endif /* CONFIG_DECNET_ROUTER */ | 195 | #endif /* CONFIG_DECNET_ROUTER */ |
| 196 | 196 | ||
| 197 | static inline u16 dnet_make_mask(int n) | 197 | static inline __le16 dnet_make_mask(int n) |
| 198 | { | 198 | { |
| 199 | if (n) | 199 | if (n) |
| 200 | return htons(~((1<<(16-n))-1)); | 200 | return dn_htons(~((1<<(16-n))-1)); |
| 201 | return 0; | 201 | return 0; |
| 202 | } | 202 | } |
| 203 | 203 | ||
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h index 4b1eb038d637..4cb4ae7fb81f 100644 --- a/include/net/dn_neigh.h +++ b/include/net/dn_neigh.h | |||
| @@ -7,13 +7,13 @@ | |||
| 7 | */ | 7 | */ |
| 8 | struct dn_neigh { | 8 | struct dn_neigh { |
| 9 | struct neighbour n; | 9 | struct neighbour n; |
| 10 | dn_address addr; | 10 | __le16 addr; |
| 11 | unsigned long flags; | 11 | unsigned long flags; |
| 12 | #define DN_NDFLAG_R1 0x0001 /* Router L1 */ | 12 | #define DN_NDFLAG_R1 0x0001 /* Router L1 */ |
| 13 | #define DN_NDFLAG_R2 0x0002 /* Router L2 */ | 13 | #define DN_NDFLAG_R2 0x0002 /* Router L2 */ |
| 14 | #define DN_NDFLAG_P3 0x0004 /* Phase III Node */ | 14 | #define DN_NDFLAG_P3 0x0004 /* Phase III Node */ |
| 15 | unsigned long blksize; | 15 | unsigned long blksize; |
| 16 | unsigned char priority; | 16 | __u8 priority; |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | extern void dn_neigh_init(void); | 19 | extern void dn_neigh_init(void); |
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 | |||
| 72 | 72 | ||
| 73 | struct nsp_data_seg_msg | 73 | struct nsp_data_seg_msg |
| 74 | { | 74 | { |
| 75 | unsigned char msgflg; | 75 | __u8 msgflg; |
| 76 | unsigned short dstaddr; | 76 | __le16 dstaddr; |
| 77 | unsigned short srcaddr; | 77 | __le16 srcaddr; |
| 78 | } __attribute__((packed)); | 78 | } __attribute__((packed)); |
| 79 | 79 | ||
| 80 | struct nsp_data_opt_msg | 80 | struct nsp_data_opt_msg |
| 81 | { | 81 | { |
| 82 | unsigned short acknum; | 82 | __le16 acknum; |
| 83 | unsigned short segnum; | 83 | __le16 segnum; |
| 84 | unsigned short lsflgs; | 84 | __le16 lsflgs; |
| 85 | } __attribute__((packed)); | 85 | } __attribute__((packed)); |
| 86 | 86 | ||
| 87 | struct nsp_data_opt_msg1 | 87 | struct nsp_data_opt_msg1 |
| 88 | { | 88 | { |
| 89 | unsigned short acknum; | 89 | __le16 acknum; |
| 90 | unsigned short segnum; | 90 | __le16 segnum; |
| 91 | } __attribute__((packed)); | 91 | } __attribute__((packed)); |
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | /* Acknowledgment Message (data/other data) */ | 94 | /* Acknowledgment Message (data/other data) */ |
| 95 | struct nsp_data_ack_msg | 95 | struct nsp_data_ack_msg |
| 96 | { | 96 | { |
| 97 | unsigned char msgflg; | 97 | __u8 msgflg; |
| 98 | unsigned short dstaddr; | 98 | __le16 dstaddr; |
| 99 | unsigned short srcaddr; | 99 | __le16 srcaddr; |
| 100 | unsigned short acknum; | 100 | __le16 acknum; |
| 101 | } __attribute__((packed)); | 101 | } __attribute__((packed)); |
| 102 | 102 | ||
| 103 | /* Connect Acknowledgment Message */ | 103 | /* Connect Acknowledgment Message */ |
| 104 | struct nsp_conn_ack_msg | 104 | struct nsp_conn_ack_msg |
| 105 | { | 105 | { |
| 106 | unsigned char msgflg; | 106 | __u8 msgflg; |
| 107 | unsigned short dstaddr; | 107 | __le16 dstaddr; |
| 108 | } __attribute__((packed)); | 108 | } __attribute__((packed)); |
| 109 | 109 | ||
| 110 | 110 | ||
| 111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ | 111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ |
| 112 | struct nsp_conn_init_msg | 112 | struct nsp_conn_init_msg |
| 113 | { | 113 | { |
| 114 | unsigned char msgflg; | 114 | __u8 msgflg; |
| 115 | #define NSP_CI 0x18 /* Connect Initiate */ | 115 | #define NSP_CI 0x18 /* Connect Initiate */ |
| 116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ | 116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ |
| 117 | unsigned short dstaddr; | 117 | __le16 dstaddr; |
| 118 | unsigned short srcaddr; | 118 | __le16 srcaddr; |
| 119 | unsigned char services; | 119 | __u8 services; |
| 120 | #define NSP_FC_NONE 0x00 /* Flow Control None */ | 120 | #define NSP_FC_NONE 0x00 /* Flow Control None */ |
| 121 | #define NSP_FC_SRC 0x04 /* Seg Req. Count */ | 121 | #define NSP_FC_SRC 0x04 /* Seg Req. Count */ |
| 122 | #define NSP_FC_SCMC 0x08 /* Sess. Control Mess */ | 122 | #define NSP_FC_SCMC 0x08 /* Sess. Control Mess */ |
| 123 | #define NSP_FC_MASK 0x0c /* FC type mask */ | 123 | #define NSP_FC_MASK 0x0c /* FC type mask */ |
| 124 | unsigned char info; | 124 | __u8 info; |
| 125 | unsigned short segsize; | 125 | __le16 segsize; |
| 126 | } __attribute__((packed)); | 126 | } __attribute__((packed)); |
| 127 | 127 | ||
| 128 | /* Disconnect Initiate/Disconnect Confirm */ | 128 | /* Disconnect Initiate/Disconnect Confirm */ |
| 129 | struct nsp_disconn_init_msg | 129 | struct nsp_disconn_init_msg |
| 130 | { | 130 | { |
| 131 | unsigned char msgflg; | 131 | __u8 msgflg; |
| 132 | unsigned short dstaddr; | 132 | __le16 dstaddr; |
| 133 | unsigned short srcaddr; | 133 | __le16 srcaddr; |
| 134 | unsigned short reason; | 134 | __le16 reason; |
| 135 | } __attribute__((packed)); | 135 | } __attribute__((packed)); |
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | 138 | ||
| 139 | struct srcobj_fmt | 139 | struct srcobj_fmt |
| 140 | { | 140 | { |
| 141 | char format; | 141 | __u8 format; |
| 142 | unsigned char task; | 142 | __u8 task; |
| 143 | unsigned short grpcode; | 143 | __le16 grpcode; |
| 144 | unsigned short usrcode; | 144 | __le16 usrcode; |
| 145 | char dlen; | 145 | __u8 dlen; |
| 146 | } __attribute__((packed)); | 146 | } __attribute__((packed)); |
| 147 | 147 | ||
| 148 | /* | 148 | /* |
| @@ -150,7 +150,7 @@ struct srcobj_fmt | |||
| 150 | * numbers used in NSP. Similar in operation to the functions | 150 | * numbers used in NSP. Similar in operation to the functions |
| 151 | * of the same name in TCP. | 151 | * of the same name in TCP. |
| 152 | */ | 152 | */ |
| 153 | static __inline__ int dn_before(unsigned short seq1, unsigned short seq2) | 153 | static __inline__ int dn_before(__u16 seq1, __u16 seq2) |
| 154 | { | 154 | { |
| 155 | seq1 &= 0x0fff; | 155 | seq1 &= 0x0fff; |
| 156 | seq2 &= 0x0fff; | 156 | seq2 &= 0x0fff; |
| @@ -159,7 +159,7 @@ static __inline__ int dn_before(unsigned short seq1, unsigned short seq2) | |||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | 161 | ||
| 162 | static __inline__ int dn_after(unsigned short seq1, unsigned short seq2) | 162 | static __inline__ int dn_after(__u16 seq1, __u16 seq2) |
| 163 | { | 163 | { |
| 164 | seq1 &= 0x0fff; | 164 | seq1 &= 0x0fff; |
| 165 | seq2 &= 0x0fff; | 165 | seq2 &= 0x0fff; |
| @@ -167,23 +167,23 @@ static __inline__ int dn_after(unsigned short seq1, unsigned short seq2) | |||
| 167 | return (int)((seq2 - seq1) & 0x0fff) > 2048; | 167 | return (int)((seq2 - seq1) & 0x0fff) > 2048; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | static __inline__ int dn_equal(unsigned short seq1, unsigned short seq2) | 170 | static __inline__ int dn_equal(__u16 seq1, __u16 seq2) |
| 171 | { | 171 | { |
| 172 | return ((seq1 ^ seq2) & 0x0fff) == 0; | 172 | return ((seq1 ^ seq2) & 0x0fff) == 0; |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | static __inline__ int dn_before_or_equal(unsigned short seq1, unsigned short seq2) | 175 | static __inline__ int dn_before_or_equal(__u16 seq1, __u16 seq2) |
| 176 | { | 176 | { |
| 177 | return (dn_before(seq1, seq2) || dn_equal(seq1, seq2)); | 177 | return (dn_before(seq1, seq2) || dn_equal(seq1, seq2)); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | static __inline__ void seq_add(unsigned short *seq, unsigned short off) | 180 | static __inline__ void seq_add(__u16 *seq, __u16 off) |
| 181 | { | 181 | { |
| 182 | (*seq) += off; | 182 | (*seq) += off; |
| 183 | (*seq) &= 0x0fff; | 183 | (*seq) &= 0x0fff; |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | static __inline__ int seq_next(unsigned short seq1, unsigned short seq2) | 186 | static __inline__ int seq_next(__u16 seq1, __u16 seq2) |
| 187 | { | 187 | { |
| 188 | return dn_equal(seq1 + 1, seq2); | 188 | return dn_equal(seq1 + 1, seq2); |
| 189 | } | 189 | } |
| @@ -191,7 +191,7 @@ static __inline__ int seq_next(unsigned short seq1, unsigned short seq2) | |||
| 191 | /* | 191 | /* |
| 192 | * Can we delay the ack ? | 192 | * Can we delay the ack ? |
| 193 | */ | 193 | */ |
| 194 | static __inline__ int sendack(unsigned short seq) | 194 | static __inline__ int sendack(__u16 seq) |
| 195 | { | 195 | { |
| 196 | return (int)((seq & 0x1000) ? 0 : 1); | 196 | return (int)((seq & 0x1000) ? 0 : 1); |
| 197 | } | 197 | } |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 5122da3f2eb3..76f957e258b0 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
| @@ -71,12 +71,12 @@ struct dn_route { | |||
| 71 | struct dn_route *rt_next; | 71 | struct dn_route *rt_next; |
| 72 | } u; | 72 | } u; |
| 73 | 73 | ||
| 74 | __u16 rt_saddr; | 74 | __le16 rt_saddr; |
| 75 | __u16 rt_daddr; | 75 | __le16 rt_daddr; |
| 76 | __u16 rt_gateway; | 76 | __le16 rt_gateway; |
| 77 | __u16 rt_local_src; /* Source used for forwarding packets */ | 77 | __le16 rt_local_src; /* Source used for forwarding packets */ |
| 78 | __u16 rt_src_map; | 78 | __le16 rt_src_map; |
| 79 | __u16 rt_dst_map; | 79 | __le16 rt_dst_map; |
| 80 | 80 | ||
| 81 | unsigned rt_flags; | 81 | unsigned rt_flags; |
| 82 | unsigned rt_type; | 82 | unsigned rt_type; |
diff --git a/include/net/flow.h b/include/net/flow.h index ec7eb86eb203..04d89f763451 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -30,8 +30,8 @@ struct flowi { | |||
| 30 | } ip6_u; | 30 | } ip6_u; |
| 31 | 31 | ||
| 32 | struct { | 32 | struct { |
| 33 | __u16 daddr; | 33 | __le16 daddr; |
| 34 | __u16 saddr; | 34 | __le16 saddr; |
| 35 | __u32 fwmark; | 35 | __u32 fwmark; |
| 36 | __u8 scope; | 36 | __u8 scope; |
| 37 | } dn_u; | 37 | } dn_u; |
| @@ -64,8 +64,8 @@ struct flowi { | |||
| 64 | } icmpt; | 64 | } icmpt; |
| 65 | 65 | ||
| 66 | struct { | 66 | struct { |
| 67 | __u16 sport; | 67 | __le16 sport; |
| 68 | __u16 dport; | 68 | __le16 dport; |
| 69 | __u8 objnum; | 69 | __u8 objnum; |
| 70 | __u8 objnamel; /* Not 16 bits since max val is 16 */ | 70 | __u8 objnamel; /* Not 16 bits since max val is 16 */ |
| 71 | __u8 objname[16]; /* Not zero terminated */ | 71 | __u8 objname[16]; /* Not zero terminated */ |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h new file mode 100644 index 000000000000..b971d8c82bdd --- /dev/null +++ b/include/net/ieee80211softmac.h | |||
| @@ -0,0 +1,292 @@ | |||
| 1 | /* | ||
| 2 | * ieee80211softmac.h - public interface to the softmac | ||
| 3 | * | ||
| 4 | * Copyright (c) 2005 Johannes Berg <johannes@sipsolutions.net> | ||
| 5 | * Joseph Jezak <josejx@gentoo.org> | ||
| 6 | * Larry Finger <Larry.Finger@lwfinger.net> | ||
| 7 | * Danny van Dyk <kugelfang@gentoo.org> | ||
| 8 | * Michael Buesch <mbuesch@freenet.de> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify it | ||
| 11 | * under the terms of version 2 of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 17 | * more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 22 | * | ||
| 23 | * The full GNU General Public License is included in this distribution in the | ||
| 24 | * file called COPYING. | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef IEEE80211SOFTMAC_H_ | ||
| 28 | #define IEEE80211SOFTMAC_H_ | ||
| 29 | |||
| 30 | #include <linux/kernel.h> | ||
| 31 | #include <linux/spinlock.h> | ||
| 32 | #include <linux/workqueue.h> | ||
| 33 | #include <linux/list.h> | ||
| 34 | #include <net/ieee80211.h> | ||
| 35 | |||
| 36 | /* Once the API is considered more or less stable, | ||
| 37 | * this should be incremented on API incompatible changes. | ||
| 38 | */ | ||
| 39 | #define IEEE80211SOFTMAC_API 0 | ||
| 40 | |||
| 41 | #define IEEE80211SOFTMAC_MAX_RATES_LEN 8 | ||
| 42 | #define IEEE80211SOFTMAC_MAX_EX_RATES_LEN 255 | ||
| 43 | |||
| 44 | struct ieee80211softmac_ratesinfo { | ||
| 45 | u8 count; | ||
| 46 | u8 rates[IEEE80211SOFTMAC_MAX_RATES_LEN + IEEE80211SOFTMAC_MAX_EX_RATES_LEN]; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* internal structures */ | ||
| 50 | struct ieee80211softmac_network; | ||
| 51 | struct ieee80211softmac_scaninfo; | ||
| 52 | |||
| 53 | struct ieee80211softmac_essid { | ||
| 54 | u8 len; | ||
| 55 | char data[IW_ESSID_MAX_SIZE+1]; | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct ieee80211softmac_wpa { | ||
| 59 | char *IE; | ||
| 60 | int IElen; | ||
| 61 | int IEbuflen; | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* | ||
| 65 | * Information about association | ||
| 66 | * | ||
| 67 | * Do we need a lock for this? | ||
| 68 | * We only ever use this structure inlined | ||
| 69 | * into our global struct. I've used its lock, | ||
| 70 | * but maybe we need a local one here? | ||
| 71 | */ | ||
| 72 | struct ieee80211softmac_assoc_info { | ||
| 73 | /* | ||
| 74 | * This is the requested ESSID. It is written | ||
| 75 | * only by the WX handlers. | ||
| 76 | * | ||
| 77 | */ | ||
| 78 | struct ieee80211softmac_essid req_essid; | ||
| 79 | /* | ||
| 80 | * the ESSID of the network we're currently | ||
| 81 | * associated (or trying) to. This is | ||
| 82 | * updated to the network's actual ESSID | ||
| 83 | * even if the requested ESSID was 'ANY' | ||
| 84 | */ | ||
| 85 | struct ieee80211softmac_essid associate_essid; | ||
| 86 | |||
| 87 | /* BSSID we're trying to associate to */ | ||
| 88 | char bssid[ETH_ALEN]; | ||
| 89 | |||
| 90 | /* some flags. | ||
| 91 | * static_essid is valid if the essid is constant, | ||
| 92 | * this is for use by the wx handlers only. | ||
| 93 | * | ||
| 94 | * associating is true, if the network has been | ||
| 95 | * auth'ed on and we are in the process of associating. | ||
| 96 | * | ||
| 97 | * bssvalid is true if we found a matching network | ||
| 98 | * and saved it's BSSID into the bssid above. | ||
| 99 | */ | ||
| 100 | u8 static_essid:1, | ||
| 101 | associating:1, | ||
| 102 | bssvalid:1; | ||
| 103 | |||
| 104 | /* Scan retries remaining */ | ||
| 105 | int scan_retry; | ||
| 106 | |||
| 107 | struct work_struct work; | ||
| 108 | struct work_struct timeout; | ||
| 109 | }; | ||
| 110 | |||
| 111 | enum { | ||
| 112 | IEEE80211SOFTMAC_AUTH_OPEN_REQUEST = 1, | ||
| 113 | IEEE80211SOFTMAC_AUTH_OPEN_RESPONSE = 2, | ||
| 114 | }; | ||
| 115 | |||
| 116 | enum { | ||
| 117 | IEEE80211SOFTMAC_AUTH_SHARED_REQUEST = 1, | ||
| 118 | IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE = 2, | ||
| 119 | IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE = 3, | ||
| 120 | IEEE80211SOFTMAC_AUTH_SHARED_PASS = 4, | ||
| 121 | }; | ||
| 122 | |||
| 123 | /* We should make these tunable | ||
| 124 | * AUTH_TIMEOUT seems really long, but that's what it is in BSD */ | ||
| 125 | #define IEEE80211SOFTMAC_AUTH_TIMEOUT (12 * HZ) | ||
| 126 | #define IEEE80211SOFTMAC_AUTH_RETRY_LIMIT 5 | ||
| 127 | #define IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT 3 | ||
| 128 | |||
| 129 | struct ieee80211softmac_txrates { | ||
| 130 | /* The Bit-Rate to be used for multicast frames. */ | ||
| 131 | u8 mcast_rate; | ||
| 132 | /* The Bit-Rate to be used for multicast fallback | ||
| 133 | * (If the device supports fallback and hardware-retry) | ||
| 134 | */ | ||
| 135 | u8 mcast_fallback; | ||
| 136 | /* The Bit-Rate to be used for any other (normal) data packet. */ | ||
| 137 | u8 default_rate; | ||
| 138 | /* The Bit-Rate to be used for default fallback | ||
| 139 | * (If the device supports fallback and hardware-retry) | ||
| 140 | */ | ||
| 141 | u8 default_fallback; | ||
| 142 | }; | ||
| 143 | |||
| 144 | /* Bits for txrates_change callback. */ | ||
| 145 | #define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */ | ||
| 146 | #define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */ | ||
| 147 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ | ||
| 148 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST_FBACK (1 << 3) /* mcast_fallback */ | ||
| 149 | |||
| 150 | struct ieee80211softmac_device { | ||
| 151 | /* 802.11 structure for data stuff */ | ||
| 152 | struct ieee80211_device *ieee; | ||
| 153 | struct net_device *dev; | ||
| 154 | |||
| 155 | /* only valid if associated, then holds the Association ID */ | ||
| 156 | u16 association_id; | ||
| 157 | |||
| 158 | /* the following methods are callbacks that the driver | ||
| 159 | * using this framework has to assign | ||
| 160 | */ | ||
| 161 | |||
| 162 | /* always assign these */ | ||
| 163 | void (*set_bssid_filter)(struct net_device *dev, const u8 *bssid); | ||
| 164 | void (*set_channel)(struct net_device *dev, u8 channel); | ||
| 165 | |||
| 166 | /* assign if you need it, informational only */ | ||
| 167 | void (*link_change)(struct net_device *dev); | ||
| 168 | |||
| 169 | /* If the hardware can do scanning, assign _all_ three of these callbacks. | ||
| 170 | * When the scan finishes, call ieee80211softmac_scan_finished(). | ||
| 171 | */ | ||
| 172 | |||
| 173 | /* when called, start_scan is guaranteed to not be called again | ||
| 174 | * until you call ieee80211softmac_scan_finished. | ||
| 175 | * Return 0 if scanning could start, error otherwise. | ||
| 176 | * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_start_scan */ | ||
| 177 | int (*start_scan)(struct net_device *dev); | ||
| 178 | /* this should block until after ieee80211softmac_scan_finished was called | ||
| 179 | * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_wait_for_scan */ | ||
| 180 | void (*wait_for_scan)(struct net_device *dev); | ||
| 181 | /* stop_scan aborts a scan, but is asynchronous. | ||
| 182 | * if you want to wait for it too, use wait_for_scan | ||
| 183 | * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_stop_scan */ | ||
| 184 | void (*stop_scan)(struct net_device *dev); | ||
| 185 | |||
| 186 | /* we'll need something about beacons here too, for AP or ad-hoc modes */ | ||
| 187 | |||
| 188 | /* Transmission rates to be used by the driver. | ||
| 189 | * The SoftMAC figures out the best possible rates. | ||
| 190 | * The driver just needs to read them. | ||
| 191 | */ | ||
| 192 | struct ieee80211softmac_txrates txrates; | ||
| 193 | /* If the driver needs to do stuff on TX rate changes, assign this callback. */ | ||
| 194 | void (*txrates_change)(struct net_device *dev, | ||
| 195 | u32 changes, /* see IEEE80211SOFTMAC_TXRATECHG flags */ | ||
| 196 | const struct ieee80211softmac_txrates *rates_before_change); | ||
| 197 | |||
| 198 | /* private stuff follows */ | ||
| 199 | /* this lock protects this structure */ | ||
| 200 | spinlock_t lock; | ||
| 201 | |||
| 202 | /* couple of flags */ | ||
| 203 | u8 scanning:1, /* protects scanning from being done multiple times at once */ | ||
| 204 | associated:1; | ||
| 205 | |||
| 206 | struct ieee80211softmac_scaninfo *scaninfo; | ||
| 207 | struct ieee80211softmac_assoc_info associnfo; | ||
| 208 | |||
| 209 | struct list_head auth_queue; | ||
| 210 | struct list_head events; | ||
| 211 | |||
| 212 | struct ieee80211softmac_ratesinfo ratesinfo; | ||
| 213 | int txrate_badness; | ||
| 214 | |||
| 215 | /* WPA stuff */ | ||
| 216 | struct ieee80211softmac_wpa wpa; | ||
| 217 | |||
| 218 | /* we need to keep a list of network structs we copied */ | ||
| 219 | struct list_head network_list; | ||
| 220 | |||
| 221 | /* This must be the last item so that it points to the data | ||
| 222 | * allocated beyond this structure by alloc_ieee80211 */ | ||
| 223 | u8 priv[0]; | ||
| 224 | }; | ||
| 225 | |||
| 226 | extern void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm); | ||
| 227 | |||
| 228 | static inline void * ieee80211softmac_priv(struct net_device *dev) | ||
| 229 | { | ||
| 230 | return ((struct ieee80211softmac_device *)ieee80211_priv(dev))->priv; | ||
| 231 | } | ||
| 232 | |||
| 233 | extern struct net_device * alloc_ieee80211softmac(int sizeof_priv); | ||
| 234 | extern void free_ieee80211softmac(struct net_device *dev); | ||
| 235 | |||
| 236 | /* Call this function if you detect a lost TX fragment. | ||
| 237 | * (If the device indicates failure of ACK RX, for example.) | ||
| 238 | * It is wise to call this function if you are able to detect lost packets, | ||
| 239 | * because it contributes to the TX Rates auto adjustment. | ||
| 240 | */ | ||
| 241 | extern void ieee80211softmac_fragment_lost(struct net_device *dev, | ||
| 242 | u16 wireless_sequence_number); | ||
| 243 | /* Call this function before _start to tell the softmac what rates | ||
| 244 | * the hw supports. The rates parameter is copied, so you can | ||
| 245 | * free it right after calling this function. | ||
| 246 | * Note that the rates need to be sorted. */ | ||
| 247 | extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); | ||
| 248 | |||
| 249 | /* Start the SoftMAC. Call this after you initialized the device | ||
| 250 | * and it is ready to run. | ||
| 251 | */ | ||
| 252 | extern void ieee80211softmac_start(struct net_device *dev); | ||
| 253 | /* Stop the SoftMAC. Call this before you shutdown the device. */ | ||
| 254 | extern void ieee80211softmac_stop(struct net_device *dev); | ||
| 255 | |||
| 256 | /* | ||
| 257 | * Event system | ||
| 258 | */ | ||
| 259 | |||
| 260 | /* valid event types */ | ||
| 261 | #define IEEE80211SOFTMAC_EVENT_ANY -1 /*private use only*/ | ||
| 262 | #define IEEE80211SOFTMAC_EVENT_SCAN_FINISHED 0 | ||
| 263 | #define IEEE80211SOFTMAC_EVENT_ASSOCIATED 1 | ||
| 264 | #define IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED 2 | ||
| 265 | #define IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT 3 | ||
| 266 | #define IEEE80211SOFTMAC_EVENT_AUTHENTICATED 4 | ||
| 267 | #define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5 | ||
| 268 | #define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6 | ||
| 269 | #define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7 | ||
| 270 | /* keep this updated! */ | ||
| 271 | #define IEEE80211SOFTMAC_EVENT_LAST 7 | ||
| 272 | /* | ||
| 273 | * If you want to be notified of certain events, you can call | ||
| 274 | * ieee80211softmac_notify[_atomic] with | ||
| 275 | * - event set to one of the constants below | ||
| 276 | * - fun set to a function pointer of the appropriate type | ||
| 277 | * - context set to the context data you want passed | ||
| 278 | * The return value is 0, or an error. | ||
| 279 | */ | ||
| 280 | typedef void (*notify_function_ptr)(struct net_device *dev, void *context); | ||
| 281 | |||
| 282 | #define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL); | ||
| 283 | #define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC); | ||
| 284 | |||
| 285 | extern int ieee80211softmac_notify_gfp(struct net_device *dev, | ||
| 286 | int event, notify_function_ptr fun, void *context, gfp_t gfp_mask); | ||
| 287 | |||
| 288 | /* To clear pending work (for ifconfig down, etc.) */ | ||
| 289 | extern void | ||
| 290 | ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm); | ||
| 291 | |||
| 292 | #endif /* IEEE80211SOFTMAC_H_ */ | ||
diff --git a/include/net/ieee80211softmac_wx.h b/include/net/ieee80211softmac_wx.h new file mode 100644 index 000000000000..3e0be453ecea --- /dev/null +++ b/include/net/ieee80211softmac_wx.h | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | /* | ||
| 2 | * This file contains the prototypes for the wireless extension | ||
| 3 | * handlers that the softmac API provides. Include this file to | ||
| 4 | * use the wx handlers, you can assign these directly. | ||
| 5 | * | ||
| 6 | * Copyright (c) 2005 Johannes Berg <johannes@sipsolutions.net> | ||
| 7 | * Joseph Jezak <josejx@gentoo.org> | ||
| 8 | * Larry Finger <Larry.Finger@lwfinger.net> | ||
| 9 | * Danny van Dyk <kugelfang@gentoo.org> | ||
| 10 | * Michael Buesch <mbuesch@freenet.de> | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify it | ||
| 13 | * under the terms of version 2 of the GNU General Public License as | ||
| 14 | * published by the Free Software Foundation. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 19 | * more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program; if not, write to the Free Software | ||
| 23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 24 | * | ||
| 25 | * The full GNU General Public License is included in this distribution in the | ||
| 26 | * file called COPYING. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _IEEE80211SOFTMAC_WX_H | ||
| 30 | #define _IEEE80211SOFTMAC_WX_H | ||
| 31 | |||
| 32 | #include <net/ieee80211softmac.h> | ||
| 33 | #include <net/iw_handler.h> | ||
| 34 | |||
| 35 | extern int | ||
| 36 | ieee80211softmac_wx_trigger_scan(struct net_device *net_dev, | ||
| 37 | struct iw_request_info *info, | ||
| 38 | union iwreq_data *data, | ||
| 39 | char *extra); | ||
| 40 | |||
| 41 | extern int | ||
| 42 | ieee80211softmac_wx_get_scan_results(struct net_device *net_dev, | ||
| 43 | struct iw_request_info *info, | ||
| 44 | union iwreq_data *data, | ||
| 45 | char *extra); | ||
| 46 | |||
| 47 | extern int | ||
| 48 | ieee80211softmac_wx_set_essid(struct net_device *net_dev, | ||
| 49 | struct iw_request_info *info, | ||
| 50 | union iwreq_data *data, | ||
| 51 | char *extra); | ||
| 52 | |||
| 53 | extern int | ||
| 54 | ieee80211softmac_wx_get_essid(struct net_device *net_dev, | ||
| 55 | struct iw_request_info *info, | ||
| 56 | union iwreq_data *data, | ||
| 57 | char *extra); | ||
| 58 | |||
| 59 | extern int | ||
| 60 | ieee80211softmac_wx_set_rate(struct net_device *net_dev, | ||
| 61 | struct iw_request_info *info, | ||
| 62 | union iwreq_data *data, | ||
| 63 | char *extra); | ||
| 64 | |||
| 65 | extern int | ||
| 66 | ieee80211softmac_wx_get_rate(struct net_device *net_dev, | ||
| 67 | struct iw_request_info *info, | ||
| 68 | union iwreq_data *data, | ||
| 69 | char *extra); | ||
| 70 | |||
| 71 | extern int | ||
| 72 | ieee80211softmac_wx_get_wap(struct net_device *net_dev, | ||
| 73 | struct iw_request_info *info, | ||
| 74 | union iwreq_data *data, | ||
| 75 | char *extra); | ||
| 76 | |||
| 77 | extern int | ||
| 78 | ieee80211softmac_wx_set_wap(struct net_device *net_dev, | ||
| 79 | struct iw_request_info *info, | ||
| 80 | union iwreq_data *data, | ||
| 81 | char *extra); | ||
| 82 | |||
| 83 | extern int | ||
| 84 | ieee80211softmac_wx_set_genie(struct net_device *dev, | ||
| 85 | struct iw_request_info *info, | ||
| 86 | union iwreq_data *wrqu, | ||
| 87 | char *extra); | ||
| 88 | |||
| 89 | extern int | ||
| 90 | ieee80211softmac_wx_get_genie(struct net_device *dev, | ||
| 91 | struct iw_request_info *info, | ||
| 92 | union iwreq_data *wrqu, | ||
| 93 | char *extra); | ||
| 94 | #endif /* _IEEE80211SOFTMAC_WX */ | ||
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index eb8afe3499a9..e459e1a0ae4a 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -180,11 +180,8 @@ struct inet6_dev | |||
| 180 | 180 | ||
| 181 | #ifdef CONFIG_IPV6_PRIVACY | 181 | #ifdef CONFIG_IPV6_PRIVACY |
| 182 | u8 rndid[8]; | 182 | u8 rndid[8]; |
| 183 | u8 entropy[8]; | ||
| 184 | struct timer_list regen_timer; | 183 | struct timer_list regen_timer; |
| 185 | struct inet6_ifaddr *tempaddr_list; | 184 | struct inet6_ifaddr *tempaddr_list; |
| 186 | __u8 work_eui64[8]; | ||
| 187 | __u8 work_digest[16]; | ||
| 188 | #endif | 185 | #endif |
| 189 | 186 | ||
| 190 | struct neigh_parms *nd_parms; | 187 | struct neigh_parms *nd_parms; |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index fa587c94e9d0..9bf73fe50948 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -50,6 +50,12 @@ struct inet_connection_sock_af_ops { | |||
| 50 | char __user *optval, int optlen); | 50 | char __user *optval, int optlen); |
| 51 | int (*getsockopt)(struct sock *sk, int level, int optname, | 51 | int (*getsockopt)(struct sock *sk, int level, int optname, |
| 52 | char __user *optval, int __user *optlen); | 52 | char __user *optval, int __user *optlen); |
| 53 | int (*compat_setsockopt)(struct sock *sk, | ||
| 54 | int level, int optname, | ||
| 55 | char __user *optval, int optlen); | ||
| 56 | int (*compat_getsockopt)(struct sock *sk, | ||
| 57 | int level, int optname, | ||
| 58 | char __user *optval, int __user *optlen); | ||
| 53 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); | 59 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); |
| 54 | int sockaddr_len; | 60 | int sockaddr_len; |
| 55 | }; | 61 | }; |
| @@ -72,6 +78,7 @@ struct inet_connection_sock_af_ops { | |||
| 72 | * @icsk_probes_out: unanswered 0 window probes | 78 | * @icsk_probes_out: unanswered 0 window probes |
| 73 | * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) | 79 | * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options) |
| 74 | * @icsk_ack: Delayed ACK control data | 80 | * @icsk_ack: Delayed ACK control data |
| 81 | * @icsk_mtup; MTU probing control data | ||
| 75 | */ | 82 | */ |
| 76 | struct inet_connection_sock { | 83 | struct inet_connection_sock { |
| 77 | /* inet_sock has to be the first member! */ | 84 | /* inet_sock has to be the first member! */ |
| @@ -104,6 +111,16 @@ struct inet_connection_sock { | |||
| 104 | __u16 last_seg_size; /* Size of last incoming segment */ | 111 | __u16 last_seg_size; /* Size of last incoming segment */ |
| 105 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ | 112 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ |
| 106 | } icsk_ack; | 113 | } icsk_ack; |
| 114 | struct { | ||
| 115 | int enabled; | ||
| 116 | |||
| 117 | /* Range of MTUs to search */ | ||
| 118 | int search_high; | ||
| 119 | int search_low; | ||
| 120 | |||
| 121 | /* Information on the current probe. */ | ||
| 122 | int probe_size; | ||
| 123 | } icsk_mtup; | ||
| 107 | u32 icsk_ca_priv[16]; | 124 | u32 icsk_ca_priv[16]; |
| 108 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) | 125 | #define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) |
| 109 | }; | 126 | }; |
| @@ -310,4 +327,13 @@ extern void inet_csk_listen_stop(struct sock *sk); | |||
| 310 | 327 | ||
| 311 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 328 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
| 312 | 329 | ||
| 330 | extern int inet_csk_ctl_sock_create(struct socket **sock, | ||
| 331 | unsigned short family, | ||
| 332 | unsigned short type, | ||
| 333 | unsigned char protocol); | ||
| 334 | |||
| 335 | extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, | ||
| 336 | char __user *optval, int __user *optlen); | ||
| 337 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, | ||
| 338 | char __user *optval, int optlen); | ||
| 313 | #endif /* _INET_CONNECTION_SOCK_H */ | 339 | #endif /* _INET_CONNECTION_SOCK_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index fab3d5b3ab1c..8fe6156ca9b0 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -356,6 +356,10 @@ extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | |||
| 356 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); | 356 | extern int ip_cmsg_send(struct msghdr *msg, struct ipcm_cookie *ipc); |
| 357 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); | 357 | extern int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen); |
| 358 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); | 358 | extern int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen); |
| 359 | extern int compat_ip_setsockopt(struct sock *sk, int level, | ||
| 360 | int optname, char __user *optval, int optlen); | ||
| 361 | extern int compat_ip_getsockopt(struct sock *sk, int level, | ||
| 362 | int optname, char __user *optval, int __user *optlen); | ||
| 359 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); | 363 | extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *)); |
| 360 | 364 | ||
| 361 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 365 | extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 1f2e428ca364..a398ae5e30f9 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -7,6 +7,23 @@ | |||
| 7 | #define IP6_RT_PRIO_KERN 512 | 7 | #define IP6_RT_PRIO_KERN 512 |
| 8 | #define IP6_RT_FLOW_MASK 0x00ff | 8 | #define IP6_RT_FLOW_MASK 0x00ff |
| 9 | 9 | ||
| 10 | struct route_info { | ||
| 11 | __u8 type; | ||
| 12 | __u8 length; | ||
| 13 | __u8 prefix_len; | ||
| 14 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 15 | __u8 reserved_h:3, | ||
| 16 | route_pref:2, | ||
| 17 | reserved_l:3; | ||
| 18 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 19 | __u8 reserved_l:3, | ||
| 20 | route_pref:2, | ||
| 21 | reserved_h:3; | ||
| 22 | #endif | ||
| 23 | __u32 lifetime; | ||
| 24 | __u8 prefix[0]; /* 0,8 or 16 */ | ||
| 25 | }; | ||
| 26 | |||
| 10 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
| 11 | 28 | ||
| 12 | #include <net/flow.h> | 29 | #include <net/flow.h> |
| @@ -87,11 +104,14 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
| 87 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, | 104 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, |
| 88 | struct net_device *dev); | 105 | struct net_device *dev); |
| 89 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, | 106 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, |
| 90 | struct net_device *dev); | 107 | struct net_device *dev, |
| 108 | unsigned int pref); | ||
| 91 | 109 | ||
| 92 | extern void rt6_purge_dflt_routers(void); | 110 | extern void rt6_purge_dflt_routers(void); |
| 93 | 111 | ||
| 94 | extern void rt6_reset_dflt_pointer(struct rt6_info *rt); | 112 | extern int rt6_route_rcv(struct net_device *dev, |
| 113 | u8 *opt, int len, | ||
| 114 | struct in6_addr *gwaddr); | ||
| 95 | 115 | ||
| 96 | extern void rt6_redirect(struct in6_addr *dest, | 116 | extern void rt6_redirect(struct in6_addr *dest, |
| 97 | struct in6_addr *saddr, | 117 | struct in6_addr *saddr, |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 3b1d963d396c..6d6f0634ae41 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -282,6 +282,18 @@ static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr | |||
| 282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 282 | return memcmp((const void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | static inline int | ||
| 286 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | ||
| 287 | const struct in6_addr *a2) | ||
| 288 | { | ||
| 289 | unsigned int i; | ||
| 290 | |||
| 291 | for (i = 0; i < 4; i++) | ||
| 292 | if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) | ||
| 293 | return 1; | ||
| 294 | return 0; | ||
| 295 | } | ||
| 296 | |||
| 285 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 297 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
| 286 | { | 298 | { |
| 287 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); | 299 | memcpy((void *) a1, (const void *) a2, sizeof(struct in6_addr)); |
| @@ -508,6 +520,16 @@ extern int ipv6_getsockopt(struct sock *sk, int level, | |||
| 508 | int optname, | 520 | int optname, |
| 509 | char __user *optval, | 521 | char __user *optval, |
| 510 | int __user *optlen); | 522 | int __user *optlen); |
| 523 | extern int compat_ipv6_setsockopt(struct sock *sk, | ||
| 524 | int level, | ||
| 525 | int optname, | ||
| 526 | char __user *optval, | ||
| 527 | int optlen); | ||
| 528 | extern int compat_ipv6_getsockopt(struct sock *sk, | ||
| 529 | int level, | ||
| 530 | int optname, | ||
| 531 | char __user *optval, | ||
| 532 | int __user *optlen); | ||
| 511 | 533 | ||
| 512 | extern void ipv6_packet_init(void); | 534 | extern void ipv6_packet_init(void); |
| 513 | 535 | ||
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index a2c5e0b88422..10559e937d27 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Version : 7 18.3.05 | 4 | * Version : 7 18.3.05 |
| 5 | * | 5 | * |
| 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
| 7 | * Copyright (c) 2001-2005 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 2001-2006 Jean Tourrilhes, All Rights Reserved. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #ifndef _IW_HANDLER_H | 10 | #ifndef _IW_HANDLER_H |
| @@ -436,6 +436,16 @@ extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, | |||
| 436 | /* Handle IOCTLs, called in net/core/dev.c */ | 436 | /* Handle IOCTLs, called in net/core/dev.c */ |
| 437 | extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); | 437 | extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); |
| 438 | 438 | ||
| 439 | /* Handle RtNetlink requests, called in net/core/rtnetlink.c */ | ||
| 440 | extern int wireless_rtnetlink_set(struct net_device * dev, | ||
| 441 | char * data, | ||
| 442 | int len); | ||
| 443 | extern int wireless_rtnetlink_get(struct net_device * dev, | ||
| 444 | char * data, | ||
| 445 | int len, | ||
| 446 | char ** p_buf, | ||
| 447 | int * p_len); | ||
| 448 | |||
| 439 | /* Second : functions that may be called by driver modules */ | 449 | /* Second : functions that may be called by driver modules */ |
| 440 | 450 | ||
| 441 | /* Send a single event to user space */ | 451 | /* Send a single event to user space */ |
diff --git a/include/net/llc.h b/include/net/llc.h index 1adb2ef3f6f7..f5024583fc8b 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
| @@ -71,7 +71,7 @@ extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
| 71 | struct packet_type *pt, struct net_device *orig_dev); | 71 | struct packet_type *pt, struct net_device *orig_dev); |
| 72 | 72 | ||
| 73 | extern int llc_mac_hdr_init(struct sk_buff *skb, | 73 | extern int llc_mac_hdr_init(struct sk_buff *skb, |
| 74 | unsigned char *sa, unsigned char *da); | 74 | const unsigned char *sa, const unsigned char *da); |
| 75 | 75 | ||
| 76 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, | 76 | extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, |
| 77 | struct sk_buff *skb)); | 77 | struct sk_buff *skb)); |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index bbac87eeb422..91fa271a0064 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
| @@ -22,6 +22,8 @@ enum { | |||
| 22 | ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ | 22 | ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ |
| 23 | ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ | 23 | ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ |
| 24 | ND_OPT_MTU = 5, /* RFC2461 */ | 24 | ND_OPT_MTU = 5, /* RFC2461 */ |
| 25 | __ND_OPT_ARRAY_MAX, | ||
| 26 | ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ | ||
| 25 | __ND_OPT_MAX | 27 | __ND_OPT_MAX |
| 26 | }; | 28 | }; |
| 27 | 29 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6fa9ae190741..b0666d66293f 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -68,6 +68,7 @@ struct neigh_parms | |||
| 68 | struct net_device *dev; | 68 | struct net_device *dev; |
| 69 | struct neigh_parms *next; | 69 | struct neigh_parms *next; |
| 70 | int (*neigh_setup)(struct neighbour *); | 70 | int (*neigh_setup)(struct neighbour *); |
| 71 | void (*neigh_destructor)(struct neighbour *); | ||
| 71 | struct neigh_table *tbl; | 72 | struct neigh_table *tbl; |
| 72 | 73 | ||
| 73 | void *sysctl_table; | 74 | void *sysctl_table; |
| @@ -145,7 +146,6 @@ struct neighbour | |||
| 145 | struct neigh_ops | 146 | struct neigh_ops |
| 146 | { | 147 | { |
| 147 | int family; | 148 | int family; |
| 148 | void (*destructor)(struct neighbour *); | ||
| 149 | void (*solicit)(struct neighbour *, struct sk_buff*); | 149 | void (*solicit)(struct neighbour *, struct sk_buff*); |
| 150 | void (*error_report)(struct neighbour *, struct sk_buff*); | 150 | void (*error_report)(struct neighbour *, struct sk_buff*); |
| 151 | int (*output)(struct sk_buff*); | 151 | int (*output)(struct sk_buff*); |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 6d075ca16e6e..b6f0905a4ee2 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -67,6 +67,18 @@ do { \ | |||
| 67 | 67 | ||
| 68 | struct nf_conntrack_helper; | 68 | struct nf_conntrack_helper; |
| 69 | 69 | ||
| 70 | /* nf_conn feature for connections that have a helper */ | ||
| 71 | struct nf_conn_help { | ||
| 72 | /* Helper. if any */ | ||
| 73 | struct nf_conntrack_helper *helper; | ||
| 74 | |||
| 75 | union nf_conntrack_help help; | ||
| 76 | |||
| 77 | /* Current number of expected connections */ | ||
| 78 | unsigned int expecting; | ||
| 79 | }; | ||
| 80 | |||
| 81 | |||
| 70 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 82 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
| 71 | struct nf_conn | 83 | struct nf_conn |
| 72 | { | 84 | { |
| @@ -81,6 +93,9 @@ struct nf_conn | |||
| 81 | /* Have we seen traffic both ways yet? (bitset) */ | 93 | /* Have we seen traffic both ways yet? (bitset) */ |
| 82 | unsigned long status; | 94 | unsigned long status; |
| 83 | 95 | ||
| 96 | /* If we were expected by an expectation, this will be it */ | ||
| 97 | struct nf_conn *master; | ||
| 98 | |||
| 84 | /* Timer function; drops refcnt when it goes off. */ | 99 | /* Timer function; drops refcnt when it goes off. */ |
| 85 | struct timer_list timeout; | 100 | struct timer_list timeout; |
| 86 | 101 | ||
| @@ -88,38 +103,22 @@ struct nf_conn | |||
| 88 | /* Accounting Information (same cache line as other written members) */ | 103 | /* Accounting Information (same cache line as other written members) */ |
| 89 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; | 104 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; |
| 90 | #endif | 105 | #endif |
| 91 | /* If we were expected by an expectation, this will be it */ | ||
| 92 | struct nf_conn *master; | ||
| 93 | |||
| 94 | /* Current number of expected connections */ | ||
| 95 | unsigned int expecting; | ||
| 96 | 106 | ||
| 97 | /* Unique ID that identifies this conntrack*/ | 107 | /* Unique ID that identifies this conntrack*/ |
| 98 | unsigned int id; | 108 | unsigned int id; |
| 99 | 109 | ||
| 100 | /* Helper. if any */ | ||
| 101 | struct nf_conntrack_helper *helper; | ||
| 102 | |||
| 103 | /* features - nat, helper, ... used by allocating system */ | 110 | /* features - nat, helper, ... used by allocating system */ |
| 104 | u_int32_t features; | 111 | u_int32_t features; |
| 105 | 112 | ||
| 106 | /* Storage reserved for other modules: */ | ||
| 107 | |||
| 108 | union nf_conntrack_proto proto; | ||
| 109 | |||
| 110 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 113 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
| 111 | u_int32_t mark; | 114 | u_int32_t mark; |
| 112 | #endif | 115 | #endif |
| 113 | 116 | ||
| 114 | /* These members are dynamically allocated. */ | 117 | /* Storage reserved for other modules: */ |
| 115 | 118 | union nf_conntrack_proto proto; | |
| 116 | union nf_conntrack_help *help; | ||
| 117 | 119 | ||
| 118 | /* Layer 3 dependent members. (ex: NAT) */ | 120 | /* features dynamically at the end: helper, nat (both optional) */ |
| 119 | union { | 121 | char data[0]; |
| 120 | struct nf_conntrack_ipv4 *ipv4; | ||
| 121 | } l3proto; | ||
| 122 | void *data[0]; | ||
| 123 | }; | 122 | }; |
| 124 | 123 | ||
| 125 | struct nf_conntrack_expect | 124 | struct nf_conntrack_expect |
| @@ -196,6 +195,10 @@ static inline void nf_ct_put(struct nf_conn *ct) | |||
| 196 | nf_conntrack_put(&ct->ct_general); | 195 | nf_conntrack_put(&ct->ct_general); |
| 197 | } | 196 | } |
| 198 | 197 | ||
| 198 | /* Protocol module loading */ | ||
| 199 | extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); | ||
| 200 | extern void nf_ct_l3proto_module_put(unsigned short l3proto); | ||
| 201 | |||
| 199 | extern struct nf_conntrack_tuple_hash * | 202 | extern struct nf_conntrack_tuple_hash * |
| 200 | __nf_conntrack_find(const struct nf_conntrack_tuple *tuple, | 203 | __nf_conntrack_find(const struct nf_conntrack_tuple *tuple, |
| 201 | const struct nf_conn *ignored_conntrack); | 204 | const struct nf_conn *ignored_conntrack); |
| @@ -373,10 +376,23 @@ nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | |||
| 373 | #define NF_CT_F_NUM 4 | 376 | #define NF_CT_F_NUM 4 |
| 374 | 377 | ||
| 375 | extern int | 378 | extern int |
| 376 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size, | 379 | nf_conntrack_register_cache(u_int32_t features, const char *name, size_t size); |
| 377 | int (*init_conntrack)(struct nf_conn *, u_int32_t)); | ||
| 378 | extern void | 380 | extern void |
| 379 | nf_conntrack_unregister_cache(u_int32_t features); | 381 | nf_conntrack_unregister_cache(u_int32_t features); |
| 380 | 382 | ||
| 383 | /* valid combinations: | ||
| 384 | * basic: nf_conn, nf_conn .. nf_conn_help | ||
| 385 | * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat, nf_conn help | ||
| 386 | */ | ||
| 387 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | ||
| 388 | { | ||
| 389 | unsigned int offset = sizeof(struct nf_conn); | ||
| 390 | |||
| 391 | if (!(ct->features & NF_CT_F_HELP)) | ||
| 392 | return NULL; | ||
| 393 | |||
| 394 | return (struct nf_conn_help *) ((void *)ct + offset); | ||
| 395 | } | ||
| 396 | |||
| 381 | #endif /* __KERNEL__ */ | 397 | #endif /* __KERNEL__ */ |
| 382 | #endif /* _NF_CONNTRACK_H */ | 398 | #endif /* _NF_CONNTRACK_H */ |
diff --git a/include/net/scm.h b/include/net/scm.h index c3fa3d5ab606..540619cb7160 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
| @@ -37,10 +37,12 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) | |||
| 37 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | 37 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, |
| 38 | struct scm_cookie *scm) | 38 | struct scm_cookie *scm) |
| 39 | { | 39 | { |
| 40 | memset(scm, 0, sizeof(*scm)); | 40 | struct task_struct *p = current; |
| 41 | scm->creds.uid = current->uid; | 41 | scm->creds.uid = p->uid; |
| 42 | scm->creds.gid = current->gid; | 42 | scm->creds.gid = p->gid; |
| 43 | scm->creds.pid = current->tgid; | 43 | scm->creds.pid = p->tgid; |
| 44 | scm->fp = NULL; | ||
| 45 | scm->seq = 0; | ||
| 44 | if (msg->msg_controllen <= 0) | 46 | if (msg->msg_controllen <= 0) |
| 45 | return 0; | 47 | return 0; |
| 46 | return __scm_send(sock, msg, scm); | 48 | return __scm_send(sock, msg, scm); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 072f407848a6..eba99f375517 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -514,6 +514,16 @@ struct sctp_af { | |||
| 514 | int optname, | 514 | int optname, |
| 515 | char __user *optval, | 515 | char __user *optval, |
| 516 | int __user *optlen); | 516 | int __user *optlen); |
| 517 | int (*compat_setsockopt) (struct sock *sk, | ||
| 518 | int level, | ||
| 519 | int optname, | ||
| 520 | char __user *optval, | ||
| 521 | int optlen); | ||
| 522 | int (*compat_getsockopt) (struct sock *sk, | ||
| 523 | int level, | ||
| 524 | int optname, | ||
| 525 | char __user *optval, | ||
| 526 | int __user *optlen); | ||
| 517 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, | 527 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, |
| 518 | union sctp_addr *daddr, | 528 | union sctp_addr *daddr, |
| 519 | union sctp_addr *saddr); | 529 | union sctp_addr *saddr); |
diff --git a/include/net/sock.h b/include/net/sock.h index f63d0d56712c..ec226f31dc2a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -520,6 +520,14 @@ struct proto { | |||
| 520 | int (*getsockopt)(struct sock *sk, int level, | 520 | int (*getsockopt)(struct sock *sk, int level, |
| 521 | int optname, char __user *optval, | 521 | int optname, char __user *optval, |
| 522 | int __user *option); | 522 | int __user *option); |
| 523 | int (*compat_setsockopt)(struct sock *sk, | ||
| 524 | int level, | ||
| 525 | int optname, char __user *optval, | ||
| 526 | int optlen); | ||
| 527 | int (*compat_getsockopt)(struct sock *sk, | ||
| 528 | int level, | ||
| 529 | int optname, char __user *optval, | ||
| 530 | int __user *option); | ||
| 523 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | 531 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, |
| 524 | struct msghdr *msg, size_t len); | 532 | struct msghdr *msg, size_t len); |
| 525 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, | 533 | int (*recvmsg)(struct kiocb *iocb, struct sock *sk, |
| @@ -816,6 +824,10 @@ extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 816 | struct msghdr *msg, size_t size, int flags); | 824 | struct msghdr *msg, size_t size, int flags); |
| 817 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, | 825 | extern int sock_common_setsockopt(struct socket *sock, int level, int optname, |
| 818 | char __user *optval, int optlen); | 826 | char __user *optval, int optlen); |
| 827 | extern int compat_sock_common_getsockopt(struct socket *sock, int level, | ||
| 828 | int optname, char __user *optval, int __user *optlen); | ||
| 829 | extern int compat_sock_common_setsockopt(struct socket *sock, int level, | ||
| 830 | int optname, char __user *optval, int optlen); | ||
| 819 | 831 | ||
| 820 | extern void sk_common_release(struct sock *sk); | 832 | extern void sk_common_release(struct sock *sk); |
| 821 | 833 | ||
diff --git a/include/net/tc_act/tc_ipt.h b/include/net/tc_act/tc_ipt.h index 02eccebd55ae..cb37ad08427f 100644 --- a/include/net/tc_act/tc_ipt.h +++ b/include/net/tc_act/tc_ipt.h | |||
| @@ -3,14 +3,14 @@ | |||
| 3 | 3 | ||
| 4 | #include <net/act_api.h> | 4 | #include <net/act_api.h> |
| 5 | 5 | ||
| 6 | struct ipt_entry_target; | 6 | struct xt_entry_target; |
| 7 | 7 | ||
| 8 | struct tcf_ipt | 8 | struct tcf_ipt |
| 9 | { | 9 | { |
| 10 | tca_gen(ipt); | 10 | tca_gen(ipt); |
| 11 | u32 hook; | 11 | u32 hook; |
| 12 | char *tname; | 12 | char *tname; |
| 13 | struct ipt_entry_target *t; | 13 | struct xt_entry_target *t; |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | #endif | 16 | #endif |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 77f21c65bbca..9418f4d1afbb 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 60 | /* Minimal RCV_MSS. */ | 60 | /* Minimal RCV_MSS. */ |
| 61 | #define TCP_MIN_RCVMSS 536U | 61 | #define TCP_MIN_RCVMSS 536U |
| 62 | 62 | ||
| 63 | /* The least MTU to use for probing */ | ||
| 64 | #define TCP_BASE_MSS 512 | ||
| 65 | |||
| 63 | /* After receiving this amount of duplicate ACKs fast retransmit starts. */ | 66 | /* After receiving this amount of duplicate ACKs fast retransmit starts. */ |
| 64 | #define TCP_FASTRETRANS_THRESH 3 | 67 | #define TCP_FASTRETRANS_THRESH 3 |
| 65 | 68 | ||
| @@ -219,6 +222,9 @@ extern int sysctl_tcp_nometrics_save; | |||
| 219 | extern int sysctl_tcp_moderate_rcvbuf; | 222 | extern int sysctl_tcp_moderate_rcvbuf; |
| 220 | extern int sysctl_tcp_tso_win_divisor; | 223 | extern int sysctl_tcp_tso_win_divisor; |
| 221 | extern int sysctl_tcp_abc; | 224 | extern int sysctl_tcp_abc; |
| 225 | extern int sysctl_tcp_mtu_probing; | ||
| 226 | extern int sysctl_tcp_base_mss; | ||
| 227 | extern int sysctl_tcp_workaround_signed_windows; | ||
| 222 | 228 | ||
| 223 | extern atomic_t tcp_memory_allocated; | 229 | extern atomic_t tcp_memory_allocated; |
| 224 | extern atomic_t tcp_sockets_allocated; | 230 | extern atomic_t tcp_sockets_allocated; |
| @@ -347,6 +353,12 @@ extern int tcp_getsockopt(struct sock *sk, int level, | |||
| 347 | extern int tcp_setsockopt(struct sock *sk, int level, | 353 | extern int tcp_setsockopt(struct sock *sk, int level, |
| 348 | int optname, char __user *optval, | 354 | int optname, char __user *optval, |
| 349 | int optlen); | 355 | int optlen); |
| 356 | extern int compat_tcp_getsockopt(struct sock *sk, | ||
| 357 | int level, int optname, | ||
| 358 | char __user *optval, int __user *optlen); | ||
| 359 | extern int compat_tcp_setsockopt(struct sock *sk, | ||
| 360 | int level, int optname, | ||
| 361 | char __user *optval, int optlen); | ||
| 350 | extern void tcp_set_keepalive(struct sock *sk, int val); | 362 | extern void tcp_set_keepalive(struct sock *sk, int val); |
| 351 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | 363 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, |
| 352 | struct msghdr *msg, | 364 | struct msghdr *msg, |
| @@ -447,6 +459,10 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
| 447 | 459 | ||
| 448 | extern void tcp_initialize_rcv_mss(struct sock *sk); | 460 | extern void tcp_initialize_rcv_mss(struct sock *sk); |
| 449 | 461 | ||
| 462 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | ||
| 463 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | ||
| 464 | extern void tcp_mtup_init(struct sock *sk); | ||
| 465 | |||
| 450 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 466 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
| 451 | { | 467 | { |
| 452 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 468 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
diff --git a/include/net/x25.h b/include/net/x25.h index fee62ff8c194..0ad90ebcf86e 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
| @@ -101,9 +101,17 @@ enum { | |||
| 101 | #define X25_FAC_PACKET_SIZE 0x42 | 101 | #define X25_FAC_PACKET_SIZE 0x42 |
| 102 | #define X25_FAC_WINDOW_SIZE 0x43 | 102 | #define X25_FAC_WINDOW_SIZE 0x43 |
| 103 | 103 | ||
| 104 | #define X25_MAX_FAC_LEN 20 /* Plenty to spare */ | 104 | #define X25_MAX_FAC_LEN 60 |
| 105 | #define X25_MAX_CUD_LEN 128 | 105 | #define X25_MAX_CUD_LEN 128 |
| 106 | 106 | ||
| 107 | #define X25_FAC_CALLING_AE 0xCB | ||
| 108 | #define X25_FAC_CALLED_AE 0xC9 | ||
| 109 | |||
| 110 | #define X25_MARKER 0x00 | ||
| 111 | #define X25_DTE_SERVICES 0x0F | ||
| 112 | #define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */ | ||
| 113 | #define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */ | ||
| 114 | |||
| 107 | /** | 115 | /** |
| 108 | * struct x25_route - x25 routing entry | 116 | * struct x25_route - x25 routing entry |
| 109 | * @node - entry in x25_list_lock | 117 | * @node - entry in x25_list_lock |
| @@ -148,6 +156,7 @@ struct x25_sock { | |||
| 148 | struct timer_list timer; | 156 | struct timer_list timer; |
| 149 | struct x25_causediag causediag; | 157 | struct x25_causediag causediag; |
| 150 | struct x25_facilities facilities; | 158 | struct x25_facilities facilities; |
| 159 | struct x25_dte_facilities dte_facilities; | ||
| 151 | struct x25_calluserdata calluserdata; | 160 | struct x25_calluserdata calluserdata; |
| 152 | unsigned long vc_facil_mask; /* inc_call facilities mask */ | 161 | unsigned long vc_facil_mask; /* inc_call facilities mask */ |
| 153 | }; | 162 | }; |
| @@ -180,9 +189,13 @@ extern void x25_establish_link(struct x25_neigh *); | |||
| 180 | extern void x25_terminate_link(struct x25_neigh *); | 189 | extern void x25_terminate_link(struct x25_neigh *); |
| 181 | 190 | ||
| 182 | /* x25_facilities.c */ | 191 | /* x25_facilities.c */ |
| 183 | extern int x25_parse_facilities(struct sk_buff *, struct x25_facilities *, unsigned long *); | 192 | extern int x25_parse_facilities(struct sk_buff *, struct x25_facilities *, |
| 184 | extern int x25_create_facilities(unsigned char *, struct x25_facilities *, unsigned long); | 193 | struct x25_dte_facilities *, unsigned long *); |
| 185 | extern int x25_negotiate_facilities(struct sk_buff *, struct sock *, struct x25_facilities *); | 194 | extern int x25_create_facilities(unsigned char *, struct x25_facilities *, |
| 195 | struct x25_dte_facilities *, unsigned long); | ||
| 196 | extern int x25_negotiate_facilities(struct sk_buff *, struct sock *, | ||
| 197 | struct x25_facilities *, | ||
| 198 | struct x25_dte_facilities *); | ||
| 186 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); | 199 | extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); |
| 187 | 200 | ||
| 188 | /* x25_in.c */ | 201 | /* x25_in.c */ |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 8d362c49b8a9..61b7504fc2ba 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/crypto.h> | 11 | #include <linux/crypto.h> |
| 12 | #include <linux/pfkeyv2.h> | 12 | #include <linux/pfkeyv2.h> |
| 13 | #include <linux/in6.h> | 13 | #include <linux/in6.h> |
| 14 | #include <linux/mutex.h> | ||
| 14 | 15 | ||
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
| 16 | #include <net/dst.h> | 17 | #include <net/dst.h> |
| @@ -20,7 +21,11 @@ | |||
| 20 | 21 | ||
| 21 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) | 22 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) |
| 22 | 23 | ||
| 23 | extern struct semaphore xfrm_cfg_sem; | 24 | extern struct sock *xfrm_nl; |
| 25 | extern u32 sysctl_xfrm_aevent_etime; | ||
| 26 | extern u32 sysctl_xfrm_aevent_rseqth; | ||
| 27 | |||
| 28 | extern struct mutex xfrm_cfg_mutex; | ||
| 24 | 29 | ||
| 25 | /* Organization of SPD aka "XFRM rules" | 30 | /* Organization of SPD aka "XFRM rules" |
| 26 | ------------------------------------ | 31 | ------------------------------------ |
| @@ -135,6 +140,16 @@ struct xfrm_state | |||
| 135 | /* State for replay detection */ | 140 | /* State for replay detection */ |
| 136 | struct xfrm_replay_state replay; | 141 | struct xfrm_replay_state replay; |
| 137 | 142 | ||
| 143 | /* Replay detection state at the time we sent the last notification */ | ||
| 144 | struct xfrm_replay_state preplay; | ||
| 145 | |||
| 146 | /* Replay detection notification settings */ | ||
| 147 | u32 replay_maxage; | ||
| 148 | u32 replay_maxdiff; | ||
| 149 | |||
| 150 | /* Replay detection notification timer */ | ||
| 151 | struct timer_list rtimer; | ||
| 152 | |||
| 138 | /* Statistics */ | 153 | /* Statistics */ |
| 139 | struct xfrm_stats stats; | 154 | struct xfrm_stats stats; |
| 140 | 155 | ||
| @@ -169,6 +184,7 @@ struct km_event | |||
| 169 | u32 hard; | 184 | u32 hard; |
| 170 | u32 proto; | 185 | u32 proto; |
| 171 | u32 byid; | 186 | u32 byid; |
| 187 | u32 aevent; | ||
| 172 | } data; | 188 | } data; |
| 173 | 189 | ||
| 174 | u32 seq; | 190 | u32 seq; |
| @@ -199,10 +215,13 @@ extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | |||
| 199 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 215 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
| 200 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | 216 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); |
| 201 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); | 217 | extern void km_state_notify(struct xfrm_state *x, struct km_event *c); |
| 202 | |||
| 203 | #define XFRM_ACQ_EXPIRES 30 | 218 | #define XFRM_ACQ_EXPIRES 30 |
| 204 | 219 | ||
| 205 | struct xfrm_tmpl; | 220 | struct xfrm_tmpl; |
| 221 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | ||
| 222 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid); | ||
| 223 | extern int __xfrm_state_delete(struct xfrm_state *x); | ||
| 224 | |||
| 206 | struct xfrm_state_afinfo { | 225 | struct xfrm_state_afinfo { |
| 207 | unsigned short family; | 226 | unsigned short family; |
| 208 | rwlock_t lock; | 227 | rwlock_t lock; |
| @@ -305,7 +324,21 @@ struct xfrm_policy | |||
| 305 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 324 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
| 306 | }; | 325 | }; |
| 307 | 326 | ||
| 308 | #define XFRM_KM_TIMEOUT 30 | 327 | #define XFRM_KM_TIMEOUT 30 |
| 328 | /* which seqno */ | ||
| 329 | #define XFRM_REPLAY_SEQ 1 | ||
| 330 | #define XFRM_REPLAY_OSEQ 2 | ||
| 331 | #define XFRM_REPLAY_SEQ_MASK 3 | ||
| 332 | /* what happened */ | ||
| 333 | #define XFRM_REPLAY_UPDATE XFRM_AE_CR | ||
| 334 | #define XFRM_REPLAY_TIMEOUT XFRM_AE_CE | ||
| 335 | |||
| 336 | /* default aevent timeout in units of 100ms */ | ||
| 337 | #define XFRM_AE_ETIME 10 | ||
| 338 | /* Async Event timer multiplier */ | ||
| 339 | #define XFRM_AE_ETH_M 10 | ||
| 340 | /* default seq threshold size */ | ||
| 341 | #define XFRM_AE_SEQT_SIZE 2 | ||
| 309 | 342 | ||
| 310 | struct xfrm_mgr | 343 | struct xfrm_mgr |
| 311 | { | 344 | { |
| @@ -865,6 +898,7 @@ extern int xfrm_state_delete(struct xfrm_state *x); | |||
| 865 | extern void xfrm_state_flush(u8 proto); | 898 | extern void xfrm_state_flush(u8 proto); |
| 866 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 899 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
| 867 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 900 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |
| 901 | extern void xfrm_replay_notify(struct xfrm_state *x, int event); | ||
| 868 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); | 902 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); |
| 869 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 903 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
| 870 | extern int xfrm_init_state(struct xfrm_state *x); | 904 | extern int xfrm_init_state(struct xfrm_state *x); |
| @@ -924,7 +958,7 @@ extern void xfrm_init_pmtu(struct dst_entry *dst); | |||
| 924 | 958 | ||
| 925 | extern wait_queue_head_t km_waitq; | 959 | extern wait_queue_head_t km_waitq; |
| 926 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 960 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); |
| 927 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard); | 961 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); |
| 928 | 962 | ||
| 929 | extern void xfrm_input_init(void); | 963 | extern void xfrm_input_init(void); |
| 930 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); | 964 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); |
| @@ -965,4 +999,24 @@ static inline int xfrm_policy_id2dir(u32 index) | |||
| 965 | return index & 7; | 999 | return index & 7; |
| 966 | } | 1000 | } |
| 967 | 1001 | ||
| 1002 | static inline int xfrm_aevent_is_on(void) | ||
| 1003 | { | ||
| 1004 | struct sock *nlsk; | ||
| 1005 | int ret = 0; | ||
| 1006 | |||
| 1007 | rcu_read_lock(); | ||
| 1008 | nlsk = rcu_dereference(xfrm_nl); | ||
| 1009 | if (nlsk) | ||
| 1010 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); | ||
| 1011 | rcu_read_unlock(); | ||
| 1012 | return ret; | ||
| 1013 | } | ||
| 1014 | |||
| 1015 | static inline void xfrm_aevent_doreplay(struct xfrm_state *x) | ||
| 1016 | { | ||
| 1017 | if (xfrm_aevent_is_on()) | ||
| 1018 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); | ||
| 1019 | } | ||
| 1020 | |||
| 1021 | |||
| 968 | #endif /* _NET_XFRM_H */ | 1022 | #endif /* _NET_XFRM_H */ |
