Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/netfilter/nf_conntrack_h323_asn1.c | static int decode_int(struct bitstr *bs, const struct field_t *f, char *base,
int level) {
unsigned int len;
PRINT("%*.s%s", level * TAB_SIZE, " ", f->name);
switch (f->sz) {
case BYTE:
BYTE_ALIGN(bs);
bs->cur++;
break;
case WORD: /* 257 <= Range <= 64K */
BYTE_ALIGN(bs... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_asn1.c | static int decode_bitstr(struct bitstr *bs, const struct field_t *f, char *base,
int level) {
unsigned int len;
PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name);
BYTE_ALIGN(bs);
switch (f->sz) {
case FIXD:
len = f->lb;
break;
case WORD: /* 2-byte length */
if (nf_h323... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_asn1.c |
static int DecodeH323_UserInformation(unsigned char *buf, unsigned char *beg,
size_t sz, H323_UserInformation *uuie) {
static const struct field_t h323_userinformation = {
FNAME("H323-UserInformation") SEQ,
1,
2,
2,
DECODE | EXT,
0,
_H32... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c |
static int process_olc(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, int dataoff,
OpenLogicalChannel *olc) {
int ret;
pr_debug("nf_ct_h323: OpenLogicalChannel\n");
if (olc-... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c |
int get_h225_addr(struct nf_conn *ct, unsigned char *data,
TransportAddress *taddr, union nf_inet_addr *addr,
__be16 *port) {
const unsigned char *p;
int len;
switch (taddr->choice) {
case eTransportAddress_ipAddress:
if (nf_ct_l3num(ct) != AF_INET)
return 0;
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c |
static int process_callproceeding(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo,
unsigned int protoff, unsigned char **data,
int dataoff, CallProceeding_UUIE *callproc) {
int ret;
int i;
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c |
static int process_alerting(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, int dataoff,
Alerting_UUIE *alert) {
int ret;
int i;
pr_debug("nf_ct_q931: Alerting\... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c | static int q931_help(struct sk_buff *skb, unsigned int protoff,
struct nf_conn *ct, enum ip_conntrack_info ctinfo) {
static Q931 q931;
unsigned char *data = NULL;
int datalen;
int dataoff;
int ret;
if (ctinfo != IP_CT_ESTABLISHED && ctinfo != IP_CT_ESTABLISHED_REPLY)
return NF_ACCE... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c |
static int process_rrq(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, RegistrationRequest *rrq) {
struct nf_ct_h323_master *info = nfct_help_data(ct);
const struct nfct_h323_nat_hooks *nathook;
int ... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c | static int process_rcf(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, RegistrationConfirm *rcf) {
struct nf_ct_h323_master *info = nfct_help_data(ct);
const struct nfct_h323_nat_hooks *nathook;
int d... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c | static int process_urq(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, UnregistrationRequest *urq) {
struct nf_ct_h323_master *info = nfct_help_data(ct);
const struct nfct_h323_nat_hooks *nathook;
int... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c | static int process_acf(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, AdmissionConfirm *acf) {
int dir = CTINFO2DIR(ctinfo);
int ret = 0;
__be16 port;
union nf_inet_addr addr;
struct nf_conntrack... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_main.c | static int process_lcf(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, unsigned int protoff,
unsigned char **data, LocationConfirm *lcf) {
int dir = CTINFO2DIR(ctinfo);
int ret = 0;
__be16 port;
union nf_inet_addr addr;
struct nf_conntrack_... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c |
void nf_conntrack_helper_put(struct nf_conntrack_helper *helper) {
refcount_dec(&helper->refcnt);
module_put(helper->me);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c |
int nf_nat_helper_try_module_get(const char *name, u16 l3num, u8 protonum) {
struct nf_conntrack_helper *h;
struct nf_conntrack_nat_helper *nat;
char mod_name[NF_CT_HELPER_NAME_LEN];
int ret = 0;
rcu_read_lock();
h = __nf_conntrack_helper_find(name, l3num, protonum);
if (!h) {
rcu_read_unlock();
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c |
void nf_nat_helper_put(struct nf_conntrack_helper *helper) {
struct nf_conntrack_nat_helper *nat;
nat = nf_conntrack_nat_helper_find(helper->nat_mod_name);
if (WARN_ON_ONCE(!nat))
return;
module_put(nat->module);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c | struct nf_ct_helper_expectfn *
nf_ct_helper_expectfn_find_by_symbol(const void *symbol) {
struct nf_ct_helper_expectfn *cur;
bool found = false;
list_for_each_entry_rcu(cur, &nf_ct_helper_expectfn_list, head) {
if (cur->expectfn == symbol) {
found = true;
break;
}
}
return found ? cur : N... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c | void nf_ct_helper_log(struct sk_buff *skb, const struct nf_conn *ct,
const char *fmt, ...) {
const struct nf_conn_help *help;
const struct nf_conntrack_helper *helper;
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
help = nfct_help(ct);
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c | int nf_conntrack_helper_register(struct nf_conntrack_helper *me) {
struct nf_conntrack_tuple_mask mask = {.src.u.all = htons(0xFFFF)};
unsigned int h = helper_hash(&me->tuple);
struct nf_conntrack_helper *cur;
int ret = 0, i;
BUG_ON(me->expect_policy == NULL);
BUG_ON(me->expect_class_max >= NF_CT_MAX_EXPEC... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c |
static bool expect_iter_me(struct nf_conntrack_expect *exp, void *data) {
struct nf_conn_help *help = nfct_help(exp->master);
const struct nf_conntrack_helper *me = data;
const struct nf_conntrack_helper *this;
if (exp->helper == me)
return true;
this = rcu_dereference_protected(help->helper,
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_helper.c |
int nf_conntrack_helpers_register(struct nf_conntrack_helper *helper,
unsigned int n) {
unsigned int i;
int err = 0;
for (i = 0; i < n; i++) {
err = nf_conntrack_helper_register(&helper[i]);
if (err < 0)
goto err;
}
return err;
err:
if (i > 0)
nf_conntr... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_irc.c | static int __init nf_conntrack_irc_init(void) {
int i, ret;
if (max_dcc_channels < 1) {
pr_err("max_dcc_channels must not be zero\n");
return -EINVAL;
}
if (max_dcc_channels > NF_CT_EXPECT_MAX_CNT) {
pr_err("max_dcc_channels must not be more than %u\n", NF_CT_EXPECT_MAX_CNT);
return -EINVAL;
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_labels.c |
int nf_connlabels_get(struct net *net, unsigned int bits) {
if (BIT_WORD(bits) >= NF_CT_LABELS_MAX_SIZE / sizeof(long))
return -ERANGE;
spin_lock(&nf_connlabels_lock);
net->ct.labels_used++;
spin_unlock(&nf_connlabels_lock);
BUILD_BUG_ON(NF_CT_LABELS_MAX_SIZE / sizeof(long) >= U8_MAX);
return 0;
} | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ipv4_tuple_to_nlattr(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple) {
if (nla_put_in_addr(skb, CTA_IP_V4_SRC, tuple->src.u3.ip) ||
nla_put_in_addr(skb, CTA_IP_V4_DST, tuple->dst.u3.ip))
return -EMSGSIZE;
return 0;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_tuples_ip(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple) {
int ret = 0;
struct nlattr *nest_parms;
nest_parms = nla_nest_start(skb, CTA_TUPLE_IP);
if (!nest_parms)
goto nla_put_failure;
switch (tuple->src.l3num) {
case NFPROT... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_tuples(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple) {
const struct nf_conntrack_l4proto *l4proto;
int ret;
rcu_read_lock();
ret = ctnetlink_dump_tuples_ip(skb, tuple);
if (ret >= 0) {
l4proto = nf_ct_l4proto_find(tuple->dst.prot... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_status(struct sk_buff *skb,
const struct nf_conn *ct) {
if (nla_put_be32(skb, CTA_STATUS, htonl(ct->status)))
goto nla_put_failure;
return 0;
nla_put_failure:
return -1;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_protoinfo(struct sk_buff *skb, struct nf_conn *ct,
bool destroy) {
const struct nf_conntrack_l4proto *l4proto;
struct nlattr *nest_proto;
int ret;
l4proto = nf_ct_l4proto_find(nf_ct_protonum(ct));
if (!l4proto->to_nlattr)
return 0;
nest_pr... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_timestamp(struct sk_buff *skb,
const struct nf_conn *ct) {
struct nlattr *nest_count;
const struct nf_conn_tstamp *tstamp;
tstamp = nf_conn_tstamp_find(ct);
if (!tstamp)
return 0;
nest_count = nla_nest_start(skb, CTA_TIMESTAMP);
if (!nest_... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_dump_mark(struct sk_buff *skb, const struct nf_conn *ct) {
u32 mark = READ_ONCE(ct->mark);
if (!mark)
return 0;
if (nla_put_be32(skb, CTA_MARK, htonl(mark)))
goto nla_put_failure;
return 0;
nla_put_failure:
return -1;
}
#else
#define ctnetlink_dump_mark(a, b) (0) | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_labels(struct sk_buff *skb,
const struct nf_conn *ct) {
struct nf_conn_labels *labels = nf_ct_labels_find(ct);
unsigned int i;
if (!labels)
return 0;
i = 0;
do {
if (labels->bits[i] != 0)
return nla_put(skb, CTA_LABELS, sizeof(labels-... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int dump_ct_seq_adj(struct sk_buff *skb, const struct nf_ct_seqadj *seq,
int type) {
struct nlattr *nest_parms;
nest_parms = nla_nest_start(skb, type);
if (!nest_parms)
goto nla_put_failure;
if (nla_put_be32(skb, CTA_SEQADJ_CORRECTION_POS,
htonl(seq->c... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static inline int ctnetlink_secctx_size(const struct nf_conn *ct) {
#ifdef CONFIG_NF_CONNTRACK_SECMARK
int len, ret;
ret = security_secid_to_secctx(ct->secmark, NULL, &len);
if (ret)
return 0;
return nla_total_size(0) +
nla_total_size(sizeof(char) * len); /* CTA_SECCTX_NAME */
#else
return 0;
#... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static size_t ctnetlink_nlmsg_size(const struct nf_conn *ct) {
return NLMSG_ALIGN(sizeof(struct nfgenmsg)) + 3 * nla_total_size(0) +
3 * nla_total_size(0) /* CTA_TUPLE_IP */
+ 3 * nla_total_size(0) /* CTA_TUPLE_PROTO */
+ 3 * nla_total_size(sizeof(u_int8_t)) ... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_done(struct netlink_callback *cb) {
if (cb->args[1])
nf_ct_put((struct nf_conn *)cb->args[1]);
kfree(cb->data);
return 0;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_filter_parse_status(struct ctnetlink_filter_u32 *status,
const struct nlattr *const cda[]) {
if (cda[CTA_STATUS]) {
status->val = ntohl(nla_get_be32(cda[CTA_STATUS]));
if (cda[CTA_STATUS_MASK])
status->mask = ntohl(nla_get_be32(cda[CTA_STATUS... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ipv4_nlattr_to_tuple(struct nlattr *tb[],
struct nf_conntrack_tuple *t, u_int32_t flags) {
if (flags & CTA_FILTER_FLAG(CTA_IP_SRC)) {
if (!tb[CTA_IP_V4_SRC])
return -EINVAL;
t->src.u3.ip = nla_get_in_addr(tb[CTA_IP_V4_SRC]);
}
if (flags & CTA_FILTER_FLAG... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ipv6_nlattr_to_tuple(struct nlattr *tb[],
struct nf_conntrack_tuple *t, u_int32_t flags) {
if (flags & CTA_FILTER_FLAG(CTA_IP_SRC)) {
if (!tb[CTA_IP_V6_SRC])
return -EINVAL;
t->src.u3.in6 = nla_get_in6_addr(tb[CTA_IP_V6_SRC]);
}
if (flags & CTA_FILTER_FL... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_parse_tuple_ip(struct nlattr *attr,
struct nf_conntrack_tuple *tuple,
u_int32_t flags) {
struct nlattr *tb[CTA_IP_MAX + 1];
int ret = 0;
ret = nla_parse_nested_deprecated(tb, CTA_IP_MAX, attr, NULL, NULL);
if (ret < 0... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_parse_tuple_filter(const struct nlattr *const cda[],
struct nf_conntrack_tuple *tuple,
u32 type, u_int8_t l3num,
struct nf_conntrack_zone *zone,
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_parse_help(const struct nlattr *attr, char **helper_name,
struct nlattr **helpinfo) {
int err;
struct nlattr *tb[CTA_HELP_MAX + 1];
err = nla_parse_nested_deprecated(tb, CTA_HELP_MAX, attr, help_nla_policy,
NULL);
if (err... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_dump_one_entry(struct sk_buff *skb,
struct netlink_callback *cb,
struct nf_conn *ct, bool dying) {
struct ctnetlink_list_dump_ctx *ctx = (void *)cb->ctx;
struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
u8 l3proto = nfmsg->n... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_unconfirmed(struct sk_buff *skb,
struct netlink_callback *cb) {
return 0;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_dump_dying(struct sk_buff *skb,
struct netlink_callback *cb) {
struct ctnetlink_list_dump_ctx *ctx = (void *)cb->ctx;
struct nf_conn *last = ctx->last;
#ifdef CONFIG_NF_CONNTRACK_EVENTS
const struct net *net = sock_net(skb->sk);
struct nf_conntrack_net_ecach... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_get_ct_dying(struct sk_buff *skb,
const struct nfnl_info *info,
const struct nlattr *const cda[]) {
if (info->nlh->nlmsg_flags & NLM_F_DUMP) {
struct netlink_dump_control c = {
.dump = ctnetlink_dump_dying,
.... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_parse_nat_setup(struct nf_conn *ct,
enum nf_nat_manip_type manip,
const struct nlattr *attr)
__must_hold(RCU) {
const struct nf_nat_hook *nat_hook;
int err;
nat_hook = rcu_dereference(nf_nat_hook);
if (!nat_hook)... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_change_status(struct nf_conn *ct,
const struct nlattr *const cda[]) {
return nf_ct_change_status_common(ct, ntohl(nla_get_be32(cda[CTA_STATUS])));
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_change_protoinfo(struct nf_conn *ct,
const struct nlattr *const cda[]) {
const struct nlattr *attr = cda[CTA_PROTOINFO];
const struct nf_conntrack_l4proto *l4proto;
struct nlattr *tb[CTA_PROTOINFO_MAX + 1];
int err = 0;
err = nla_parse_nested_deprec... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo,
u_int16_t ct_attr, u_int16_t ct_info_attr) {
struct nlattr *nest_parms;
nest_parms = nla_nest_start(skb, ct_attr);
if (!nest_parms)
goto nla... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_glue_parse(const struct nlattr *attr, struct nf_conn *ct) {
struct nlattr *cda[CTA_MAX + 1];
int ret;
ret = nla_parse_nested_deprecated(cda, CTA_MAX, attr, ct_nla_policy, NULL);
if (ret < 0)
return ret;
return ctnetlink_glue_parse_ct((const struct nlattr **)cda, ct);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_exp_dump_mask(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple,
const struct nf_conntrack_tuple_mask *mask) {
const struct nf_conntrack_l4proto *l4proto;
struct nf_conntrack_tuple m;
struct nlattr *nest_parms;
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_expect_event(unsigned int events,
const struct nf_exp_event *item) {
struct nf_conntrack_expect *exp = item->exp;
struct net *net = nf_ct_exp_net(exp);
struct nlmsghdr *nlh;
struct sk_buff *skb;
unsigned int type, group;
int flags = 0;
if (events & (... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_exp_done(struct netlink_callback *cb) {
if (cb->args[1])
nf_ct_expect_put((struct nf_conntrack_expect *)cb->args[1]);
return 0;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_exp_ct_dump_table(struct sk_buff *skb,
struct netlink_callback *cb) {
struct nf_conntrack_expect *exp, *last;
struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
struct nf_conn *ct = cb->data;
struct nf_conn_help *help = nfct_help(ct);
u_int8_t l3proto = ... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static bool expect_iter_all(struct nf_conntrack_expect *exp, void *data) {
return true;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c | static int ctnetlink_change_expect(struct nf_conntrack_expect *x,
const struct nlattr *const cda[]) {
if (cda[CTA_EXPECT_TIMEOUT]) {
if (!del_timer(&x->timeout))
return -ETIME;
x->timeout.expires =
jiffies + ntohl(nla_get_be32(cda[CTA_EXPECT_TIMEOUT])) * HZ;
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static struct nf_conntrack_expect *
ctnetlink_alloc_expect(const struct nlattr *const cda[], struct nf_conn *ct,
struct nf_conntrack_helper *helper,
struct nf_conntrack_tuple *tuple,
struct nf_conntrack_tuple *mask) {
u_int32_t class = 0;
struct ... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_new_expect(struct sk_buff *skb,
const struct nfnl_info *info,
const struct nlattr *const cda[]) {
u_int8_t u3 = info->nfmsg->nfgen_family;
struct nf_conntrack_tuple tuple;
struct nf_conntrack_expect *exp;
struct nf_conntrack_z... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int ctnetlink_exp_stat_cpu_dump(struct sk_buff *skb,
struct netlink_callback *cb) {
int cpu;
struct net *net = sock_net(skb->sk);
if (cb->args[0] == nr_cpu_ids)
return 0;
for (cpu = cb->args[0]; cpu < nr_cpu_ids; cpu++) {
const struct ip_conntrack_stat *s... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_netlink.c |
static int __net_init ctnetlink_net_init(struct net *net) {
#ifdef CONFIG_NF_CONNTRACK_EVENTS
nf_conntrack_register_notifier(net, &ctnl_notifier);
#endif
return 0;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_pptp.c |
static int __init nf_conntrack_pptp_init(void) {
NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nf_ct_pptp_master));
return nf_conntrack_helper_register(&pptp);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_pptp.c |
static void __exit nf_conntrack_pptp_fini(void) {
nf_conntrack_helper_unregister(&pptp);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto.c | void nf_l4proto_log_invalid(const struct sk_buff *skb,
const struct nf_hook_state *state, u8 protonum,
const char *fmt, ...) {
struct net *net = state->net;
struct va_format vaf;
va_list args;
if (net->ct.sysctl_log_invalid != protonum &&
net->ct.sy... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto.c | unsigned int nf_confirm(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) {
const struct nf_conn_help *help;
enum ip_conntrack_info ctinfo;
unsigned int protoff;
struct nf_conn *ct;
bool seqadj_needed;
__be16 frag_off;
u8 pnum;
ct = nf_ct_get(skb, &ctinfo);
i... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto.c |
static unsigned int ipv4_conntrack_in(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) {
return nf_conntrack_in(skb, state);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto.c | static unsigned int ipv4_conntrack_local(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state) {
if (ip_is_fragment(ip_hdr(skb))) {
enum ip_conntrack_info ctinfo;
struct nf_conn *tmpl;
tmpl = nf_ct_get(skb, &ctinfo);
if (tmpl && nf_ct_is_template... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto.c |
static void nf_ct_netns_do_put(struct net *net, u8 nfproto) {
struct nf_conntrack_net *cnet = nf_ct_pernet(net);
mutex_lock(&nf_ct_proto_mutex);
switch (nfproto) {
case NFPROTO_IPV4:
if (cnet->users4 && (--cnet->users4 == 0)) {
nf_unregister_net_hooks(net, ipv4_conntrack_ops,
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto.c |
void nf_ct_netns_put(struct net *net, uint8_t nfproto) {
switch (nfproto) {
case NFPROTO_BRIDGE:
nf_ct_netns_do_put(net, NFPROTO_BRIDGE);
fallthrough;
case NFPROTO_INET:
nf_ct_netns_do_put(net, NFPROTO_IPV4);
nf_ct_netns_do_put(net, NFPROTO_IPV6);
break;
default:
nf_ct_netns_do_put(net,... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_dccp.c | static void dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct) {
seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]);
}
#endif | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_dccp.c | static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
struct nf_conn *ct, bool destroy) {
struct nlattr *nest_parms;
spin_lock_bh(&ct->lock);
nest_parms = nla_nest_start(skb, CTA_PROTOINFO_DCCP);
if (!nest_parms)
goto nla_put_failure;
if (nla_put_u8(skb, CTA_PROTOIN... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_dccp.c | void nf_conntrack_dccp_init_net(struct net *net) {
struct nf_dccp_net *dn = nf_dccp_pernet(net);
dn->dccp_loose = 1;
dn->dccp_timeout[CT_DCCP_REQUEST] = 2 * DCCP_MSL;
dn->dccp_timeout[CT_DCCP_RESPOND] = 4 * DCCP_MSL;
dn->dccp_timeout[CT_DCCP_PARTOPEN] = 4 * DCCP_MSL;
dn->dccp_timeout[CT_DCCP_OPEN] = 12 * 3... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_gre.c | static void gre_print_conntrack(struct seq_file *s, struct nf_conn *ct) {
seq_printf(s, "timeout=%u, stream_timeout=%u ", (ct->proto.gre.timeout / HZ),
(ct->proto.gre.stream_timeout / HZ));
}
#endif | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_gre.c | int nf_conntrack_gre_packet(struct nf_conn *ct, struct sk_buff *skb,
unsigned int dataoff, enum ip_conntrack_info ctinfo,
const struct nf_hook_state *state) {
if (!nf_ct_is_confirmed(ct)) {
unsigned int *timeouts = nf_ct_timeout_lookup(ct);
if (!timeout... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_gre.c |
void nf_conntrack_gre_init_net(struct net *net) {
struct nf_gre_net *net_gre = gre_pernet(net);
int i;
INIT_LIST_HEAD(&net_gre->keymap_list);
for (i = 0; i < GRE_CT_MAX; i++)
net_gre->timeouts[i] = gre_timeouts[i];
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_icmp.c |
bool icmp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
struct net *net, struct nf_conntrack_tuple *tuple) {
const struct icmphdr *hp;
struct icmphdr _hdr;
hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr);
if (hp == NULL)
return false;
tuple->dst.u.icmp.... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_icmp.c |
static unsigned int icmp_nlattr_tuple_size(void) {
static unsigned int size __read_mostly;
if (!size)
size = nla_policy_len(icmp_nla_policy, CTA_PROTO_MAX + 1);
return size;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_icmp.c | static int icmp_timeout_nlattr_to_obj(struct nlattr *tb[], struct net *net,
void *data) {
unsigned int *timeout = data;
struct nf_icmp_net *in = nf_icmp_pernet(net);
if (tb[CTA_TIMEOUT_ICMP_TIMEOUT]) {
if (!timeout)
timeout = &in->timeout;
*timeout = ntohl(nla_... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_icmpv6.c |
static int icmpv6_nlattr_to_tuple(struct nlattr *tb[],
struct nf_conntrack_tuple *tuple,
u_int32_t flags) {
if (flags & CTA_FILTER_FLAG(CTA_PROTO_ICMPV6_TYPE)) {
if (!tb[CTA_PROTO_ICMPV6_TYPE])
return -EINVAL;
tuple->dst.u.icmp.type =... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_icmpv6.c |
static unsigned int icmpv6_nlattr_tuple_size(void) {
static unsigned int size __read_mostly;
if (!size)
size = nla_policy_len(icmpv6_nla_policy, CTA_PROTO_MAX + 1);
return size;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_sctp.c | static int do_basic_checks(struct nf_conn *ct, const struct sk_buff *skb,
unsigned int dataoff, unsigned long *map) {
u_int32_t offset, count;
struct sctp_chunkhdr _sch, *sch;
int flag;
flag = 0;
for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) {
pr_debug("Chunk Num... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_sctp.c |
static bool sctp_can_early_drop(const struct nf_conn *ct) {
switch (ct->proto.sctp.state) {
case SCTP_CONNTRACK_SHUTDOWN_SENT:
case SCTP_CONNTRACK_SHUTDOWN_RECD:
case SCTP_CONNTRACK_SHUTDOWN_ACK_SENT:
return true;
default:
break;
}
return false;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_sctp.c |
static int sctp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
struct nf_conn *ct, bool destroy) {
struct nlattr *nest_parms;
spin_lock_bh(&ct->lock);
nest_parms = nla_nest_start(skb, CTA_PROTOINFO_SCTP);
if (!nest_parms)
goto nla_put_failure;
if (nla_put_u8(skb, CTA_PROTO... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_tcp.c |
static unsigned int get_conntrack_index(const struct tcphdr *tcph) {
if (tcph->rst)
return TCP_RST_SET;
else if (tcph->syn)
return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET);
else if (tcph->fin)
return TCP_FIN_SET;
else if (tcph->ack)
return TCP_ACK_SET;
else
return TCP_NONE_SET;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_tcp.c |
static int tcp_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data) {
const unsigned int *timeouts = data;
if (nla_put_be32(skb, CTA_TIMEOUT_TCP_SYN_SENT,
htonl(timeouts[TCP_CONNTRACK_SYN_SENT] / HZ)) ||
nla_put_be32(skb, CTA_TIMEOUT_TCP_SYN_RECV,
htonl(timeouts... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_udp.c |
static void udp_error_log(const struct sk_buff *skb,
const struct nf_hook_state *state, const char *msg) {
nf_l4proto_log_invalid(skb, state, IPPROTO_UDP, "%s", msg);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_udp.c | int nf_conntrack_udplite_packet(struct nf_conn *ct, struct sk_buff *skb,
unsigned int dataoff,
enum ip_conntrack_info ctinfo,
const struct nf_hook_state *state) {
unsigned int *timeouts;
if (udplite_error(skb, dataoff, ... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_proto_udp.c | static int udp_timeout_nlattr_to_obj(struct nlattr *tb[], struct net *net,
void *data) {
unsigned int *timeouts = data;
struct nf_udp_net *un = nf_udp_pernet(net);
if (!timeouts)
timeouts = un->timeouts;
timeouts[UDP_CT_UNREPLIED] = un->timeouts[UDP_CT_UNREPLIED];
ti... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_seqadj.c |
void nf_ct_tcp_seqadj_set(struct sk_buff *skb, struct nf_conn *ct,
enum ip_conntrack_info ctinfo, s32 off) {
const struct tcphdr *th;
if (nf_ct_protonum(ct) != IPPROTO_TCP)
return;
th = (struct tcphdr *)(skb_network_header(skb) + ip_hdrlen(skb));
nf_ct_seqadj_set(ct, ctinfo, th-... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_seqadj.c | static unsigned int nf_ct_sack_adjust(struct sk_buff *skb, unsigned int protoff,
struct nf_conn *ct,
enum ip_conntrack_info ctinfo) {
struct tcphdr *tcph = (void *)skb->data + protoff;
struct nf_conn_seqadj *seqadj = nfct_seqadj(ct);
unsi... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c |
static int iswordc(const char c) {
if (isalnum(c) || c == '!' || c == '"' || c == '%' ||
(c >= '(' && c <= '+') || c == ':' || c == '<' || c == '>' || c == '?' ||
(c >= '[' && c <= ']') || c == '_' || c == '`' || c == '{' || c == '}' ||
c == '~' || (c >= '-' && c <= '/') || c == '\'')
return 1;... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c |
static int sip_parse_addr(const struct nf_conn *ct, const char *cp,
const char **endp, union nf_inet_addr *addr,
const char *limit, bool delim) {
const char *end;
int ret;
if (!ct)
return 0;
memset(addr, 0, sizeof(*addr));
switch (nf_ct_l3num(ct)) {
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c | static int skp_epaddr_len(const struct nf_conn *ct, const char *dptr,
const char *limit, int *shift) {
const char *start = dptr;
int s = *shift;
while (dptr < limit && *dptr != '@' && *dptr != '\r' && *dptr != '\n') {
(*shift)++;
dptr++;
}
if (dptr < limit && *dptr == '@') ... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c | static const char *ct_sip_header_search(const char *dptr, const char *limit,
const char *needle, unsigned int len) {
for (limit -= len; dptr < limit; dptr++) {
if (*dptr == '\r' || *dptr == '\n') {
dptr = sip_follow_continuation(dptr, limit);
if (dptr == NULL)
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c | int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr,
unsigned int dataoff, unsigned int datalen,
const char *name, unsigned int *matchoff,
unsigned int *matchlen, unsigned int *val) {
const char ... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c | static int sdp_addr_len(const struct nf_conn *ct, const char *dptr,
const char *limit, int *shift) {
union nf_inet_addr addr;
const char *aux = dptr;
if (!sdp_parse_addr(ct, dptr, &dptr, &addr, limit)) {
pr_debug("ip: %s parse failed.!\n", dptr);
return 0;
}
return dptr - aux... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c | int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr,
unsigned int dataoff, unsigned int datalen,
enum sdp_header_types type,
enum sdp_header_types term, unsigned int *matchoff,
unsigned int *matchlen... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c |
static void flush_expectations(struct nf_conn *ct, bool media) {
struct nf_conn_help *help = nfct_help(ct);
struct nf_conntrack_expect *exp;
struct hlist_node *next;
spin_lock_bh(&nf_conntrack_expect_lock);
hlist_for_each_entry_safe(exp, next, &help->expectations, lnode) {
if ((exp->class != SIP_EXPECT_... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c | static int process_invite_response(struct sk_buff *skb, unsigned int protoff,
unsigned int dataoff, const char **dptr,
unsigned int *datalen, unsigned int cseq,
unsigned int code) {
enum ip_conntrack_info ctinfo;
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c |
static int process_update_response(struct sk_buff *skb, unsigned int protoff,
unsigned int dataoff, const char **dptr,
unsigned int *datalen, unsigned int cseq,
unsigned int code) {
enum ip_conntrack_info ctinfo;... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_sip.c |
static int process_prack_response(struct sk_buff *skb, unsigned int protoff,
unsigned int dataoff, const char **dptr,
unsigned int *datalen, unsigned int cseq,
unsigned int code) {
enum ip_conntrack_info ctinfo;
s... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.