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/libsystemd/sd-netlink/netlink-types-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "macro.h"
#include "netlink-types.h"
/* C.f. see 'struct nla_policy' at include/net/netlink.h. */
struct NLAPolicy {
NLAType type;
size_t size;
union {
const NLAPolicySet *policy_set;
const N... | 2,722 | 39.641791 | 99 | h |
null | systemd-main/src/libsystemd/sd-netlink/netlink-types-nfnl.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if.h>
#include <linux/netfilter/nf_tables.h>
#include <linux/netfilter/nfnetlink.h>
#include "netlink-types-internal.h"
static const NLAPolicy nfnl_nft_table_policies[] = {
[NFTA_TABLE_NAME] = BUILD_POLICY_WITH_SIZE(STRING, NFT_TABLE_MAXNAMELE... | 7,894 | 39.487179 | 109 | c |
null | systemd-main/src/libsystemd/sd-netlink/netlink-types.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/netlink.h>
#include "netlink-genl.h"
#include "netlink-internal.h"
#include "netlink-types-internal.h"
static const NLAPolicy empty_policies[1] = {
/* fake array to avoid .types==NULL, which denotes invalid type-systems */
};
DEFINE_POLICY_SET... | 4,786 | 30.084416 | 126 | c |
null | systemd-main/src/libsystemd/sd-netlink/netlink-types.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include "sd-netlink.h"
typedef enum NLAType {
NETLINK_TYPE_UNSPEC, /* NLA_UNSPEC */
NETLINK_TYPE_BINARY, /* NLA_BINARY */
NETLINK_TYPE_FLAG, /* NLA_FLAG... | 2,974 | 45.484375 | 126 | h |
null | systemd-main/src/libsystemd/sd-netlink/netlink-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <linux/rtnetlink.h>
#include "sd-netlink.h"
#include "ether-addr-util.h"
#include "in-addr-util.h"
#include "ordered-set.h"
#include "socket-util.h"
/* See struct rtvia in rtnetlink.h */
typedef struct RouteVia {
uint16_t family;
... | 5,618 | 49.169643 | 130 | h |
null | systemd-main/src/libsystemd/sd-network/network-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-network.h"
#include "alloc-util.h"
#include "network-util.h"
#include "string-table.h"
#include "strv.h"
bool network_is_online(void) {
_cleanup_free_ char *online_state = NULL;
LinkOnlineState state;
int r;
r = sd_network... | 5,294 | 32.512658 | 95 | c |
null | systemd-main/src/libsystemd/sd-network/network-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include <stdbool.h>
#include "macro.h"
bool network_is_online(void);
typedef enum AddressFamily {
/* This is a bitmask, though it usually doesn't feel that way! */
ADDRESS_FAMILY_NO = 0,
ADDRESS_FAM... | 3,249 | 36.356322 | 93 | h |
null | systemd-main/src/libsystemd/sd-network/sd-network.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <poll.h>
#include <sys/inotify.h>
#include "sd-network.h"
#include "alloc-util.h"
#include "env-file.h"
#include "fd-util.h"
#include "fs-util.h"
#include "inotify-util.h"
#include "macro.h"
#include "parse-util.h"
#include "stdio-util.h"
#... | 12,943 | 26.956803 | 87 | c |
null | systemd-main/src/libsystemd/sd-path/sd-path.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-path.h"
#include "alloc-util.h"
#include "architecture.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "nulstr-util.h"
#include "path-lookup.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
#include "user-util.... | 21,040 | 28.67701 | 108 | c |
null | systemd-main/src/libsystemd/sd-resolve/resolve-private.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-resolve.h"
int resolve_getaddrinfo_with_destroy_callback(
sd_resolve *resolve, sd_resolve_query **q,
const char *node, const char *service, const struct addrinfo *hints,
sd_resolve_getaddrinfo_ha... | 2,391 | 58.8 | 115 | h |
null | systemd-main/src/libsystemd/sd-resolve/test-resolve.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <arpa/inet.h>
#include <errno.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <resolv.h>
#include <stdio.h>
#include "sd-resolve.h"
#include "alloc-util.h"
#include "macro.h"
#include "socket-util.h"
#include "string-util.h"
#include "time-util.h"... | 3,603 | 32.06422 | 128 | c |
null | systemd-main/src/libudev/libudev-enumerate.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <dirent.h>
#include <errno.h>
#include <fnmatch.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "libudev.h"
#include "sd-device.h"
#include "alloc-util.h"
#include "device-e... | 13,112 | 27.568627 | 128 | c |
null | systemd-main/src/libudev/libudev-hwdb.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "sd-hwdb.h"
#include "alloc-util.h"
#include "hwdb-util.h"
#include "libudev-list-internal.h"
/**
* SECTION:libudev-hwdb
* @short_description: retrieve properties from the hardware database
*
* Libudev hardware database interface.
*/
... | 3,190 | 24.733871 | 132 | c |
null | systemd-main/src/libudev/libudev-list-internal.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "libudev.h"
#include "macro.h"
struct udev_list;
struct udev_list *udev_list_new(bool unique);
void udev_list_cleanup(struct udev_list *list);
struct udev_list *udev_list_free(struct udev_list *list);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_list... | 517 | 29.470588 | 105 | h |
null | systemd-main/src/libudev/libudev-list.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "hashmap.h"
#include "libudev-list-internal.h"
#include "list.h"
#include "sort-util.h"
/**
* SECTION:libudev-list
* @short_description: list operation
*
* Libudev list operations.
*/
/**
* udev_list_entry:
*
* Opaque object re... | 6,502 | 26.555085 | 116 | c |
null | systemd-main/src/libudev/libudev-queue.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/***
Copyright © 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
***/
#include <errno.h>
#include <unistd.h>
#include "libudev.h"
#include "alloc-util.h"
#include "fd-util.h"
#include "io-util.h"
#include "udev-util.h"
/**
* SECTION:libudev-queue
* @short_descrip... | 5,518 | 23.100437 | 115 | c |
null | systemd-main/src/libudev/libudev-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "device-nodes.h"
#include "libudev-util.h"
/**
* SECTION:libudev-util
* @short_description: utils
*
* Utilities useful when dealing with devices and device node names.
*/
/**
* udev_util_encode_string:
* @str: input string to be encoded
* @str_enc: ou... | 804 | 27.75 | 82 | c |
null | systemd-main/src/libudev/libudev-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "libudev.h"
#include "macro.h"
/* Cleanup functions */
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_enumerate*, udev_enumerate_... | 531 | 34.466667 | 74 | h |
null | systemd-main/src/libudev/libudev.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <ctype.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include "libudev.h"
#include "alloc-util.h"
#include "fd-util.h"
#include "string-util.h"
/**
* SECTION:libudev
* @short_description: libudev context
*/
/**
* udev... | 3,478 | 21.445161 | 100 | c |
null | systemd-main/src/libudev/test-libudev.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <getopt.h>
#include <sys/epoll.h>
#include <unistd.h>
#include "alloc-util.h"
#include "devnum-util.h"
#include "fd-util.h"
#include "libudev-list-internal.h"
#include "libudev-util.h"
#include "log.h"
#include "main-func.h"
#include "stdio-... | 18,173 | 35.567404 | 107 | c |
null | systemd-main/src/libudev/test-udev-device-thread.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include "libudev.h"
#define handle_error_errno(error, msg) \
({ \
errno = abs(error); ... | 1,583 | 29.461538 | 93 | c |
null | systemd-main/src/locale/localed-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <sys/stat.h>
#include "sd-bus.h"
#include "hashmap.h"
#include "locale-setup.h"
typedef struct X11Context {
char *layout;
char *model;
char *variant;
char *options;
} X11Context;
typedef struct VCContext {
... | 2,596 | 31.061728 | 90 | h |
null | systemd-main/src/locale/test-localed-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "localed-util.h"
#include "log.h"
#include "string-util.h"
#include "tests.h"
TEST(find_language_fallback) {
_cleanup_free_ char *ans = NULL, *ans2 = NULL;
assert_se(find_language_fallback("foobar", &ans) == 0);
... | 8,158 | 36.948837 | 103 | c |
null | systemd-main/src/locale/xkbcommon-util.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dlfcn-util.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
#include "xkbcommon-util.h"
#if HAVE_XKBCOMMON
static void *xkbcommon_dl = NULL;
struct xkb_context* (*sym_xkb_context_new)(enum xkb_context_flags flags);
void (*sym_xkb_context_unref... | 2,847 | 34.160494 | 104 | c |
null | systemd-main/src/locale/xkbcommon-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if HAVE_XKBCOMMON
#include <xkbcommon/xkbcommon.h>
extern struct xkb_context* (*sym_xkb_context_new)(enum xkb_context_flags flags);
extern void (*sym_xkb_context_unref)(struct xkb_context *context);
extern void (*sym_xkb_context_set_log_fn)(
... | 1,104 | 34.645161 | 117 | h |
null | systemd-main/src/login/logind-action.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <unistd.h>
#include "sd-messages.h"
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-util.h"
#include "conf-parser.h"
#include "format-util.h"
#include "logind-action.h"
#include "logind-dbus.h"
#include "logind-session-dbus.h"
#include "process-u... | 15,655 | 51.013289 | 125 | c |
null | systemd-main/src/login/logind-action.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
typedef enum HandleAction {
HANDLE_IGNORE,
HANDLE_POWEROFF,
HANDLE_REBOOT,
HANDLE_HALT,
HANDLE_KEXEC,
HANDLE_SOFT_REBOOT,
HANDLE_SUSPEND,
HANDLE_HIBERNATE,
HAN... | 1,654 | 26.131148 | 66 | h |
null | systemd-main/src/login/logind-brightness.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "bus-util.h"
#include "device-util.h"
#include "hash-funcs.h"
#include "logind-brightness.h"
#include "logind.h"
#include "process-util.h"
#include "stdio-util.h"
/* Brightness and LED devices tend to be very slow to write to (often being I2C and such). Writes... | 8,374 | 32.366534 | 128 | c |
null | systemd-main/src/login/logind-device.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <string.h>
#include "alloc-util.h"
#include "logind-device.h"
#include "logind-seat-dbus.h"
Device* device_new(Manager *m, const char *sysfs, bool master) {
Device *d;
assert(m);
assert(sysfs);
d = new0(Device, 1);
if... | 2,631 | 24.066667 | 79 | c |
null | systemd-main/src/login/logind-device.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef struct Device Device;
#include "list.h"
#include "logind-seat.h"
#include "logind-session-device.h"
struct Device {
Manager *manager;
char *sysfs;
Seat *seat;
bool master;
dual_timestamp timestamp;
... | 547 | 20.076923 | 63 | h |
null | systemd-main/src/login/logind-inhibit.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
#include "env-file.h"
#include "errno-list.h"
#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "f... | 14,565 | 26.692015 | 116 | c |
null | systemd-main/src/login/logind-polkit.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "bus-polkit.h"
#include "logind-polkit.h"
#include "missing_capability.h"
#include "user-util.h"
int check_polkit_chvt(sd_bus_message *message, Manager *manager, sd_bus_error *error) {
#if ENABLE_POLKIT
return bus_verify_polkit_async(
... | 858 | 33.36 | 107 | c |
null | systemd-main/src/login/logind-seat-dbus.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-label.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "logind-dbus.h"
#include "logind-polkit.h"
#include "logind-seat-dbus.h"
#include "lo... | 13,685 | 29.893905 | 134 | c |
null | systemd-main/src/login/logind-seat.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-messages.h"
#include "alloc-util.h"
#include "devnode-acl.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#in... | 17,081 | 24.457526 | 101 | c |
null | systemd-main/src/login/logind-seat.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef struct Seat Seat;
#include "list.h"
#include "logind-session.h"
struct Seat {
Manager *manager;
char *id;
char *state_file;
LIST_HEAD(Device, devices);
Session *active;
Session *pending_switch;
... | 1,856 | 23.76 | 66 | h |
null | systemd-main/src/login/logind-session-dbus.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "bus-object.h"
#include "logind-session.h"
extern const BusObjectImplementation session_object;
char *session_bus_path(Session *s);
int session_send_signal(Session *s, bool new_session);
int session_send_changed(Session *s, ... | 896 | 36.375 | 95 | h |
null | systemd-main/src/login/logind-session-device.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include "sd-device.h"
#include "sd-daemon.h"
#include "alloc-util.h"
#include "bus-util.h"
#include "daemon-util.h"
#include "fd-util.h"
#include "logind-session-dbus.h"
#include "lo... | 15,248 | 29.316103 | 134 | c |
null | systemd-main/src/login/logind-session-device.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef enum DeviceType DeviceType;
typedef struct SessionDevice SessionDevice;
#include "list.h"
#include "logind.h"
enum DeviceType {
DEVICE_TYPE_UNKNOWN,
DEVICE_TYPE_DRM,
DEVICE_TYPE_EVDEV,
};
struct SessionDevice {
Ses... | 1,071 | 24.52381 | 85 | h |
null | systemd-main/src/login/logind-session.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef struct Session Session;
typedef enum KillWho KillWho;
#include "list.h"
#include "login-util.h"
#include "logind-user.h"
#include "string-util.h"
typedef enum SessionState {
SESSION_OPENING, /* Session scope is being created */
SE... | 5,027 | 26.47541 | 95 | h |
null | systemd-main/src/login/logind-user-dbus.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "alloc-util.h"
#include "bus-get-properties.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "format-util.h"
#include "logind-dbus.h"
#include "logind-session-dbus.h"
#include "logind-user-dbus.h"
#include "logind-user.h"
#include "... | 12,816 | 29.372038 | 134 | c |
null | systemd-main/src/login/logind-user.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef struct User User;
#include "conf-parser.h"
#include "list.h"
#include "logind.h"
#include "user-record.h"
typedef enum UserState {
USER_OFFLINE, /* Not logged in at all */
USER_OPENING, /* Is logging in */
USER_LINGER... | 2,480 | 31.644737 | 116 | h |
null | systemd-main/src/login/logind-utmp.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <unistd.h>
#include "sd-messages.h"
#include "alloc-util.h"
#include "audit-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-util.h"
#include "event-util.h"
#include "format-util.h"
#include "logind.h"
#include "p... | 5,472 | 30.819767 | 108 | c |
null | systemd-main/src/login/logind.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include <sys/stat.h>
#include "sd-bus.h"
#include "sd-device.h"
#include "sd-event.h"
#include "conf-parser.h"
#include "hashmap.h"
#include "list.h"
#include "set.h"
#include "time-util.h"
#include "user-record.h"
typedef struct Ma... | 5,926 | 30.359788 | 110 | h |
null | systemd-main/src/login/test-inhibit.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <unistd.h>
#include <fcntl.h>
#include "sd-bus.h"
#include "bus-locator.h"
#include "bus-util.h"
#include "fd-util.h"
#include "macro.h"
static int inhibit(sd_bus *bus, const char *what) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL... | 2,317 | 26.927711 | 108 | c |
null | systemd-main/src/login/test-login-tables.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "logind-action.h"
#include "logind-session.h"
#include "test-tables.h"
int main(int argc, char **argv) {
test_table(handle_action, HANDLE_ACTION);
test_table(inhibit_mode, INHIBIT_MODE);
test_table(kill_who, KILL_WHO);
test_tabl... | 527 | 28.333333 | 49 | c |
null | systemd-main/src/login/test-session-properties.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Usage:
* ./test-session-properties <SESSION-OBJECT-PATH> [<TTY>]
* e.g.,
* ./test-session-properties /org/freedesktop/login1/session/_32 /dev/tty2
*/
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
#include "bus-common-error... | 8,108 | 40.798969 | 115 | c |
null | systemd-main/src/machine/image-dbus.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "bus-object.h"
#include "machined.h"
extern const BusObjectImplementation image_object;
char *image_bus_path(const char *name);
int bus_image_method_remove(sd_bus_message *message, void *userdata, sd_bus_error *error);
int bus_image_method_renam... | 1,064 | 52.25 | 100 | h |
null | systemd-main/src/machine/machine-dbus.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "bus-util.h"
#include "machine.h"
typedef enum {
MACHINE_COPY_REPLACE = 1 << 0, /* Public API via DBUS, do not change */
_MACHINE_COPY_FLAGS_MASK_PUBLIC = MACHINE_COPY_REPLACE,
} MachineCopyFlags;
extern const... | 1,687 | 50.151515 | 105 | h |
null | systemd-main/src/machine/machine.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef struct Machine Machine;
typedef enum KillWho KillWho;
#include "list.h"
#include "machined.h"
#include "operation.h"
#include "time-util.h"
typedef enum MachineState {
MACHINE_OPENING, /* Machine is being registered */
MACHINE_R... | 2,790 | 26.097087 | 87 | h |
null | systemd-main/src/machine/machined-core.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "machined.h"
#include "nscd-flush.h"
#include "strv.h"
#include "user-util.h"
#if ENABLE_NSCD
static int on_nscd_cache_flush_event(sd_event_source *s, void *userdata) {
/* Let's ask glibc's nscd daemon to flush its caches. We request this for the three... | 3,293 | 29.785047 | 118 | c |
null | systemd-main/src/machine/machined.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "cgroup-util.h"
#include "c... | 11,360 | 29.296 | 132 | c |
null | systemd-main/src/machine/machined.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "sd-bus.h"
#include "sd-event.h"
typedef struct Manager Manager;
#include "hashmap.h"
#include "image-dbus.h"
#include "list.h"
#include "machine-dbus.h"
#include "machine.h"
#include "operation.h"
#include "varlink.h"
stru... | 2,163 | 29.914286 | 109 | h |
null | systemd-main/src/machine/operation.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/wait.h>
#include <unistd.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "operation.h"
#include "process-util.h"
static int operation_done(sd_event_source *s, const siginfo_t *si, void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_err... | 3,978 | 27.625899 | 124 | c |
null | systemd-main/src/machine/operation.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <sys/types.h>
#include "sd-bus.h"
#include "sd-event.h"
#include "list.h"
typedef struct Operation Operation;
#include "machined.h"
#define OPERATIONS_MAX 64
struct Operation {
Manager *manager;
Machine *machine;
pid_t... | 775 | 23.25 | 123 | h |
null | systemd-main/src/modules-load/modules-load.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <getopt.h>
#include <limits.h>
#include <sys/stat.h>
#include "build.h"
#include "conf-files.h"
#include "constants.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
#include "main-func.h"
#include "module-util.h"
#include "pretty... | 6,232 | 26.702222 | 92 | c |
null | systemd-main/src/network/fuzz-netdev-parser.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fd-util.h"
#include "fs-util.h"
#include "fuzz.h"
#include "networkd-manager.h"
#include "tmpfile-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(manager_freep) Manager *manager = NULL;
_cleanup_fclose_ FILE *f... | 894 | 29.862069 | 87 | c |
null | systemd-main/src/network/fuzz-network-parser.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fd-util.h"
#include "fs-util.h"
#include "fuzz.h"
#include "networkd-manager.h"
#include "tmpfile-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(manager_freep) Manager *manager = NULL;
_cleanup_fclose_ FILE *f... | 918 | 30.689655 | 88 | c |
null | systemd-main/src/network/networkd-address-generation.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
#include "in-addr-util.h"
#include "set.h"
typedef struct Link Link;
int dhcp_pd_generate_addresses(Link *link, const struct in6_addr *prefix, Set **ret);
int ndisc_generate_addresses(Link *link, const struct in6_addr *prefix, uin... | 527 | 34.2 | 114 | h |
null | systemd-main/src/network/networkd-address-label.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
#include <linux/if_addrlabel.h>
#include "alloc-util.h"
#include "netlink-util.h"
#include "networkd-address-label.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-queue.h"
#include "parse-... | 9,517 | 30.832776 | 125 | c |
null | systemd-main/src/network/networkd-address-label.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include "conf-parser.h"
#include "in-addr-util.h"
#include "networkd-util.h"
typedef struct Link Link;
typedef struct Network Network;
typedef struct AddressLabel {
Network *network;
ConfigSection *section;
... | 727 | 22.483871 | 59 | h |
null | systemd-main/src/network/networkd-address-pool.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "networkd-address-pool.h"
#include "networkd-address.h"
#include "networkd-manager.h"
#include "set.h"
#include "string-util.h"
#define RANDOM_PREFIX_TRIAL_MAX 1024
static int address_pool_new(
Manager *m,
... | 4,585 | 25.056818 | 113 | c |
null | systemd-main/src/network/networkd-address.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include "sd-ipv4acd.h"
#include "conf-parser.h"
#include "in-addr-util.h"
#include "networkd-link.h"
#include "networkd-util.h"
#include "time-util.h"
typedef struct Address Address;
typedef ... | 5,521 | 39.014493 | 130 | h |
null | systemd-main/src/network/networkd-bridge-fdb.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/***
Copyright © 2014 Intel Corporation. All rights reserved.
***/
#include <net/ethernet.h>
#include <net/if.h>
#include "alloc-util.h"
#include "bridge.h"
#include "netlink-util.h"
#include "networkd-bridge-fdb.h"
#include "networkd-link.h"
#include "networkd-manag... | 16,170 | 29.169776 | 125 | c |
null | systemd-main/src/network/networkd-bridge-fdb.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2014 Intel Corporation. All rights reserved.
***/
#include <inttypes.h>
#include <linux/neighbour.h>
#include "conf-parser.h"
#include "ether-addr-util.h"
#include "in-addr-util.h"
typedef struct Link Link;
typedef struct Network Netwo... | 1,532 | 26.872727 | 63 | h |
null | systemd-main/src/network/networkd-bridge-mdb.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include "conf-parser.h"
#include "in-addr-util.h"
#include "networkd-util.h"
typedef struct Link Link;
typedef struct Network Network;
typedef struct BridgeMDB {
Network *network;
ConfigSection *section;
in... | 677 | 21.6 | 63 | h |
null | systemd-main/src/network/networkd-bridge-vlan.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2016 BISDN GmbH. All rights reserved.
***/
#include <inttypes.h>
#include "sd-netlink.h"
#include "conf-parser.h"
#define BRIDGE_VLAN_BITMAP_MAX 4096
#define BRIDGE_VLAN_BITMAP_LEN (BRIDGE_VLAN_BITMAP_MAX / 32)
typedef struct Link Li... | 803 | 24.125 | 60 | h |
null | systemd-main/src/network/networkd-can.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
#include <linux/can/netlink.h>
#include "networkd-can.h"
#include "networkd-link.h"
#include "networkd-network.h"
#include "networkd-setlink.h"
#include "parse-util.h"
#include "string-util.h"
#define CAN_TERMINATION_DEFAULT_OHM_VALUE 120
int can_... | 11,682 | 33.667656 | 128 | c |
null | systemd-main/src/network/networkd-can.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <linux/can/netlink.h>
#include "sd-netlink.h"
#include "conf-parser.h"
typedef struct Link Link;
int can_set_netlink_message(Link *link, sd_netlink_message *m);
CONFIG_PARSER_PROTOTYPE(config_parse_can_bitrate);
CONFIG_PARSER_PROTOTYPE(config_... | 511 | 25.947368 | 63 | h |
null | systemd-main/src/network/networkd-conf.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
/***
Copyright © 2014 Vinay Kulkarni <kulkarniv@vmware.com>
***/
#include "conf-parser.h"
#include "constants.h"
#include "networkd-conf.h"
#include "networkd-manager.h"
#include "networkd-speed-meter.h"
int manager_parse_config_file(Manager *m) {
int r;
... | 1,200 | 32.361111 | 101 | c |
null | systemd-main/src/network/networkd-dhcp-common.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <netinet/in.h>
#include "conf-parser.h"
#include "dhcp-identifier.h"
#include "in-addr-util.h"
#include "set.h"
#include "time-util.h"
/* Special values for *_uplink_index. */
#define UPLINK_INDEX_AUTO 0 /* uplink will be selected automatically ... | 4,228 | 36.096491 | 126 | h |
null | systemd-main/src/network/networkd-dhcp-prefix-delegation.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "sd-dhcp-lease.h"
#include "sd-dhcp6-lease.h"
#include "conf-parser.h"
typedef struct Link Link;
bool link_dhcp_pd_is_enabled(Link *link);
bool dhcp_pd_is_uplink(Link *link, Link *target, bool accept_auto);
int dhcp_pd_find... | 787 | 29.307692 | 67 | h |
null | systemd-main/src/network/networkd-dhcp-server-bus.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-util.h"
#include "dhcp-server-internal.h"
#include "networkd-dhcp-server-bus.h"
#include "networkd-link-bus.h"
#include "networkd-manager.h"
#include "strv.h"
static int property_get_leases(
... | 3,834 | 31.5 | 127 | c |
null | systemd-main/src/network/networkd-dhcp-server-static-lease.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include "conf-parser.h"
#include "in-addr-util.h"
typedef struct Network Network;
typedef struct ConfigSection ConfigSection;
typedef struct DHCPStaticLease {
Network *network;
ConfigSection *section;
stru... | 673 | 23.962963 | 64 | h |
null | systemd-main/src/network/networkd-dhcp4.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
typedef struct Link Link;
typedef struct Network Network;
typedef enum DHCPClientIdentifier {
DHCP_CLIENT_ID_MAC,
DHCP_CLIENT_ID_DUID,
/* The following option may not be good for RFC regarding DHCP (3315 an... | 1,328 | 35.916667 | 99 | h |
null | systemd-main/src/network/networkd-dhcp6.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
#include "macro.h"
typedef enum DHCP6ClientStartMode {
DHCP6_CLIENT_START_MODE_NO,
DHCP6_CLIENT_START_MODE_INFORMATION_REQUEST,
DHCP6_CLIENT_START_MODE_SOLICIT,
_DHCP6_CLIENT_START_MODE_MAX,
... | 1,061 | 31.181818 | 79 | h |
null | systemd-main/src/network/networkd-ipv4acd.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h> /* IFF_LOOPBACK */
#include <net/if_arp.h> /* ARPHRD_ETHER */
#include "sd-dhcp-client.h"
#include "sd-ipv4acd.h"
#include "ipvlan.h"
#include "networkd-address.h"
#include "networkd-dhcp4.h"
#include "networkd-ipv4acd.h"
#include "networkd-link.h"... | 9,480 | 27.905488 | 119 | c |
null | systemd-main/src/network/networkd-ipv4ll.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <netinet/in.h>
#include <linux/if.h>
#include "netif-util.h"
#include "networkd-address.h"
#include "networkd-ipv4acd.h"
#include "networkd-ipv4ll.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
#include "parse-util.h"
... | 9,489 | 28.563863 | 120 | c |
null | systemd-main/src/network/networkd-ipv6-proxy-ndp.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <netinet/in.h>
#include <linux/if.h>
#include "netlink-util.h"
#include "networkd-ipv6-proxy-ndp.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
#include "networkd-queue.h"
#include "socket-util.h"
#include "string-uti... | 5,981 | 32.049724 | 115 | c |
null | systemd-main/src/network/networkd-ipv6ll.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if.h>
#include <linux/if_arp.h>
#include "in-addr-util.h"
#include "networkd-address.h"
#include "networkd-ipv6ll.h"
#include "networkd-link.h"
#include "networkd-network.h"
#include "networkd-util.h"
#include "socket-util.h"
#include "string-table.h"
#... | 8,576 | 33.584677 | 119 | c |
null | systemd-main/src/network/networkd-ipv6ll.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include <linux/if_link.h>
#include <stdbool.h>
#include "sd-netlink.h"
#include "conf-parser.h"
#include "macro.h"
typedef struct Link Link;
typedef enum IPv6LinkLocalAddressGenMode {
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_EUI64 ... | 1,499 | 38.473684 | 100 | h |
null | systemd-main/src/network/networkd-link.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <endian.h>
#include <linux/nl80211.h>
#include "sd-bus.h"
#include "sd-device.h"
#include "sd-dhcp-client.h"
#include "sd-dhcp-server.h"
#include "sd-dhcp6-client.h"
#include "sd-ipv4acd.h"
#include "sd-ipv4ll.h"
#include "sd-lldp-rx.h"
#include "... | 7,716 | 29.868 | 110 | h |
null | systemd-main/src/network/networkd-lldp-rx.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
#include <net/if_arp.h>
#include <unistd.h>
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "networkd-link.h"
#include "networkd-lldp-rx.h"
#include "networkd-lldp-tx.h"
#include "networkd-manager.h"
#include "networkd-network... | 5,062 | 28.097701 | 134 | c |
null | systemd-main/src/network/networkd-lldp-rx.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
typedef struct Link Link;
typedef enum LLDPMode {
LLDP_MODE_NO = 0,
LLDP_MODE_YES = 1,
LLDP_MODE_ROUTERS_ONLY = 2,
_LLDP_MODE_MAX,
_LLDP_MODE_INVALID = -EINVAL,
} LLDPMode;
int link_lldp_rx... | 534 | 22.26087 | 53 | h |
null | systemd-main/src/network/networkd-lldp-tx.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
#include <net/if_arp.h>
#include "sd-lldp-tx.h"
#include "networkd-link.h"
#include "networkd-lldp-tx.h"
#include "networkd-manager.h"
#include "parse-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
static bool link_ll... | 4,079 | 28.565217 | 105 | c |
null | systemd-main/src/network/networkd-manager.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-device.h"
#include "sd-event.h"
#include "sd-id128.h"
#include "sd-netlink.h"
#include "sd-resolve.h"
#include "dhcp-identifier.h"
#include "firewall-util.h"
#include "hashmap.h"
#include "networkd-link.h"
#include "network... | 3,177 | 24.629032 | 64 | h |
null | systemd-main/src/network/networkd-ndisc.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
#include "time-util.h"
typedef struct Link Link;
typedef struct Network Network;
typedef enum IPv6AcceptRAStartDHCP6Client {
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO,
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS,
I... | 1,817 | 30.344828 | 74 | h |
null | systemd-main/src/network/networkd-neighbor.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "hashmap.h"
#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-neighbor.h"
#include "networkd-network.h"
#include "networkd-queue.h"
#include "set.h"
Neighbor *neighbor_free(Neighbor *n... | 21,834 | 31.016129 | 133 | c |
null | systemd-main/src/network/networkd-neighbor.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "sd-netlink.h"
#include "conf-parser.h"
#include "ether-addr-util.h"
#include "in-addr-util.h"
#include "networkd-util.h"
typedef struct Link Link;
typedef struct Manager Manager;
typedef struct Network Network;
typedef str... | 1,142 | 24.4 | 93 | h |
null | systemd-main/src/network/networkd-netlabel.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "escape.h"
#include "netlink-util.h"
#include "networkd-address.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-netlabel.h"
#include "networkd-network.h"
static int netlabel_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *... | 4,775 | 36.023256 | 134 | c |
null | systemd-main/src/network/networkd-network-bus.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "ether-addr-util.h"
#include "networkd-manager.h"
#include "networkd-network-bus.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
static int property_get_hw_addrs(
sd_bus *bus,
const c... | 4,237 | 28.227586 | 130 | c |
null | systemd-main/src/network/networkd-network.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <linux/nl80211.h>
#include "sd-bus.h"
#include "sd-device.h"
#include "sd-lldp-tx.h"
#include "bridge.h"
#include "condition.h"
#include "conf-parser.h"
#include "hashmap.h"
#include "ipoib.h"
#include "net-condition.h"
#include "netdev.h"
#inclu... | 14,057 | 33.121359 | 110 | h |
null | systemd-main/src/network/networkd-nexthop.h | /* SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright © 2019 VMware, Inc.
*/
#pragma once
#include <inttypes.h>
#include "sd-netlink.h"
#include "conf-parser.h"
#include "hashmap.h"
#include "in-addr-util.h"
#include "networkd-util.h"
typedef struct Link Link;
typedef struct Manager Manager;
typedef struct N... | 1,645 | 26.433333 | 92 | h |
null | systemd-main/src/network/networkd-queue.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "netdev.h"
#include "netlink-util.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
#include "string-table.h"
static Request *request_free(Request *req) {
if (!req)
return NULL;
/* To preve... | 10,498 | 33.422951 | 103 | c |
null | systemd-main/src/network/networkd-queue.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-event.h"
#include "sd-netlink.h"
#include "alloc-util.h"
#include "hash-funcs.h"
typedef struct Link Link;
typedef struct NetDev NetDev;
typedef struct Manager Manager;
typedef struct Request Request;
typedef int (*request_process_func_t)(Re... | 6,106 | 42.621429 | 131 | h |
null | systemd-main/src/network/networkd-radv.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/***
Copyright © 2017 Intel Corporation. All rights reserved.
***/
#include <inttypes.h>
#include <stdbool.h>
#include "sd-radv.h"
#include "in-addr-util.h"
#include "conf-parser.h"
#include "networkd-util.h"
typedef struct Link Link;
typedef struct N... | 2,679 | 29.804598 | 101 | h |
null | systemd-main/src/network/networkd-route-util.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include "conf-parser.h"
typedef struct Link Link;
typedef struct Manager Manager;
typedef struct Address Address;
unsigned routes_max(void);
int manager_find_uplink(Manager *m, int family, Link *exclude, Link ... | 1,635 | 31.72 | 101 | h |
null | systemd-main/src/network/networkd-route.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include "sd-netlink.h"
#include "conf-parser.h"
#include "in-addr-util.h"
#include "networkd-link.h"
#include "networkd-util.h"
typedef struct Manager Manager;
typedef struct Network Network;
typedef struct Req... | 4,405 | 32.633588 | 113 | h |
null | systemd-main/src/network/networkd-routing-policy-rule.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <linux/fib_rules.h>
#include <stdbool.h>
#include "conf-parser.h"
#include "in-addr-util.h"
#include "networkd-util.h"
typedef struct Link Link;
typedef struct Manager Manager;
typedef struct Network Network;
typedef struct... | 3,209 | 34.274725 | 93 | h |
null | systemd-main/src/network/networkd-setlink.h | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stdbool.h>
typedef struct Link Link;
int link_request_to_set_addrgen_mode(Link *link);
int link_request_to_set_bond(Link *link);
int link_request_to_set_bridge(Link *link);
int link_request_to_set_bridge_vlan(Link *link);
i... | 887 | 28.6 | 58 | h |
null | systemd-main/src/network/networkd-speed-meter.c | /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "sd-event.h"
#include "sd-netlink.h"
#include "networkd-link-bus.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-speed-meter.h"
static int process_message(Manager *manager, sd_netlink_message *message) {
... | 3,177 | 27.375 | 103 | c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.