diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-11-13 01:11:20 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-11-13 10:18:33 +0100 |
commit | 2e93f10b5c30001b2052234a20082c5bda17f0e1 (patch) | |
tree | c2d5526ad687300bf3e2cd187933403a480c5afa | |
parent | c16f0c7dc7b342f46835ad339dd2aa498fec56ea (diff) | |
download | hurd-2e93f10b5c30001b2052234a20082c5bda17f0e1.tar.gz hurd-2e93f10b5c30001b2052234a20082c5bda17f0e1.tar.bz2 hurd-2e93f10b5c30001b2052234a20082c5bda17f0e1.zip |
Add ioctl_types.defs to avoid duplication of type definitions.
Also change type srtentry_t to use the new struct format.
Message-Id: <Y3CKiDS3wszn0G4a@viriathus>
-rw-r--r-- | hurd/iioctl.defs | 10 | ||||
-rw-r--r-- | hurd/ioctl_types.defs | 40 | ||||
-rw-r--r-- | hurd/rioctl.defs | 10 |
3 files changed, 42 insertions, 18 deletions
diff --git a/hurd/iioctl.defs b/hurd/iioctl.defs index ff54a40c..78521795 100644 --- a/hurd/iioctl.defs +++ b/hurd/iioctl.defs @@ -22,6 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ subsystem iioctl 112000; /* XXX */ #include <hurd/hurd_types.defs> +#include <hurd/ioctl_types.defs> #ifdef IIOCTL_IMPORTS IIOCTL_IMPORTS @@ -29,19 +30,10 @@ IIOCTL_IMPORTS INTR_INTERFACE -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. */ -/* This is the struct srtentry from <net/route.h>. */ -type srtentry_t = struct[10] of int; /* sizeof(struct srtentry) is 40. */ - 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 */ diff --git a/hurd/ioctl_types.defs b/hurd/ioctl_types.defs new file mode 100644 index 00000000..e8bf87d6 --- /dev/null +++ b/hurd/ioctl_types.defs @@ -0,0 +1,40 @@ +/* Definitions for interface ioctls + Copyright (C) 2022 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> + +import <hurd/ioctl_types.h>; + +/* Needs to be kept in sync with ioctl_types.h */ +type srtentry_t = struct { + uint32_t rt_dest; + uint32_t rt_mask; + uint32_t rt_gateway; + int rt_flags; + int rt_metric; + int rt_mtu; + int rt_window; + int rt_irtt; + int rt_tos; + int rt_class; +}; + +/* 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. */ diff --git a/hurd/rioctl.defs b/hurd/rioctl.defs index c4b88e5c..6bf3c276 100644 --- a/hurd/rioctl.defs +++ b/hurd/rioctl.defs @@ -23,6 +23,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ subsystem rioctl 148000; /* XXX */ #include <hurd/hurd_types.defs> +#include <hurd/ioctl_types.defs> #ifdef RIOCTL_IMPORTS RIOCTL_IMPORTS @@ -30,15 +31,6 @@ RIOCTL_IMPORTS INTR_INTERFACE -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 struct srtentry from <net/route.h>. */ -type srtentry_t = struct[10] of int; /* sizeof(struct srtentry) is 40. */ - skip; skip; skip; skip; /* 0 1 2 3 unused */ skip; skip; skip; skip; /* 4 5 6 7 unused */ skip; skip; /* 8 9 unused */ |