search for: configure_device

Displaying 20 results from an estimated 27 matches for "configure_device".

2007 May 08
1
[PATCH] lguest: two net bugfixes
...etion(-) diff -r 999a9058a151 Documentation/lguest/lguest.c --- a/Documentation/lguest/lguest.c Tue May 08 19:49:33 2007 +1000 +++ b/Documentation/lguest/lguest.c Tue May 08 21:04:51 2007 +1000 @@ -860,6 +860,10 @@ static void setup_tun_net(const char *ar /* We are peer 0, ie. first slot. */ configure_device(ipfd, ifr.ifr_name, ip, dev->mem); + + /* Set "promisc" bit: we want every single packet. */ + *((u8 *)dev->mem) |= 0x1; + close(ipfd); verbose("device %p: tun net %u.%u.%u.%u\n", diff -r 999a9058a151 drivers/net/lguest_net.c --- a/drivers/net/lguest_net.c Tue May 08...
2007 May 08
1
[PATCH] lguest: two net bugfixes
...etion(-) diff -r 999a9058a151 Documentation/lguest/lguest.c --- a/Documentation/lguest/lguest.c Tue May 08 19:49:33 2007 +1000 +++ b/Documentation/lguest/lguest.c Tue May 08 21:04:51 2007 +1000 @@ -860,6 +860,10 @@ static void setup_tun_net(const char *ar /* We are peer 0, ie. first slot. */ configure_device(ipfd, ifr.ifr_name, ip, dev->mem); + + /* Set "promisc" bit: we want every single packet. */ + *((u8 *)dev->mem) |= 0x1; + close(ipfd); verbose("device %p: tun net %u.%u.%u.%u\n", diff -r 999a9058a151 drivers/net/lguest_net.c --- a/drivers/net/lguest_net.c Tue May 08...
2006 Jun 22
2
[patch] ipconfig add dhcp file preseeding support
...int_device_config(struct n printf(" nisdomain: %-64s\n", dev->nisdomainname); printf(" rootserver: %s ", my_inet_ntoa(dev->ip_server)); printf("rootpath: %s\n", dev->bootpath); + printf(" filename : %s\n", dev->filename); } static void configure_device(struct netdev *dev) @@ -112,6 +113,7 @@ static void dump_device_config(struct ne fprintf(f, "NISDOMAIN=%s\n", dev->nisdomainname); fprintf(f, "ROOTSERVER=%s\n", my_inet_ntoa(dev->ip_server)); fprintf(f, "ROOTPATH=%s\n", dev->bootpath); + fprintf(f, &...
2011 Apr 15
2
[PATCH] Escape DHCP options written to /tmp/net-$DEVCICE.conf
....c | 55 +++++++++++++++++++++++++++++++------------- 1 files changed, 39 insertions(+), 16 deletions(-) diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index 76708a9..e53e22c 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -95,6 +95,25 @@ static void configure_device(struct netdev *dev) dev->hostname, dev->name); } +static void write_option(FILE* f, const char* name, const char* value) +{ + int i=0; + + fprintf(f, "%s=\"", name); + while (value[i]) { + switch (value[i]) { + case '"': + case '$': + case ...
2006 Jul 07
0
[patch] ipconfig set hostname from dhcpd server
...co.uk, see http://bugs.debian.org/377144 Signed-off-by: maximilian attems <maks at sternwelten.at> diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index c9d3b0e..3afd7c9 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -87,6 +87,10 @@ static void configure_device(struct netd if (netdev_setdefaultroute(dev)) printf("IP-Config: failed to set default route on %s\n", dev->name); + if (dev->hostname[0] && + sethostname(dev->hostname, strlen(dev->hostname))) + printf("IP-Config: failed to set hostname '%s...
2007 Nov 10
2
[PATCH] Change virtio_pci to use a shared memory area for config
This patch changes virtio_pci to use a shared memory area for virtio config info instead of using the PCI configuration space. This is closer semantically to what the virtio API exposes and is it a lot easier to implement on both ends. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index eb9a8e0..7e6e453 100644
2007 Nov 10
2
[PATCH] Change virtio_pci to use a shared memory area for config
This patch changes virtio_pci to use a shared memory area for virtio config info instead of using the PCI configuration space. This is closer semantically to what the virtio API exposes and is it a lot easier to implement on both ends. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index eb9a8e0..7e6e453 100644
2003 Apr 29
0
[PATCH] Fix busy-looping behaviour in ipconfig
...quot;ipconfig.h" #include "netdev.h" #include "bootp_packet.h" #include "bootp_proto.h" @@ -15,6 +17,7 @@ #include "packet.h" static const char *progname; +static char do_not_config; struct state { int state; @@ -57,6 +60,9 @@ static void configure_device(struct netdev *dev) { + if (do_not_config) + return; + if (netdev_setaddress(dev)) printf("IP-Config: failed to set addresses on %s\n", dev->name); if (netdev_setdefaultroute(dev)) @@ -118,8 +124,10 @@ } } -static void process_receive_event(struct state *s, time_t now) +...
2017 Feb 04
0
[PATCH] ipconfig: handle multiple interfaces correctly
...lt_caps = CAP_DHCP | CAP_BOOTP | CAP_RARP; static int loop_timeout = -1; static int configured; static int bringup_first = 0; +static int n_devices = 0; /* DHCP vendor class identifier */ char vendor_class_identifier[260]; @@ -220,6 +221,7 @@ static void complete_device(struct netdev *dev) configure_device(dev); dump_device_config(dev); print_device_config(dev); + packet_close(dev); ++configured; @@ -374,34 +376,36 @@ struct netdev *ifaces; * 0 = No dhcp/bootp packet was received * 1 = A packet was received and handled */ -static int do_pkt_recv(int pkt_fd, time_t now) +static int d...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...se { + len = readv(dev->fd, reply, reply_num); + *lenp = len; + } + + p->result = 1 + (p->bytes != len); + trigger_irq(fd, irq); + return 0; +} + +#define HIPQUAD(ip) \ + ((u8)(ip >> 24)), \ + ((u8)(ip >> 16)), \ + ((u8)(ip >> 8)), \ + ((u8)(ip)) + +static void configure_device(int fd, const char *devname, u32 ipaddr, + unsigned char hwaddr[6]) +{ + struct ifreq ifr; + struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; + + memset(&ifr, 0, sizeof(ifr)); + strcpy(ifr.ifr_name, devname); + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = h...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...se { + len = readv(dev->fd, reply, reply_num); + *lenp = len; + } + + p->result = 1 + (p->bytes != len); + trigger_irq(fd, irq); + return 0; +} + +#define HIPQUAD(ip) \ + ((u8)(ip >> 24)), \ + ((u8)(ip >> 16)), \ + ((u8)(ip >> 8)), \ + ((u8)(ip)) + +static void configure_device(int fd, const char *devname, u32 ipaddr, + unsigned char hwaddr[6]) +{ + struct ifreq ifr; + struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; + + memset(&ifr, 0, sizeof(ifr)); + strcpy(ifr.ifr_name, devname); + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = h...
2019 Jan 18
0
[klibc:master] ipconfig: handle multiple interfaces correctly
...lt_caps = CAP_DHCP | CAP_BOOTP | CAP_RARP; static int loop_timeout = -1; static int configured; static int bringup_first = 0; +static int n_devices = 0; /* DHCP vendor class identifier */ char vendor_class_identifier[260]; @@ -220,6 +221,7 @@ static void complete_device(struct netdev *dev) configure_device(dev); dump_device_config(dev); print_device_config(dev); + packet_close(dev); ++configured; @@ -374,34 +376,36 @@ struct netdev *ifaces; * 0 = No dhcp/bootp packet was received * 1 = A packet was received and handled */ -static int do_pkt_recv(int pkt_fd, time_t now) +static int d...
2017 Dec 19
0
[PATCH] Implement classless static routes
...s0 : %-16s ", my_inet_ntoa(dev->ip_nameserver[0])); + printf("dns1 : %-16s\n", my_inet_ntoa(dev->ip_nameserver[1])); + } if (dev->hostname[0]) printf(" host : %-64s\n", dev->hostname); if (dev->dnsdomainname[0]) @@ -105,8 +118,8 @@ static void configure_device(struct netdev *dev) if (netdev_setaddress(dev)) printf("IP-Config: failed to set addresses on %s\n", dev->name); - if (netdev_setdefaultroute(dev)) - printf("IP-Config: failed to set default route on %s\n", + if (netdev_setroutes(dev)) + printf("IP-Confi...
2018 Jun 12
0
[PATCH v2] Implement classless static routes
...my_inet_ntoa(dev->ip_nameserver[0])); + printf(" dns1%*c: %-16s\n", dns1_spaces, ' ', my_inet_ntoa(dev->ip_nameserver[1])); if (dev->hostname[0]) printf(" host : %-64s\n", dev->hostname); if (dev->dnsdomainname[0]) @@ -105,8 +125,8 @@ static void configure_device(struct netdev *dev) if (netdev_setaddress(dev)) printf("IP-Config: failed to set addresses on %s\n", dev->name); - if (netdev_setdefaultroute(dev)) - printf("IP-Config: failed to set default route on %s\n", + if (netdev_setroutes(dev)) + printf("IP-Confi...
2019 Jan 18
0
[klibc:master] ipconfig: Implement classless static routes
...my_inet_ntoa(dev->ip_nameserver[0])); + printf(" dns1%*c: %-16s\n", dns1_spaces, ' ', my_inet_ntoa(dev->ip_nameserver[1])); if (dev->hostname[0]) printf(" host : %-64s\n", dev->hostname); if (dev->dnsdomainname[0]) @@ -106,8 +126,8 @@ static void configure_device(struct netdev *dev) if (netdev_setaddress(dev)) printf("IP-Config: failed to set addresses on %s\n", dev->name); - if (netdev_setdefaultroute(dev)) - printf("IP-Config: failed to set default route on %s\n", + if (netdev_setroutes(dev)) + printf("IP-Confi...
2018 Jun 18
1
[PATCH v3 1/2] Implement classless static routes
...my_inet_ntoa(dev->ip_nameserver[0])); + printf(" dns1%*c: %-16s\n", dns1_spaces, ' ', my_inet_ntoa(dev->ip_nameserver[1])); if (dev->hostname[0]) printf(" host : %-64s\n", dev->hostname); if (dev->dnsdomainname[0]) @@ -105,8 +125,8 @@ static void configure_device(struct netdev *dev) if (netdev_setaddress(dev)) printf("IP-Config: failed to set addresses on %s\n", dev->name); - if (netdev_setdefaultroute(dev)) - printf("IP-Config: failed to set default route on %s\n", + if (netdev_setroutes(dev)) + printf("IP-Confi...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...ex(if_name); + if (!ifidx) + errx(1, "interface %s does not exist!", if_name); + + strncpy(ifr.ifr_name, br_name, IFNAMSIZ); + ifr.ifr_ifindex = ifidx; + if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) + err(1, "can't add %s to bridge %s", if_name, br_name); +} + +static void configure_device(int fd, const char *devname, u32 ipaddr, + unsigned char hwaddr[6]) +{ + struct ifreq ifr; + struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; + + memset(&ifr, 0, sizeof(ifr)); + strcpy(ifr.ifr_name, devname); + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = h...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...ex(if_name); + if (!ifidx) + errx(1, "interface %s does not exist!", if_name); + + strncpy(ifr.ifr_name, br_name, IFNAMSIZ); + ifr.ifr_ifindex = ifidx; + if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) + err(1, "can't add %s to bridge %s", if_name, br_name); +} + +static void configure_device(int fd, const char *devname, u32 ipaddr, + unsigned char hwaddr[6]) +{ + struct ifreq ifr; + struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; + + memset(&ifr, 0, sizeof(ifr)); + strcpy(ifr.ifr_name, devname); + sin->sin_family = AF_INET; + sin->sin_addr.s_addr = h...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...tun device and tell it we want a tap device. A * tap device is like a tun device, only somehow different. To tell @@ -1259,12 +1289,13 @@ static void setup_tun_net(const char *arg) ip = str2ip(arg); /* Set up the tun device, and get the mac address for the interface. */ - configure_device(ipfd, ifr.ifr_name, ip, hwaddr); + configure_device(ipfd, ifr.ifr_name, ip, conf.mac); /* Tell Guest what MAC address to use. */ - add_desc_field(dev, VIRTIO_CONFIG_NET_MAC_F, sizeof(hwaddr), hwaddr); + add_feature(dev, VIRTIO_NET_F_MAC); + set_config(dev, sizeof(conf), &conf...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...tun device and tell it we want a tap device. A * tap device is like a tun device, only somehow different. To tell @@ -1259,12 +1289,13 @@ static void setup_tun_net(const char *arg) ip = str2ip(arg); /* Set up the tun device, and get the mac address for the interface. */ - configure_device(ipfd, ifr.ifr_name, ip, hwaddr); + configure_device(ipfd, ifr.ifr_name, ip, conf.mac); /* Tell Guest what MAC address to use. */ - add_desc_field(dev, VIRTIO_CONFIG_NET_MAC_F, sizeof(hwaddr), hwaddr); + add_feature(dev, VIRTIO_NET_F_MAC); + set_config(dev, sizeof(conf), &conf...