Displaying 20 results from an estimated 72 matches for "ifr_nam".
Did you mean:
ifr_name
2004 May 28
1
ipconfig related question (do not get static IP setting)
Hi!! I found your ipconfig stuff in the udev rpm in SuSE 9.1. I'm about to
setup a initramfs (pretty cool - much better than initrd) to boot linux
diskless clients over the net. All the tools I would need, seem to be
there with ipconfig/nfsmount ...
I like to use the information I get from PXE/syslinux or Etherboot
writing something like:
2009 Sep 21
2
[patch] RFC: put server tunnel name in environment
If an ssh server receives a tun/tap tunnel request and sets up the tunnel
concerned, as far as I can see there is currently no way for the server
to configure the tunnel in a manner dependent upon (e.g) the key used to
set up the ssh session. Whilst an id based on the key can be passed to
the ssh child process, where the tunnel is dynamically allocated, its
tunnel name is lost.
This patch
2003 Feb 20
0
Netbios name service forwarding.
...e = 1;
int j;
struct ifreq ifr = { 0 };
bzero (i, sizeof (struct iface_struct));
i->name = strdup (name);
i->fd = socket (AF_INET, SOCK_DGRAM, 0);
if (i->fd < 0)
{
syslog (LOG_ERR, "Can't open socket: %m");
exit (1);
}
strcpy (&ifr.ifr_name[0], name);
if (setsockopt (i->fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof (ifr)))
{
syslog (LOG_ERR, "Can't bind to interface %s: %m", name);
exit (1);
}
bzero (&ifr, sizeof (ifr));
strcpy (&ifr.ifr_name[0], name);
if (ioctl (i->fd, S...
2009 Sep 20
1
openssh server and tun devices
If an ssh server receives a successful inbound ssh connection with 'ssh -w'
without a tunnel number specified (i.e. in 'any' mode), it allocates the
next tunnel device available on the server. The next thing the server
needs to do is to set up the tunnel device. How does the server know
which tunnel device was set up by the current connection? I'd really
like something
2017 Oct 10
3
tunnel device name acquisition?
Numerous how-tos all over the Internet show how one would set up
a tunnel using ssh, e.g.:
ssh -f -o Tunnel=ethernet <server_ip> true
I was wondering if there's a way to subsequently acquire the names
of the local and remote tun/tap interfaces (e.g., using the default
"-w any:any") for subsequent automatic tunnel configuration, e.g.:
ip link set $TapDev up
ip link set
2007 May 08
1
[PATCH] lguest: two net bugfixes
...151 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 19:49:33 2007 +10...
2007 May 08
1
[PATCH] lguest: two net bugfixes
...151 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 19:49:33 2007 +10...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...)), \
+ ((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 = htonl(ipaddr);
+ if (ioctl(fd, SIOCSIFADDR, &ifr) != 0)
+ err(1, "Setting %s interface address", devname);
+ ifr.ifr_flags = IFF_UP;
+ if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0)
+ err(1, "Bringing interfac...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...)), \
+ ((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 = htonl(ipaddr);
+ if (ioctl(fd, SIOCSIFADDR, &ifr) != 0)
+ err(1, "Setting %s interface address", devname);
+ ifr.ifr_flags = IFF_UP;
+ if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0)
+ err(1, "Bringing interfac...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...add_to_bridge(int fd, const char *if_name, const char *br_name)
+{
+ int ifidx;
+ struct ifreq ifr;
+
+ if (!*br_name)
+ errx(1, "must specify bridge name");
+
+ ifidx = if_nametoindex(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...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...add_to_bridge(int fd, const char *if_name, const char *br_name)
+{
+ int ifidx;
+ struct ifreq ifr;
+
+ if (!*br_name)
+ errx(1, "must specify bridge name");
+
+ ifidx = if_nametoindex(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...
2016 Jun 17
0
[PATCH net-next V2] tun: introduce tx skb ring
...*dev, struct device_attribute *attr,
> @@ -1755,6 +1866,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
> } else
> return -EINVAL;
>
> + if (ifr->ifr_flags & IFF_TX_ARRAY)
> + flags |= IFF_TX_ARRAY;
> +
> if (*ifr->ifr_name)
> name = ifr->ifr_name;
>
> @@ -1995,7 +2109,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
> * This is needed because we never checked for invalid flags on
> * TUNSETIFF.
> */
> - return put_user(IFF_TUN | IFF_TAP | TUN_FEATURES,...
2016 Jun 15
7
[PATCH net-next V2] tun: introduce tx skb ring
...tic ssize_t tun_show_flags(struct device *dev, struct device_attribute *attr,
@@ -1755,6 +1866,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
} else
return -EINVAL;
+ if (ifr->ifr_flags & IFF_TX_ARRAY)
+ flags |= IFF_TX_ARRAY;
+
if (*ifr->ifr_name)
name = ifr->ifr_name;
@@ -1995,7 +2109,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
* This is needed because we never checked for invalid flags on
* TUNSETIFF.
*/
- return put_user(IFF_TUN | IFF_TAP | TUN_FEATURES,
+ return put_user(IFF_TUN | IFF_TA...
2016 Jun 15
7
[PATCH net-next V2] tun: introduce tx skb ring
...tic ssize_t tun_show_flags(struct device *dev, struct device_attribute *attr,
@@ -1755,6 +1866,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
} else
return -EINVAL;
+ if (ifr->ifr_flags & IFF_TX_ARRAY)
+ flags |= IFF_TX_ARRAY;
+
if (*ifr->ifr_name)
name = ifr->ifr_name;
@@ -1995,7 +2109,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
* This is needed because we never checked for invalid flags on
* TUNSETIFF.
*/
- return put_user(IFF_TUN | IFF_TAP | TUN_FEATURES,
+ return put_user(IFF_TUN | IFF_TA...
2003 May 23
7
CBQ DEVICE BW?
Hi,
The CBQ config file shud be some thing like this.
DEVICE=eth0,10Mbit,1Mbit
RATE=50Kbit
WEIGHT=5Kbit
Shall i hardcode the DEVICE BW as 10/100 Mbit
or
Shall i use any other tool like ethtool for getting this.
ethtool gives Speed: 10Mbps
If so, how about, if i use some other Interfaces other than eth0,
like ppp0 or some other?
C''d anybody can give a suggestion over this?
thanks
2006 Aug 02
0
no PROMISC mode ..
...#39;s not clear enough and also if you don''t agree :
- The case it shows the flag with iproute is
because it''s using a single flag set.
That was working on kernels linux <2.1.x. (2.0 etc.)
Basically the mechanism was :
---
strncpy(ifr.ifr_name, our_device, IFNAMSIZ);
ioctl(sock, SIOCGIFFLAGS, &ifr);
ifr.ifr_flags |= IFF_PROMISC;
ioctl(sock, SIOCSIFFLAGS, &ifr);
---
And only one could set the IFF_PROMISC, because if another process
decided to set it too, then it was c...
2005 Oct 31
1
ip tunnel doesn''t show warning or error
This is really strange behavior ..
root@garfield ~# ip tunnel add testing123 mode ipip remote 192.168.1.1
local 192.168.1.12
root@garfield ~# ip tunnel show
..
testing123: ip/ip remote 192.168.1.1 local 192.168.1.12 ttl inherit
root@garfield ~# ip tunnel add testingabc mode ipip remote 192.168.1.1
local 192.168.1.12
root@garfield ~# echo $?
0
root@garfield ~# ip tunnel show
..
testing123:
2010 Apr 26
0
[PATCH matahari] Created the NetworkDevice agent.
...NDOR_FROM_DATABASE"));
+ string model = string(udev_device_get_property_value(device, "ID_MODEL_FROM_DATABASE"));
+
+ if(sock >= 0)
+ {
+ ifr.ifr_addr.sa_family = AF_INET;
+ strncpy(ifr.ifr_name, ifname.c_str(), IFNAMSIZ - 1);
+
+ if(!ioctl(sock, SIOCGIFHWADDR, &ifr))
+ {
+ char macaddr[256];
+
+ sprintf(macaddr,
+ "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
+...
2007 Apr 18
1
[Bridge] Little problem with 1.x versions (if_indextoname)
Hi,
I have used bridge-utils 0.9.6 so far in a kernel 2.4.26, uClibc and ppc environment.
When I use version 1.0.3 I have the problem that I do not see the brige with the 'brctl show' command if it is not fully set up. It was working with 0.9.6.
I tracked the problem down to an 'incompatibility' in bridge/uClibc/kernel.
0.9.6 uses its own if_indextoname function which uses the
2008 Aug 13
1
[PATCH 1/1] tun: TUNGETIFF interface to query name and flags
...file, struct ifreq *ifr)
return err;
}
+static int tun_get_iff(struct net *net, struct file *file, struct ifreq *ifr)
+{
+ struct tun_struct *tun = file->private_data;
+
+ if (!tun)
+ return -EBADFD;
+
+ DBG(KERN_INFO "%s: tun_get_iff\n", tun->dev->name);
+
+ strcpy(ifr->ifr_name, tun->dev->name);
+
+ ifr->ifr_flags = 0;
+
+ if (ifr->ifr_flags & TUN_TUN_DEV)
+ ifr->ifr_flags |= IFF_TUN;
+ else
+ ifr->ifr_flags |= IFF_TAP;
+
+ if (tun->flags & TUN_NO_PI)
+ ifr->ifr_flags |= IFF_NO_PI;
+
+ if (tun->flags & TUN_ONE_QUEUE)
+ ifr->i...