repo stringlengths 1 152 ⌀ | file stringlengths 14 221 | code stringlengths 501 25k | file_length int64 501 25k | avg_line_length float64 20 99.5 | max_line_length int64 21 134 | extension_type stringclasses 2
values |
|---|---|---|---|---|---|---|
null | systemd-main/src/fundamental/macro-fundamental.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if !SD_BOOT
# include <assert.h>
#endif
#include <limits.h>
#include <stdalign.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define _align_(x) __attribute__((__aligned__(x)))
#define _alignas_(x) __attribute__((__aligned__(alignof(x))... | 19,393 | 47.728643 | 133 | h |
null | systemd-main/src/fundamental/memory-util-fundamental.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stddef.h>
#if SD_BOOT
# include "efi-string.h"
#else
# include <string.h>
#endif
#include "macro-fundamental.h"
#if !SD_BOOT && HAVE_EXPLICIT_BZERO
static inline void *explicit_bzero_safe(void *p, size_t l) {
if (p && l > 0)
... | 2,318 | 33.61194 | 118 | h |
null | systemd-main/src/fundamental/sha256.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Stolen from glibc and converted to our style. In glibc it comes with the following copyright blurb: */
/* Functions to compute SHA256 message digest of files or memory blocks.
according to the definition of SHA256 in FIPS 180-2.
Copyright (C) 2007-2022 Free So... | 10,778 | 36.688811 | 105 | c |
null | systemd-main/src/fundamental/sha256.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stddef.h>
#include <stdint.h>
#define SHA256_DIGEST_SIZE 32
struct sha256_ctx {
uint32_t H[8];
union {
uint64_t total64;
#define TOTAL64_low (1 - (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
#define TOTAL64_high ... | 1,262 | 30.575 | 106 | h |
null | systemd-main/src/fundamental/string-util-fundamental.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#if !SD_BOOT
# include <ctype.h>
#endif
#include "macro-fundamental.h"
#include "string-util-fundamental.h"
sd_char *startswith(const sd_char *s, const sd_char *prefix) {
size_t l;
assert(s);
assert(prefix);
l = strlen(prefix);
... | 7,849 | 33.279476 | 105 | c |
null | systemd-main/src/fundamental/string-util-fundamental.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if SD_BOOT
# include "efi.h"
# include "efi-string.h"
#else
# include <string.h>
#endif
#include "macro-fundamental.h"
#if SD_BOOT
# define strlen strlen16
# define strcmp strcmp16
# define strncmp strncmp16
# define strcasecmp strcasecmp16
# def... | 3,229 | 26.372881 | 87 | h |
null | systemd-main/src/fundamental/tpm-pcr.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stddef.h>
#include "tpm-pcr.h"
const char* const unified_sections[_UNIFIED_SECTION_MAX + 1] = {
[UNIFIED_SECTION_LINUX] = ".linux",
[UNIFIED_SECTION_OSREL] = ".osrel",
[UNIFIED_SECTION_CMDLINE] = ".cmdline",
[UNIFIED_SECTI... | 639 | 31 | 64 | c |
null | systemd-main/src/fundamental/tpm-pcr.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "macro-fundamental.h"
/* The various TPM PCRs we measure into from sd-stub and sd-boot. */
/* This TPM PCR is where we extend the sd-stub "payloads" into, before using them. i.e. the kernel ELF image,
* embedded initrd, and so on. In contrast to... | 2,011 | 42.73913 | 109 | h |
null | systemd-main/src/fundamental/unaligned-fundamental.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdint.h>
static inline uint16_t unaligned_read_ne16(const void *_u) {
const struct __attribute__((__packed__, __may_alias__)) { uint16_t x; } *u = _u;
return u->x;
}
static inline uint32_t unaligned_read_ne32(const void *_u) {
... | 1,115 | 26.219512 | 88 | h |
null | systemd-main/src/fuzz/fuzz-bootspec.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <string.h>
#include "bootspec.h"
#include "env-util.h"
#include "escape.h"
#include "fuzz.h"
#include "fd-util.h"
#include "json.h"
static int json_dispatch_config(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userdata) {
Boot... | 4,282 | 32.992063 | 115 | c |
null | systemd-main/src/fuzz/fuzz-calendarspec.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "calendarspec.h"
#include "fd-util.h"
#include "fuzz.h"
#include "string-util.h"
#include "time-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(calendar_spec_freep) CalendarSpec *cspec = NULL;
... | 1,818 | 29.830508 | 76 | c |
null | systemd-main/src/fuzz/fuzz-catalog.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "catalog.h"
#include "fd-util.h"
#include "fs-util.h"
#include "fuzz.h"
#include "tmpfile-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(unlink_tempfilep) char name[] = "/tmp/fuzz-catalog.XXXXXX";
_cleanup_clos... | 757 | 27.074074 | 77 | c |
null | systemd-main/src/fuzz/fuzz-compress.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "alloc-util.h"
#include "compress.h"
#include "fuzz.h"
typedef struct header {
uint32_t alg:2; /* We have only three compression algorithms so far, but we might add more in the
* future. Let's make this a bi... | 2,175 | 30.085714 | 105 | c |
null | systemd-main/src/fuzz/fuzz-env-file.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdio.h>
#include "alloc-util.h"
#include "env-file.h"
#include "fd-util.h"
#include "fuzz.h"
#include "strv.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_strv_free_ char **rl = NU... | 864 | 26.03125 | 75 | c |
null | systemd-main/src/fuzz/fuzz-hostname-setup.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "fd-util.h"
#include "fuzz.h"
#include "hostname-setup.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_fclose_ FILE *f = NULL;
_cleanup_free_ char *ret = NULL;
f = data_to_file(data, s... | 645 | 25.916667 | 75 | c |
null | systemd-main/src/fuzz/fuzz-json.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "env-util.h"
#include "fd-util.h"
#include "fuzz.h"
#include "json.h"
#include "memstream-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(memstream_done) MemStream m = {};
_cleanup_(json_... | 4,251 | 35.033898 | 105 | c |
null | systemd-main/src/fuzz/fuzz-main.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "fileio.h"
#include "fuzz.h"
#include "log.h"
#include "parse-util.h"
#include "string-util.h"
#include "tests.h"
/* This is a test driver for the systemd fuzzers that provides main function
* for regression testing outside of oss-fuzz... | 1,841 | 31.315789 | 133 | c |
null | systemd-main/src/fuzz/fuzz-time-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "fd-util.h"
#include "fuzz.h"
#include "time-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_free_ char *str = NULL;
usec_t usec;
if (!getenv("SYSTEMD_LOG_LEVEL"))
... | 746 | 25.678571 | 62 | c |
null | systemd-main/src/fuzz/fuzz-udev-database.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "device-internal.h"
#include "device-private.h"
#include "fd-util.h"
#include "fs-util.h"
#include "fuzz.h"
#include "tmpfile-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(sd_device_unrefp) sd_device *dev = NULL;
... | 825 | 29.592593 | 87 | c |
null | systemd-main/src/fuzz/fuzz-varlink.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <unistd.h>
#include "errno-util.h"
#include "fd-util.h"
#include "fuzz.h"
#include "hexdecoct.h"
#include "io-util.h"
#include "varlink.h"
#include "log.h"
static FILE *null = NULL;
static int method_something(Varlink *v, JsonVariant *p, VarlinkMethodFlags f... | 5,343 | 39.793893 | 125 | c |
null | systemd-main/src/fuzz/fuzz.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stddef.h>
#include <stdint.h>
#include "env-util.h"
#include "fileio.h"
/* The entry point into the fuzzer */
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
static inline FILE* data_to_file(const uint8_t *data, size_t size) {
... | 947 | 27.727273 | 80 | h |
null | systemd-main/src/getty-generator/getty-generator.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "alloc-util.h"
#include "creds-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "generator.h"
#include "initrd-util.h"
#include "log.h"
#include "mkdir-label.h"
#include... | 9,356 | 30.086379 | 123 | c |
null | systemd-main/src/hibernate-resume/hibernate-resume.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <sys/stat.h>
#include "devnum-util.h"
#include "initrd-util.h"
#include "log.h"
#include "main-func.h"
#include "parse-util.h"
#include "sleep-util.h"
static const char *arg_resume_device = NULL;
static uint64_t arg_resume_offset = 0; /* in... | 1,814 | 31.410714 | 128 | c |
null | systemd-main/src/home/home-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dns-domain.h"
#include "home-util.h"
#include "libcrypt-util.h"
#include "memory-util.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
#include "user-util.h"
bool suitable_user_name(const char *name) {
/* Checks whether the specif... | 4,204 | 29.035714 | 107 | c |
null | systemd-main/src/home/homectl-fido2.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#if HAVE_LIBFIDO2
#include <fido.h>
#endif
#include "ask-password-api.h"
#include "errno-util.h"
#include "format-table.h"
#include "hexdecoct.h"
#include "homectl-fido2.h"
#include "homectl-pkcs11.h"
#include "libcrypt-util.h"
#include "libfido2-util.h"
#include "loca... | 7,938 | 36.448113 | 129 | c |
null | systemd-main/src/home/homectl-pkcs11.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "errno-util.h"
#include "format-table.h"
#include "hexdecoct.h"
#include "homectl-pkcs11.h"
#include "libcrypt-util.h"
#include "memory-util.h"
#include "openssl-util.h"
#include "pkcs11-util.h"
#include "random-util.h"
#include "strv.h"
static int add_pkcs11_... | 7,825 | 34.73516 | 117 | c |
null | systemd-main/src/home/homectl-recovery-key.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "errno-util.h"
#include "glyph-util.h"
#include "homectl-recovery-key.h"
#include "libcrypt-util.h"
#include "memory-util.h"
#include "qrcode-util.h"
#include "random-util.h"
#include "recovery-key.h"
#include "strv.h"
#include "terminal-util.h"
static int add... | 5,491 | 32.084337 | 108 | c |
null | systemd-main/src/home/homed-conf.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "conf-parser.h"
#include "constants.h"
#include "home-util.h"
#include "homed-conf.h"
int manager_parse_config_file(Manager *m) {
assert(m);
return config_parse_config_file("homed.conf", "Home\0",
confi... | 1,279 | 28.767442 | 125 | c |
null | systemd-main/src/home/homed-home-bus.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "bus-object.h"
#include "homed-home.h"
int bus_home_client_is_trusted(Home *h, sd_bus_message *message);
int bus_home_get_record_json(Home *h, sd_bus_message *message, char **ret, bool *ret_incomplete);
int bus_home_method_ac... | 1,943 | 54.542857 | 108 | h |
null | systemd-main/src/home/homed-manager.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <openssl/evp.h>
#include "sd-bus.h"
#include "sd-device.h"
#include "sd-event.h"
typedef struct Manager Manager;
#include "hashmap.h"
#include "homed-home.h"
#include "varlink.h"
/* The LUKS free disk space rebalancing logic goes through this s... | 3,272 | 33.819149 | 105 | h |
null | systemd-main/src/home/homed.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
#include <sys/types.h>
#include "bus-log-control-api.h"
#include "daemon-util.h"
#include "homed-manager.h"
#include "homed-manager-bus.h"
#include "log.h"
#include "main-func.h"
#include "service-util.h"
#include "signal-util.h"
static int run(i... | 1,512 | 28.096154 | 101 | c |
null | systemd-main/src/home/homework-directory.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "homework.h"
#include "user-record.h"
int home_setup_directory(UserRecord *h, HomeSetup *setup);
int home_activate_directory(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home);
int home_create_direc... | 522 | 46.545455 | 128 | h |
null | systemd-main/src/home/homework-fido2.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fido.h>
#include "hexdecoct.h"
#include "homework-fido2.h"
#include "libfido2-util.h"
#include "memory-util.h"
#include "strv.h"
int fido2_use_token(
UserRecord *h,
UserRecord *secret,
const Fido2HmacSalt *salt... | 2,277 | 29.373333 | 103 | c |
null | systemd-main/src/home/homework-mount.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
int home_mount_node(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options);
int home_unshare_and_mkdir(void);
int home_unshare_and_mount(const char *node, const char *fstype, bool disc... | 562 | 50.181818 | 133 | h |
null | systemd-main/src/home/homework-password-cache.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "homework-password-cache.h"
#include "keyring-util.h"
#include "missing_syscall.h"
#include "user-record.h"
void password_cache_free(PasswordCache *cache) {
if (!cache)
return;
cache->pkcs11_passwords = strv_free_erase(cache->p... | 1,996 | 33.431034 | 128 | c |
null | systemd-main/src/home/homework-password-cache.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "strv.h"
#include "user-record.h"
typedef struct PasswordCache {
/* Passwords acquired from the kernel keyring */
char **keyring_passswords;
/* Decoding passwords from security tokens is expensive and typically requires us... | 916 | 30.62069 | 104 | h |
null | systemd-main/src/home/homework-quota.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/quota.h>
#include "blockdev-util.h"
#include "btrfs-util.h"
#include "errno-util.h"
#include "format-util.h"
#include "homework-quota.h"
#include "missing_magic.h"
#include "quota-util.h"
#include "stat-util.h"
#include "user-util.h"
int home_update_quota... | 4,238 | 32.912 | 134 | c |
null | systemd-main/src/home/user-record-password-quality.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "bus-common-errors.h"
#include "errno-util.h"
#include "home-util.h"
#include "libcrypt-util.h"
#include "password-quality-util.h"
#include "strv.h"
#include "user-record-password-quality.h"
#include "user-record-util.h"
#if HAVE_PASSWDQC || HAVE_PWQUALITY
in... | 2,878 | 31.715909 | 116 | c |
null | systemd-main/src/home/user-record-sign.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <openssl/evp.h>
#include "user-record.h"
int user_record_sign(UserRecord *ur, EVP_PKEY *private_key, UserRecord **ret);
enum {
USER_RECORD_UNSIGNED, /* user record has no signature */
USER_RECORD_SIGNED_EXCLUSIVE, /* ... | 671 | 32.6 | 93 | h |
null | systemd-main/src/hwdb/hwdb.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include "sd-hwdb.h"
#include "alloc-util.h"
#include "build.h"
#include "hwdb-util.h"
#include "main-func.h"
#include "pretty-print.h"
#include "selinux-util.h"
#include "terminal-util.h"
#include "verbs.h"
static const char *arg_hwdb_bin_dir = N... | 3,717 | 26.540741 | 99 | c |
null | systemd-main/src/id128/id128.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <stdio.h>
#include "alloc-util.h"
#include "build.h"
#include "gpt.h"
#include "id128-print.h"
#include "main-func.h"
#include "pretty-print.h"
#include "strv.h"
#include "format-table.h"
#include "terminal-util.h"
#include "verbs.h"
stati... | 8,686 | 31.905303 | 114 | c |
null | systemd-main/src/import/curl-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include "alloc-util.h"
#include "curl-util.h"
#include "fd-util.h"
#include "locale-util.h"
#include "string-util.h"
#include "version.h"
static void curl_glue_check_finished(CurlGlue *g) {
CURLMsg *msg;
int k = 0;
assert(g... | 10,440 | 26.119481 | 120 | c |
null | systemd-main/src/import/curl-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <curl/curl.h>
#include <sys/types.h>
#include "sd-event.h"
#include "hashmap.h"
#include "time-util.h"
typedef struct CurlGlue CurlGlue;
struct CurlGlue {
sd_event *event;
CURLM *curl;
sd_event_source *timer;
Has... | 1,175 | 28.4 | 89 | h |
null | systemd-main/src/import/export-raw.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/sendfile.h>
#include "sd-daemon.h"
#include "alloc-util.h"
#include "btrfs-util.h"
#include "copy.h"
#include "export-raw.h"
#include "fd-util.h"
#include "fs-util.h"
#include "import-common.h"
#include "missing_fcntl.h"
#include "ratelimit.h"
#include "... | 8,682 | 25.716923 | 119 | c |
null | systemd-main/src/import/export-raw.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "import-compress.h"
#include "macro.h"
typedef struct RawExport RawExport;
typedef void (*RawExportFinished)(RawExport *export, int error, void *userdata);
int raw_export_new(RawExport **export, sd_event *event, RawExportF... | 563 | 28.684211 | 103 | h |
null | systemd-main/src/import/export-tar.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-daemon.h"
#include "alloc-util.h"
#include "btrfs-util.h"
#include "export-tar.h"
#include "fd-util.h"
#include "import-common.h"
#include "process-util.h"
#include "ratelimit.h"
#include "string-util.h"
#include "tmpfile-util.h"
#define COPY_BUFFER_SIZE ... | 9,017 | 26.577982 | 131 | c |
null | systemd-main/src/import/export-tar.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "import-compress.h"
#include "macro.h"
typedef struct TarExport TarExport;
typedef void (*TarExportFinished)(TarExport *export, int error, void *userdata);
int tar_export_new(TarExport **export, sd_event *event, TarExportF... | 563 | 28.684211 | 103 | h |
null | systemd-main/src/import/import-common.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <sys/types.h>
#include "sd-event.h"
typedef enum ImportFlags {
IMPORT_FORCE = 1 << 0, /* replace existing image */
IMPORT_READ_ONLY = 1 << 1, /* make generated image read-only */
IMPORT_BTRFS_SUBVOL = 1 << ... | 1,265 | 42.655172 | 127 | h |
null | systemd-main/src/import/import-compress.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "import-compress.h"
#include "string-table.h"
void import_compress_free(ImportCompress *c) {
assert(c);
if (c->type == IMPORT_COMPRESS_XZ)
lzma_end(&c->xz);
else if (c->type == IMPORT_COMPRESS_GZIP) {
if... | 14,067 | 28.36952 | 133 | c |
null | systemd-main/src/import/import-compress.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if HAVE_BZIP2
#include <bzlib.h>
#endif
#include <lzma.h>
#include <sys/types.h>
#include <zlib.h>
#include "macro.h"
typedef enum ImportCompressType {
IMPORT_COMPRESS_UNKNOWN,
IMPORT_COMPRESS_UNCOMPRESSED,
IMPORT_COMPRESS_XZ,
... | 1,586 | 31.387755 | 132 | h |
null | systemd-main/src/import/import-fs.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <locale.h>
#include "alloc-util.h"
#include "build.h"
#include "btrfs-util.h"
#include "discover-image.h"
#include "fd-util.h"
#include "format-util.h"
#include "fs-util.h"
#include "hostname-util.h"
#include "import-common.h"
#include "imp... | 13,691 | 33.839695 | 125 | c |
null | systemd-main/src/import/import-raw.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "import-common.h"
#include "import-util.h"
#include "macro.h"
typedef struct RawImport RawImport;
typedef void (*RawImportFinished)(RawImport *import, int error, void *userdata);
int raw_import_new(RawImport **import, sd_e... | 632 | 30.65 | 127 | h |
null | systemd-main/src/import/import-tar.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "import-common.h"
#include "import-util.h"
#include "macro.h"
typedef struct TarImport TarImport;
typedef void (*TarImportFinished)(TarImport *import, int error, void *userdata);
int tar_import_new(TarImport **import, sd_e... | 601 | 29.1 | 127 | h |
null | systemd-main/src/import/pull-job.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <sys/stat.h>
#include "curl-util.h"
#include "import-compress.h"
#include "macro.h"
#include "openssl-util.h"
#include "pull-common.h"
typedef struct PullJob PullJob;
typedef void (*PullJobFinished)(PullJob *job);
typedef int (*PullJobOpenDisk)(... | 2,361 | 24.12766 | 90 | h |
null | systemd-main/src/import/pull-tar.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <curl/curl.h>
#include <sys/prctl.h>
#include "sd-daemon.h"
#include "alloc-util.h"
#include "btrfs-util.h"
#include "copy.h"
#include "curl-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "hostname-util.h"
#include "import-common.h"
#include "impo... | 22,203 | 31.749263 | 127 | c |
null | systemd-main/src/import/pull-tar.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "import-util.h"
#include "macro.h"
#include "pull-common.h"
typedef struct TarPull TarPull;
typedef void (*TarPullFinished)(TarPull *pull, int error, void *userdata);
int tar_pull_new(TarPull **pull, sd_event *event, const... | 613 | 29.7 | 130 | h |
null | systemd-main/src/import/qcow2-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <zlib.h>
#include "alloc-util.h"
#include "btrfs-util.h"
#include "qcow2-util.h"
#include "sparse-endian.h"
#define QCOW2_MAGIC 0x514649fb
#define QCOW2_COPIED (1ULL << 63)
#define QCOW2_COMPRESSED (1ULL << 62)
#define QCOW2_ZERO (1ULL << 0)
typedef struct ... | 9,956 | 28.811377 | 111 | c |
null | systemd-main/src/import/test-qcow2.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "fd-util.h"
#include "log.h"
#include "qcow2-util.h"
int main(int argc, char *argv[]) {
_cleanup_close_ int sfd = -EBADF, dfd = -EBADF;
int r;
if (argc != 3) {
... | 1,023 | 24.6 | 74 | c |
null | systemd-main/src/initctl/initctl.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <sys/epoll.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "sd-bus.h"
#include "sd-daemon.h"
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-locator.h"
#include... | 10,603 | 28.786517 | 128 | c |
null | systemd-main/src/integritysetup/integrity-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "integrity-util.h"
#include "extract-word.h"
#include "fileio.h"
#include "path-util.h"
#include "percent-util.h"
static int supported_integrity_algorithm(char *user_supplied) {
if (!STR_IN_SET(user_supplied, "crc32", "crc32c", "sha1", "sha256", "hmac... | 4,225 | 47.574713 | 133 | c |
null | systemd-main/src/integritysetup/integrity-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdint.h>
#include "cryptsetup-util.h"
#include "time-util.h"
int parse_integrity_options(
const char *options,
uint32_t *ret_activate_flags,
int *ret_percent,
usec_t *ret_commit_t... | 535 | 25.8 | 90 | h |
null | systemd-main/src/journal-remote/fuzz-journal-remote.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fuzz.h"
#include <sys/mman.h>
#include "sd-journal.h"
#include "env-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "journal-remote.h"
#include "logs-show.h"
#include "memfd-util.h"
#include "path-util.h"
#include "rm-rf.h"
#i... | 3,134 | 31.319588 | 95 | c |
null | systemd-main/src/journal-remote/journal-remote-parse.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "fd-util.h"
#include "journal-remote-parse.h"
#include "journald-native.h"
#include "parse-util.h"
#include "string-util.h"
void source_free(RemoteSource *source) {
if (!source)
return;
journal_importer_... | 2,560 | 27.775281 | 79 | c |
null | systemd-main/src/journal-remote/journal-remote-parse.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "journal-importer.h"
#include "journal-remote-write.h"
typedef struct RemoteSource {
JournalImporter importer;
Writer *writer;
sd_event_source *event;
sd_event_source *buffer_event;
} Remote... | 519 | 23.761905 | 78 | h |
null | systemd-main/src/journal-remote/journal-remote-write.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <libgen.h>
#include "alloc-util.h"
#include "journal-remote.h"
#include "path-util.h"
#include "stat-util.h"
static int do_rotate(ManagedJournalFile **f, MMapCache *m, JournalFileFlags file_flags) {
int r;
r = managed_journal_file_rotate(f, m... | 4,523 | 29.362416 | 131 | c |
null | systemd-main/src/journal-remote/journal-remote-write.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "journal-importer.h"
#include "managed-journal-file.h"
typedef struct RemoteServer RemoteServer;
typedef struct Writer {
ManagedJournalFile *journal;
JournalMetrics metrics;
char *output; /* directory where we wri... | 1,082 | 25.414634 | 76 | h |
null | systemd-main/src/journal-remote/journal-remote.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/prctl.h>
#include <stdint.h>
#include "sd-daemon.h"
#include "af-list.h"
#include "alloc-util.h"
#include "constants.h"
#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "j... | 17,684 | 29.917832 | 115 | c |
null | systemd-main/src/journal-remote/journal-remote.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "hashmap.h"
#include "journal-remote-parse.h"
#include "journal-remote-write.h"
#include "journal-vacuum.h"
#if HAVE_MICROHTTPD
#include "microhttpd-util.h"
typedef struct MHDDaemonWrapper MHDDaemonWrapper;
struct MHDDaemo... | 1,854 | 26.279412 | 88 | h |
null | systemd-main/src/journal-remote/journal-upload-journal.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <curl/curl.h>
#include <stdbool.h>
#include "sd-daemon.h"
#include "alloc-util.h"
#include "journal-upload.h"
#include "log.h"
#include "string-util.h"
#include "utf8.h"
/**
* Write up to size bytes to buf. Return negative on error, and number of
* bytes w... | 14,535 | 34.453659 | 103 | c |
null | systemd-main/src/journal-remote/journal-upload.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include "sd-event.h"
#include "sd-journal.h"
#include "time-util.h"
typedef enum {
ENTRY_CURSOR = 0, /* Nothing actually written yet. */
ENTRY_REALTIME,
ENTRY_MONOTONIC,
ENTRY_BOOT_ID,
... | 2,215 | 28.546667 | 77 | h |
null | systemd-main/src/journal-remote/microhttpd-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <microhttpd.h>
#include <stdarg.h>
#include "macro.h"
/* Those defines are added when options are renamed. If the old names
* are not '#define'd, then they are not deprecated yet and there are
* enum elements with the same name. Hence let's che... | 2,851 | 31.044944 | 87 | h |
null | systemd-main/src/journal/cat.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-journal.h"
#include "alloc-util.h"
#include "build.h"
#include "fd-util.h"
#include "format-util.h"
#include "main-f... | 6,595 | 34.462366 | 117 | c |
null | systemd-main/src/journal/fuzz-journald-kmsg.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fuzz.h"
#include "fuzz-journald.h"
#include "journald-kmsg.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
Server s;
if (size == 0)
return 0;
/* We don't want to fill the logs with assert warnings.
... | 602 | 24.125 | 63 | c |
null | systemd-main/src/journal/fuzz-journald-native-fd.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fd-util.h"
#include "fs-util.h"
#include "fuzz-journald.h"
#include "fuzz.h"
#include "journald-native.h"
#include "memfd-util.h"
#include "process-util.h"
#include "tmpfile-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
Server... | 1,397 | 30.066667 | 88 | c |
null | systemd-main/src/journal/fuzz-journald-stream.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/sockios.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "fd-util.h"
#include "fuzz.h"
#include "fuzz-journald.h"
#include "journald-stream.h"
static int stream_fds[2] = PIPE_EBADF;
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
... | 1,120 | 28.5 | 99 | c |
null | systemd-main/src/journal/journald-audit.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <malloc.h>
#include "alloc-util.h"
#include "audit-type.h"
#include "errno-util.h"
#include "fd-util.h"
#include "hexdecoct.h"
#include "io-util.h"
#include "journal-internal.h"
#include "journald-audit.h"
#include "missing_audit.h"
#include "string-util.h"
t... | 18,459 | 32.141831 | 122 | c |
null | systemd-main/src/journal/journald-console.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/socket.h>
#include <time.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "io-util.h"
#include "journald-console.h"
#include "journald-server.h"
#include "parse-util.h"
#include "proc... | 3,627 | 32.592593 | 119 | c |
null | systemd-main/src/journal/journald-context.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "sd-id128.h"
#include "set.h"
#include "time-util.h"
typedef struct ClientContext ClientContext;
#include "journald-server.h"
struct ClientContext {
unsigned n_ref;
... | 2,540 | 22.747664 | 87 | h |
null | systemd-main/src/journal/journald-native.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "journald-server.h"
void server_process_native_message(
Server *s,
const char *buffer,
size_t buffer_size,
const struct ucred *ucred,
const struct timeval *tv,
... | 693 | 27.916667 | 68 | h |
null | systemd-main/src/journal/journald-wall.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "format-util.h"
#include "journald-server.h"
#include "journald-wall.h"
#include "process-util.h"
#include "string-util.h"
#include "utmp-wtmp.h"
void server_forward_wall(
Server *s,
int priority,
... | 1,490 | 26.109091 | 107 | c |
null | systemd-main/src/journal/journald.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <unistd.h>
#include "sd-daemon.h"
#include "sd-messages.h"
#include "format-util.h"
#include "journal-authenticate.h"
#include "journald-kmsg.h"
#include "journald-server.h"
#include "journald-syslog.h"
#include "process-util.h"
#include "sigbus.h"
int main(... | 4,948 | 34.604317 | 126 | c |
null | systemd-main/src/journal/managed-journal-file.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <pthread.h>
#include <unistd.h>
#include "chattr-util.h"
#include "copy.h"
#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "journal-authenticate.h"
#include "managed-journal-file.h"
#include "path-util.h"
#include "random-util.h"... | 22,618 | 37.864261 | 130 | c |
null | systemd-main/src/journal/test-journal-append.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
#include <unistd.h>
#include "chattr-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "io-util.h"
#include "log.h"
#include "managed-journal-file.h"
#include "mmap-cache.h"
#include "parse-util.h"
#inc... | 11,513 | 41.175824 | 121 | c |
null | systemd-main/src/journal/test-journal-config.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdbool.h>
#include "journald-server.h"
#include "tests.h"
#define _COMPRESS_PARSE_CHECK(str, enab, thresh, varname) \
do { \
JournalCompressOptions varname = {t... | 2,064 | 39.490196 | 114 | c |
null | systemd-main/src/journal/test-journal-flush.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <unistd.h>
#include "sd-journal.h"
#include "alloc-util.h"
#include "chattr-util.h"
#include "journal-internal.h"
#include "macro.h"
#include "managed-journal-file.h"
#include "path-util.h"
#include "rm-rf.h"
#include "string-util.h"
#inclu... | 2,712 | 31.686747 | 109 | c |
null | systemd-main/src/journal/test-journal-interleaving.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <unistd.h>
#include "sd-id128.h"
#include "sd-journal.h"
#include "alloc-util.h"
#include "chattr-util.h"
#include "io-util.h"
#include "journal-vacuum.h"
#include "log.h"
#include "managed-journal-file.h"
#include "parse-util.h"
#include "... | 15,140 | 34.625882 | 133 | c |
null | systemd-main/src/journal/test-journal-syslog.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "journald-syslog.h"
#include "macro.h"
#include "string-util.h"
#include "syslog-util.h"
#include "tests.h"
static void test_syslog_parse_identifier_one(const char *str,
const char *ident, const ... | 3,172 | 43.690141 | 105 | c |
null | systemd-main/src/libsystemd-network/arp-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/***
Copyright © 2014 Axis Communications AB. All rights reserved.
***/
#include <arpa/inet.h>
#include <linux/filter.h>
#include <netinet/if_ether.h>
#include "arp-util.h"
#include "ether-addr-util.h"
#include "fd-util.h"
#include "in-addr-util.h"
#include "unaligne... | 7,287 | 51.057143 | 131 | c |
null | systemd-main/src/libsystemd-network/arp-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2014 Axis Communications AB. All rights reserved.
***/
#include <net/ethernet.h>
#include <netinet/in.h>
#include "socket-util.h"
#include "sparse-endian.h"
int arp_update_filter(int fd, const struct in_addr *a, const struct ether_addr... | 1,105 | 28.891892 | 100 | h |
null | systemd-main/src/libsystemd-network/dhcp-identifier.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-device.h"
#include "sd-id128.h"
#include "ether-addr-util.h"
#include "macro.h"
#include "sparse-endian.h"
#include "time-util.h"
#include "unaligned.h"
#define SYSTEMD_PEN 43793
typedef enum DUIDType {
DUID_TYPE_LLT = 1,
... | 2,285 | 29.078947 | 88 | h |
null | systemd-main/src/libsystemd-network/dhcp-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2013 Intel Corporation. All rights reserved.
***/
#include <linux/if_packet.h>
#include <net/ethernet.h>
#include <stdint.h>
#include "sd-dhcp-client.h"
#include "dhcp-protocol.h"
#include "ether-addr-util.h"
#include "network-common.h... | 3,755 | 38.957447 | 121 | h |
null | systemd-main/src/libsystemd-network/dhcp-lease-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2013 Intel Corporation. All rights reserved.
***/
#include "sd-dhcp-client.h"
#include "dhcp-internal.h"
#include "dhcp-protocol.h"
#include "list.h"
struct sd_dhcp_route {
struct in_addr dst_addr;
struct in_addr gw_add... | 2,254 | 23.78022 | 103 | h |
null | systemd-main/src/libsystemd-network/dhcp-packet.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/***
Copyright © 2013 Intel Corporation. All rights reserved.
***/
#include <errno.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <string.h>
#include "dhcp-internal.h"
#include "dhcp-protocol.h"
#include "memory-util.h"
#define DHCP_CLIENT_MIN_OPTIONS... | 6,712 | 33.963542 | 119 | c |
null | systemd-main/src/libsystemd-network/dhcp-protocol.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2013 Intel Corporation. All rights reserved.
***/
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <stdint.h>
#include "macro.h"
#include "sparse-endian.h"
struct DHCPMessage {
uint8_t op;
uint8_t htype;
... | 3,730 | 32.918182 | 119 | h |
null | systemd-main/src/libsystemd-network/dhcp-server-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2013 Intel Corporation. All rights reserved.
***/
#include "sd-dhcp-server.h"
#include "sd-event.h"
#include "dhcp-internal.h"
#include "network-common.h"
#include "ordered-set.h"
#include "time-util.h"
typedef enum DHCPRawOption {
... | 3,807 | 27.631579 | 76 | h |
null | systemd-main/src/libsystemd-network/dhcp6-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2014-2015 Intel Corporation. All rights reserved.
***/
#include <net/ethernet.h>
#include <netinet/in.h>
#include "sd-event.h"
#include "sd-dhcp6-client.h"
#include "dhcp-identifier.h"
#include "dhcp6-option.h"
#include "dhcp6-protocol... | 3,240 | 29.575472 | 88 | h |
null | systemd-main/src/libsystemd-network/dhcp6-lease-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2014-2015 Intel Corporation. All rights reserved.
***/
#include <inttypes.h>
#include "sd-dhcp6-lease.h"
#include "dhcp6-option.h"
#include "macro.h"
#include "time-util.h"
struct sd_dhcp6_lease {
unsigned n_ref;
uint... | 2,714 | 35.689189 | 103 | h |
null | systemd-main/src/libsystemd-network/dhcp6-network.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/***
Copyright © 2014 Intel Corporation. All rights reserved.
***/
#include <errno.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/if_packet.h>
#include "dhcp6-inter... | 2,123 | 25.886076 | 85 | c |
null | systemd-main/src/libsystemd-network/dhcp6-option.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-dhcp6-client.h"
#include "hash-funcs.h"
#include "list.h"
#include "macro.h"
#include "ordered-set.h"
#include "sparse-endian.h"
typedef struct sd_dhcp6_option {
unsigned n_ref;
uint32_t enterprise_identifier;
uint16_... | 3,213 | 29.320755 | 97 | h |
null | systemd-main/src/libsystemd-network/dhcp6-protocol.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dhcp6-protocol.h"
#include "string-table.h"
static const char * const dhcp6_state_table[_DHCP6_STATE_MAX] = {
[DHCP6_STATE_STOPPED] = "stopped",
[DHCP6_STATE_INFORMATION_REQUEST] = "information-request",
[DHCP6_STATE_SOLICI... | 5,145 | 52.051546 | 85 | c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.