shithub: mc

Download patch

ref: d975b42d6abcc4cbbfca1d62f1ef1e0d13564071
parent: a4f0e677a8cfbd95e0f47a0bb62b98a77c8946e6
author: Ori Bernstein <[email protected]>
date: Wed Jun 11 19:25:10 EDT 2014

Add ifreq structs.

--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -18,6 +18,7 @@
     hasprefix.myr \
     hassuffix.myr \
     htab.myr \
+    ifreq.myr \
     intparse.myr \
     ipparse.myr \
     mk.myr \
@@ -60,6 +61,9 @@
 
 sys.myr: sys-$(SYS).myr
 	cp sys-$(SYS).myr sys.myr
+
+ifreq.myr: ifreq-$(SYS).myr
+	cp ifreq-$(SYS).myr ifreq.myr
 
 waitstatus.myr: waitstatus-$(SYS).myr
 	cp waitstatus-$(SYS).myr waitstatus.myr
--- /dev/null
+++ b/libstd/ifreq.myr
@@ -1,0 +1,67 @@
+use "sys.use"
+
+pkg std =
+	const Ifnamesz = 16
+
+	type ifreq_addr = struct
+		name	: byte[Ifnamesz]
+		addr	: sockaddr
+	;;
+
+	type ifreq_dstaddr = struct
+		name	: byte[Ifnamesz]
+		dstaddr	: sockaddr
+	;;
+
+	type ifreq_broadaddr = struct
+		name	: byte[Ifnamesz]
+		broadaddr	: sockaddr
+	;;
+
+	type ifreq_netmask = struct
+		name	: byte[Ifnamesz]
+		netmask	: sockaddr
+	;;
+
+
+	type ifreq_hwaddr = struct
+		name	: byte[Ifnamesz]
+		hwaddr	: sockaddr
+	;;
+
+	type ifreq_flags = struct
+		name	: byte[Ifnamesz]
+		flags	: int16
+	;;
+
+	type ifreq_ifindex = struct
+		name	: byte[Ifnamesz]
+		index	: int32
+	;;
+
+	type ifreq_metric = struct
+		name	: byte[Ifnamesz]
+		metric	: int32
+	;;
+
+
+	type ifreq_mtu = struct
+		name	: byte[Ifnamesz]
+		mtu	: int32
+	;;
+
+	type ifreq_slave = struct
+		name	: byte[Ifnamesz]
+		slave	: byte[Ifnamesz]
+	;;
+
+	type ifreq_newname = struct
+		name	: byte[Ifnamesz]
+		newname	: byte[Ifnamesz]
+	;;
+
+	type ifreq_data = struct
+		name	: byte[Ifnamesz]
+		data	: void#
+	;;
+;;