summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/ChangeLog8
-rw-r--r--hurd/iioctl.defs172
-rw-r--r--hurd/ioctl_types.h4
-rw-r--r--hurd/pfinet.defs46
4 files changed, 196 insertions, 34 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog
index 301a80a8..4d621354 100644
--- a/hurd/ChangeLog
+++ b/hurd/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2000-11-15 Marcus Brinkmann <marcus@gnu.org>
* hurd_types.h: Doc fix reported by Neal H Walfield
diff --git a/hurd/iioctl.defs b/hurd/iioctl.defs
new file mode 100644
index 00000000..42c1ecaa
--- /dev/null
+++ b/hurd/iioctl.defs
@@ -0,0 +1,172 @@
+/* Definitions for interface ioctls
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+This file is part of the GNU Hurd.
+
+The GNU Hurd is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU Hurd is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU Hurd; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+#include <hurd/hurd_types.defs>
+
+INTR_INTERFACE
+
+/* Ioctl class `i'; the subsystem is derived from calculations in
+ <ioctls.h>. */
+subsystem iioctl 112000; /* XXX */
+
+import <hurd/ioctl_types.h>; /* XXX */
+
+/* This is the first arg for a struct ifreq_something as specified by the
+ definition of _IOT_ifreq_something in <net/if.h>. */
+type ifname_t = array[16] of char; /* IFNAMSIZ is 16. */
+
+/* This is the second arg of struct ifreq as specified by the
+ definition of _IOT_ifreq in <net/if.h>. */
+type sockaddr_t = struct[16] of char; /* sizeof(struct sockaddr) is 16. */
+
+skip; skip; skip; skip; /* 0 1 2 3 unused */
+skip; skip; skip; skip; /* 4 5 6 7 unused */
+skip; skip; skip; skip; /* 8 9 10 11 unused */
+
+/* 12 SIOCSIFADDR */
+routine iioctl_siocsifaddr (
+ reqport: io_t;
+ ifnam: ifname_t;
+ addr: sockaddr_t);
+
+skip; /* 13 unused */
+
+/* 14 SIOCSIFDSTADDR */
+routine iioctl_siocsifdstaddr (
+ reqport: io_t;
+ ifnam: ifname_t;
+ dstaddr: sockaddr_t);
+
+skip; /* 15 unused */
+
+/* 16 SIOCSIFFLAGS */
+routine iioctl_siocsifflags (
+ reqport: io_t;
+ ifnam: ifname_t;
+ flags: short);
+
+/* 17 SIOCGIFFLAGS */
+routine iioctl_siocgifflags (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout flags: short);
+
+skip; /* 18 unused */
+
+/* 19 SIOCSIFBRDADDR */
+routine iioctl_siocsifbrdaddr (
+ reqport: io_t;
+ ifnam: ifname_t;
+ brdaddr: sockaddr_t);
+
+skip; skip; /* 20 21 unused */
+
+/* 22 SIOCSIFNETMASK */
+routine iioctl_siocsifnetmask (
+ reqport: io_t;
+ ifnam: ifname_t;
+ netmask: sockaddr_t);
+
+/* 23 SIOCGIFMETRIC */
+routine iioctl_siocgifmetric (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout metric: int);
+
+/* 24 SIOCSIFMETRIC */
+routine iioctl_siocsifmetric (
+ reqport: io_t;
+ ifnam: ifname_t;
+ metric: int);
+
+/* 25 SIOCDIFADDR */
+routine iioctl_siocdifaddr (
+ reqport: io_t;
+ ifnam: ifname_t;
+ addr: sockaddr_t);
+
+skip; skip; skip; skip; /* 26 27 28 29 unused */
+skip; skip; skip; /* 30 31 32 unused */
+
+/* 33 SIOCGIFADDR */
+routine iioctl_siocgifaddr (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout addr: sockaddr_t);
+
+/* 34 SIOCGIFDSTADDR */
+routine iioctl_siocgifdstaddr (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout dstaddr: sockaddr_t);
+
+/* 35 SIOCGIFBRDADDR */
+routine iioctl_siocgifbrdaddr (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout brdaddr: sockaddr_t);
+
+skip; /* 36 SIOCGIFCONF -- implemented in C library */
+
+/* 37 SIOCGIFNETMASK */
+routine iioctl_siocgifnetmask (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout netmask: sockaddr_t);
+
+skip; skip; skip; skip; /* 38, 39, 40, 41 unused */
+skip; skip; skip; skip; /* 42, 43, 44, 45 unused */
+skip; skip; skip; skip; /* 46, 47, 48, 49 unused */
+skip; /* 50 unused */
+
+/* 51 SIOCGIFMTU */
+routine iioctl_siocgifmtu (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout mtu: int);
+
+/* 52 SIOCSIFMTU */
+routine iioctl_siocsifmtu (
+ reqport: io_t;
+ ifnam: ifname_t;
+ mtu: int);
+
+skip; skip; skip; skip; /* 53, 54, 55, 56 unused */
+skip; skip; skip; skip; /* 57, 58, 59, 60 unused */
+skip; skip; skip; skip; /* 61, 62, 63, 64 unused */
+skip; skip; skip; skip; /* 65, 66, 67, 68 unused */
+skip; skip; skip; skip; /* 69, 70, 71, 72 unused */
+skip; skip; skip; skip; /* 73, 74, 75, 76 unused */
+skip; skip; skip; skip; /* 77, 78, 79, 80 unused */
+skip; skip; skip; skip; /* 81, 82, 83, 84 unused */
+skip; skip; skip; skip; /* 85, 86, 87, 88 unused */
+skip; /* 89 unused */
+
+/* 90 SIOCGIFINDEX */
+routine iioctl_siocgifindex (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout index: int);
+
+/* 91 SIOCGIFNAME */
+routine iioctl_siocgifname (
+ reqport: io_t;
+ inout ifnam: ifname_t;
+ inout index: int);
diff --git a/hurd/ioctl_types.h b/hurd/ioctl_types.h
index 01a1e2e6..8baa3604 100644
--- a/hurd/ioctl_types.h
+++ b/hurd/ioctl_types.h
@@ -26,4 +26,8 @@ typedef cc_t ccs_t[NCCS];
#include <sys/ioctl.h>
typedef struct winsize winsize_t;
+#include <net/if.h>
+typedef struct sockaddr sockaddr_t;
+typedef char ifname_t[16];
+
#endif /* hurd/ioctl_types.h */
diff --git a/hurd/pfinet.defs b/hurd/pfinet.defs
index abaf14d8..669e3f7a 100644
--- a/hurd/pfinet.defs
+++ b/hurd/pfinet.defs
@@ -1,5 +1,5 @@
/* Definitions for pfinet-specific calls
- Copyright (C) 1999 Free Software Foundation
+ Copyright (C) 1999, 2000 Free Software Foundation
This file is part of the GNU Hurd.
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with the GNU Hurd; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-subsystem pfinet 21000;
+subsystem pfinet 37000;
#include <hurd/hurd_types.defs>
@@ -27,35 +27,13 @@ SOCKET_IMPORTS
INTR_INTERFACE
-
-/* Register a new interface. This call is made on the main socket
- rendezvous port (/servers/socket/pfinet). */
-routine pfinet_register_interface (
- server: pf_t;
- name: string_t;
- address: int; /* in net byte order */
- network: int; /* in net byte order */
- mask: int; /* in net byte order */
- broadcast: int; /* in net byte order */
- mac_hdr_len: int;
- xmit: mach_port_send_t;
- out recv: mach_port_send_t);
-
-/* Process an incoming packet. This is made on the RECVXMIT port returned
- by a previous call to pfinet_register_interface. */
-simpleroutine pfinet_recv (
- rx: mach_port_t;
- packet: data_t);
-
-/* Sent by pfinet TO an interface for each packet that needs to be sent.
- The first mac_hdr_len bytes of the buffer are unfilled; the actual
- IP packet begins that many bytes in. */
-simpleroutine pfinet_xmit (
- tx: mach_port_t;
- is_broadcast: int;
- packet: data_t);
-
-
-
-
-
+/* Return a list of interfaces as expected by the SIOCGIFCONF ioctl.
+ The maximum number of bytes returned can be given in AMOUNT, but if
+ AMOUNT is negative, all interfaces will be returned. Always
+ succeeds (and interface list will be truncated to fit into AMOUNT
+ space) for BSD compatibility. */
+routine pfinet_siocgifconf (
+ port: io_t;
+ amount: int;
+ out buf: data_t, dealloc
+);