* @sk_route_caps - route capabilities (e.g. %NETIF_F_TSO)
* @sk_lingertime - %SO_LINGER l_linger setting
* @sk_hashent - hash entry in several tables (e.g. tcp_ehash)
- * @sk_pair - socket pair (e.g. AF_UNIX/unix_peer)
* @sk_backlog - always used with the per-socket spinlock held
* @sk_callback_lock - used with the callbacks in the end of this struct
* @sk_error_queue - rarely used
int sk_route_caps;
unsigned long sk_lingertime;
int sk_hashent;
- struct sock *sk_pair;
/*
* The backlog queue is special, it is always used with
* the per-socket spinlock held and requires low latency
int *sysctl_rmem;
int max_header;
+ kmem_cache_t *slab;
+ int slab_obj_size;
+
+ struct module *owner;
+
char name[32];
struct {
} stats[NR_CPUS];
};
+extern int sk_alloc_slab(struct proto *prot, char *name);
+extern void sk_free_slab(struct proto *prot);
+
+static inline void sk_alloc_slab_error(struct proto *proto)
+{
+ printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", proto->name);
+}
+
static __inline__ void sk_set_owner(struct sock *sk, struct module *owner)
{
/*
* Since ~2.3.5 it is also exclusive sleep lock serializing
* accesses from user process context.
*/
-extern void __lock_sock(struct sock *sk);
-extern void __release_sock(struct sock *sk);
#define sock_owned_by_user(sk) ((sk)->sk_lock.owner)
extern void FASTCALL(lock_sock(struct sock *sk));
unsigned long size,
int noblock,
int *errcode);
-extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
- unsigned long header_len,
- unsigned long data_len,
- int noblock,
- int *errcode);
extern void *sock_kmalloc(struct sock *sk, int size, int priority);
extern void sock_kfree_s(struct sock *sk, void *mem, int size);
extern void sk_send_sigurg(struct sock *sk);
* Functions to fill in entries in struct proto_ops when a protocol
* does not implement a particular function.
*/
-extern int sock_no_release(struct socket *);
extern int sock_no_bind(struct socket *,
struct sockaddr *, int);
extern int sock_no_connect(struct socket *,
* Default socket callbacks and setup code
*/
-extern void sock_def_destruct(struct sock *);
-
/* Initialise core socket variables */
extern void sock_init_data(struct socket *sock, struct sock *sk);
__kfree_skb(skb);
}
-extern atomic_t netstamp_needed;
extern void sock_enable_timestamp(struct sock *sk);
-extern void sock_disable_timestamp(struct sock *sk);
-
-static inline void net_timestamp(struct timeval *stamp)
-{
- if (atomic_read(&netstamp_needed))
- do_gettimeofday(stamp);
- else {
- stamp->tv_sec = 0;
- stamp->tv_usec = 0;
- }
-}
-
extern int sock_get_timestamp(struct sock *, struct timeval __user *);
/*
extern __u32 sysctl_wmem_max;
extern __u32 sysctl_rmem_max;
+#ifdef CONFIG_NET
int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
+#else
+static inline int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ return -ENODEV;
+}
+#endif
#endif /* _SOCK_H */