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_ctl.c
struct ip_vs_dest *ip_vs_find_real_service(struct netns_ipvs *ipvs, int af, __u16 protocol, const union nf_inet_addr *daddr, __be16 dport) { unsigned int hash; struct ip_vs_dest *dest; ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
struct ip_vs_dest *ip_vs_find_tunnel(struct netns_ipvs *ipvs, int af, const union nf_inet_addr *daddr, __be16 tun_port) { struct ip_vs_dest *dest; unsigned int hash; hash = ip_vs_rs_hashkey(af, daddr, tun_port); hlist_for_each_entry_rcu...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
struct ip_vs_dest *ip_vs_find_dest(struct netns_ipvs *ipvs, int svc_af, int dest_af, const union nf_inet_addr *daddr, __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, _...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static struct ip_vs_dest *ip_vs_trash_get_dest(struct ip_vs_service *svc, int dest_af, const union nf_inet_addr *daddr, __be16 dport) { struct ip_vs_dest *dest; struct netns_i...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static void ip_vs_dest_free(struct ip_vs_dest *dest) { struct ip_vs_service *svc = rcu_dereference_protected(dest->svc, 1); __ip_vs_dst_cache_reset(dest); __ip_vs_svc_put(svc); call_rcu(&dest->rcu_head, ip_vs_dest_rcu_free); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
int ip_vs_stats_init_alloc(struct ip_vs_stats *s) { int i; spin_lock_init(&s->lock); s->cpustats = alloc_percpu(struct ip_vs_cpu_stats); if (!s->cpustats) return -ENOMEM; for_each_possible_cpu(i) { struct ip_vs_cpu_stats *cs = per_cpu_ptr(s->cpustats, i); u64_stats_init(&cs->syncp); } retur...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
struct ip_vs_stats *ip_vs_stats_alloc(void) { struct ip_vs_stats *s = kzalloc(sizeof(*s), GFP_KERNEL); if (s && ip_vs_stats_init_alloc(s) >= 0) return s; kfree(s); return NULL; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
void ip_vs_stats_free(struct ip_vs_stats *stats) { if (stats) { ip_vs_stats_release(stats); kfree(stats); } }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static void __ip_vs_unlink_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest, int svcupd) { dest->flags &= ~IP_VS_DEST_F_AVAILABLE; list_del_rcu(&dest->n_list); svc->num_dests--; if (dest->af != svc->af) svc->ipvs->mixed_address_family_dests--; if (svcupd) { st...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int ip_vs_del_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest) { struct ip_vs_dest *dest; __be16 dport = udest->port; EnterFunction(2); rcu_read_lock(); dest = ip_vs_lookup_dest(svc, udest->af, &udest->addr, dport); rcu_read_unlock(); if (dest == NULL...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int ip_vs_flush(struct netns_ipvs *ipvs, bool cleanup) { int idx; struct ip_vs_service *svc; struct hlist_node *n; for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { hlist_for_each_entry_safe(svc, n, &ip_vs_svc_table[idx], s_list) { if (svc->ipvs == ipvs) ip_vs_unlink_service(svc, cleanu...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static inline const char *ip_vs_fwd_name(unsigned int flags) { switch (flags & IP_VS_CONN_F_FWD_MASK) { case IP_VS_CONN_F_LOCALNODE: return "Local"; case IP_VS_CONN_F_TUNNEL: return "Tunnel"; case IP_VS_CONN_F_DROUTE: return "Route"; default: return "Masq"; } }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static struct ip_vs_service *ip_vs_info_array(struct seq_file *seq, loff_t pos) { struct net *net = seq_file_net(seq); struct netns_ipvs *ipvs = net_ipvs(net); struct ip_vs_iter *iter = seq->private; int idx; struct ip_vs_service *svc; for (idx = 0; idx < IP_VS...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static void *ip_vs_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct hlist_node *e; struct ip_vs_iter *iter; struct ip_vs_service *svc; ++*pos; if (v == SEQ_START_TOKEN) return ip_vs_info_array(seq, 0); svc = v; iter = seq->private; if (iter->table == ip_vs_svc_table) { e = ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static void ip_vs_info_seq_stop(struct seq_file *seq, void *v) __releases(RCU) { rcu_read_unlock(); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static inline int __ip_vs_get_dest_entries(struct netns_ipvs *ipvs, const struct ip_vs_get_dests *get, struct ip_vs_get_dests __user *uptr) { struct ip_vs_service *svc; union nf_inet_addr addr = {.ip = get->addr}; int ret = 0; rcu_read_lock(); if (get->fwmark...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static inline void __ip_vs_get_timeouts(struct netns_ipvs *ipvs, struct ip_vs_timeout_user *u) { #if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP) struct ip_vs_proto_data *pd; #endif memset(u, 0, sizeof(*u)); #ifdef CONFIG_IP_VS_PROTO_TCP pd = ip_vs_...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int ip_vs_genl_fill_stats(struct sk_buff *skb, int container_type, struct ip_vs_kstats *kstats) { struct nlattr *nl_stats = nla_nest_start_noflag(skb, container_type); if (!nl_stats) return -EMSGSIZE; if (nla_put_u32(skb, IPVS_STATS_ATTR_CONNS, (u32)kstats->conns) ||...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int ip_vs_genl_dump_dest(struct sk_buff *skb, struct ip_vs_dest *dest, struct netlink_callback *cb) { void *hdr; hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, &ip_vs_genl_family, NLM_F_MULTI, IPVS_CMD_NEW_DEST); if (!hdr) re...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int ip_vs_genl_fill_daemon(struct sk_buff *skb, __u32 state, struct ipvs_sync_daemon_cfg *c) { struct nlattr *nl_daemon; nl_daemon = nla_nest_start_noflag(skb, IPVS_CMD_ATTR_DAEMON); if (!nl_daemon) return -EMSGSIZE; if (nla_put_u32(skb, IPVS_DAEMON_ATTR_STATE, st...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int ip_vs_genl_dump_daemon(struct sk_buff *skb, __u32 state, struct ipvs_sync_daemon_cfg *c, struct netlink_callback *cb) { void *hdr; hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, &ip_vs_genl_fa...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static void ip_vs_genl_unregister(void) { genl_unregister_family(&ip_vs_genl_family); } /* * per netns intit/exit func. */ #ifdef CONFIG_SYSCTL
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
static int __net_init ip_vs_control_net_init_sysctl(struct netns_ipvs *ipvs) { return 0; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs) { int ret = -ENOMEM; int idx; for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++) INIT_HLIST_HEAD(&ipvs->rs_table[idx]); INIT_LIST_HEAD(&ipvs->dest_trash); spin_lock_init(&ipvs->dest_trash_lock); timer_setup(&ipvs->dest_trash_timer, ip_vs_dest_tra...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
void __net_exit ip_vs_control_net_cleanup(struct netns_ipvs *ipvs) { ip_vs_trash_cleanup(ipvs); ip_vs_control_net_cleanup_sysctl(ipvs); cancel_delayed_work_sync(&ipvs->est_reload_work); #ifdef CONFIG_PROC_FS remove_proc_entry("ip_vs_stats_percpu", ipvs->net->proc_net); remove_proc_entry("ip_vs_stats", ipvs->...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ctl.c
int __init ip_vs_control_init(void) { int idx; int ret; EnterFunction(2); for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { INIT_HLIST_HEAD(&ip_vs_svc_table[idx]); INIT_HLIST_HEAD(&ip_vs_svc_fwm_table[idx]); } smp_wmb(); /* Do we really need it now ? */ ret = register_netdevice_notifier(&ip_vs_...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_dh.c
static void ip_vs_dh_flush(struct ip_vs_dh_state *s) { int i; struct ip_vs_dh_bucket *b; struct ip_vs_dest *dest; b = &s->buckets[0]; for (i = 0; i < IP_VS_DH_TAB_SIZE; i++) { dest = rcu_dereference_protected(b->dest, 1); if (dest) { ip_vs_dest_put(dest); RCU_INIT_POINTER(b->dest, NULL); ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_dh.c
static void ip_vs_dh_done_svc(struct ip_vs_service *svc) { struct ip_vs_dh_state *s = svc->sched_data; ip_vs_dh_flush(s); /* release the table itself */ kfree_rcu(s, rcu_head); IP_VS_DBG(6, "DH hash table (memory=%zdbytes) released\n", sizeof(struct ip_vs_dh_bucket) * IP_VS_DH_TAB_SIZE); }
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_dh.c
static int __init ip_vs_dh_init(void) { return register_ip_vs_scheduler(&ip_vs_dh_scheduler); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_est.c
void ip_vs_est_reload_start(struct netns_ipvs *ipvs) { if (!ipvs->enable) return; ip_vs_est_stopped_recalc(ipvs); /* Bump the kthread configuration genid */ atomic_inc(&ipvs->est_genid); queue_delayed_work(system_long_wq, &ipvs->est_reload_work, 0); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_est.c
static void ip_vs_est_update_ktid(struct netns_ipvs *ipvs) { int ktid, best = ipvs->est_kt_count; struct ip_vs_est_kt_data *kd; for (ktid = 0; ktid < ipvs->est_kt_count; ktid++) { kd = ipvs->est_kt_arr[ktid]; if (kd) { if (kd->est_count < kd->est_max_count) { best = ktid; break; ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_est.c
static void ip_vs_est_drain_temp_list(struct netns_ipvs *ipvs) { struct ip_vs_estimator *est; while (1) { int max = 16; mutex_lock(&__ip_vs_mutex); while (max-- > 0) { est = hlist_entry_safe(ipvs->est_temp_list.first, struct ip_vs_estimator, list); if (est) { ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ftp.c
static int ip_vs_ftp_init_conn(struct ip_vs_app *app, struct ip_vs_conn *cp) { cp->flags |= IP_VS_CONN_F_NFCT; return 0; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ftp.c
static int __init ip_vs_ftp_init(void) { return register_pernet_subsys(&ip_vs_ftp_ops); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ftp.c
static void __exit ip_vs_ftp_exit(void) { unregister_pernet_subsys(&ip_vs_ftp_ops); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static void ip_vs_lblc_rcu_free(struct rcu_head *head) { struct ip_vs_lblc_entry *en = container_of(head, struct ip_vs_lblc_entry, rcu_head); ip_vs_dest_put_and_free(en->dest); kfree(en); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static inline unsigned int ip_vs_lblc_hashkey(int af, const union nf_inet_addr *addr) { __be32 addr_fold = addr->ip; #ifdef CONFIG_IP_VS_IPV6 if (af == AF_INET6) addr_fold = addr->ip6[0] ^ addr->ip6[1] ^ addr->ip6[2] ^ addr->ip6[3]; #endif return hash_32(ntohl(ad...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static void ip_vs_lblc_flush(struct ip_vs_service *svc) { struct ip_vs_lblc_table *tbl = svc->sched_data; struct ip_vs_lblc_entry *en; struct hlist_node *next; int i; spin_lock_bh(&svc->sched_lock); tbl->dead = true; for (i = 0; i < IP_VS_LBLC_TAB_SIZE; i++) { hlist_for_each_entry_safe(en, next, &tbl...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static int sysctl_lblc_expiration(struct ip_vs_service *svc) { #ifdef CONFIG_SYSCTL return svc->ipvs->sysctl_lblc_expiration; #else return DEFAULT_EXPIRATION; #endif }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static inline void ip_vs_lblc_full_check(struct ip_vs_service *svc) { struct ip_vs_lblc_table *tbl = svc->sched_data; struct ip_vs_lblc_entry *en; struct hlist_node *next; unsigned long now = jiffies; int i, j; for (i = 0, j = tbl->rover; i < IP_VS_LBLC_TAB_SIZE; i++) { j = (j + 1) & IP_VS_LBLC_TAB_MA...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) { int i; struct ip_vs_lblc_table *tbl; tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); if (tbl == NULL) return -ENOMEM; svc->sched_data = tbl; IP_VS_DBG(6, "LBLC hash table (memory=%zdbytes) allocated for " "current service\n",...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static struct ip_vs_dest *ip_vs_lblc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb, struct ip_vs_iphdr *iph) { struct ip_vs_lblc_table *tbl = svc->sched_data; struct ip_vs_dest *dest = NULL; struct ip_vs_lb...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static void __net_exit __ip_vs_lblc_exit(struct net *net) {} #endif
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblc.c
static int __init ip_vs_lblc_init(void) { int ret; ret = register_pernet_subsys(&ip_vs_lblc_ops); if (ret) return ret; ret = register_ip_vs_scheduler(&ip_vs_lblc_scheduler); if (ret) unregister_pernet_subsys(&ip_vs_lblc_ops); return ret; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static void ip_vs_lblcr_elem_rcu_free(struct rcu_head *head) { struct ip_vs_dest_set_elem *e; e = container_of(head, struct ip_vs_dest_set_elem, rcu_head); ip_vs_dest_put_and_free(e->dest); kfree(e); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static void ip_vs_dest_set_eraseall(struct ip_vs_dest_set *set) { struct ip_vs_dest_set_elem *e, *ep; list_for_each_entry_safe(e, ep, &set->list, list) { list_del_rcu(&e->list); call_rcu(&e->rcu_head, ip_vs_lblcr_elem_rcu_free); } }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static inline struct ip_vs_dest * ip_vs_dest_set_min(struct ip_vs_dest_set *set) { struct ip_vs_dest_set_elem *e; struct ip_vs_dest *dest, *least; int loh, doh; list_for_each_entry_rcu(e, &set->list, list) { least = e->dest; if (least->flags & IP_VS_DEST_F_OVERLOAD) continue; if ((atomic_rea...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static void ip_vs_lblcr_hash(struct ip_vs_lblcr_table *tbl, struct ip_vs_lblcr_entry *en) { unsigned int hash = ip_vs_lblcr_hashkey(en->af, &en->addr); hlist_add_head_rcu(&en->list, &tbl->bucket[hash]); atomic_inc(&tbl->entries); }
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static inline struct ip_vs_lblcr_entry * ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr, u16 af, struct ip_vs_dest *dest) { struct ip_vs_lblcr_entry *en; en = ip_vs_lblcr_get(af, tbl, daddr); if (!en) { en = kmalloc(sizeof(*en), GFP_ATOMIC); if (!en) ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static void ip_vs_lblcr_flush(struct ip_vs_service *svc) { struct ip_vs_lblcr_table *tbl = svc->sched_data; int i; struct ip_vs_lblcr_entry *en; struct hlist_node *next; spin_lock_bh(&svc->sched_lock); tbl->dead = true; for (i = 0; i < IP_VS_LBLCR_TAB_SIZE; i++) { hlist_for_each_entry_safe(en, next, ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static inline void ip_vs_lblcr_full_check(struct ip_vs_service *svc) { struct ip_vs_lblcr_table *tbl = svc->sched_data; unsigned long now = jiffies; int i, j; struct ip_vs_lblcr_entry *en; struct hlist_node *next; for (i = 0, j = tbl->rover; i < IP_VS_LBLCR_TAB_SIZE; i++) { j = (j + 1) & IP_VS_LBLCR_T...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static void ip_vs_lblcr_check_expire(struct timer_list *t) { struct ip_vs_lblcr_table *tbl = from_timer(tbl, t, periodic_timer); struct ip_vs_service *svc = tbl->svc; unsigned long now = jiffies; int goal; int i, j; struct ip_vs_lblcr_entry *en; struct hlist_node *next; if ((tbl->counter % COUNT_FOR_FU...
[ 1, 1 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lblcr.c
static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) { int i; struct ip_vs_lblcr_table *tbl; tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); if (tbl == NULL) return -ENOMEM; svc->sched_data = tbl; IP_VS_DBG(6, "LBLCR hash table (memory=%zdbytes) allocated for " "current service\...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_lc.c
static struct ip_vs_dest *ip_vs_lc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb, struct ip_vs_iphdr *iph) { struct ip_vs_dest *dest, *least = NULL; unsigned int loh = 0, doh; IP_VS_DBG(6, "%s(): Scheduling......
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static void ip_vs_mh_reset(struct ip_vs_mh_state *s) { int i; struct ip_vs_mh_lookup *l; struct ip_vs_dest *dest; l = &s->lookup[0]; for (i = 0; i < IP_VS_MH_TAB_SIZE; i++) { dest = rcu_dereference_protected(l->dest, 1); if (dest) { ip_vs_dest_put(dest); RCU_INIT_POINTER(l->dest, NULL); ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static int ip_vs_mh_permutate(struct ip_vs_mh_state *s, struct ip_vs_service *svc) { struct list_head *p; struct ip_vs_mh_dest_setup *ds; struct ip_vs_dest *dest; int lw; if (s->gcd < 1) return 0; /* Set dest_setup for the dests permutation */ p = &svc->destinations; ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static int ip_vs_mh_populate(struct ip_vs_mh_state *s, struct ip_vs_service *svc) { int n, c, dt_count; unsigned long *table; struct list_head *p; struct ip_vs_mh_dest_setup *ds; struct ip_vs_dest *dest, *new_dest; if (s->gcd < 1) { ip_vs_mh_reset(s); return 0; } t...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static inline struct ip_vs_dest *ip_vs_mh_get(struct ip_vs_service *svc, struct ip_vs_mh_state *s, const union nf_inet_addr *addr, __be16 port) { unsigned int hash = ip_vs_mh...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static inline struct ip_vs_dest * ip_vs_mh_get_fallback(struct ip_vs_service *svc, struct ip_vs_mh_state *s, const union nf_inet_addr *addr, __be16 port) { unsigned int offset, roffset; unsigned int hash, ihash; struct ip_vs_dest *dest; ihash = ip_vs_mh_hashkey(svc->af, addr, port, ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static int ip_vs_mh_shift_weight(struct ip_vs_service *svc, int gcd) { struct ip_vs_dest *dest; int new_weight, weight = 0; int mw, shift; if (gcd < 1) return 0; list_for_each_entry(dest, &svc->destinations, n_list) { new_weight = atomic_read(&dest->last_weight); if (new_weight > weight) w...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static void ip_vs_mh_state_free(struct rcu_head *head) { struct ip_vs_mh_state *s; s = container_of(head, struct ip_vs_mh_state, rcu_head); kfree(s->lookup); kfree(s); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_mh.c
static struct ip_vs_dest *ip_vs_mh_schedule(struct ip_vs_service *svc, const struct sk_buff *skb, struct ip_vs_iphdr *iph) { struct ip_vs_dest *dest; struct ip_vs_mh_state *s; __be16 port = 0; const union nf_inet_addr *hash_...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_nfct.c
void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, struct ip_vs_conn *cp, u_int8_t proto, const __be16 port, int from_rs) { struct nf_conntrack_expect *exp; if (ct == NULL) return; exp = nf_ct_expect_alloc(ct); if (!exp) ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_nq.c
static inline int ip_vs_nq_dest_overhead(struct ip_vs_dest *dest) { return atomic_read(&dest->activeconns) + 1; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_ovf.c
static void __exit ip_vs_ovf_cleanup(void) { unregister_ip_vs_scheduler(&ip_vs_ovf_scheduler); synchronize_rcu(); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_pe.c
struct ip_vs_pe *ip_vs_pe_getbyname(const char *name) { struct ip_vs_pe *pe; pe = __ip_vs_pe_getbyname(name); /* If pe not found, load the module and search again */ if (!pe) { request_module("ip_vs_pe_%s", name); pe = __ip_vs_pe_getbyname(name); } return pe; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_pe.c
int register_ip_vs_pe(struct ip_vs_pe *pe) { struct ip_vs_pe *tmp; if (!ip_vs_use_count_inc()) return -ENOENT; mutex_lock(&ip_vs_pe_mutex); /* Make sure that the pe with this name doesn't exist * in the pe list. */ list_for_each_entry(tmp, &ip_vs_pe, n_list) { if (strcmp(tmp->name, pe->name) =...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_pe_sip.c
static int ip_vs_sip_fill_param(struct ip_vs_conn_param *p, struct sk_buff *skb) { struct ip_vs_iphdr iph; unsigned int dataoff, datalen, matchoff, matchlen; const char *dptr; int retc; retc = ip_vs_fill_iph_skb(p->af, skb, false, &iph); if (!retc || iph.protocol != IPPROTO...
[ 1, 1 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_pe_sip.c
static u32 ip_vs_sip_hashkey_raw(const struct ip_vs_conn_param *p, u32 initval, bool inverse) { return jhash(p->pe_data, p->pe_data_len, initval); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_pe_sip.c
static void __exit ip_vs_sip_cleanup(void) { unregister_ip_vs_pe(&ip_vs_sip_pe); synchronize_rcu(); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto.c
static int register_ip_vs_proto_netns(struct netns_ipvs *ipvs, struct ip_vs_protocol *pp) { unsigned int hash = IP_VS_PROTO_HASH(pp->protocol); struct ip_vs_proto_data *pd = kzalloc(sizeof(struct ip_vs_proto_data), GFP_KERNEL); if (!pd) return -ENOMEM; pd->pp = ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto.c
struct ip_vs_proto_data *ip_vs_proto_data_get(struct netns_ipvs *ipvs, unsigned short proto) { struct ip_vs_proto_data *pd; unsigned int hash = IP_VS_PROTO_HASH(proto); for (pd = ipvs->proto_data_table[hash]; pd; pd = pd->next) { if (pd->pp->protocol == proto) ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto.c
const char *ip_vs_state_name(const struct ip_vs_conn *cp) { unsigned int state = cp->state; struct ip_vs_protocol *pp; if (cp->flags & IP_VS_CONN_F_TEMPLATE) { if (state >= IP_VS_CTPL_S_LAST) return "ERR!"; return ip_vs_ctpl_state_name_table[state] ?: "?"; } pp = ip_vs_proto_get(cp->protocol...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto.c
static void ip_vs_tcpudp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[128]; struct iphdr _iph, *ih; ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); if ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto.c
static void ip_vs_tcpudp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[192]; struct ipv6hdr _iph, *ih; ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); if ...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto.c
int __init ip_vs_protocol_init(void) { char protocols[64]; #define REGISTER_PROTOCOL(p) \ do { \ register_ip_vs_protocol(p); \ strcat(prot...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_ah_esp.c
static void ah_esp_conn_fill_param_proto(struct netns_ipvs *ipvs, int af, const struct ip_vs_iphdr *iph, struct ip_vs_conn_param *p) { if (likely(!ip_vs_iph_inverse(iph))) ip_vs_conn_fill_param(ipvs, af, IPPROTO_UDP, &iph->saddr, ...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_sctp.c
static void sctp_nat_csum(struct sk_buff *skb, struct sctphdr *sctph, unsigned int sctphoff) { sctph->checksum = sctp_compute_cksum(skb, sctphoff); skb->ip_summed = CHECKSUM_UNNECESSARY; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_sctp.c
static int sctp_dnat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, struct ip_vs_conn *cp, struct ip_vs_iphdr *iph) { struct sctphdr *sctph; unsigned int sctphoff = iph->len; bool payload_csum = false; #ifdef CONFIG_IP_VS_IPV6 if (cp->af == AF_INET6 && iph->fragoffs) r...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_sctp.c
static int sctp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp) { unsigned int sctphoff; struct sctphdr *sh; __le32 cmp, val; #ifdef CONFIG_IP_VS_IPV6 if (af == AF_INET6) sctphoff = sizeof(struct ipv6hdr); else #endif sctphoff = ip_hdrlen(skb); sh = (s...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_sctp.c
static void sctp_unregister_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc) { struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_SCTP); atomic_dec(&pd->appcnt); list_del_rcu(&inc->p_list); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_sctp.c
static int __ip_vs_sctp_init(struct netns_ipvs *ipvs, struct ip_vs_proto_data *pd) { ip_vs_init_hash_table(ipvs->sctp_apps, SCTP_APP_TAB_SIZE); pd->timeout_table = ip_vs_create_timeout_table((int *)sctp_timeouts, sizeof(sctp_timeouts)); if (!pd->timeout_table) return -ENOMEM...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_tcp.c
static int tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb, struct ip_vs_proto_data *pd, int *verdict, struct ip_vs_conn **cpp, struct ip_vs_iphdr *iph) { struct ip_vs_service *svc; struct tcphdr _tcph, *th...
[ 1, 1 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_tcp.c
static inline void tcp_partial_csum_update(int af, struct tcphdr *tcph, const union nf_inet_addr *oldip, const union nf_inet_addr *newip, __be16 oldlen, __be16 newlen) { #ifdef CONFIG_IP_VS...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_tcp.c
static void tcp_state_transition(struct ip_vs_conn *cp, int direction, const struct sk_buff *skb, struct ip_vs_proto_data *pd) { struct tcphdr _tcph, *th; #ifdef CONFIG_IP_VS_IPV6 int ihl = cp->af == AF_INET ? ip_hdrlen(skb) : sizeof(struct ipv6hdr)...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_tcp.c
static int tcp_register_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc) { struct ip_vs_app *i; __u16 hash; __be16 port = inc->port; int ret = 0; struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP); hash = tcp_app_hashkey(port); list_for_each_entry(i, &ipvs->tcp_apps[hash], p_list...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static inline void udp_partial_csum_update(int af, struct udphdr *uhdr, const union nf_inet_addr *oldip, const union nf_inet_addr *newip, __be16 oldlen, __be16 newlen) { #ifdef CONFIG_IP_VS_...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static int udp_register_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc) { struct ip_vs_app *i; __u16 hash; __be16 port = inc->port; int ret = 0; struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_UDP); hash = udp_app_hashkey(port); list_for_each_entry(i, &ipvs->udp_apps[hash], p_list...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static int udp_app_conn_bind(struct ip_vs_conn *cp) { struct netns_ipvs *ipvs = cp->ipvs; int hash; struct ip_vs_app *inc; int result = 0; if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) return 0; /* Lookup application incarnations and bind the right one */ hash = udp_app_hashkey(cp->vport); list_...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static const char *udp_state_name(int state) { if (state >= IP_VS_UDP_S_LAST) return "ERR!"; return udp_state_name_table[state] ? udp_state_name_table[state] : "?"; }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static void udp_state_transition(struct ip_vs_conn *cp, int direction, const struct sk_buff *skb, struct ip_vs_proto_data *pd) { if (unlikely(!pd)) { pr_err("UDP no ns data\n"); return; } cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static int __udp_init(struct netns_ipvs *ipvs, struct ip_vs_proto_data *pd) { ip_vs_init_hash_table(ipvs->udp_apps, UDP_APP_TAB_SIZE); pd->timeout_table = ip_vs_create_timeout_table((int *)udp_timeouts, sizeof(udp_timeouts)); if (!pd->timeout_table) return -ENOMEM; return 0; }
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_proto_udp.c
static void __udp_exit(struct netns_ipvs *ipvs, struct ip_vs_proto_data *pd) { kfree(pd->timeout_table); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_rr.c
static struct ip_vs_dest *ip_vs_rr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb, struct ip_vs_iphdr *iph) { struct list_head *p; struct ip_vs_dest *dest, *last; int pass = 0; IP_VS_DBG(6, "%s(): Scheduling....
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_rr.c
static int __init ip_vs_rr_init(void) { return register_ip_vs_scheduler(&ip_vs_rr_scheduler); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_rr.c
static void __exit ip_vs_rr_cleanup(void) { unregister_ip_vs_scheduler(&ip_vs_rr_scheduler); synchronize_rcu(); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sched.c
void ip_vs_unbind_scheduler(struct ip_vs_service *svc, struct ip_vs_scheduler *sched) { struct ip_vs_scheduler *cur_sched; cur_sched = rcu_dereference_protected(svc->scheduler, 1); if (!cur_sched) return; if (sched->done_service) sched->done_service(svc); /* svc->schedul...
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sched.c
void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler) { if (scheduler) module_put(scheduler->module); }
[ 0, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sched.c
int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) { struct ip_vs_scheduler *sched; if (!scheduler) { pr_err("%s(): NULL arg\n", __func__); return -EINVAL; } if (!scheduler->name) { pr_err("%s(): NULL scheduler_name\n", __func__); return -EINVAL; } if (!ip_vs_use_count_inc())...
[ 1, 0 ]
Linux Kernel
net/netfilter/ipvs/ip_vs_sh.c
static inline struct ip_vs_dest *ip_vs_sh_get(struct ip_vs_service *svc, struct ip_vs_sh_state *s, const union nf_inet_addr *addr, __be16 port) { unsigned int hash = ip_vs_sh_hashk...
[ 1, 0 ]