Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
net/netfilter/ipvs/ip_vs_sh.c
static int __init ip_vs_sh_init(void) { return register_ip_vs_scheduler(&ip_vs_sh_scheduler); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static void hton_seq(struct ip_vs_seq *ho, struct ip_vs_seq *no) { put_unaligned_be32(ho->init_seq, &no->init_seq); put_unaligned_be32(ho->delta, &no->delta); put_unaligned_be32(ho->previous_delta, &no->previous_delta); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static inline struct ip_vs_sync_buff * sb_dequeue(struct netns_ipvs *ipvs, struct ipvs_master_sync_state *ms) { struct ip_vs_sync_buff *sb; spin_lock_bh(&ipvs->sync_lock); if (list_empty(&ms->sync_queue)) { sb = NULL; __set_current_state(TASK_INTERRUPTIBLE); } else { sb = list_entry(ms->sync_queue...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static inline void sb_queue_tail(struct netns_ipvs *ipvs, struct ipvs_master_sync_state *ms) { struct ip_vs_sync_buff *sb = ms->sync_buff; spin_lock(&ipvs->sync_lock); if (ipvs->sync_state & IP_VS_STATE_MASTER && ms->sync_queue_len < sysctl_sync_qlen_max(ipvs)) { if (!...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static inline struct ip_vs_sync_buff * get_curr_sync_buff(struct netns_ipvs *ipvs, struct ipvs_master_sync_state *ms, unsigned long time) { struct ip_vs_sync_buff *sb; spin_lock_bh(&ipvs->sync_buff_lock); sb = ms->sync_buff; if (sb && time_after_eq(jiffies - sb->firstuse, time)) { ms->sy...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static inline struct ip_vs_sync_buff * ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs, unsigned int len) { struct ip_vs_sync_buff *sb; struct ip_vs_sync_mesg_v0 *mesg; if (!(sb = kmalloc(sizeof(struct ip_vs_sync_buff), GFP_ATOMIC))) return NULL; len = max_t(unsigned int, len + sizeof(struct ip_vs_sync_...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static inline int ip_vs_proc_seqopt(__u8 *p, unsigned int plen, __u32 *opt_flags, struct ip_vs_sync_conn_options *opt) { struct ip_vs_sync_conn_options *topt; topt = (struct ip_vs_sync_conn_options *)p; if (plen != sizeof(struct ip_vs_sync_...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static int join_mcast_group6(struct sock *sk, struct in6_addr *addr, struct net_device *dev) { int ret; if (sk->sk_bound_dev_if && dev->ifindex != sk->sk_bound_dev_if) return -EINVAL; lock_sock(sk); ret = ipv6_sock_mc_join(sk, dev->ifindex, addr); release_sock(sk); return...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static int bind_mcastif_addr(struct socket *sock, struct net_device *dev) { __be32 addr; struct sockaddr_in sin; addr = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE); if (!addr) pr_err("You probably need to specify IP address on " "multicast interface.\n"); IP_VS_DBG(7, "binding socket with (%s...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static void get_mcast_sockaddr(union ipvs_sockaddr *sa, int *salen, struct ipvs_sync_daemon_cfg *c, int id) { if (AF_INET6 == c->mcast_af) { sa->in6 = (struct sockaddr_in6){ .sin6_family = AF_INET6, .sin6_port = htons(c->mcast_port + id), }; sa->in6.sin6_add...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static int make_receive_sock(struct netns_ipvs *ipvs, int id, struct net_device *dev, struct socket **sock_ret) { union ipvs_sockaddr mcast_addr; struct socket *sock; int result, salen; /* First create a socket */ result = sock_create_kern(ipvs->net, ipvs->bcfg.mcast_af, SOCK_DG...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static int ip_vs_send_async(struct socket *sock, const char *buffer, const size_t length) { struct msghdr msg = {.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL}; struct kvec iov; int len; EnterFunction(7); iov.iov_base = (void *)buffer; iov.iov_len = length; len = kernel_sendmsg(...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static int ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen) { struct msghdr msg = { NULL, }; struct kvec iov = {buffer, buflen}; int len; EnterFunction(7); iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, buflen); len = sock_recvmsg(sock, &msg, MSG_DON...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static inline struct ip_vs_sync_buff * next_sync_buff(struct netns_ipvs *ipvs, struct ipvs_master_sync_state *ms) { struct ip_vs_sync_buff *sb; sb = sb_dequeue(ipvs, ms); if (sb) return sb; return get_curr_sync_buff(ipvs, ms, IPVS_SYNC_FLUSH_TIME); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sync.c
static int sync_thread_master(void *data) { struct ip_vs_sync_thread_data *tinfo = data; struct netns_ipvs *ipvs = tinfo->ipvs; struct ipvs_master_sync_state *ms = &ipvs->ms[tinfo->id]; struct sock *sk = tinfo->sock->sk; struct ip_vs_sync_buff *sb; pr_info("sync thread started: state = MASTER, mcast_ifn = ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_wlc.c
static int __init ip_vs_wlc_init(void) { return register_ip_vs_scheduler(&ip_vs_wlc_scheduler); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_wrr.c
static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) { struct ip_vs_dest *dest; int weight; int g = 0; list_for_each_entry(dest, &svc->destinations, n_list) { weight = atomic_read(&dest->weight); if (weight > 0) { if (g > 0) g = gcd(weight, g); else g = weight; }...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_wrr.c
static int __init ip_vs_wrr_init(void) { return register_ip_vs_scheduler(&ip_vs_wrr_scheduler); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_xmit.c
static inline struct ip_vs_dest_dst * __ip_vs_dst_check(struct ip_vs_dest *dest) { struct ip_vs_dest_dst *dest_dst = rcu_dereference(dest->dest_dst); struct dst_entry *dst; if (!dest_dst) return NULL; dst = dest_dst->dst_cache; if (dst->obsolete && dst->ops->check(dst, dest_dst->dst_cookie) == NULL) ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_xmit.c
static inline void ip_vs_drop_early_demux_sk(struct sk_buff *skb) { if (skb->dev) skb_orphan(skb); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_xmit.c
static struct sk_buff * ip_vs_prepare_tunneled_skb(struct sk_buff *skb, int skb_af, unsigned int max_headroom, __u8 *next_protocol, __u32 *payload_len, __u8 *dsfield, __u8 *ttl, __be16 *df) { struct sk_buff *new_skb = NULL; struct iphd...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_xmit.c
static inline int __tun_gso_type_mask(int encaps_af, int orig_af) { switch (encaps_af) { case AF_INET: return SKB_GSO_IPXIP4; case AF_INET6: return SKB_GSO_IPXIP6; default: return 0; } }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink.c
void nfnl_unlock(__u8 subsys_id) { mutex_unlock(&table[subsys_id].mutex); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink.c
int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n) { u8 cb_id; for (cb_id = 0; cb_id < n->cb_count; cb_id++) if (WARN_ON(n->cb[cb_id].attr_count > NFNL_MAX_ATTR_COUNT)) return -EINVAL; nfnl_lock(n->subsys_id); if (table[n->subsys_id].subsys) { nfnl_unlock(n->subsys_id); retur...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink.c
int nfnetlink_has_listeners(struct net *net, unsigned int group) { struct nfnl_net *nfnlnet = nfnl_pernet(net); return netlink_has_listeners(nfnlnet->nfnl, group); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink.c
static void nfnl_err_reset(struct list_head *err_list) { struct nfnl_err *nfnl_err, *next; list_for_each_entry_safe(nfnl_err, next, err_list, head) nfnl_err_del(nfnl_err); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink.c
static void nfnetlink_unbind(struct net *net, int group) { #ifdef CONFIG_NF_CONNTRACK_EVENTS int type, group_bit; if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX) return; type = nfnl_group2type[group]; switch (type) { case NFNL_SUBSYS_CTNETLINK: break; case NFNL_SUBSYS_CTNETLINK_EXP: break; ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink.c
static void __net_exit nfnetlink_net_exit_batch(struct list_head *net_exit_list) { struct nfnl_net *nfnlnet; struct net *net; list_for_each_entry(net, net_exit_list, exit_list) { nfnlnet = nfnl_pernet(net); netlink_kernel_release(nfnlnet->nfnl); } }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_acct.c
static int nfnl_acct_try_del(struct nf_acct *cur) { int ret = 0; if (refcount_dec_if_one(&cur->refcnt)) { /* We are protected by nfnl mutex. */ list_del_rcu(&cur->head); kfree_rcu(cur, rcu_head); } else { ret = -EBUSY; } return ret; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_acct.c
static int __net_init nfnl_acct_net_init(struct net *net) { INIT_LIST_HEAD(&nfnl_acct_pernet(net)->nfnl_acct_list); return 0; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cthelper.c
static int nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple, const struct nlattr *attr) { int err; struct nlattr *tb[NFCTH_TUPLE_MAX + 1]; err = nla_parse_nested_deprecated(tb, NFCTH_TUPLE_MAX, attr, nfnl_cthelper_tuple_pol, NULL)...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cthelper.c
static int nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct) { struct nf_conn_help *help = nfct_help(ct); const struct nf_conntrack_helper *helper; if (attr == NULL) return -EINVAL; helper = rcu_dereference(help->helper); if (!helper || helper->data_len == 0) return -EINVAL; nla...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cthelper.c
static int nfnl_cthelper_update_policy(struct nf_conntrack_helper *helper, const struct nlattr *attr) { struct nlattr *tb[NFCTH_POLICY_SET_MAX + 1]; unsigned int class_max; int err; err = nla_parse_nested_deprecated(tb, NFCTH_POLICY_SET_MAX, attr, ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cthelper.c
static int nfnl_cthelper_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type, int event, struct nf_conntrack_helper *helper) { struct nlmsghdr *nlh; unsigned int flags = portid ? NLM_F_MULTI : 0; int status; event = nfnl_msg_type(N...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cttimeout.c
static struct nfct_timeout_pernet *nfct_timeout_pernet(struct net *net) { return net_generic(net, nfct_timeout_id); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cttimeout.c
static int ctnl_timeout_dump(struct sk_buff *skb, struct netlink_callback *cb) { struct nfct_timeout_pernet *pernet; struct net *net = sock_net(skb->sk); struct ctnl_timeout *cur, *last; if (cb->args[2]) return 0; last = (struct ctnl_timeout *)cb->args[1]; if (cb->args[1]) cb->args[1] = 0; rcu...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cttimeout.c
static struct nf_ct_timeout *ctnl_timeout_find_get(struct net *net, const char *name) { struct nfct_timeout_pernet *pernet = nfct_timeout_pernet(net); struct ctnl_timeout *timeout, *matching = NULL; list_for_each_entry_rcu(timeout, &pernet->nfct_timeout_list, h...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_cttimeout.c
static void ctnl_timeout_put(struct nf_ct_timeout *t) { struct ctnl_timeout *timeout = container_of(t, struct ctnl_timeout, timeout); if (refcount_dec_and_test(&timeout->refcnt)) { kfree_rcu(timeout, rcu_head); module_put(THIS_MODULE); } }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_hook.c
static int nf_netlink_dump_start_rcu(struct sock *nlsk, struct sk_buff *skb, const struct nlmsghdr *nlh, struct netlink_dump_control *c) { int err; if (!try_module_get(THIS_MODULE)) return -EINVAL; rcu_read_unlock(); err = netlink_...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static struct nfulnl_instance *__instance_lookup(struct nfnl_log_net *log, u_int16_t group_num) { struct hlist_head *head; struct nfulnl_instance *inst; head = &log->instance_table[instance_hashfn(group_num)]; hlist_for_each_entry_rcu(inst, head, hlist) { i...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static inline void instance_get(struct nfulnl_instance *inst) { refcount_inc(&inst->use); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static void nfulnl_instance_free_rcu(struct rcu_head *head) { struct nfulnl_instance *inst = container_of(head, struct nfulnl_instance, rcu); put_net_track(inst->net, &inst->ns_tracker); kfree(inst); module_put(THIS_MODULE); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static void __instance_destroy(struct nfulnl_instance *inst) { hlist_del_rcu(&inst->hlist); /* then flush all pending packets from skb */ spin_lock(&inst->lock); /* lockless readers wont be able to use us */ inst->copy_mode = NFULNL_COPY_DISABLED; if (inst->skb) __nfulnl_flush(inst); spin_unlock(...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static void __nfulnl_send(struct nfulnl_instance *inst) { if (inst->qlen > 1) { struct nlmsghdr *nlh = nlmsg_put(inst->skb, 0, 0, NLMSG_DONE, sizeof(struct nfgenmsg), 0); if (WARN_ONCE(!nlh, "bad nlskb size: %u, tailroom %d\n", inst->skb->len, skb_tailroom(inst->skb))) { kfree...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static int nfulnl_put_bridge(struct nfulnl_instance *inst, const struct sk_buff *skb) { if (!skb_mac_header_was_set(skb)) return 0; if (skb_vlan_tag_present(skb)) { struct nlattr *nest; nest = nla_nest_start(inst->skb, NFULA_VLAN); if (!nest) goto nla_put_failur...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static int nfulnl_recv_unsupp(struct sk_buff *skb, const struct nfnl_info *info, const struct nlattr *const nfula[]) { return -ENOTSUPP; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static void seq_stop(struct seq_file *s, void *v) __releases(rcu_bh) { rcu_read_unlock_bh(); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static int seq_show(struct seq_file *s, void *v) { const struct nfulnl_instance *inst = v; seq_printf(s, "%5u %6u %5u %1u %5u %6u %2u\n", inst->group_num, inst->peer_portid, inst->qlen, inst->copy_mode, inst->copy_range, inst->flushtimeout, refcount_read(&inst->use)); return 0; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static int __init nfnetlink_log_init(void) { int status; status = register_pernet_subsys(&nfnl_log_net_ops); if (status < 0) { pr_err("failed to register pernet ops\n"); goto out; } netlink_register_notifier(&nfulnl_rtnl_notifier); status = nfnetlink_subsys_register(&nfulnl_subsys); if (status ...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_log.c
static void __exit nfnetlink_log_fini(void) { nfnetlink_subsys_unregister(&nfulnl_subsys); netlink_unregister_notifier(&nfulnl_rtnl_notifier); unregister_pernet_subsys(&nfnl_log_net_ops); nf_log_unregister(&nfulnl_logger); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_osf.c
static const struct tcphdr *nf_osf_hdr_ctx_init(struct nf_osf_hdr_ctx *ctx, const struct sk_buff *skb, const struct iphdr *ip, unsigned char *opts, ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static void instance_destroy_rcu(struct rcu_head *head) { struct nfqnl_instance *inst = container_of(head, struct nfqnl_instance, rcu); nfqnl_flush(inst, NULL, 0); kfree(inst); module_put(THIS_MODULE); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static inline void __enqueue_entry(struct nfqnl_instance *queue, struct nf_queue_entry *entry) { list_add_tail(&entry->list, &queue->queue_list); queue->queue_total++; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static void __dequeue_entry(struct nfqnl_instance *queue, struct nf_queue_entry *entry) { list_del(&entry->list); queue->queue_total--; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqnl_put_sk_uidgid(struct sk_buff *skb, struct sock *sk) { const struct cred *cred; if (!sk_fullsock(sk)) return 0; read_lock_bh(&sk->sk_callback_lock); if (sk->sk_socket && sk->sk_socket->file) { cred = sk->sk_socket->file->f_cred; if (nla_put_be32(skb, NFQA_UID, ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqnl_mangle(void *data, unsigned int data_len, struct nf_queue_entry *e, int diff) { struct sk_buff *nskb; if (diff < 0) { unsigned int min_len = skb_transport_offset(e->skb); if (data_len < min_len) return -EINVAL; if (pskb_trim(e->skb, data_len)) ret...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int dev_cmp(struct nf_queue_entry *entry, unsigned long ifindex) { #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) int physinif, physoutif; physinif = nf_bridge_get_physinif(entry->skb); physoutif = nf_bridge_get_physoutif(entry->skb); if (physinif == ifindex || physoutif == ifindex) return 1; #endif if...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqnl_rcv_dev_event(struct notifier_block *this, unsigned long event, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); if (event == NETDEV_DOWN) nfqnl_dev_drop(dev_net(dev), dev->ifindex); return NOTIFY_DONE; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static void nfqnl_nf_hook_drop(struct net *net) { struct nfnl_queue_net *q = nfnl_queue_pernet(net); int i; if (!q) return; for (i = 0; i < INSTANCE_BUCKETS; i++) { struct nfqnl_instance *inst; struct hlist_head *head = &q->instance_table[i]; hlist_for_each_entry_rcu(inst, head, hlist) nfqnl_...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqnl_rcv_nl_event(struct notifier_block *this, unsigned long event, void *ptr) { struct netlink_notify *n = ptr; struct nfnl_queue_net *q = nfnl_queue_pernet(n->net); if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) { int i; spin_lock(&q->insta...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqnl_recv_verdict_batch(struct sk_buff *skb, const struct nfnl_info *info, const struct nlattr *const nfqa[]) { struct nfnl_queue_net *q = nfnl_queue_pernet(info->net); u16 queue_num = ntohs(info->nfmsg->res_id); struct nf_queue_...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static struct nf_conn *nfqnl_ct_parse(const struct nfnl_ct_hook *nfnl_ct, const struct nlmsghdr *nlh, const struct nlattr *const nfqa[], struct nf_queue_entry *entry, ...
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqa_parse_bridge(struct nf_queue_entry *entry, const struct nlattr *const nfqa[]) { if (nfqa[NFQA_VLAN]) { struct nlattr *tb[NFQA_VLAN_MAX + 1]; int err; err = nla_parse_nested_deprecated(tb, NFQA_VLAN_MAX, nfqa[NFQA_VLAN], n...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static int nfqnl_recv_unsupp(struct sk_buff *skb, const struct nfnl_info *info, const struct nlattr *const cda[]) { return -ENOTSUPP; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static struct hlist_node *get_next(struct seq_file *seq, struct hlist_node *h) { struct iter_state *st = seq->private; struct net *net = seq_file_net(seq); h = h->next; while (!h) { struct nfnl_queue_net *q; if (++st->bucket >= INSTANCE_BUCKETS) return NULL; q = nfnl_queue_pernet(net); ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nfnetlink_queue.c
static void seq_stop(struct seq_file *s, void *v) __releases(nfnl_queue_pernet(seq_file_net(s))->inst
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_bitwise.c
static void nft_bitwise_eval_rshift(u32 *dst, const u32 *src, const struct nft_bitwise *priv) { u32 shift = priv->data.data[0]; unsigned int i; u32 carry = 0; for (i = 0; i < DIV_ROUND_UP(priv->len, sizeof(u32)); i++) { dst[i] = carry | (src[i] >> shift); carry = sr...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_bitwise.c
void nft_bitwise_eval(const struct nft_expr *expr, struct nft_regs *regs, const struct nft_pktinfo *pkt) { const struct nft_bitwise *priv = nft_expr_priv(expr); const u32 *src = &regs->data[priv->sreg]; u32 *dst = &regs->data[priv->dreg]; switch (priv->op) { case NFT_BITWISE_BOOL: ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_bitwise.c
static int nft_bitwise_dump_shift(struct sk_buff *skb, const struct nft_bitwise *priv) { if (nft_data_dump(skb, NFTA_BITWISE_DATA, &priv->data, NFT_DATA_VALUE, sizeof(u32)) < 0) return -1; return 0; }
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_bitwise.c
static int nft_bitwise_fast_offload(struct nft_offload_ctx *ctx, struct nft_flow_rule *flow, const struct nft_expr *expr) { const struct nft_bitwise_fast_expr *priv = nft_expr_priv(expr); struct nft_offload_reg *reg = &ctx->regs[priv->dreg]; ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_bitwise.c
static bool nft_bitwise_fast_reduce(struct nft_regs_track *track, const struct nft_expr *expr) { const struct nft_bitwise_fast_expr *priv = nft_expr_priv(expr); const struct nft_bitwise_fast_expr *bitwise; if (!track->regs[priv->sreg].selector) return false; bitwise = ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static void nft_chain_filter_ipv4_init(void) { nft_register_chain_type(&nft_chain_filter_ipv4); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static inline void nft_chain_filter_ipv4_init(void) {}
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static void nft_chain_filter_arp_fini(void) { nft_unregister_chain_type(&nft_chain_filter_arp); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static unsigned int nft_do_chain_inet_ingress(void *priv, struct sk_buff *skb, const struct nf_hook_state *state) { struct nf_hook_state ingress_state = *state; struct nft_pktinfo pkt; switch (skb->protocol) { case htons(ETH_P_IP): ingress_state.pf = NFPROTO_IPV4; ingress_sta...
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static inline void nft_chain_filter_inet_init(void) {}
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static void nft_chain_filter_bridge_fini(void) { nft_unregister_chain_type(&nft_chain_filter_bridge); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
static inline void nft_chain_filter_bridge_init(void) {}
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_filter.c
int __init nft_chain_filter_init(void) { int err; err = nft_chain_filter_netdev_init(); if (err < 0) return err; nft_chain_filter_ipv4_init(); nft_chain_filter_ipv6_init(); nft_chain_filter_arp_init(); nft_chain_filter_inet_init(); nft_chain_filter_bridge_init(); return 0; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_nat.c
static int nft_nat_inet_reg(struct net *net, const struct nf_hook_ops *ops) { return nf_nat_inet_register_fn(net, ops); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_nat.c
static int __init nft_chain_nat_init(void) { #ifdef CONFIG_NF_TABLES_IPV6 nft_register_chain_type(&nft_chain_nat_ipv6); #endif #ifdef CONFIG_NF_TABLES_IPV4 nft_register_chain_type(&nft_chain_nat_ipv4); #endif #ifdef CONFIG_NF_TABLES_INET nft_register_chain_type(&nft_chain_nat_inet); #endif return 0; }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_chain_route.c
void __init nft_chain_route_init(void) { #ifdef CONFIG_NF_TABLES_IPV6 nft_register_chain_type(&nft_chain_route_ipv6); #endif #ifdef CONFIG_NF_TABLES_IPV4 nft_register_chain_type(&nft_chain_route_ipv4); #endif #ifdef CONFIG_NF_TABLES_INET nft_register_chain_type(&nft_chain_route_inet); #endif }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_cmp.c
void nft_cmp_eval(const struct nft_expr *expr, struct nft_regs *regs, const struct nft_pktinfo *pkt) { const struct nft_cmp_expr *priv = nft_expr_priv(expr); int d; d = memcmp(&regs->data[priv->sreg], &priv->data, priv->len); switch (priv->op) { case NFT_CMP_EQ: if (d != 0) goto ...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_cmp.c
static int nft_cmp_init(const struct nft_ctx *ctx, const struct nft_expr *expr, const struct nlattr *const tb[]) { struct nft_cmp_expr *priv = nft_expr_priv(expr); struct nft_data_desc desc = { .type = NFT_DATA_VALUE, .size = sizeof(priv->data), }; int err; err = nft_data...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_cmp.c
static int __nft_cmp_offload(struct nft_offload_ctx *ctx, struct nft_flow_rule *flow, const struct nft_cmp_expr *priv) { struct nft_offload_reg *reg = &ctx->regs[priv->sreg]; union nft_cmp_offload_data _data, _datamask; u8 *mask = (u8 *)&flow->match.mask;...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_cmp.c
static int nft_cmp_fast_offload(struct nft_offload_ctx *ctx, struct nft_flow_rule *flow, const struct nft_expr *expr) { const struct nft_cmp_fast_expr *priv = nft_expr_priv(expr); struct nft_cmp_expr cmp = { .data = { .da...
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_cmp.c
static int nft_cmp16_fast_dump(struct sk_buff *skb, const struct nft_expr *expr, bool reset) { const struct nft_cmp16_fast_expr *priv = nft_expr_priv(expr); enum nft_cmp_ops op = priv->inv ? NFT_CMP_NEQ : NFT_CMP_EQ; if (nft_dump_register(skb, NFTA_CMP_SREG, priv->sreg)) goto ...
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static int nft_extension_dump_info(struct sk_buff *skb, int attr, const void *info, unsigned int size, unsigned int user_size) { unsigned int info_size, aligned_size = XT_ALIGN(size); struct nlattr *nla; nla = nla_reserve(skb, attr, aligned_s...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static int nft_target_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, const struct nft_data **data) { struct xt_target *target = expr->ops->data; unsigned int hook_mask = 0; int ret; if (nft_is_base_chain(ctx->chain)) { const s...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static void nft_match_large_eval(const struct nft_expr *expr, struct nft_regs *regs, const struct nft_pktinfo *pkt) { struct nft_xt_match_priv *priv = nft_expr_priv(expr); __nft_match_eval(expr, regs, pkt, priv->info); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static void nft_match_set_mtchk_param(struct xt_mtchk_param *par, const struct nft_ctx *ctx, struct xt_match *match, void *info, union nft_entry *entry, u16 proto, bool...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static void __nft_match_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr, void *info) { struct xt_match *match = expr->ops->data; struct module *me = match->me; struct xt_mtdtor_param par; par.net = ctx->net; par.match = match; par.matchinfo = info; par.fami...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static int nft_match_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, const struct nft_data **data) { struct xt_match *match = expr->ops->data; unsigned int hook_mask = 0; int ret; if (nft_is_base_chain(ctx->chain)) { const struct...
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static bool nft_match_reduce(struct nft_regs_track *track, const struct nft_expr *expr) { const struct xt_match *match = expr->ops->data; return strcmp(match->name, "comment") == 0; }
[ 1, 0 ]
Linux Kernel
net/netfilter/nft_compat.c
static void nft_target_release_ops(const struct nft_expr_ops *ops) { struct xt_target *target = ops->data; module_put(target->me); kfree(ops); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_connlimit.c
static inline void nft_connlimit_do_eval(struct nft_connlimit *priv, struct nft_regs *regs, const struct nft_pktinfo *pkt, const struct nft_set_ext *ext) { const struct nf_conntrack_zone *zone =...
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_connlimit.c
static int nft_connlimit_obj_dump(struct sk_buff *skb, struct nft_object *obj, bool reset) { struct nft_connlimit *priv = nft_obj_data(obj); return nft_connlimit_do_dump(skb, priv); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_connlimit.c
static void nft_connlimit_eval(const struct nft_expr *expr, struct nft_regs *regs, const struct nft_pktinfo *pkt) { struct nft_connlimit *priv = nft_expr_priv(expr); nft_connlimit_do_eval(priv, regs, pkt, NULL); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_connlimit.c
static void nft_connlimit_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr) { struct nft_connlimit *priv = nft_expr_priv(expr); nft_connlimit_do_destroy(ctx, priv); }
[ 0, 0 ]
Linux Kernel
net/netfilter/nft_connlimit.c
static int nft_connlimit_clone(struct nft_expr *dst, const struct nft_expr *src) { struct nft_connlimit *priv_dst = nft_expr_priv(dst); struct nft_connlimit *priv_src = nft_expr_priv(src); priv_dst->list = kmalloc(sizeof(*priv_dst->list), GFP_ATOMIC); if (!priv_dst->list) re...
[ 0, 0 ]