Lines Matching defs:sock

19  *		Alan Cox	:	sock->protocol is set correctly.
37 * Alan Cox : Fixed TCP ack bug, removed remove sock
125 #include <net/sock.h>
137 #include <trace/events/sock.h>
157 bool sk_ns_capable(const struct sock *sk,
174 bool sk_capable(const struct sock *sk, int cap)
189 bool sk_net_capable(const struct sock *sk, int cap)
293 void sk_set_memalloc(struct sock *sk)
301 void sk_clear_memalloc(struct sock *sk)
318 int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
416 static bool sock_needs_netstamp(const struct sock *sk)
427 static void sock_disable_timestamp(struct sock *sk, unsigned long flags)
438 int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
473 int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
485 int __sk_receive_skb(struct sock *sk, struct sk_buff *skb,
529 struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
545 struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie)
559 static int sock_bindtoindex_locked(struct sock *sk, int ifindex)
587 int sock_bindtoindex(struct sock *sk, int ifindex, bool lock_sk)
601 static int sock_setbindtodevice(struct sock *sk, sockptr_t optval, int optlen)
647 static int sock_getbindtodevice(struct sock *sk, char __user *optval,
687 bool sk_mc_loop(struct sock *sk)
707 void sock_set_reuseaddr(struct sock *sk)
715 void sock_set_reuseport(struct sock *sk)
723 void sock_no_linger(struct sock *sk)
732 void sock_set_priority(struct sock *sk, u32 priority)
740 void sock_set_sndtimeo(struct sock *sk, s64 secs)
751 static void __sock_set_timestamps(struct sock *sk, bool val, bool new, bool ns)
764 void sock_enable_timestamps(struct sock *sk)
772 void sock_set_keepalive(struct sock *sk)
782 static void __sock_set_rcvbuf(struct sock *sk, int val)
803 void sock_set_rcvbuf(struct sock *sk, int val)
811 static void __sock_set_mark(struct sock *sk, u32 val)
819 void sock_set_mark(struct sock *sk, u32 val)
832 int sock_setsockopt(struct socket *sock, int level, int optname,
836 struct sock *sk = sock->sk;
987 set_bit(SOCK_PASSCRED, &sock->flags);
989 clear_bit(SOCK_PASSCRED, &sock->flags);
1046 if (sock->ops->set_rcvlowat)
1047 ret = sock->ops->set_rcvlowat(sk, val);
1123 set_bit(SOCK_PASSSEC, &sock->flags);
1125 clear_bit(SOCK_PASSSEC, &sock->flags);
1145 if (sock->ops->set_peek_off)
1146 ret = sock->ops->set_peek_off(sk, val);
1260 static const struct cred *sk_get_peer_cred(struct sock *sk)
1296 int sock_getsockopt(struct socket *sock, int level, int optname,
1299 struct sock *sk = sock->sk;
1435 v.val = !!test_bit(SOCK_PASSCRED, &sock->flags);
1481 lv = sock->ops->getname(sock, (struct sockaddr *)address, 2);
1499 v.val = !!test_bit(SOCK_PASSSEC, &sock->flags);
1503 return security_socket_getpeersec_stream(sock, optval, optlen, len);
1518 if (!sock->ops->set_peek_off)
1641 static inline void sock_lock_init(struct sock *sk)
1664 static void sock_copy(struct sock *nsk, const struct sock *osk)
1670 memcpy(nsk, osk, offsetof(struct sock, sk_dontcopy_begin));
1673 prot->obj_size - offsetof(struct sock, sk_dontcopy_end));
1681 static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority,
1684 struct sock *sk;
1718 static void sk_prot_free(struct proto *prot, struct sock *sk)
1741 * @prot: struct proto associated with this new sock instance
1744 struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
1747 struct sock *sk;
1753 * See comment in struct sock definition to understand
1784 struct sock *sk = container_of(head, struct sock, sk_rcu);
1821 void sk_destruct(struct sock *sk)
1836 static void __sk_free(struct sock *sk)
1847 void sk_free(struct sock *sk)
1859 static void sk_init_common(struct sock *sk)
1887 struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
1892 struct sock *newsk;
1940 /* though it's an empty new sock, the charging may fail
1985 * sock (sk_refcnt_debug_inc uses newsk->sk_prot->socks, that
2009 void sk_free_unlock_clone(struct sock *sk)
2019 void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
2051 struct sock *sk = skb->sk;
2077 struct sock *sk = skb->sk;
2083 void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
2098 * is enough to guarantee sk_free() wont free this sock until
2141 struct sock *sk = skb->sk;
2171 kuid_t sock_i_uid(struct sock *sk)
2182 unsigned long __sock_i_ino(struct sock *sk)
2193 unsigned long sock_i_ino(struct sock *sk)
2207 struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
2225 struct sock *sk = skb->sk;
2230 struct sk_buff *sock_omalloc(struct sock *sk, unsigned long size,
2253 void *sock_kmalloc(struct sock *sk, int size, gfp_t priority)
2277 static inline void __sock_kfree_s(struct sock *sk, void *mem, int size,
2289 void sock_kfree_s(struct sock *sk, void *mem, int size)
2295 void sock_kzfree_s(struct sock *sk, void *mem, int size)
2304 static long sock_wait_for_wmem(struct sock *sk, long timeo)
2333 struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
2377 struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size,
2384 int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
2427 int sock_cmsg_send(struct sock *sk, struct msghdr *msg,
2446 static void sk_enter_memory_pressure(struct sock *sk)
2454 static void sk_leave_memory_pressure(struct sock *sk)
2512 bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag)
2523 static void __lock_sock(struct sock *sk)
2541 void __release_sock(struct sock *sk)
2574 void __sk_flush_backlog(struct sock *sk)
2583 * @sk: sock to wait on
2592 int sk_wait_data(struct sock *sk, long *timeo, const struct sk_buff *skb)
2615 int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind)
2702 int __sk_mem_schedule(struct sock *sk, int size, int kind)
2721 void __sk_mem_reduce_allocated(struct sock *sk, int amount)
2739 void __sk_mem_reclaim(struct sock *sk, int amount)
2747 int sk_set_peek_off(struct sock *sk, int val)
2761 int sock_no_bind(struct socket *sock, struct sockaddr *saddr, int len)
2767 int sock_no_connect(struct socket *sock, struct sockaddr *saddr,
2780 int sock_no_accept(struct socket *sock, struct socket *newsock, int flags,
2787 int sock_no_getname(struct socket *sock, struct sockaddr *saddr,
2794 int sock_no_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
2800 int sock_no_listen(struct socket *sock, int backlog)
2806 int sock_no_shutdown(struct socket *sock, int how)
2812 int sock_no_sendmsg(struct socket *sock, struct msghdr *m, size_t len)
2818 int sock_no_sendmsg_locked(struct sock *sk, struct msghdr *m, size_t len)
2824 int sock_no_recvmsg(struct socket *sock, struct msghdr *m, size_t len,
2831 int sock_no_mmap(struct file *file, struct socket *sock, struct vm_area_struct *vma)
2840 * various sock-based usage counts.
2844 struct socket *sock;
2850 * "sock" for NULL is sufficient.
2852 sock = sock_from_file(file, &error);
2853 if (sock) {
2854 sock_update_netprioidx(&sock->sk->sk_cgrp_data);
2855 sock_update_classid(&sock->sk->sk_cgrp_data);
2859 ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags)
2867 res = kernel_sendmsg(sock, &msg, &iov, 1, size);
2873 ssize_t sock_no_sendpage_locked(struct sock *sk, struct page *page,
2893 static void sock_def_wakeup(struct sock *sk)
2904 static void sock_def_error_report(struct sock *sk)
2916 void sock_def_readable(struct sock *sk)
2929 static void sock_def_write_space(struct sock *sk)
2952 static void sock_def_destruct(struct sock *sk)
2956 void sk_send_sigurg(struct sock *sk)
2964 void sk_reset_timer(struct sock *sk, struct timer_list* timer,
2972 void sk_stop_timer(struct sock *sk, struct timer_list* timer)
2979 void sk_stop_timer_sync(struct sock *sk, struct timer_list *timer)
2986 void sock_init_data_uid(struct socket *sock, struct sock *sk, kuid_t uid)
2997 sk_set_socket(sk, sock);
3001 if (sock) {
3002 sk->sk_type = sock->type;
3003 RCU_INIT_POINTER(sk->sk_wq, &sock->wq);
3004 sock->sk = sk;
3068 void sock_init_data(struct socket *sock, struct sock *sk)
3070 kuid_t uid = sock ?
3071 SOCK_INODE(sock)->i_uid :
3074 sock_init_data_uid(sock, sk, uid);
3078 void lock_sock_nested(struct sock *sk, int subclass)
3094 void release_sock(struct sock *sk)
3126 bool lock_sock_fast(struct sock *sk)
3149 int sock_gettstamp(struct socket *sock, void __user *userstamp,
3152 struct sock *sk = sock->sk;
3188 void sock_enable_timestamp(struct sock *sk, enum sock_flags flag)
3205 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
3248 int sock_common_getsockopt(struct socket *sock, int level, int optname,
3251 struct sock *sk = sock->sk;
3258 int sock_common_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
3261 struct sock *sk = sock->sk;
3276 int sock_common_setsockopt(struct socket *sock, int level, int optname,
3279 struct sock *sk = sock->sk;
3286 void sk_common_release(struct sock *sk)
3323 void sk_get_meminfo(const struct sock *sk, u32 *mem)
3490 pr_crit("%s: Can't create request sock SLAB cache!\n",
3510 pr_crit("%s: Can't create sock SLAB cache!\n",
3724 struct sock *sk = p;
3732 int sock_bind_add(struct sock *sk, struct sockaddr *addr, int addr_len)