summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-08-29 10:30:04 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-29 23:01:17 +0200
commit574bc98f0f236939c6ef5bc1fc61c919ee8b5d47 (patch)
tree308c207b2db56a9f8a644a389dd9187f065a9362 /hurd
parent5adb4b834b1eba82b7f3eca6324bed0355cae0af (diff)
pfinet: Add SIOCADDRT and SIOCDELRT equivalent iioctls
Using a new client side <net/route.h> I was able to clean up the existing options.c in pfinet and add two new ioctls for adding/deleting network routes. /* move to bits/ioctl.h */ struct ifrtreq { char ifname[IFNAMSIZ]; in_addr_t rt_dest; in_addr_t rt_mask; in_addr_t rt_gateway; int rt_flags; int rt_metric; int rt_mtu; int rt_window; int rt_irtt; int rt_tos; int rt_class; }; Message-Id: <20220829102952.369798-1-damien@zamaudio.com>
Diffstat (limited to 'hurd')
-rw-r--r--hurd/iioctl.defs17
-rw-r--r--hurd/ioctl_types.h15
2 files changed, 31 insertions, 1 deletions
diff --git a/hurd/iioctl.defs b/hurd/iioctl.defs
index dfa89033..6701d8ec 100644
--- a/hurd/iioctl.defs
+++ b/hurd/iioctl.defs
@@ -40,9 +40,24 @@ type ifname_t = array[16] of char; /* IFNAMSIZ is 16. */
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[40] of char; /* 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 */
+skip; skip; /* 8 9 unused */
+
+/* 10 SIOCADDRT */
+routine iioctl_siocaddrt (
+ reqport: io_t;
+ ifnam: ifname_t;
+ route: srtentry_t);
+
+/* 11 SIOCDELRT */
+routine iioctl_siocdelrt (
+ reqport: io_t;
+ ifnam: ifname_t;
+ route: srtentry_t);
/* 12 SIOCSIFADDR */
routine iioctl_siocsifaddr (
diff --git a/hurd/ioctl_types.h b/hurd/ioctl_types.h
index 8baa3604..1e22fe59 100644
--- a/hurd/ioctl_types.h
+++ b/hurd/ioctl_types.h
@@ -30,4 +30,19 @@ typedef struct winsize winsize_t;
typedef struct sockaddr sockaddr_t;
typedef char ifname_t[16];
+#include <stdint.h>
+struct srtentry {
+ 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;
+};
+
+typedef struct srtentry srtentry_t;
#endif /* hurd/ioctl_types.h */