Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/nfc/nci/core.c | static int nci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target,
struct sk_buff *skb, data_exchange_cb_t cb,
void *cb_context) {
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
int rc;
struct nci_conn_info *conn_info;
conn_info = ndev->rf_conn_i... | [
1,
0
] |
Linux Kernel | net/nfc/nci/core.c |
static int nci_disable_se(struct nfc_dev *nfc_dev, u32 se_idx) {
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
if (ndev->ops->disable_se)
return ndev->ops->disable_se(ndev, se_idx);
return 0;
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/core.c |
static int nci_fw_download(struct nfc_dev *nfc_dev, const char *firmware_name) {
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
if (!ndev->ops->fw_download)
return -ENOTSUPP;
return ndev->ops->fw_download(ndev, firmware_name);
} | [
1,
0
] |
Linux Kernel | net/nfc/nci/core.c | void nci_unregister_device(struct nci_dev *ndev) {
struct nci_conn_info *conn_info, *n;
set_bit(NCI_UNREG, &ndev->flags);
nci_close_device(ndev);
destroy_workqueue(ndev->cmd_wq);
destroy_workqueue(ndev->rx_wq);
destroy_workqueue(ndev->tx_wq);
list_for_each_entry_safe(conn_info, n, &ndev->conn_info_lis... | [
0,
0
] |
Linux Kernel | net/nfc/nci/core.c | int nci_send_frame(struct nci_dev *ndev, struct sk_buff *skb) {
pr_debug("len %d\n", skb->len);
if (!ndev) {
kfree_skb(skb);
return -ENODEV;
}
skb_orphan(skb);
/* Send copy to sniffer */
nfc_send_to_raw_sock(ndev->nfc_dev, skb, RAW_PAYLOAD_NCI, NFC_DIRECTION_TX);
return ndev->ops->send(ndev, s... | [
0,
0
] |
Linux Kernel | net/nfc/nci/core.c | int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen,
const void *payload) {
struct nci_ctrl_hdr *hdr;
struct sk_buff *skb;
pr_debug("opcode 0x%x, plen %d\n", opcode, plen);
skb = nci_skb_alloc(ndev, (NCI_CTRL_HDR_SIZE + plen), GFP_KERNEL);
if (!skb) {
pr_err("no memory for co... | [
0,
0
] |
Linux Kernel | net/nfc/nci/core.c | static void nci_cmd_work(struct work_struct *work) {
struct nci_dev *ndev = container_of(work, struct nci_dev, cmd_work);
struct sk_buff *skb;
pr_debug("cmd_cnt %d\n", atomic_read(&ndev->cmd_cnt));
if (atomic_read(&ndev->cmd_cnt)) {
skb = skb_dequeue(&ndev->cmd_q);
if (!skb)
return;
kcov_re... | [
0,
0
] |
Linux Kernel | net/nfc/nci/data.c | void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
__u8 conn_id, int err) {
const struct nci_conn_info *conn_info;
data_exchange_cb_t cb;
void *cb_context;
conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id);
if (!conn_info) {
kfree_skb(skb);
... | [
0,
0
] |
Linux Kernel | net/nfc/nci/data.c | static int nci_queue_tx_data_frags(struct nci_dev *ndev, __u8 conn_id,
struct sk_buff *skb) {
const struct nci_conn_info *conn_info;
int total_len = skb->len;
const unsigned char *data = skb->data;
unsigned long flags;
struct sk_buff_head frags_q;
struct sk_buff *skb_frag;... | [
1,
0
] |
Linux Kernel | net/nfc/nci/data.c | int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb) {
const struct nci_conn_info *conn_info;
int rc = 0;
pr_debug("conn_id 0x%x, plen %d\n", conn_id, skb->len);
conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id);
if (!conn_info) {
rc = -EPROTO;
goto free_exit;
}
if (... | [
0,
0
] |
Linux Kernel | net/nfc/nci/hci.c |
static void nci_hci_send_data_req(struct nci_dev *ndev, const void *opt) {
const struct nci_data *data = opt;
nci_hci_send_data(ndev, data->pipe, data->cmd, data->data, data->data_len);
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/hci.c |
static int nci_hci_delete_pipe(struct nci_dev *ndev, u8 pipe) {
return nci_hci_send_cmd(ndev, NCI_HCI_ADMIN_GATE, NCI_HCI_ADM_DELETE_PIPE,
&pipe, 1, NULL);
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/hci.c |
int nci_hci_set_param(struct nci_dev *ndev, u8 gate, u8 idx, const u8 *param,
size_t param_len) {
const struct nci_hcp_message *message;
const struct nci_conn_info *conn_info;
struct nci_data data;
int r;
u8 *tmp;
u8 pipe = ndev->hci_dev->gate2pipe[gate];
pr_debug("idx=%d to gate %... | [
1,
0
] |
Linux Kernel | net/nfc/nci/hci.c |
int nci_hci_get_param(struct nci_dev *ndev, u8 gate, u8 idx,
struct sk_buff **skb) {
const struct nci_hcp_message *message;
const struct nci_conn_info *conn_info;
struct nci_data data;
int r;
u8 pipe = ndev->hci_dev->gate2pipe[gate];
pr_debug("idx=%d to gate %d\n", idx, gate);
if ... | [
0,
0
] |
Linux Kernel | net/nfc/nci/lib.c | int nci_to_errno(__u8 code) {
switch (code) {
case NCI_STATUS_OK:
return 0;
case NCI_STATUS_REJECTED:
return -EBUSY;
case NCI_STATUS_RF_FRAME_CORRUPTED:
return -EBADMSG;
case NCI_STATUS_NOT_INITIALIZED:
return -EHOSTDOWN;
case NCI_STATUS_SYNTAX_ERROR:
case NCI_STATUS_SEMANTIC_ERROR:
... | [
0,
0
] |
Linux Kernel | net/nfc/nci/ntf.c | static void nci_core_generic_error_ntf_packet(struct nci_dev *ndev,
const struct sk_buff *skb) {
__u8 status = skb->data[0];
pr_debug("status 0x%x\n", status);
if (atomic_read(&ndev->state) == NCI_W4_HOST_SELECT) {
nci_req_complete(ndev, status);
}
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/ntf.c |
static const __u8 *nci_extract_rf_params_nfcb_passive_poll(
struct nci_dev *ndev, struct rf_tech_specific_params_nfcb_poll *nfcb_poll,
const __u8 *data) {
nfcb_poll->sensb_res_len = min_t(__u8, *data++, NFC_SENSB_RES_MAXSIZE);
pr_debug("sensb_res_len %d\n", nfcb_poll->sensb_res_len);
memcpy(nfcb_poll->... | [
1,
0
] |
Linux Kernel | net/nfc/nci/ntf.c |
static const __u8 *nci_extract_rf_params_nfcv_passive_poll(
struct nci_dev *ndev, struct rf_tech_specific_params_nfcv_poll *nfcv_poll,
const __u8 *data) {
++data;
nfcv_poll->dsfid = *data++;
memcpy(nfcv_poll->uid, data, NFC_ISO15693_UID_MAXSIZE);
data += NFC_ISO15693_UID_MAXSIZE;
return data;
} | [
1,
0
] |
Linux Kernel | net/nfc/nci/ntf.c |
static int
nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
struct nci_rf_intf_activated_ntf *ntf,
const __u8 *data) {
struct activation_params_nfca_poll_iso_dep *nfca_poll;
struct activation_params_nfcb_poll_iso_dep *nfcb_poll;... | [
1,
0
] |
Linux Kernel | net/nfc/nci/ntf.c |
static void
nci_target_auto_activated(struct nci_dev *ndev,
const struct nci_rf_intf_activated_ntf *ntf) {
struct nfc_target *target;
int rc;
target = &ndev->targets[ndev->n_targets];
rc = nci_add_new_protocol(ndev, target, ntf->rf_protocol,
ntf->activati... | [
0,
0
] |
Linux Kernel | net/nfc/nci/ntf.c |
static int
nci_store_general_bytes_nfc_dep(struct nci_dev *ndev,
const struct nci_rf_intf_activated_ntf *ntf) {
ndev->remote_gb_len = 0;
if (ntf->activation_params_len <= 0)
return NCI_STATUS_OK;
switch (ntf->activation_rf_tech_and_mode) {
case NCI_NFC_A_PASSIVE_POLL_MODE:... | [
1,
0
] |
Linux Kernel | net/nfc/nci/ntf.c | static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
const struct sk_buff *skb) {
const struct nci_conn_info *conn_info;
const struct nci_rf_deactivate_ntf *ntf = (void *)skb->data;
pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason);
conn_inf... | [
1,
0
] |
Linux Kernel | net/nfc/nci/rsp.c | static void nci_core_reset_rsp_packet(struct nci_dev *ndev,
const struct sk_buff *skb) {
const struct nci_core_reset_rsp *rsp = (void *)skb->data;
pr_debug("status 0x%x\n", rsp->status);
if (skb->len != 1) {
if (rsp->status == NCI_STATUS_OK) {
ndev->nci_ver = rsp-... | [
0,
0
] |
Linux Kernel | net/nfc/nci/rsp.c |
static void nci_rf_disc_rsp_packet(struct nci_dev *ndev,
const struct sk_buff *skb) {
struct nci_conn_info *conn_info;
__u8 status = skb->data[0];
pr_debug("status 0x%x\n", status);
if (status == NCI_STATUS_OK) {
atomic_set(&ndev->state, NCI_DISCOVERY);
conn_info =... | [
1,
0
] |
Linux Kernel | net/nfc/nci/spi.c | static int send_acknowledge(struct nci_spi *nspi, u8 acknowledge) {
struct sk_buff *skb;
unsigned char *hdr;
u16 crc;
int ret;
skb = nci_skb_alloc(nspi->ndev, 0, GFP_KERNEL);
hdr = skb_push(skb, NCI_SPI_HDR_LEN);
hdr[0] = NCI_SPI_DIRECT_WRITE;
hdr[1] = NCI_SPI_CRC_ENABLED;
hdr[2] = acknowledge << NC... | [
0,
0
] |
Linux Kernel | net/nfc/nci/uart.c |
static inline int nci_uart_queue_empty(struct nci_uart *nu) {
if (nu->tx_skb)
return 0;
return skb_queue_empty(&nu->tx_q);
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/uart.c | static void nci_uart_tty_close(struct tty_struct *tty) {
struct nci_uart *nu = (void *)tty->disc_data;
tty->disc_data = NULL;
if (!nu)
return;
kfree_skb(nu->tx_skb);
kfree_skb(nu->rx_skb);
skb_queue_purge(&nu->tx_q);
nu->ops.close(nu);
nu->tty = NULL;
module_put(nu->owner);
cancel_work_syn... | [
0,
0
] |
Linux Kernel | net/nfc/nci/uart.c | static void nci_uart_tty_wakeup(struct tty_struct *tty) {
struct nci_uart *nu = (void *)tty->disc_data;
if (!nu)
return;
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
if (tty != nu->tty)
return;
nci_uart_tx_wakeup(nu);
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/uart.c | static int nci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
unsigned long arg) {
struct nci_uart *nu = (void *)tty->disc_data;
int err = 0;
switch (cmd) {
case NCIUARTSETDRIVER:
if (!nu)
return nci_uart_set_driver(tty, (unsigned int)arg);
else
retur... | [
0,
0
] |
Linux Kernel | net/nfc/nci/uart.c | static int nci_uart_send(struct nci_uart *nu, struct sk_buff *skb) {
skb_queue_tail(&nu->tx_q, skb);
/* Try to start TX (if possible) */
nci_uart_tx_wakeup(nu);
return 0;
} | [
0,
0
] |
Linux Kernel | net/nfc/nci/uart.c | int nci_uart_register(struct nci_uart *nu) {
if (!nu || !nu->ops.open || !nu->ops.recv || !nu->ops.close)
return -EINVAL;
nu->ops.send = nci_uart_send;
/* Add this driver in the driver list */
if (nci_uart_drivers[nu->driver]) {
pr_err("driver %d is already registered\n", nu->driver);
return -EBUS... | [
1,
0
] |
Linux Kernel | net/nfc/netlink.c |
static int nfc_genl_dump_targets_done(struct netlink_callback *cb) {
struct nfc_dev *dev = (struct nfc_dev *)cb->args[1];
if (dev)
nfc_put_device(dev);
return 0;
} | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
int nfc_genl_targets_found(struct nfc_dev *dev) {
struct sk_buff *msg;
void *hdr;
dev->genl_data.poll_req_portid = 0;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
return -ENOMEM;
hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_EVENT_TARGETS_FOUND);
if (!hdr)
goto free_msg;
... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
static int nfc_genl_setup_device_added(struct nfc_dev *dev,
struct sk_buff *msg) {
if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protoco... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
int nfc_genl_llc_send_sdres(struct nfc_dev *dev,
struct hlist_head *sdres_list) {
struct sk_buff *msg;
struct nlattr *sdp_attr, *uri_attr;
struct nfc_llcp_sdp_tlv *sdres;
struct hlist_node *n;
void *hdr;
int rc = -EMSGSIZE;
int i;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KER... | [
1,
0
] |
Linux Kernel | net/nfc/netlink.c |
int nfc_genl_se_removed(struct nfc_dev *dev, u32 se_idx) {
struct sk_buff *msg;
void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_EVENT_SE_REMOVED);
if (!hdr)
goto free_msg;
if (nla_put_u32(msg, NFC_ATTR_... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx,
u8 comm_mode, u8 rf_mode) {
struct sk_buff *msg;
void *hdr;
pr_debug("DEP link is up\n");
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
return -ENOMEM;
hdr = genlmsg_put(msg, 0, 0, &nfc_ge... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
static int nfc_genl_get_device(struct sk_buff *skb, struct genl_info *info) {
struct sk_buff *msg;
struct nfc_dev *dev;
u32 idx;
int rc = -ENOBUFS;
if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
return -EINVAL;
idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
dev = nfc_get_device(idx);
if (!dev)... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
static int nfc_genl_fw_download(struct sk_buff *skb, struct genl_info *info) {
struct nfc_dev *dev;
int rc;
u32 idx;
char firmware_name[NFC_FIRMWARE_NAME_MAXSIZE + 1];
if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
!info->attrs[NFC_ATTR_FIRMWARE_NAME])
return -EINVAL;
idx = nla_get_u32(info->attrs[... | [
1,
0
] |
Linux Kernel | net/nfc/netlink.c |
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
u32 result) {
struct sk_buff *msg;
void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
return -ENOMEM;
hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_CMD_FW_DOWNLOAD);
... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
static int nfc_genl_send_se(struct sk_buff *msg, struct nfc_dev *dev,
u32 portid, u32 seq, struct netlink_callback *cb,
int flags) {
void *hdr;
struct nfc_se *se, *n;
list_for_each_entry_safe(se, n, &dev->secure_elements, list) {
hdr =
genlmsg_... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
static int nfc_se_io(struct nfc_dev *dev, u32 se_idx, u8 *apdu,
size_t apdu_length, se_io_cb_t cb, void *cb_context) {
struct nfc_se *se;
int rc;
pr_debug("%s se index %d\n", dev_name(&dev->dev), se_idx);
device_lock(&dev->dev);
if (!device_is_registered(&dev->dev)) {
rc = -ENODEV... | [
1,
0
] |
Linux Kernel | net/nfc/netlink.c |
static void se_io_cb(void *context, u8 *apdu, size_t apdu_len, int err) {
struct se_io_ctx *ctx = context;
struct sk_buff *msg;
void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg) {
kfree(ctx);
return;
}
hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_CMD_SE_IO);
if (!... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
static void nfc_urelease_event_work(struct work_struct *work) {
struct urelease_work *w = container_of(work, struct urelease_work, w);
struct class_dev_iter iter;
struct nfc_dev *dev;
pr_debug("portid %d\n", w->portid);
mutex_lock(&nfc_devlist_mutex);
nfc_device_iter_init(&iter);
dev = nfc_device_iter... | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
void nfc_genl_data_init(struct nfc_genl_data *genl_data) {
genl_data->poll_req_portid = 0;
mutex_init(&genl_data->genl_data_mutex);
} | [
0,
0
] |
Linux Kernel | net/nfc/netlink.c |
void nfc_genl_data_exit(struct nfc_genl_data *genl_data) {
mutex_destroy(&genl_data->genl_data_mutex);
} | [
0,
0
] |
Linux Kernel | net/nfc/nfc.h |
static inline void nfc_put_device(struct nfc_dev *dev) {
put_device(&dev->dev);
} | [
0,
0
] |
Linux Kernel | net/nfc/rawsock.c |
static int rawsock_release(struct socket *sock) {
struct sock *sk = sock->sk;
pr_debug("sock=%p sk=%p\n", sock, sk);
if (!sk)
return 0;
if (sock->type == SOCK_RAW)
nfc_sock_unlink(&raw_sk_list, sk);
sock_orphan(sk);
sock_put(sk);
return 0;
} | [
0,
0
] |
Linux Kernel | net/nfc/rawsock.c |
static int rawsock_add_header(struct sk_buff *skb) {
*(u8 *)skb_push(skb, NFC_HEADER_SIZE) = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | net/nfc/rawsock.c |
static void rawsock_tx_work(struct work_struct *work) {
struct sock *sk = to_rawsock_sk(work);
struct nfc_dev *dev = nfc_rawsock(sk)->dev;
u32 target_idx = nfc_rawsock(sk)->target_idx;
struct sk_buff *skb;
int rc;
pr_debug("sk=%p target_idx=%u\n", sk, target_idx);
if (sk->sk_shutdown & SEND_SHUTDOWN) {... | [
0,
0
] |
Linux Kernel | net/nfc/rawsock.c |
static int rawsock_sendmsg(struct socket *sock, struct msghdr *msg,
size_t len) {
struct sock *sk = sock->sk;
struct nfc_dev *dev = nfc_rawsock(sk)->dev;
struct sk_buff *skb;
int rc;
pr_debug("sock=%p sk=%p len=%zu\n", sock, sk, len);
if (msg->msg_namelen)
return -EOPNOTSUP... | [
0,
0
] |
Linux Kernel | net/nfc/rawsock.c |
void nfc_send_to_raw_sock(struct nfc_dev *dev, struct sk_buff *skb,
u8 payload_type, u8 direction) {
struct sk_buff *skb_copy = NULL, *nskb;
struct sock *sk;
u8 *data;
read_lock(&raw_sk_list.lock);
sk_for_each(sk, &raw_sk_list.head) {
if (!skb_copy) {
skb_copy = __pskb_c... | [
1,
0
] |
Linux Kernel | net/nfc/rawsock.c |
int __init rawsock_init(void) {
int rc;
rc = nfc_proto_register(&rawsock_nfc_proto);
return rc;
} | [
0,
0
] |
Linux Kernel | net/nfc/rawsock.c |
void rawsock_exit(void) { nfc_proto_unregister(&rawsock_nfc_proto); } | [
0,
0
] |
Linux Kernel | net/nsh/nsh.c |
static void __exit nsh_cleanup_module(void) {
dev_remove_offload(&nsh_packet_offload);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c | static struct deferred_action *
add_deferred_actions(struct sk_buff *skb, const struct sw_flow_key *key,
const struct nlattr *actions, const int actions_len) {
struct action_fifo *fifo;
struct deferred_action *da;
fifo = this_cpu_ptr(action_fifos);
da = action_fifo_put(fifo);
if (da) {
... | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c |
static int pop_vlan(struct sk_buff *skb, struct sw_flow_key *key) {
int err;
err = skb_vlan_pop(skb);
if (skb_vlan_tag_present(skb)) {
invalidate_flow_key(key);
} else {
key->eth.vlan.tci = 0;
key->eth.vlan.tpid = 0;
}
return err;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int pop_nsh(struct sk_buff *skb, struct sw_flow_key *key) {
int err;
err = nsh_pop(skb);
if (err)
return err;
if (skb->protocol == htons(ETH_P_TEB))
key->mac_proto = MAC_PROTO_ETHERNET;
else
key->mac_proto = MAC_PROTO_NONE;
invalidate_flow_key(key);
return 0;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c |
static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, __be32 *addr,
__be32 new_addr) {
update_ip_l4_checksum(skb, nh, *addr, new_addr);
csum_replace4(&nh->check, *addr, new_addr);
skb_clear_hash(skb);
ovs_ct_clear(skb, NULL);
*addr = new_addr;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c |
static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl,
u8 mask) {
new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask);
csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8));
nh->ttl = new_ttl;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c |
static bool is_ipv6_mask_nonzero(const __be32 addr[4]) {
return !!(addr[0] | addr[1] | addr[2] | addr[3]);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int set_nsh(struct sk_buff *skb, struct sw_flow_key *flow_key,
const struct nlattr *a) {
struct nshhdr *nh;
size_t length;
int err;
u8 flags;
u8 ttl;
int i;
struct ovs_key_nsh key;
struct ovs_key_nsh mask;
err = nsh_key_from_nlattr(a, &key, &mask);
if (err)
return err... | [
1,
0
] |
Linux Kernel | net/openvswitch/actions.c | static void set_tp_port(struct sk_buff *skb, __be16 *port, __be16 new_port,
__sum16 *check) {
ovs_ct_clear(skb, NULL);
inet_proto_csum_replace2(check, skb, *port, new_port, false);
*port = new_port;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int set_udp(struct sk_buff *skb, struct sw_flow_key *flow_key,
const struct ovs_key_udp *key,
const struct ovs_key_udp *mask) {
struct udphdr *uh;
__be16 src, dst;
int err;
err = skb_ensure_writable(skb,
skb_transport_offset(skb) + sizeof... | [
1,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int set_sctp(struct sk_buff *skb, struct sw_flow_key *flow_key,
const struct ovs_key_sctp *key,
const struct ovs_key_sctp *mask) {
unsigned int sctphoff = skb_transport_offset(skb);
struct sctphdr *sh;
__le32 old_correct_csum, new_csum, old_csum;
int err;
err = ... | [
1,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int output_userspace(struct datapath *dp, struct sk_buff *skb,
struct sw_flow_key *key, const struct nlattr *attr,
const struct nlattr *actions, int actions_len,
uint32_t cutlen) {
struct dp_upcall_info upcall;
const struct n... | [
1,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int dec_ttl_exception_handler(struct datapath *dp, struct sk_buff *skb,
struct sw_flow_key *key,
const struct nlattr *attr) {
struct nlattr *actions = nla_data(attr);
if (nla_len(actions))
return clone_execute(dp, skb, key, 0, nl... | [
0,
0
] |
Linux Kernel | net/openvswitch/actions.c | static int execute_check_pkt_len(struct datapath *dp, struct sk_buff *skb,
struct sw_flow_key *key,
const struct nlattr *attr, bool last) {
struct ovs_skb_cb *ovs_cb = OVS_CB(skb);
const struct nlattr *actions, *cpl_arg;
int len, max_len, rem = nla... | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
static void ovs_ct_get_labels(const struct nf_conn *ct,
struct ovs_key_ct_labels *labels) {
struct nf_conn_labels *cl = ct ? nf_ct_labels_find(ct) : NULL;
if (cl)
memcpy(labels, cl->bits, OVS_CT_LABELS_LEN);
else
memset(labels, 0, OVS_CT_LABELS_LEN);
} | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
static struct nf_conn_labels *ovs_ct_get_conn_labels(struct nf_conn *ct) {
struct nf_conn_labels *cl;
cl = nf_ct_labels_find(ct);
if (!cl) {
nf_ct_labels_ext_add(ct);
cl = nf_ct_labels_find(ct);
}
return cl;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c | static int ovs_ct_init_labels(struct nf_conn *ct, struct sw_flow_key *key,
const struct ovs_key_ct_labels *labels,
const struct ovs_key_ct_labels *mask) {
struct nf_conn_labels *cl, *master_cl;
bool have_mask = labels_nonzero(mask);
master_cl = ct->mast... | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
static int ovs_ct_set_labels(struct nf_conn *ct, struct sw_flow_key *key,
const struct ovs_key_ct_labels *labels,
const struct ovs_key_ct_labels *mask) {
struct nf_conn_labels *cl;
int err;
cl = ovs_ct_get_conn_labels(ct);
if (!cl)
return -ENOSPC;
... | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.c | static struct nf_conntrack_expect *
ovs_ct_expect_find(struct net *net, const struct nf_conntrack_zone *zone,
u16 proto, const struct sk_buff *skb) {
struct nf_conntrack_tuple tuple;
struct nf_conntrack_expect *exp;
if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), proto, net, &tuple))
... | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c | static struct nf_conn *ovs_ct_executed(struct net *net,
const struct sw_flow_key *key,
const struct ovs_conntrack_info *info,
struct sk_buff *skb, bool *ct_executed) {
struct nf_conn *ct = NULL;
*ct... | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
static bool labels_nonzero(const struct ovs_key_ct_labels *labels) {
size_t i;
for (i = 0; i < OVS_CT_LABELS_LEN_32; i++)
if (labels->ct_labels_32[i])
return true;
return false;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c | static void ct_limit_del(const struct ovs_ct_limit_info *info, u16 zone) {
struct ovs_ct_limit *ct_limit;
struct hlist_head *head;
struct hlist_node *n;
head = ct_limit_hash_bucket(info, zone);
hlist_for_each_entry_safe(ct_limit, n, head, hlist_node) {
if (ct_limit->zone == zone) {
hlist_del_rcu(&c... | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c | int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
const struct sw_flow_key *key,
struct sw_flow_actions **sfa, bool log) {
struct ovs_conntrack_info ct_info;
const char *helper = NULL;
u16 family;
int err;
family = key_to_nfproto(key);
if (fami... | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
void ovs_ct_free_action(const struct nlattr *a) {
struct ovs_conntrack_info *ct_info = nla_data(a);
__ovs_ct_free_action(ct_info);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info) {
if (ct_info->helper) {
#if IS_ENABLED(CONFIG_NF_NAT)
if (ct_info->nat)
nf_nat_helper_put(ct_info->helper);
#endif
nf_conntrack_helper_put(ct_info->helper);
}
if (ct_info->ct) {
if (ct_info->timeout[0])
nf_ct_destroy_ti... | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
static int ovs_ct_limit_get_zone_limit(struct net *net,
struct nlattr *nla_zone_limit,
struct ovs_ct_limit_info *info,
struct sk_buff *reply) {
struct ovs_zone_limit *zone_limit;
int rem, err;
u32... | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.c |
int ovs_ct_init(struct net *net) {
unsigned int n_bits = sizeof(struct ovs_key_ct_labels) * BITS_PER_BYTE;
struct ovs_net *ovs_net = net_generic(net, ovs_net_id);
if (nf_connlabels_get(net, n_bits - 1)) {
ovs_net->xt_label = false;
OVS_NLERR(true, "Failed to set connlabel length");
} else {
ovs_ne... | [
1,
0
] |
Linux Kernel | net/openvswitch/conntrack.h |
static inline int ovs_ct_action_to_attr(const struct ovs_conntrack_info *info,
struct sk_buff *skb) {
return -ENOTSUPP;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.h |
static inline int ovs_ct_execute(struct net *net, struct sk_buff *skb,
struct sw_flow_key *key,
const struct ovs_conntrack_info *info) {
kfree_skb(skb);
return -ENOTSUPP;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/conntrack.h |
static inline void ovs_ct_free_action(const struct nlattr *a) {}
#define CT_SUPPORTED_MASK 0 | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static void ovs_notify(struct genl_family *family, struct sk_buff *skb,
struct genl_info *info) {
genl_notify(family, skb, info, 0, GFP_KERNEL);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
void ovs_lock(void) { mutex_lock(&ovs_mutex); } | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c | int lockdep_ovsl_is_held(void) {
if (debug_locks)
return lockdep_is_held(&ovs_mutex);
else
return 1;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c | const char *ovs_dp_name(const struct datapath *dp) {
struct vport *vport = ovs_vport_ovsl_rcu(dp, OVSP_LOCAL);
return ovs_vport_name(vport);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static void destroy_dp_rcu(struct rcu_head *rcu) {
struct datapath *dp = container_of(rcu, struct datapath, rcu);
ovs_flow_tbl_destroy(&dp->table);
free_percpu(dp->stats_percpu);
kfree(dp->ports);
ovs_meters_exit(dp);
kfree(rcu_dereference_raw(dp->upcall_portids));
kfree(dp);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static struct hlist_head *vport_hash_bucket(const struct datapath *dp,
u16 port_no) {
return &dp->ports[port_no & (DP_VPORT_HASH_BUCKETS - 1)];
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c | static struct vport *new_vport(const struct vport_parms *parms) {
struct vport *vport;
vport = ovs_vport_add(parms);
if (!IS_ERR(vport)) {
struct datapath *dp = parms->dp;
struct hlist_head *head = vport_hash_bucket(dp, vport->port_no);
hlist_add_head_rcu(&vport->dp_hash_node, head);
}
return vp... | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static void get_dp_stats(const struct datapath *dp, struct ovs_dp_stats *stats,
struct ovs_dp_megaflow_stats *mega_stats) {
int i;
memset(mega_stats, 0, sizeof(*mega_stats));
stats->n_flows = ovs_flow_tbl_count(&dp->table);
mega_stats->n_masks = ovs_flow_tbl_num_masks(&dp->table);
... | [
1,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static bool should_fill_key(const struct sw_flow_id *sfid,
uint32_t ufid_flags) {
return ovs_identifier_is_ufid(sfid) && !(ufid_flags & OVS_UFID_F_OMIT_KEY);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static bool should_fill_actions(uint32_t ufid_flags) {
return !(ufid_flags & OVS_UFID_F_OMIT_ACTIONS);
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c | static int ovs_flow_cmd_fill_info(const struct sw_flow *flow, int dp_ifindex,
struct sk_buff *skb, u32 portid, u32 seq,
u32 flags, u8 cmd, u32 ufid_flags) {
const int skb_orig_len = skb->len;
struct ovs_header *ovs_header;
int err;
ovs_header ... | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c | static struct sk_buff *
ovs_flow_cmd_alloc_info(const struct sw_flow_actions *acts,
const struct sw_flow_id *sfid, struct genl_info *info,
bool always, uint32_t ufid_flags) {
struct sk_buff *skb;
size_t len;
if (!always && !ovs_must_notify(&dp_flow_genl_family, inf... | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static void ovs_dp_reset_user_features(struct sk_buff *skb,
struct genl_info *info) {
struct datapath *dp;
dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);
if (IS_ERR(dp))
return;
pr_warn("%s: Dropping previously announced user features\n", ovs_d... | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c | static int ovs_dp_change(struct datapath *dp, struct nlattr *a[]) {
u32 user_features = 0, old_features = dp->user_features;
int err;
if (a[OVS_DP_ATTR_USER_FEATURES]) {
user_features = nla_get_u32(a[OVS_DP_ATTR_USER_FEATURES]);
if (user_features &
~(OVS_DP_F_VPORT_PIDS | OVS_DP_F_UNALIGNED |
... | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static int ovs_dp_stats_init(struct datapath *dp) {
dp->stats_percpu = netdev_alloc_pcpu_stats(struct dp_stats_percpu);
if (!dp->stats_percpu)
return -ENOMEM;
return 0;
} | [
0,
0
] |
Linux Kernel | net/openvswitch/datapath.c |
static struct sk_buff *ovs_vport_cmd_alloc_info(void) {
return nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.