Lines Matching refs:sock
161 bool sk_ns_capable(const struct sock *sk, in sk_ns_capable()
178 bool sk_capable(const struct sock *sk, int cap) in sk_capable()
193 bool sk_net_capable(const struct sock *sk, int cap) in sk_net_capable()
298 void sk_set_memalloc(struct sock *sk) in sk_set_memalloc()
306 void sk_clear_memalloc(struct sock *sk) in sk_clear_memalloc()
323 int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) in __sk_backlog_rcv()
339 void sk_error_report(struct sock *sk) in sk_error_report()
437 static bool sock_needs_netstamp(const struct sock *sk) in sock_needs_netstamp()
448 static void sock_disable_timestamp(struct sock *sk, unsigned long flags) in sock_disable_timestamp()
459 int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) in __sock_queue_rcv_skb()
494 int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) in sock_queue_rcv_skb()
506 int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, in __sk_receive_skb()
554 struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) in __sk_dst_check()
572 struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie) in sk_dst_check()
588 static int sock_bindtoindex_locked(struct sock *sk, int ifindex) in sock_bindtoindex_locked()
616 int sock_bindtoindex(struct sock *sk, int ifindex, bool lock_sk) in sock_bindtoindex()
630 static int sock_setbindtodevice(struct sock *sk, sockptr_t optval, int optlen) in sock_setbindtodevice()
676 static int sock_getbindtodevice(struct sock *sk, char __user *optval, in sock_getbindtodevice()
716 bool sk_mc_loop(struct sock *sk) in sk_mc_loop()
736 void sock_set_reuseaddr(struct sock *sk) in sock_set_reuseaddr()
744 void sock_set_reuseport(struct sock *sk) in sock_set_reuseport()
752 void sock_no_linger(struct sock *sk) in sock_no_linger()
761 void sock_set_priority(struct sock *sk, u32 priority) in sock_set_priority()
769 void sock_set_sndtimeo(struct sock *sk, s64 secs) in sock_set_sndtimeo()
780 static void __sock_set_timestamps(struct sock *sk, bool val, bool new, bool ns) in __sock_set_timestamps()
793 void sock_enable_timestamps(struct sock *sk) in sock_enable_timestamps()
801 void sock_set_timestamp(struct sock *sk, int optname, bool valbool) in sock_set_timestamp()
819 static int sock_timestamping_bind_phc(struct sock *sk, int phc_index) in sock_timestamping_bind_phc()
856 int sock_set_timestamping(struct sock *sk, int optname, in sock_set_timestamping()
900 void sock_set_keepalive(struct sock *sk) in sock_set_keepalive()
910 static void __sock_set_rcvbuf(struct sock *sk, int val) in __sock_set_rcvbuf()
931 void sock_set_rcvbuf(struct sock *sk, int val) in sock_set_rcvbuf()
939 static void __sock_set_mark(struct sock *sk, u32 val) in __sock_set_mark()
947 void sock_set_mark(struct sock *sk, u32 val) in sock_set_mark()
960 int sock_setsockopt(struct socket *sock, int level, int optname, in sock_setsockopt() argument
965 struct sock *sk = sock->sk; in sock_setsockopt()
1116 set_bit(SOCK_PASSCRED, &sock->flags); in sock_setsockopt()
1118 clear_bit(SOCK_PASSCRED, &sock->flags); in sock_setsockopt()
1146 if (sock->ops->set_rcvlowat) in sock_setsockopt()
1147 ret = sock->ops->set_rcvlowat(sk, val); in sock_setsockopt()
1223 set_bit(SOCK_PASSSEC, &sock->flags); in sock_setsockopt()
1225 clear_bit(SOCK_PASSSEC, &sock->flags); in sock_setsockopt()
1245 if (sock->ops->set_peek_off) in sock_setsockopt()
1246 ret = sock->ops->set_peek_off(sk, val); in sock_setsockopt()
1385 static const struct cred *sk_get_peer_cred(struct sock *sk) in sk_get_peer_cred()
1421 int sock_getsockopt(struct socket *sock, int level, int optname, in sock_getsockopt() argument
1424 struct sock *sk = sock->sk; in sock_getsockopt()
1570 v.val = !!test_bit(SOCK_PASSCRED, &sock->flags); in sock_getsockopt()
1616 lv = sock->ops->getname(sock, (struct sockaddr *)address, 2); in sock_getsockopt()
1634 v.val = !!test_bit(SOCK_PASSSEC, &sock->flags); in sock_getsockopt()
1638 return security_socket_getpeersec_stream(sock, optval, optlen, len); in sock_getsockopt()
1653 if (!sock->ops->set_peek_off) in sock_getsockopt()
1790 static inline void sock_lock_init(struct sock *sk) in sock_lock_init()
1813 static void sock_copy(struct sock *nsk, const struct sock *osk) in sock_copy()
1824 BUILD_BUG_ON(offsetof(struct sock, sk_tx_queue_mapping) < in sock_copy()
1825 offsetof(struct sock, sk_dontcopy_begin) || in sock_copy()
1826 offsetof(struct sock, sk_tx_queue_mapping) >= in sock_copy()
1827 offsetof(struct sock, sk_dontcopy_end)); in sock_copy()
1829 memcpy(nsk, osk, offsetof(struct sock, sk_dontcopy_begin)); in sock_copy()
1832 prot->obj_size - offsetof(struct sock, sk_dontcopy_end)); in sock_copy()
1840 static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, in sk_prot_alloc()
1843 struct sock *sk; in sk_prot_alloc()
1879 static void sk_prot_free(struct proto *prot, struct sock *sk) in sk_prot_free()
1906 struct sock *sk_alloc(struct net *net, int family, gfp_t priority, in sk_alloc()
1909 struct sock *sk; in sk_alloc()
1946 struct sock *sk = container_of(head, struct sock, sk_rcu); in __sk_destruct()
1983 void sk_destruct(struct sock *sk) in sk_destruct()
1998 static void __sk_free(struct sock *sk) in __sk_free()
2009 void sk_free(struct sock *sk) in sk_free()
2021 static void sk_init_common(struct sock *sk) in sk_init_common()
2049 struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) in sk_clone_lock()
2054 struct sock *newsk; in sk_clone_lock()
2171 void sk_free_unlock_clone(struct sock *sk) in sk_free_unlock_clone()
2181 void sk_setup_caps(struct sock *sk, struct dst_entry *dst) in sk_setup_caps()
2213 struct sock *sk = skb->sk; in sock_wfree()
2239 struct sock *sk = skb->sk; in __sock_wfree()
2245 void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) in skb_set_owner_w()
2303 struct sock *sk = skb->sk; in sock_rfree()
2333 kuid_t sock_i_uid(struct sock *sk) in sock_i_uid()
2344 unsigned long __sock_i_ino(struct sock *sk) in __sock_i_ino()
2355 unsigned long sock_i_ino(struct sock *sk) in sock_i_ino()
2369 struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, in sock_wmalloc()
2387 struct sock *sk = skb->sk; in sock_ofree()
2392 struct sk_buff *sock_omalloc(struct sock *sk, unsigned long size, in sock_omalloc()
2415 void *sock_kmalloc(struct sock *sk, int size, gfp_t priority) in sock_kmalloc()
2439 static inline void __sock_kfree_s(struct sock *sk, void *mem, int size, in __sock_kfree_s()
2451 void sock_kfree_s(struct sock *sk, void *mem, int size) in sock_kfree_s()
2457 void sock_kzfree_s(struct sock *sk, void *mem, int size) in sock_kzfree_s()
2466 static long sock_wait_for_wmem(struct sock *sk, long timeo) in sock_wait_for_wmem()
2495 struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, in sock_alloc_send_pskb()
2539 struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, in sock_alloc_send_skb()
2546 int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg, in __sock_cmsg_send()
2589 int sock_cmsg_send(struct sock *sk, struct msghdr *msg, in sock_cmsg_send()
2608 static void sk_enter_memory_pressure(struct sock *sk) in sk_enter_memory_pressure()
2616 static void sk_leave_memory_pressure(struct sock *sk) in sk_leave_memory_pressure()
2674 bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag) in sk_page_frag_refill()
2685 void __lock_sock(struct sock *sk) in __lock_sock()
2703 void __release_sock(struct sock *sk) in __release_sock()
2736 void __sk_flush_backlog(struct sock *sk) in __sk_flush_backlog()
2754 int sk_wait_data(struct sock *sk, long *timeo, const struct sk_buff *skb) in sk_wait_data()
2777 int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) in __sk_mem_raise_allocated()
2872 int __sk_mem_schedule(struct sock *sk, int size, int kind) in __sk_mem_schedule()
2891 void __sk_mem_reduce_allocated(struct sock *sk, int amount) in __sk_mem_reduce_allocated()
2909 void __sk_mem_reclaim(struct sock *sk, int amount) in __sk_mem_reclaim()
2917 int sk_set_peek_off(struct sock *sk, int val) in sk_set_peek_off()
2931 int sock_no_bind(struct socket *sock, struct sockaddr *saddr, int len) in sock_no_bind() argument
2937 int sock_no_connect(struct socket *sock, struct sockaddr *saddr, in sock_no_connect() argument
2950 int sock_no_accept(struct socket *sock, struct socket *newsock, int flags, in sock_no_accept() argument
2957 int sock_no_getname(struct socket *sock, struct sockaddr *saddr, in sock_no_getname() argument
2964 int sock_no_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) in sock_no_ioctl() argument
2970 int sock_no_listen(struct socket *sock, int backlog) in sock_no_listen() argument
2976 int sock_no_shutdown(struct socket *sock, int how) in sock_no_shutdown() argument
2982 int sock_no_sendmsg(struct socket *sock, struct msghdr *m, size_t len) in sock_no_sendmsg() argument
2988 int sock_no_sendmsg_locked(struct sock *sk, struct msghdr *m, size_t len) in sock_no_sendmsg_locked()
2994 int sock_no_recvmsg(struct socket *sock, struct msghdr *m, size_t len, in sock_no_recvmsg() argument
3001 int sock_no_mmap(struct file *file, struct socket *sock, struct vm_area_struct *vma) in sock_no_mmap() argument
3014 struct socket *sock; in __receive_sock() local
3016 sock = sock_from_file(file); in __receive_sock()
3017 if (sock) { in __receive_sock()
3018 sock_update_netprioidx(&sock->sk->sk_cgrp_data); in __receive_sock()
3019 sock_update_classid(&sock->sk->sk_cgrp_data); in __receive_sock()
3023 ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags) in sock_no_sendpage() argument
3031 res = kernel_sendmsg(sock, &msg, &iov, 1, size); in sock_no_sendpage()
3037 ssize_t sock_no_sendpage_locked(struct sock *sk, struct page *page, in sock_no_sendpage_locked()
3057 static void sock_def_wakeup(struct sock *sk) in sock_def_wakeup()
3068 static void sock_def_error_report(struct sock *sk) in sock_def_error_report()
3080 void sock_def_readable(struct sock *sk) in sock_def_readable()
3103 static void sock_def_write_space(struct sock *sk) in sock_def_write_space()
3126 static void sock_def_destruct(struct sock *sk) in sock_def_destruct()
3130 void sk_send_sigurg(struct sock *sk) in sk_send_sigurg()
3138 void sk_reset_timer(struct sock *sk, struct timer_list* timer, in sk_reset_timer()
3146 void sk_stop_timer(struct sock *sk, struct timer_list* timer) in sk_stop_timer()
3153 void sk_stop_timer_sync(struct sock *sk, struct timer_list *timer) in sk_stop_timer_sync()
3160 void sock_init_data_uid(struct socket *sock, struct sock *sk, kuid_t uid) in sock_init_data_uid() argument
3171 sk_set_socket(sk, sock); in sock_init_data_uid()
3175 if (sock) { in sock_init_data_uid()
3176 sk->sk_type = sock->type; in sock_init_data_uid()
3177 RCU_INIT_POINTER(sk->sk_wq, &sock->wq); in sock_init_data_uid()
3178 sock->sk = sk; in sock_init_data_uid()
3242 void sock_init_data(struct socket *sock, struct sock *sk) in sock_init_data() argument
3244 kuid_t uid = sock ? in sock_init_data()
3245 SOCK_INODE(sock)->i_uid : in sock_init_data()
3248 sock_init_data_uid(sock, sk, uid); in sock_init_data()
3252 void lock_sock_nested(struct sock *sk, int subclass) in lock_sock_nested()
3266 void release_sock(struct sock *sk) in release_sock()
3285 bool __lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock) in __lock_sock_fast()
3317 int sock_gettstamp(struct socket *sock, void __user *userstamp, in sock_gettstamp() argument
3320 struct sock *sk = sock->sk; in sock_gettstamp()
3356 void sock_enable_timestamp(struct sock *sk, enum sock_flags flag) in sock_enable_timestamp()
3373 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, in sock_recv_errqueue()
3416 int sock_common_getsockopt(struct socket *sock, int level, int optname, in sock_common_getsockopt() argument
3419 struct sock *sk = sock->sk; in sock_common_getsockopt()
3425 int sock_common_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, in sock_common_recvmsg() argument
3428 struct sock *sk = sock->sk; in sock_common_recvmsg()
3443 int sock_common_setsockopt(struct socket *sock, int level, int optname, in sock_common_setsockopt() argument
3446 struct sock *sk = sock->sk; in sock_common_setsockopt()
3452 void sk_common_release(struct sock *sk) in sk_common_release()
3489 void sk_get_meminfo(const struct sock *sk, u32 *mem) in sk_get_meminfo()
3902 struct sock *sk = p; in sk_busy_loop_end()
3910 int sock_bind_add(struct sock *sk, struct sockaddr *addr, int addr_len) in sock_bind_add()