summaryrefslogtreecommitdiff
path: root/pfinet/linux-src/net
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-01-11 22:28:29 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-01-11 22:28:29 +0000
commit2a0220f19b262f122bc8dc7b68e6f4c0a5a16cae (patch)
tree933d00b5e3b4b7371ccf1b10f2a24affa2bfc70d /pfinet/linux-src/net
parentf63be3bda31acdc2a88e1cd64770966e73ca0b5d (diff)
hurd/
2001-01-07 Marcus Brinkmann <marcus@gnu.org> * ioctl_types.h: Include <net/if.h>, define types sockaddr_t and ifname_t for iioctl.defs. * iioctl.defs: New file for network interface ioctls. * pfinet.defs: Remove old RPCs, fix subsystem number, add RPC for SIOCGIFCONF. pfinet/ 2001-01-07 Marcus Brinkmann <marcus@gnu.org> * pfinet-ops.c: New file to implement hurd/pfinet.defs. * iioctl-ops.c: New file to implement iioctl.defs. * linux-src/net/core/dev.c: If _HURD_, don't define netdev_chain as static. * glue-include/linux/if.h: New file, to avoid conflict between <net/if.h> (imported by iioctl.defs) and linux version of it. * main.c (pfinet_demuxer): Prototype pfinet_server and iioctl_server, use them. * pfinet.h: New global variables pfinetctl, pfinet_owner and pfinet_group. * main.c (main): New variable ST. Request pfinetctl from trivfs_startup. Use it to determine the owner and group of the underlying node. * io-ops.c (S_io_reauthenticate): New index variable j. Set newuser->isroot also for owners of the underlying file and group owners. (S_io_restrict_auth): Likewise. * socket-ops.c: Include <sys/stat.h> and <hurd/fshelp.h>. (S_socket_create): New variable isroot. If master->isroot is not set, use fshelp_isowner to check ownership and if to set it. Pass isroot to make_sock_user instead master->isroot. * linux-src/net/ipv4/devinet.c (configure_device): Accept new parameter BROADCAST, set ifa_broadcast if this is not INADDR_NONE. (inquire_device): Accept new parameter broadcast, set it. * main.c: Add new paramter to prototype of configure_device. (main): Add new parameter to call to configure_device. * options.c: Add new parameters to prototypes of configure_device and inquire_device. (trivfs_append_args): Define new variable BROAD, use its address as the new parameter for inquire_device. * linux-src/net/core/dev.c (dev_ifconf): Don't declare static if _HURD_. * linux-src/net/ipv4/devinet.c (inet_gifconf): If _HURD_, set sin_len member. * Makefile (MIGSRCS): Add pfinetServer.c and iioctlServer.c. (SRCS): Add pfinet-ops.c, iioctl-ops.c.
Diffstat (limited to 'pfinet/linux-src/net')
-rw-r--r--pfinet/linux-src/net/core/dev.c8
-rw-r--r--pfinet/linux-src/net/ipv4/devinet.c15
2 files changed, 20 insertions, 3 deletions
diff --git a/pfinet/linux-src/net/core/dev.c b/pfinet/linux-src/net/core/dev.c
index aaee35a2..5b4c6255 100644
--- a/pfinet/linux-src/net/core/dev.c
+++ b/pfinet/linux-src/net/core/dev.c
@@ -146,7 +146,11 @@ atomic_t dev_lockct = ATOMIC_INIT(0);
* Our notifier list
*/
+#ifdef _HURD_
+struct notifier_block *netdev_chain=NULL;
+#else
static struct notifier_block *netdev_chain=NULL;
+#endif
/*
* Device drivers call our routines to queue packets here. We empty the
@@ -1103,7 +1107,11 @@ static int dev_ifname(struct ifreq *arg)
* Thus we will need a 'compatibility mode'.
*/
+#ifdef _HURD_
+int dev_ifconf(char *arg)
+#else
static int dev_ifconf(char *arg)
+#endif
{
struct ifconf ifc;
struct device *dev;
diff --git a/pfinet/linux-src/net/ipv4/devinet.c b/pfinet/linux-src/net/ipv4/devinet.c
index 71beaf18..d107f335 100644
--- a/pfinet/linux-src/net/ipv4/devinet.c
+++ b/pfinet/linux-src/net/ipv4/devinet.c
@@ -401,7 +401,8 @@ static __inline__ int inet_abc_len(u32 addr)
error_t
configure_device (struct device *dev,
- uint32_t addr, uint32_t netmask, uint32_t peer)
+ uint32_t addr, uint32_t netmask, uint32_t peer,
+ uint32_t broadcast)
{
struct in_device *in_dev = dev->ip_ptr;
struct in_ifaddr *ifa = in_dev ? in_dev->ifa_list : 0;
@@ -441,13 +442,17 @@ configure_device (struct device *dev,
ifa->ifa_address = peer;
}
+ if (broadcast != INADDR_NONE)
+ ifa->ifa_broadcast = broadcast;
+
return - (inet_set_ifa (dev, ifa)
?: dev_change_flags (dev, dev->flags | IFF_UP));
}
void
inquire_device (struct device *dev,
- uint32_t *addr, uint32_t *netmask, uint32_t *peer)
+ uint32_t *addr, uint32_t *netmask, uint32_t *peer,
+ uint32_t *broadcast)
{
struct in_device *in_dev = dev->ip_ptr;
struct in_ifaddr *ifa = in_dev ? in_dev->ifa_list : 0;
@@ -457,9 +462,10 @@ inquire_device (struct device *dev,
*addr = ifa->ifa_local;
*netmask = ifa->ifa_mask;
*peer = ifa->ifa_address;
+ *broadcast = ifa->ifa_broadcast;
}
else
- *addr = *netmask = *peer = INADDR_NONE;
+ *addr = *netmask = *peer = *broadcast = INADDR_NONE;
}
#else
@@ -700,6 +706,9 @@ inet_gifconf(struct device *dev, char *buf, int len)
else
strcpy(ifr.ifr_name, dev->name);
+#ifdef _HURD_
+ (*(struct sockaddr_in *) &ifr.ifr_addr).sin_len = sizeof (struct sockaddr_in);
+#endif
(*(struct sockaddr_in *) &ifr.ifr_addr).sin_family = AF_INET;
(*(struct sockaddr_in *) &ifr.ifr_addr).sin_addr.s_addr = ifa->ifa_local;