cregit-Linux how code gets into the kernel

Release 4.14 arch/um/os-Linux/drivers/tuntap_kern.c

/*
 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 * Licensed under the GPL
 */

#include <linux/netdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <asm/errno.h>
#include <net_kern.h>
#include "tuntap.h"


struct tuntap_init {
	
char *dev_name;
	
char *gate_addr;
};


static void tuntap_init(struct net_device *dev, void *data) { struct uml_net_private *pri; struct tuntap_data *tpri; struct tuntap_init *init = data; pri = netdev_priv(dev); tpri = (struct tuntap_data *) pri->user; tpri->dev_name = init->dev_name; tpri->fixed_config = (init->dev_name != NULL); tpri->gate_addr = init->gate_addr; tpri->fd = -1; tpri->dev = dev; printk(KERN_INFO "TUN/TAP backend - "); if (tpri->gate_addr != NULL) printk(KERN_CONT "IP = %s", tpri->gate_addr); printk(KERN_CONT "\n"); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike10586.78%466.67%
David S. Miller1310.74%116.67%
Wang Chen32.48%116.67%
Total121100.00%6100.00%


static int tuntap_read(int fd, struct sk_buff *skb, struct uml_net_private *lp) { return net_read(fd, skb_mac_header(skb), skb->dev->mtu + ETH_HEADER_OTHER); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike3592.11%150.00%
Arnaldo Carvalho de Melo37.89%150.00%
Total38100.00%2100.00%


static int tuntap_write(int fd, struct sk_buff *skb, struct uml_net_private *lp) { return net_write(fd, skb->data, skb->len); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike33100.00%1100.00%
Total33100.00%1100.00%

const struct net_kern_info tuntap_kern_info = { .init = tuntap_init, .protocol = eth_protocol, .read = tuntap_read, .write = tuntap_write, };
int tuntap_setup(char *str, char **mac_out, void *data) { struct tuntap_init *init = data; *init = ((struct tuntap_init) { .dev_name = NULL, .gate_addr = NULL }); if (tap_setup_common(str, "tuntap", &init->dev_name, mac_out, &init->gate_addr)) return 0; return 1; }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike73100.00%3100.00%
Total73100.00%3100.00%

static struct transport tuntap_transport = { .list = LIST_HEAD_INIT(tuntap_transport.list), .name = "tuntap", .setup = tuntap_setup, .user = &tuntap_user_info, .kern = &tuntap_kern_info, .private_size = sizeof(struct tuntap_data), .setup_size = sizeof(struct tuntap_init), };
static int register_tuntap(void) { register_transport(&tuntap_transport); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike17100.00%2100.00%
Total17100.00%2100.00%

late_initcall(register_tuntap);

Overall Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike38395.04%866.67%
David S. Miller133.23%18.33%
Wang Chen30.74%18.33%
Arnaldo Carvalho de Melo30.74%18.33%
Al Viro10.25%18.33%
Total403100.00%12100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.