Skip to content
Snippets Groups Projects
Commit e1715685 authored by Timo Teräs's avatar Timo Teräs
Browse files

main/musl: add igmp headers and quota headers/syscall

parent 825c4398
No related branches found
No related tags found
No related merge requests found
From cc449aebaa572fbea2d400d1ee058f03f2638df2 Mon Sep 17 00:00:00 2001 From 33ea72845ca2f4244358a67940a5daedeced14ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Mon, 14 Oct 2013 10:01:01 +0300 Date: Mon, 14 Oct 2013 10:01:01 +0300
Subject: [PATCH] add basic dns record parsing functions Subject: [PATCH] add basic dns record parsing functions
...@@ -268,5 +268,5 @@ index 0000000..5ef0d90 ...@@ -268,5 +268,5 @@ index 0000000..5ef0d90
+} +}
+ +
-- --
1.8.4 1.8.5.1
From 03dbf5d8e44e2e3bca6a55bec189d1682442b0cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 18 Dec 2013 08:41:22 +0200
Subject: [PATCH] add sys/quota.h and quotactl syscall wrapper
---
include/sys/quota.h | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++
src/linux/quotactl.c | 7 ++++
2 files changed, 111 insertions(+)
create mode 100644 include/sys/quota.h
create mode 100644 src/linux/quotactl.c
diff --git a/include/sys/quota.h b/include/sys/quota.h
new file mode 100644
index 0000000..7bcad02
--- /dev/null
+++ b/include/sys/quota.h
@@ -0,0 +1,104 @@
+#ifndef _SYS_SYSCTL_H
+#define _SYS_SYSCTL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define _LINUX_QUOTA_VERSION 2
+
+#define dbtob(num) ((num) << 10)
+#define btodb(num) ((num) >> 10)
+#define fs_to_dq_blocks(num, blksize) (((num) * (blksize)) / BLOCK_SIZE)
+
+#define MAX_IQ_TIME 604800
+#define MAX_DQ_TIME 604800
+
+#define MAXQUOTAS 2
+#define USRQUOTA 0
+#define GRPQUOTA 1
+
+#define INITQFNAMES { "user", "group", "undefined" };
+
+#define QUOTAFILENAME "quota"
+#define QUOTAGROUP "staff"
+
+#define NR_DQHASH 43
+#define NR_DQUOTS 256
+
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_SYNC 0x800001
+#define Q_QUOTAON 0x800002
+#define Q_QUOTAOFF 0x800003
+#define Q_GETFMT 0x800004
+#define Q_GETINFO 0x800005
+#define Q_SETINFO 0x800006
+#define Q_GETQUOTA 0x800007
+#define Q_SETQUOTA 0x800008
+
+#define QFMT_VFS_OLD 1
+#define QFMT_VFS_V0 2
+#define QFMT_OCFS2 3
+#define QFMT_VFS_V1 4
+
+#define QIF_BLIMITS 1
+#define QIF_SPACE 2
+#define QIF_ILIMITS 4
+#define QIF_INODES 8
+#define QIF_BTIME 16
+#define QIF_ITIME 32
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct dqblk
+{
+ uint64_t dqb_bhardlimit;
+ uint64_t dqb_bsoftlimit;
+ uint64_t dqb_curspace;
+ uint64_t dqb_ihardlimit;
+ uint64_t dqb_isoftlimit;
+ uint64_t dqb_curinodes;
+ uint64_t dqb_btime;
+ uint64_t dqb_itime;
+ uint32_t dqb_valid;
+};
+
+#define dq_bhardlimit dq_dqb.dqb_bhardlimit
+#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
+#define dq_curspace dq_dqb.dqb_curspace
+#define dq_valid dq_dqb.dqb_valid
+#define dq_ihardlimit dq_dqb.dqb_ihardlimit
+#define dq_isoftlimit dq_dqb.dqb_isoftlimit
+#define dq_curinodes dq_dqb.dqb_curinodes
+#define dq_btime dq_dqb.dqb_btime
+#define dq_itime dq_dqb.dqb_itime
+
+#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
+
+#define IIF_BGRACE 1
+#define IIF_IGRACE 2
+#define IIF_FLAGS 4
+#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct dqinfo
+{
+ uint64_t dqi_bgrace;
+ uint64_t dqi_igrace;
+ uint32_t dqi_flags;
+ uint32_t dqi_valid;
+};
+
+int quotactl(int, const char *, int, char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/linux/quotactl.c b/src/linux/quotactl.c
new file mode 100644
index 0000000..344eb0d
--- /dev/null
+++ b/src/linux/quotactl.c
@@ -0,0 +1,7 @@
+#include <sys/quota.h>
+#include "syscall.h"
+
+int quotactl(int cmd, const char *special, int id, char *addr)
+{
+ return syscall(SYS_quotactl, cmd, special, id, addr);
+}
--
1.8.5.1
From e136625c8e0dc757dd1bd335bfca6e753e06d185 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 18 Dec 2013 08:47:01 +0200
Subject: [PATCH] add netinet/igmp.h and multicast groups to netinet/in.h
---
include/netinet/igmp.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
include/netinet/in.h | 5 +++++
2 files changed, 57 insertions(+)
create mode 100644 include/netinet/igmp.h
diff --git a/include/netinet/igmp.h b/include/netinet/igmp.h
new file mode 100644
index 0000000..822a6c7
--- /dev/null
+++ b/include/netinet/igmp.h
@@ -0,0 +1,52 @@
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H 1
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+
+#include <sys/types.h>
+#include <netinet/in.h>
+
+struct igmp {
+ u_int8_t igmp_type; /* IGMP type */
+ u_int8_t igmp_code; /* routing code */
+ u_int16_t igmp_cksum; /* checksum */
+ struct in_addr igmp_group; /* group address */
+};
+
+#define IGMP_MINLEN 8
+
+#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
+#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
+#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
+#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
+
+#define IGMP_DVMRP 0x13 /* DVMRP routing message */
+#define IGMP_PIM 0x14 /* PIM routing message */
+#define IGMP_TRACE 0x15
+
+#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
+#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
+
+#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
+ /* query (in seconds) according */
+ /* to RFC1112 */
+#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
+ /* specifies time in 10th of seconds*/
+
+#define IGMP_DELAYING_MEMBER 1
+#define IGMP_IDLE_MEMBER 2
+#define IGMP_LAZY_MEMBER 3
+#define IGMP_SLEEPING_MEMBER 4
+#define IGMP_AWAKENING_MEMBER 5
+
+#define IGMP_v1_ROUTER 1
+#define IGMP_v2_ROUTER 2
+
+#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
+#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
+#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
+#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
+
+#endif
+
+#endif
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 8be51e8..db96144 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -53,6 +53,11 @@ struct ipv6_mreq
#define INADDR_NONE ((in_addr_t) 0xffffffff)
#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
+#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
+#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
+#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
+#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
+
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
--
1.8.5.1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi> # Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl pkgname=musl
pkgver=0.9.14 pkgver=0.9.14
pkgrel=7 pkgrel=8
pkgdesc="the musl c library (libc) implementation" pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/" url="http://www.musl-libc.org/"
arch="all" arch="all"
...@@ -15,7 +15,11 @@ subpackages="$pkgname-dev $pkgname-utils" ...@@ -15,7 +15,11 @@ subpackages="$pkgname-dev $pkgname-utils"
[ "${CTARGET#*musl}" = "$CTARGET" ] && subpackages="$subpackages musl-gcc:crosstool" [ "${CTARGET#*musl}" = "$CTARGET" ] && subpackages="$subpackages musl-gcc:crosstool"
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0001-updates-from-git.patch 0001-updates-from-git.patch
1003-add-basic-dns-record-parsing-functions.patch
1001-add-basic-dns-record-parsing-functions.patch
1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch
1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch
2001-workaround-gcc-pr58245.patch 2001-workaround-gcc-pr58245.patch
getopt_long.c getopt_long.c
...@@ -109,7 +113,9 @@ crosstool() { ...@@ -109,7 +113,9 @@ crosstool() {
md5sums="bfb685695aa942e64c63170589e575b2 musl-0.9.14.tar.gz md5sums="bfb685695aa942e64c63170589e575b2 musl-0.9.14.tar.gz
de075c4b6ff2bf406f437d100f06c6bd 0001-updates-from-git.patch de075c4b6ff2bf406f437d100f06c6bd 0001-updates-from-git.patch
6cdf1c56450d59f3a3acf452b2db4c2e 1003-add-basic-dns-record-parsing-functions.patch a3810683ef61ac27e2f6ec9801280c81 1001-add-basic-dns-record-parsing-functions.patch
06a67be89404258c321c08348cb547ce 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch
bb7b6eb67c1749943f378c88acc48e5c 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch
7a09c5cd7b3e9532e6902f54a5e928bb 2001-workaround-gcc-pr58245.patch 7a09c5cd7b3e9532e6902f54a5e928bb 2001-workaround-gcc-pr58245.patch
61c6c1e84ed1df82abbe6d75e90cf21c getopt_long.c 61c6c1e84ed1df82abbe6d75e90cf21c getopt_long.c
0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c 0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c
...@@ -117,7 +123,9 @@ ef81489a6258501cf45db58dfc6d5211 getent ...@@ -117,7 +123,9 @@ ef81489a6258501cf45db58dfc6d5211 getent
33e4fd94e2560e008e2c3b431d0e3419 ldconfig" 33e4fd94e2560e008e2c3b431d0e3419 ldconfig"
sha256sums="982e9de1287cf95f9aa526adba008660d8885bfccc41faf5c613ea47f1922872 musl-0.9.14.tar.gz sha256sums="982e9de1287cf95f9aa526adba008660d8885bfccc41faf5c613ea47f1922872 musl-0.9.14.tar.gz
d8e303e61f2cc220ce2b7ffd992d37406b87dd2a4062f61f5de3e0df144227b0 0001-updates-from-git.patch d8e303e61f2cc220ce2b7ffd992d37406b87dd2a4062f61f5de3e0df144227b0 0001-updates-from-git.patch
54686df1392c52f4e9c62648dcb544f4bd48111be8d9734b7f65d8452b7ead12 1003-add-basic-dns-record-parsing-functions.patch 758390768b1bc4159d56908ca332b9640cd0552ed3b4b2b8d4a6d499c54c11a1 1001-add-basic-dns-record-parsing-functions.patch
4ef5ae263b55c0c691c5fb212bcdaa2050091e6acfa2a6dffc597db9743b8c53 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch
f57dee5a9309055b298056e4d4107c67e3b0d5f164ab277ffcb353fb1688a2d2 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch
45d6efda7450809e4e68f6e951431dcadf6cb7f0260930d50a9f1a8667aca49f 2001-workaround-gcc-pr58245.patch 45d6efda7450809e4e68f6e951431dcadf6cb7f0260930d50a9f1a8667aca49f 2001-workaround-gcc-pr58245.patch
d9b644ec20bc33e81a7c52b9fcf7973d835923a69faf50f03db45534b811bd96 getopt_long.c d9b644ec20bc33e81a7c52b9fcf7973d835923a69faf50f03db45534b811bd96 getopt_long.c
299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c 299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c
...@@ -125,7 +133,9 @@ d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb getent ...@@ -125,7 +133,9 @@ d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb getent
306c6ca7407560340797866e077e053627ad409277d1b9da58106fce4cf717cb ldconfig" 306c6ca7407560340797866e077e053627ad409277d1b9da58106fce4cf717cb ldconfig"
sha512sums="e5c3f7b1549dc2f9cbd3359cc413f761d5967607c23705f651c33d0ae93f00582193a41fe1f87158467d58d8eba2d7c09e0fe2f2b2c02c1dda78eee1a4cecff6 musl-0.9.14.tar.gz sha512sums="e5c3f7b1549dc2f9cbd3359cc413f761d5967607c23705f651c33d0ae93f00582193a41fe1f87158467d58d8eba2d7c09e0fe2f2b2c02c1dda78eee1a4cecff6 musl-0.9.14.tar.gz
1f93d537e707c60f53823419477fd9165e0aa8b6b28c6b95b80222c943b572029dcdaec2c1bb34e20e5c8c73c6869b89f5bea5b99f401db64d0a4c00abc4b092 0001-updates-from-git.patch 1f93d537e707c60f53823419477fd9165e0aa8b6b28c6b95b80222c943b572029dcdaec2c1bb34e20e5c8c73c6869b89f5bea5b99f401db64d0a4c00abc4b092 0001-updates-from-git.patch
335ec63cfbc7f348f33cfba1238c069fed4c8c51a51d1ea39eff4b7dfcceeae7ff4afb1038fa7c5545a42854ed553a936c0b1ff6c4795fa25b982398a2cc02bd 1003-add-basic-dns-record-parsing-functions.patch dad965258daf69371b844f76bfe5a914b0eca0ca76f3fc340b8fd7acf598b5f87bbe6d68b1f43ed0293ee0ed3bfd85d5173ccc169aa6265646248d5b8a906708 1001-add-basic-dns-record-parsing-functions.patch
c64a8c5fa7f0ad095e9281cf23eeed70f476adadb044eb8ac8e038153fd19accf601d82cf89dc289c933b7cbfce3e59ba6c03fa5f7a3a63038905453b5b152a1 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch
a8bb390658552b766c1d92cf261bc77bd2369cd185d9803f2ba0265713de16f812dfe916a4d1b428bf5073848741800d856571009042e7514098344d31751f45 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch
69ad3fc851b44f33dd7c98b83fd0adbd149b37263d17b989f4d7338ee0703dfe8994f4299744e2509492300227d652de6f21b6cdba9b633fcefd3d9f7ca0cf20 2001-workaround-gcc-pr58245.patch 69ad3fc851b44f33dd7c98b83fd0adbd149b37263d17b989f4d7338ee0703dfe8994f4299744e2509492300227d652de6f21b6cdba9b633fcefd3d9f7ca0cf20 2001-workaround-gcc-pr58245.patch
140f3f20d30bd95ebce8c41b8cc7f616c6cbedf4ea06c729c21014e74f6043796825cc40ebc5180620ea38173afdba23f09ebf6d8b11fa05440b14d23764fca9 getopt_long.c 140f3f20d30bd95ebce8c41b8cc7f616c6cbedf4ea06c729c21014e74f6043796825cc40ebc5180620ea38173afdba23f09ebf6d8b11fa05440b14d23764fca9 getopt_long.c
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment