Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/netlabel/netlabel_domainhash.c | int netlbl_domhsh_add_default(struct netlbl_dom_map *entry,
struct netlbl_audit *audit_info) {
return netlbl_domhsh_add(entry, audit_info);
} | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_domainhash.c | int netlbl_domhsh_remove(const char *domain, u16 family,
struct netlbl_audit *audit_info) {
int ret_val = -EINVAL;
struct netlbl_dom_map *entry;
rcu_read_lock();
if (family == AF_INET || family == AF_UNSPEC) {
if (domain)
entry = netlbl_domhsh_search(domain, AF_INET);
el... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_domainhash.c | int netlbl_domhsh_remove_default(u16 family, struct netlbl_audit *audit_info) {
return netlbl_domhsh_remove(NULL, family, audit_info);
} | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | int netlbl_cfg_unlbl_static_del(struct net *net, const char *dev_name,
const void *addr, const void *mask, u16 family,
struct netlbl_audit *audit_info) {
u32 addr_len;
switch (family) {
case AF_INET:
addr_len = sizeof(struct in_addr);
break;... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | int netlbl_catmap_walk(struct netlbl_lsm_catmap *catmap, u32 offset) {
struct netlbl_lsm_catmap *iter;
u32 idx;
u32 bit;
NETLBL_CATMAP_MAPTYPE bitmap;
iter = _netlbl_catmap_getnode(&catmap, offset, _CM_F_WALK, 0);
if (iter == NULL)
return -ENOENT;
if (offset > iter->startbit) {
offset -= iter->st... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | int netlbl_catmap_setbit(struct netlbl_lsm_catmap **catmap, u32 bit,
gfp_t flags) {
struct netlbl_lsm_catmap *iter;
u32 idx;
iter = _netlbl_catmap_getnode(catmap, bit, _CM_F_ALLOC, flags);
if (iter == NULL)
return -ENOMEM;
bit -= iter->startbit;
idx = bit / NETLBL_CATMAP_MAPSI... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, u32 start, u32 end,
gfp_t flags) {
int rc = 0;
u32 spot = start;
while (rc == 0 && spot <= end) {
if (((spot & (BITS_PER_LONG - 1)) == 0) && ((end - spot) > BITS_PER_LONG)) {
rc = netlbl_catmap_setlong(catmap, spot, (u... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | void netlbl_skbuff_err(struct sk_buff *skb, u16 family, int error,
int gateway) {
switch (family) {
case AF_INET:
if (cipso_v4_optptr(skb))
cipso_v4_error(skb, error, gateway);
break;
}
} | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | struct audit_buffer *netlbl_audit_start(int type,
struct netlbl_audit *audit_info) {
return netlbl_audit_start_common(type, audit_info);
} | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_kapi.c | static int __init netlbl_init(void) {
int ret_val;
printk(KERN_INFO "NetLabel: Initializing\n");
printk(KERN_INFO "NetLabel: domain hash size = %u\n",
(1 << NETLBL_DOMHSH_BITSIZE));
printk(KERN_INFO "NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO\n");
ret_val = netlbl_domhsh_init(NETLBL_DOMHSH_B... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_mgmt.c | static int netlbl_mgmt_add(struct sk_buff *skb, struct genl_info *info) {
struct netlbl_audit audit_info;
if ((!info->attrs[NLBL_MGMT_A_DOMAIN]) ||
(!info->attrs[NLBL_MGMT_A_PROTOCOL]) ||
(info->attrs[NLBL_MGMT_A_IPV4ADDR] &&
info->attrs[NLBL_MGMT_A_IPV6ADDR]) ||
(info->attrs[NLBL_MGMT_A_I... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_mgmt.c | static int netlbl_mgmt_protocols(struct sk_buff *skb,
struct netlink_callback *cb) {
u32 protos_sent = cb->args[0];
if (protos_sent == 0) {
if (netlbl_mgmt_protocols_cb(skb, cb, NETLBL_NLTYPE_UNLABELED) < 0)
goto protocols_return;
protos_sent++;
}
if (protos_sent ... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_mgmt.c | static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info) {
int ret_val = -ENOMEM;
struct sk_buff *ans_skb = NULL;
void *data;
ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (ans_skb == NULL)
return -ENOMEM;
data = genlmsg_put_reply(ans_skb, info, &netlbl_mgmt_gnl_family, 0,
... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface,
const struct in6_addr *addr,
const struct in6_addr *mask, u32 secid) {
int ret_val;
struct netlbl_unlhsh_addr6 *entry;
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
if (ent... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) {
u32 bkt;
struct netlbl_unlhsh_iface *iface;
iface = kzalloc(sizeof(*iface), GFP_ATOMIC);
if (iface == NULL)
return NULL;
iface->ifindex = ifindex;
INIT_LIST_HEAD(&iface->addr4_list);
INIT_LIST_HEAD(&iface->addr6_list);
iface... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | static int netlbl_unlhsh_remove_addr4(struct net *net,
struct netlbl_unlhsh_iface *iface,
const struct in_addr *addr,
const struct in_addr *mask,
struct netlbl_audit *a... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | int netlbl_unlhsh_remove(struct net *net, const char *dev_name,
const void *addr, const void *mask, u32 addr_len,
struct netlbl_audit *audit_info) {
int ret_val;
struct net_device *dev;
struct netlbl_unlhsh_iface *iface;
if (addr_len != sizeof(struct in_addr) &... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | static int netlbl_unlabel_accept(struct sk_buff *skb, struct genl_info *info) {
u8 value;
struct netlbl_audit audit_info;
if (info->attrs[NLBL_UNLABEL_A_ACPTFLG]) {
value = nla_get_u8(info->attrs[NLBL_UNLABEL_A_ACPTFLG]);
if (value == 1 || value == 0) {
netlbl_netlink_auditinfo(&audit_info);
... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | static int netlbl_unlabel_staticadddef(struct sk_buff *skb,
struct genl_info *info) {
int ret_val;
void *addr;
void *mask;
u32 addr_len;
u32 secid;
struct netlbl_audit audit_info;
if (!info->attrs[NLBL_UNLABEL_A_SECCTX] ||
!((!info->attrs[NLBL_UNLABEL_A_IPV4AD... | [
0,
0
] |
Linux Kernel | net/netlabel/netlabel_unlabeled.c | int __init netlbl_unlabel_init(u32 size) {
u32 iter;
struct netlbl_unlhsh_tbl *hsh_tbl;
if (size == 0)
return -EINVAL;
hsh_tbl = kmalloc(sizeof(*hsh_tbl), GFP_KERNEL);
if (hsh_tbl == NULL)
return -ENOMEM;
hsh_tbl->size = 1 << size;
hsh_tbl->tbl = kcalloc(hsh_tbl->size, sizeof(struct list_head), ... | [
1,
0
] |
Linux Kernel | net/netlabel/netlabel_user.c | struct audit_buffer *
netlbl_audit_start_common(int type, struct netlbl_audit *audit_info) {
struct audit_buffer *audit_buf;
char *secctx;
u32 secctx_len;
if (audit_enabled == AUDIT_OFF)
return NULL;
audit_buf = audit_log_start(audit_context(), GFP_ATOMIC, type);
if (audit_buf == NULL)
return NULL... | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static void netlink_deliver_tap_kernel(struct sock *dst, struct sock *src,
struct sk_buff *skb) {
if (!(netlink_is_kernel(dst) && netlink_is_kernel(src)))
netlink_deliver_tap(sock_net(dst), skb);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c | void netlink_table_grab(void) __acquires(nl_table_lock) {
might_sleep();
write_lock_irq(&nl_table_lock);
if (atomic_read(&nl_table_users)) {
DECLARE_WAITQUEUE(wait, current);
add_wait_queue_exclusive(&nl_table_wait, &wait);
for (;;) {
set_current_state(TASK_UNINTERRUPTIBLE);
if (atomic_... | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c | static inline void netlink_lock_table(void) {
unsigned long flags;
read_lock_irqsave(&nl_table_lock, flags);
atomic_inc(&nl_table_users);
read_unlock_irqrestore(&nl_table_lock, flags);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static inline void netlink_unlock_table(void) {
if (atomic_dec_and_test(&nl_table_users))
wake_up(&nl_table_wait);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static struct sock *__netlink_lookup(struct netlink_table *table, u32 portid,
struct net *net) {
struct netlink_compare_arg arg;
netlink_compare_arg_init(&arg, net, portid);
return rhashtable_lookup_fast(&table->hash, &arg, netlink_rhashtable_params);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static struct sock *netlink_lookup(struct net *net, int protocol, u32 portid) {
struct netlink_table *table = &nl_table[protocol];
struct sock *sk;
rcu_read_lock();
sk = __netlink_lookup(table, portid, net);
if (sk)
sock_hold(sk);
rcu_read_unlock();
return sk;
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static int netlink_create(struct net *net, struct socket *sock, int protocol,
int kern) {
struct module *module = NULL;
struct mutex *cb_mutex;
struct netlink_sock *nlk;
int (*bind)(struct net *net, int group);
void (*unbind)(struct net *net, int group);
int err = 0;
sock->stat... | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c | bool netlink_ns_capable(const struct sk_buff *skb,
struct user_namespace *user_ns, int cap) {
return __netlink_ns_capable(&NETLINK_CB(skb), user_ns, cap);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c | static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid) {
struct sock *sock;
struct netlink_sock *nlk;
sock = netlink_lookup(sock_net(ssk), ssk->sk_protocol, portid);
if (!sock)
return ERR_PTR(-ECONNREFUSED);
nlk = nlk_sk(sock);
if (sock->sk_state == NETLINK_CONNECTED &&
nlk->d... | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb) {
int len = skb->len;
netlink_deliver_tap(sock_net(sk), skb);
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk);
return len;
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
struct nlmsghdr *__nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type,
int len, int flags) {
struct nlmsghdr *nlh;
int size = nlmsg_msg_size(len);
nlh = skb_put(skb, NLMSG_ALIGN(size));
nlh->nlmsg_type = type;
nlh->nlmsg_len = size;
nlh->nlmsg_flags = flags;
nlh->n... | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c | void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err,
const struct netlink_ext_ack *extack) {
struct sk_buff *skb;
struct nlmsghdr *rep;
struct nlmsgerr *errmsg;
size_t payload = sizeof(*errmsg);
struct netlink_sock *nlk = nlk_sk(NETLINK_CB(in_skb).sk);
unsigned int flags ... | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c | int netlink_rcv_skb(struct sk_buff *skb,
int (*cb)(struct sk_buff *, struct nlmsghdr *,
struct netlink_ext_ack *)) {
struct netlink_ext_ack extack;
struct nlmsghdr *nlh;
int err;
while (skb->len >= nlmsg_total_size(0)) {
int msglen;
memset(&extack, 0, ... | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static void netlink_walk_stop(struct nl_seq_iter *iter) {
rhashtable_walk_stop(&iter->hti);
rhashtable_walk_exit(&iter->hti);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static void *__netlink_seq_next(struct seq_file *seq) {
struct nl_seq_iter *iter = seq->private;
struct netlink_sock *nlk;
do {
for (;;) {
nlk = rhashtable_walk_next(&iter->hti);
if (IS_ERR(nlk)) {
if (PTR_ERR(nlk) == -EAGAIN)
continue;
return nlk;
}
if (... | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static void netlink_seq_stop(struct seq_file *seq, void *v) {
netlink_native_seq_stop(seq, v);
}
#endif | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
int netlink_register_notifier(struct notifier_block *nb) {
return blocking_notifier_chain_register(&netlink_chain, nb);
} | [
0,
0
] |
Linux Kernel | net/netlink/af_netlink.c |
static int __net_init netlink_net_init(struct net *net) {
#ifdef CONFIG_PROC_FS
if (!proc_create_net("netlink", 0, net->proc_net, &netlink_seq_ops,
sizeof(struct nl_seq_iter)))
return -ENOMEM;
#endif
return 0;
} | [
1,
0
] |
Linux Kernel | net/netlink/af_netlink.c | static int __init netlink_proto_init(void) {
int i;
int err = proto_register(&netlink_proto, 0);
if (err != 0)
goto out;
#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_PROC_FS)
err = bpf_iter_register();
if (err)
goto out;
#endif
BUILD_BUG_ON(sizeof(struct netlink_skb_parms) >
s... | [
1,
0
] |
Linux Kernel | net/netlink/diag.c |
static int netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) {
struct netlink_diag_req *req;
int s_num = cb->args[0];
int err = 0;
req = nlmsg_data(cb->nlh);
if (req->sdiag_protocol == NDIAG_PROTO_ALL) {
int i;
for (i = cb->args[1]; i < MAX_LINKS; i++) {
err = __netlink_dia... | [
0,
0
] |
Linux Kernel | net/netlink/diag.c |
static int netlink_diag_dump_done(struct netlink_callback *cb) {
struct rhashtable_iter *hti = (void *)cb->args[2];
if (cb->args[0] == 1)
rhashtable_walk_exit(hti);
kfree(hti);
return 0;
} | [
0,
0
] |
Linux Kernel | net/netlink/diag.c |
static void __exit netlink_diag_exit(void) {
sock_diag_unregister(&netlink_diag_handler);
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
void genl_lock(void) { mutex_lock(&genl_mutex); } | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static const struct genl_family *genl_family_find_byid(unsigned int id) {
return idr_find(&genl_fam_idr, id);
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static int genl_get_cmd_full(u32 cmd, const struct genl_family *family,
struct genl_ops *op) {
int i;
for (i = 0; i < family->n_ops; i++)
if (family->ops[i].cmd == cmd) {
genl_op_from_full(family, i, op);
return 0;
}
return -ENOENT;
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static int genl_get_cmd_small(u32 cmd, const struct genl_family *family,
struct genl_ops *op) {
int i;
for (i = 0; i < family->n_small_ops; i++)
if (family->small_ops[i].cmd == cmd) {
genl_op_from_small(family, i, op);
return 0;
}
return -ENOENT;
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static bool genl_op_iter_init(const struct genl_family *family,
struct genl_op_iter *iter) {
iter->family = family;
iter->cmd_idx = 0;
iter->entry_idx = 0;
iter->flags = 0;
return iter->family->n_ops + iter->family->n_small_ops +
iter->family->n_split_ops;
} | [
1,
0
] |
Linux Kernel | net/netlink/genetlink.c | static int genl_validate_ops(const struct genl_family *family) {
struct genl_op_iter i, j;
unsigned int s;
if (WARN_ON(family->n_ops && !family->ops) ||
WARN_ON(family->n_small_ops && !family->small_ops) ||
WARN_ON(family->n_split_ops && !family->split_ops))
return -EINVAL;
for (genl_op_iter_i... | [
1,
0
] |
Linux Kernel | net/netlink/genetlink.c | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
const struct genl_family *family, int flags, u8 cmd) {
struct nlmsghdr *nlh;
struct genlmsghdr *hdr;
nlh = nlmsg_put(skb, portid, seq, family->id, GENL_HDRLEN + family->hdrsize,
flags);
if (nlh == NULL)
return N... | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static struct genl_dumpit_info *genl_dumpit_info_alloc(void) {
return kmalloc(sizeof(struct genl_dumpit_info), GFP_KERNEL);
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static void genl_family_rcv_msg_attrs_free(struct nlattr **attrbuf) {
kfree(attrbuf);
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static int genl_lock_done(struct netlink_callback *cb) {
const struct genl_dumpit_info *info = genl_dumpit_info(cb);
const struct genl_split_ops *ops = &info->op;
int rc = 0;
if (ops->done) {
genl_lock();
rc = ops->done(cb);
genl_unlock();
}
genl_family_rcv_msg_attrs_free(info->attrs);
genl_... | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static int genl_parallel_done(struct netlink_callback *cb) {
const struct genl_dumpit_info *info = genl_dumpit_info(cb);
const struct genl_split_ops *ops = &info->op;
int rc = 0;
if (ops->done)
rc = ops->done(cb);
genl_family_rcv_msg_attrs_free(info->attrs);
genl_dumpit_info_free(info);
return rc;
} | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c | static int genl_family_rcv_msg(const struct genl_family *family,
struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack) {
struct net *net = sock_net(skb->sk);
struct genlmsghdr *hdr = nlmsg_data(nlh);
struct genl_split_ops op;
int... | [
0,
0
] |
Linux Kernel | net/netlink/genetlink.c |
static int ctrl_fill_mcgrp_info(const struct genl_family *family,
const struct genl_multicast_group *grp,
int grp_id, u32 portid, u32 seq, u32 flags,
struct sk_buff *skb, u8 cmd) {
void *hdr;
struct nlattr *nla_grps;
... | [
0,
0
] |
Linux Kernel | net/netlink/policy.c | int netlink_policy_dump_add_policy(struct netlink_policy_dump_state **pstate,
const struct nla_policy *policy,
unsigned int maxtype) {
struct netlink_policy_dump_state *state = *pstate;
unsigned int policy_idx;
int err;
if (!state) {
sta... | [
1,
0
] |
Linux Kernel | net/netlink/policy.c |
static bool
netlink_policy_dump_finished(struct netlink_policy_dump_state *state) {
return state->policy_idx >= state->n_alloc ||
!state->policies[state->policy_idx].policy;
} | [
1,
0
] |
Linux Kernel | net/netrom/af_netrom.c | static void nr_kill_by_device(struct net_device *dev) {
struct sock *s;
spin_lock_bh(&nr_list_lock);
sk_for_each(s, &nr_list) if (nr_sk(s)->device == dev)
nr_disconnect(s, ENETUNREACH);
spin_unlock_bh(&nr_list_lock);
} | [
0,
0
] |
Linux Kernel | net/netrom/af_netrom.c | static struct sock *nr_find_listener(ax25_address *addr) {
struct sock *s;
spin_lock_bh(&nr_list_lock);
sk_for_each(s, &nr_list) if (!ax25cmp(&nr_sk(s)->source_addr, addr) &&
s->sk_state == TCP_LISTEN) {
sock_hold(s);
goto found;
}
s = NULL;
found:
spin_unlock_bh(&nr_... | [
0,
0
] |
Linux Kernel | net/netrom/af_netrom.c | static void nr_destroy_timer(struct timer_list *t) {
struct sock *sk = from_timer(sk, t, sk_timer);
bh_lock_sock(sk);
sock_hold(sk);
nr_destroy_socket(sk);
bh_unlock_sock(sk);
sock_put(sk);
} | [
0,
0
] |
Linux Kernel | net/netrom/af_netrom.c |
static int nr_release(struct socket *sock) {
struct sock *sk = sock->sk;
struct nr_sock *nr;
if (sk == NULL)
return 0;
sock_hold(sk);
sock_orphan(sk);
lock_sock(sk);
nr = nr_sk(sk);
switch (nr->state) {
case NR_STATE_0:
case NR_STATE_1:
case NR_STATE_2:
nr_disconnect(sk, 0);
nr_des... | [
0,
0
] |
Linux Kernel | net/netrom/af_netrom.c | static int nr_accept(struct socket *sock, struct socket *newsock, int flags,
bool kern) {
struct sk_buff *skb;
struct sock *newsk;
DEFINE_WAIT(wait);
struct sock *sk;
int err = 0;
if ((sk = sock->sk) == NULL)
return -EINVAL;
lock_sock(sk);
if (sk->sk_type != SOCK_SEQPACKET) {
... | [
0,
0
] |
Linux Kernel | net/netrom/af_netrom.c |
static void *nr_info_next(struct seq_file *seq, void *v, loff_t *pos) {
return seq_hlist_next(v, &nr_list, pos);
} | [
0,
0
] |
Linux Kernel | net/netrom/af_netrom.c |
static void __exit nr_exit(void) {
int i;
remove_proc_entry("nr", init_net.proc_net);
remove_proc_entry("nr_neigh", init_net.proc_net);
remove_proc_entry("nr_nodes", init_net.proc_net);
nr_loopback_clear();
nr_rt_free();
#ifdef CONFIG_SYSCTL
nr_unregister_sysctl();
#endif
ax25_linkfail_release(&nr_... | [
0,
0
] |
Linux Kernel | net/netrom/nr_dev.c | int nr_rx_ip(struct sk_buff *skb, struct net_device *dev) {
struct net_device_stats *stats = &dev->stats;
if (!netif_running(dev)) {
stats->rx_dropped++;
return 0;
}
stats->rx_packets++;
stats->rx_bytes += skb->len;
skb->protocol = htons(ETH_P_IP);
skb->dev = dev;
skb->mac_header = skb->netw... | [
0,
0
] |
Linux Kernel | net/netrom/nr_dev.c |
static int nr_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr, const void *saddr,
unsigned int len) {
unsigned char *buff = skb_push(skb, NR_NETWORK_LEN + NR_TRANSPORT_LEN);
memcpy(buff, (saddr != NULL) ? saddr : dev->dev_addr, d... | [
1,
0
] |
Linux Kernel | net/netrom/nr_dev.c | void nr_setup(struct net_device *dev) {
dev->mtu = NR_MAX_PACKET_SIZE;
dev->netdev_ops = &nr_netdev_ops;
dev->header_ops = &nr_header_ops;
dev->hard_header_len = NR_NETWORK_LEN + NR_TRANSPORT_LEN;
dev->addr_len = AX25_ADDR_LEN;
dev->type = ARPHRD_NETROM;
dev->flags = IFF_NOARP;
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_loopback.c |
void nr_loopback_clear(void) {
del_timer_sync(&loopback_timer);
skb_queue_purge(&loopback_queue);
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_out.c | void nr_transmit_buffer(struct sock *sk, struct sk_buff *skb) {
struct nr_sock *nr = nr_sk(sk);
unsigned char *dptr;
dptr = skb_push(skb, NR_NETWORK_LEN);
memcpy(dptr, &nr->source_addr, AX25_ADDR_LEN);
dptr[6] &= ~AX25_CBIT;
dptr[6] &= ~AX25_EBIT;
dptr[6] |= AX25_SSSID_SPARE;
dptr += AX25_ADDR_LEN;
... | [
1,
0
] |
Linux Kernel | net/netrom/nr_out.c | void nr_enquiry_response(struct sock *sk) {
struct nr_sock *nr = nr_sk(sk);
int frametype = NR_INFOACK;
if (nr->condition & NR_COND_OWN_RX_BUSY) {
frametype |= NR_CHOKE_FLAG;
} else {
if (skb_peek(&nr->reseq_queue) != NULL)
frametype |= NR_NAK_FLAG;
}
nr_write_internal(sk, frametype);
nr-... | [
0,
0
] |
Linux Kernel | net/netrom/nr_route.c | static int nr_del_node(ax25_address *callsign, ax25_address *neighbour,
struct net_device *dev) {
struct nr_node *nr_node;
struct nr_neigh *nr_neigh;
int i;
nr_node = nr_node_get(callsign);
if (nr_node == NULL)
return -EINVAL;
nr_neigh = nr_neigh_get_dev(neighbour, dev);
if ... | [
1,
0
] |
Linux Kernel | net/netrom/nr_route.c | static int __must_check nr_add_neigh(ax25_address *callsign,
ax25_digi *ax25_digi,
struct net_device *dev,
unsigned int quality) {
struct nr_neigh *nr_neigh;
nr_neigh = nr_neigh_get_dev(callsign, dev);
... | [
1,
0
] |
Linux Kernel | net/netrom/nr_route.c | static struct net_device *nr_ax25_dev_get(char *devname) {
struct net_device *dev;
if ((dev = dev_get_by_name(&init_net, devname)) == NULL)
return NULL;
if ((dev->flags & IFF_UP) && dev->type == ARPHRD_AX25)
return dev;
dev_put(dev);
return NULL;
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_route.c | struct net_device *nr_dev_get(ax25_address *addr) {
struct net_device *dev;
rcu_read_lock();
for_each_netdev_rcu(&init_net, dev) {
if ((dev->flags & IFF_UP) && dev->type == ARPHRD_NETROM &&
ax25cmp(addr, (const ax25_address *)dev->dev_addr) == 0) {
dev_hold(dev);
goto out;
}
}
dev... | [
0,
0
] |
Linux Kernel | net/netrom/nr_route.c | int nr_rt_ioctl(unsigned int cmd, void __user *arg) {
struct nr_route_struct nr_route;
struct net_device *dev;
ax25_digi digi;
int ret;
switch (cmd) {
case SIOCADDRT:
if (copy_from_user(&nr_route, arg, sizeof(struct nr_route_struct)))
return -EFAULT;
if (nr_route.ndigis > AX25_MAX_DIGIS)
... | [
1,
0
] |
Linux Kernel | net/netrom/nr_route.c | void nr_link_failed(ax25_cb *ax25, int reason) {
struct nr_neigh *s, *nr_neigh = NULL;
struct nr_node *nr_node = NULL;
spin_lock_bh(&nr_neigh_list_lock);
nr_neigh_for_each(s, &nr_neigh_list) {
if (s->ax25 == ax25) {
nr_neigh_hold(s);
nr_neigh = s;
break;
}
}
spin_unlock_bh(&nr_nei... | [
1,
0
] |
Linux Kernel | net/netrom/nr_route.c |
static void nr_node_stop(struct seq_file *seq, void *v)
__releases(&nr_node_list_lock) | [
0,
0
] |
Linux Kernel | net/netrom/nr_route.c |
static int nr_node_show(struct seq_file *seq, void *v) {
char buf[11];
int i;
if (v == SEQ_START_TOKEN)
seq_puts(seq, "callsign mnemonic w n qual obs neigh qual obs neigh qual "
"obs neigh\n");
else {
struct nr_node *nr_node = hlist_entry(v, struct nr_node, node_node);
nr_node_... | [
1,
0
] |
Linux Kernel | net/netrom/nr_subr.c | int nr_validate_nr(struct sock *sk, unsigned short nr) {
struct nr_sock *nrom = nr_sk(sk);
unsigned short vc = nrom->va;
while (vc != nrom->vs) {
if (nr == vc)
return 1;
vc = (vc + 1) % NR_MODULUS;
}
return nr == nrom->vs;
} | [
1,
0
] |
Linux Kernel | net/netrom/nr_subr.c | int nr_in_rx_window(struct sock *sk, unsigned short ns) {
struct nr_sock *nr = nr_sk(sk);
unsigned short vc = nr->vr;
unsigned short vt = (nr->vl + nr->window) % NR_MODULUS;
while (vc != vt) {
if (ns == vc)
return 1;
vc = (vc + 1) % NR_MODULUS;
}
return 0;
} | [
1,
0
] |
Linux Kernel | net/netrom/nr_timer.c |
void nr_start_t1timer(struct sock *sk) {
struct nr_sock *nr = nr_sk(sk);
sk_reset_timer(sk, &nr->t1timer, jiffies + nr->t1);
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_timer.c |
void nr_start_t2timer(struct sock *sk) {
struct nr_sock *nr = nr_sk(sk);
sk_reset_timer(sk, &nr->t2timer, jiffies + nr->t2);
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_timer.c |
void nr_start_heartbeat(struct sock *sk) {
sk_reset_timer(sk, &sk->sk_timer, jiffies + 5 * HZ);
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_timer.c |
void nr_stop_idletimer(struct sock *sk) {
sk_stop_timer(sk, &nr_sk(sk)->idletimer);
} | [
0,
0
] |
Linux Kernel | net/netrom/nr_timer.c |
static void nr_t1timer_expiry(struct timer_list *t) {
struct nr_sock *nr = from_timer(nr, t, t1timer);
struct sock *sk = &nr->sock;
bh_lock_sock(sk);
switch (nr->state) {
case NR_STATE_1:
if (nr->n2count == nr->n2) {
nr_disconnect(sk, ETIMEDOUT);
goto out;
} else {
nr->n2count++;
... | [
1,
0
] |
Linux Kernel | net/netrom/sysctl_net_netrom.c |
void nr_unregister_sysctl(void) {
unregister_net_sysctl_table(nr_table_header);
} | [
0,
0
] |
Linux Kernel | net/nfc/af_nfc.c |
static int nfc_sock_create(struct net *net, struct socket *sock, int proto,
int kern) {
int rc = -EPROTONOSUPPORT;
if (net != &init_net)
return -EAFNOSUPPORT;
if (proto < 0 || proto >= NFC_SOCKPROTO_MAX)
return -EINVAL;
read_lock(&proto_tab_lock);
if (proto_tab[proto] &&... | [
1,
0
] |
Linux Kernel | net/nfc/af_nfc.c |
void nfc_proto_unregister(const struct nfc_protocol *nfc_proto) {
write_lock(&proto_tab_lock);
proto_tab[nfc_proto->id] = NULL;
write_unlock(&proto_tab_lock);
proto_unregister(nfc_proto->proto);
} | [
0,
0
] |
Linux Kernel | net/nfc/af_nfc.c |
int __init af_nfc_init(void) { return sock_register(&nfc_sock_family_ops); } | [
0,
0
] |
Linux Kernel | net/nfc/core.c | int nfc_dev_down(struct nfc_dev *dev) {
int rc = 0;
pr_debug("dev_name=%s\n", dev_name(&dev->dev));
device_lock(&dev->dev);
if (dev->shutting_down) {
rc = -ENODEV;
goto error;
}
if (!dev->dev_up) {
rc = -EALREADY;
goto error;
}
if (dev->polling || dev->active_target) {
rc = -EBU... | [
1,
0
] |
Linux Kernel | net/nfc/core.c |
int nfc_dep_link_up(struct nfc_dev *dev, int target_index, u8 comm_mode) {
int rc = 0;
u8 *gb;
size_t gb_len;
struct nfc_target *target;
pr_debug("dev_name=%s comm %d\n", dev_name(&dev->dev), comm_mode);
if (!dev->ops->dep_link_up)
return -EOPNOTSUPP;
device_lock(&dev->dev);
if (dev->shutting_d... | [
1,
0
] |
Linux Kernel | net/nfc/core.c | int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb) {
if (dev->dep_link_up == false) {
kfree_skb(skb);
return -ENOLINK;
}
return nfc_llcp_data_received(dev, skb);
} | [
0,
0
] |
Linux Kernel | net/nfc/core.c |
int nfc_tm_deactivated(struct nfc_dev *dev) {
dev->dep_link_up = false;
dev->rf_mode = NFC_RF_NONE;
return nfc_genl_tm_deactivated(dev);
} | [
0,
0
] |
Linux Kernel | net/nfc/core.c | struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk,
unsigned int flags, unsigned int size,
unsigned int *err) {
struct sk_buff *skb;
unsigned int total_size;
total_size = size + dev->tx_headroom + dev->tx_tailroom + NFC_HE... | [
0,
0
] |
Linux Kernel | net/nfc/core.c | struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp) {
struct sk_buff *skb;
unsigned int total_size;
total_size = size + 1;
skb = alloc_skb(total_size, gfp);
if (skb)
skb_reserve(skb, 1);
return skb;
} | [
0,
0
] |
Linux Kernel | net/nfc/core.c | int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
int n_targets) {
int i;
pr_debug("dev_name=%s n_targets=%d\n", dev_name(&dev->dev), n_targets);
for (i = 0; i < n_targets; i++)
targets[i].idx = dev->target_next_idx++;
device_lock(&dev->dev);
if (dev->polling... | [
1,
0
] |
Linux Kernel | net/nfc/core.c | int nfc_target_lost(struct nfc_dev *dev, u32 target_idx) {
const struct nfc_target *tg;
int i;
pr_debug("dev_name %s n_target %d\n", dev_name(&dev->dev), target_idx);
device_lock(&dev->dev);
for (i = 0; i < dev->n_targets; i++) {
tg = &dev->targets[i];
if (tg->idx == target_idx)
break;
}
... | [
1,
0
] |
Linux Kernel | net/nfc/core.c |
static void nfc_release(struct device *d) {
struct nfc_dev *dev = to_nfc_dev(d);
struct nfc_se *se, *n;
pr_debug("dev_name=%s\n", dev_name(&dev->dev));
nfc_genl_data_exit(&dev->genl_data);
kfree(dev->targets);
list_for_each_entry_safe(se, n, &dev->secure_elements, list) {
nfc_genl_se_removed(dev, se... | [
0,
0
] |
Linux Kernel | net/nfc/core.c |
static void nfc_check_pres_timeout(struct timer_list *t) {
struct nfc_dev *dev = from_timer(dev, t, check_pres_timer);
schedule_work(&dev->check_pres_work);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.