/
githubmirror
/
libseccomp
Обзор
Документация
Войти
/
githubmirror
/
libseccomp
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.0.0
src/arch.h
76 строк
2 KB
Paul Moore
all: relicense the library from GPLv2 to LGPLv2.1
10 апр 2012, 02:07
10 апр 2012, 02:07
160e7c1
Код
Авторство
О чём код?
/** * Enhanced Seccomp Architecture/Machine Specific Code * * Copyright (c) 2012 Red Hat <pmoore@redhat.com> * Author: Paul Moore <pmoore@redhat.com> */ /* * This library is free software; you can redistribute it and/or modify it * under the terms of version 2.1 of the GNU Lesser General Public License as * published by the Free Software Foundation. * * This library 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 Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, see <http://www.gnu.org/licenses>. */ #ifndef _ARCH_H #define _ARCH_H #include <inttypes.h> #include <stddef.h> #include <seccomp.h> #include "system.h" struct db_api_arg; struct arch_def { uint32_t token; enum { ARCH_SIZE_UNSPEC = 0, ARCH_SIZE_32 = 32, ARCH_SIZE_64 = 64, } size; enum { ARCH_ENDIAN_UNSPEC = 0, ARCH_ENDIAN_LITTLE, ARCH_ENDIAN_BIG, } endian; }; /* arch_def for the current process */ extern const struct arch_def arch_def_native; #define DATUM_MAX ((scmp_datum_t)-1) #define D64_LO(x) ((uint32_t)((uint64_t)(x) & 0x00000000ffffffff)) #define D64_HI(x) ((uint32_t)((uint64_t)(x) >> 32)) int arch_arg_count_max(const struct arch_def *arch); /** * Determine the argument offset * @param _arg the argument number * * Return the correct offset of the given argument. * */ #define arch_arg_offset(_arg) (offsetof(struct seccomp_data, args[_arg])) int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg); int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg); int arch_syscall_rewrite(const struct arch_def *arch, int *syscall); int arch_filter_rewrite(const struct arch_def *arch, unsigned int strict, int *syscall, struct db_api_arg *chain); #endif