From 6e23f891135756f3aef5dc928f4830ff79630f2a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 4 Feb 2000 08:40:53 +0000 Subject: 2000-02-04 Roland McGrath * linux-src/net/ipv4/devinet.c [_HURD_] (inquire_device): New function. * options.c: Declare it. (trivfs_append_args): Use inquire_device for --address and --netmask. (ADD_ADDR_OPT): #undef it after uses. --- pfinet/linux-src/net/ipv4/devinet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pfinet/linux-src/net/ipv4/devinet.c') diff --git a/pfinet/linux-src/net/ipv4/devinet.c b/pfinet/linux-src/net/ipv4/devinet.c index ccae0c58..d980631b 100644 --- a/pfinet/linux-src/net/ipv4/devinet.c +++ b/pfinet/linux-src/net/ipv4/devinet.c @@ -435,6 +435,22 @@ configure_device (struct device *dev, return - inet_set_ifa (dev, ifa); } +void +inquire_device (struct device *dev, + uint32_t *addr, uint32_t *netmask) +{ + struct in_device *in_dev = dev->ip_ptr; + struct in_ifaddr *ifa = in_dev ? in_dev->ifa_list : 0; + + if (ifa) + { + *addr = ifa->ifa_local; + *netmask = ifa->ifa_mask; + } + else + *addr = *netmask = INADDR_NONE; +} + #else int devinet_ioctl(unsigned int cmd, void *arg) -- cgit v1.2.3