Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 32) sorted by relevance

12

/systemd-251/src/fundamental/ !
Dsha256.c80 void sha256_init_ctx(struct sha256_ctx *ctx) { in sha256_init_ctx() argument
81 assert(ctx); in sha256_init_ctx()
83 ctx->H[0] = 0x6a09e667; in sha256_init_ctx()
84 ctx->H[1] = 0xbb67ae85; in sha256_init_ctx()
85 ctx->H[2] = 0x3c6ef372; in sha256_init_ctx()
86 ctx->H[3] = 0xa54ff53a; in sha256_init_ctx()
87 ctx->H[4] = 0x510e527f; in sha256_init_ctx()
88 ctx->H[5] = 0x9b05688c; in sha256_init_ctx()
89 ctx->H[6] = 0x1f83d9ab; in sha256_init_ctx()
90 ctx->H[7] = 0x5be0cd19; in sha256_init_ctx()
[all …]
Dsha256.h32 void sha256_init_ctx(struct sha256_ctx *ctx);
33 void *sha256_finish_ctx(struct sha256_ctx *ctx, void *resbuf);
34 void sha256_process_bytes(const void *buffer, size_t len, struct sha256_ctx *ctx);
/systemd-251/src/oom/ !
Doomd-util.c61 OomdCGroupContext *oomd_cgroup_context_free(OomdCGroupContext *ctx) { in oomd_cgroup_context_free() argument
62 if (!ctx) in oomd_cgroup_context_free()
65 free(ctx->path); in oomd_cgroup_context_free()
66 return mfree(ctx); in oomd_cgroup_context_free()
71 OomdCGroupContext *ctx; in oomd_pressure_above() local
82 HASHMAP_FOREACH_KEY(ctx, key, h) { in oomd_pressure_above()
83 if (ctx->memory_pressure.avg10 > ctx->mem_pressure_limit) { in oomd_pressure_above()
86 if (ctx->mem_pressure_limit_hit_start == 0) in oomd_pressure_above()
87 ctx->mem_pressure_limit_hit_start = now(CLOCK_MONOTONIC); in oomd_pressure_above()
89 diff = now(CLOCK_MONOTONIC) - ctx->mem_pressure_limit_hit_start; in oomd_pressure_above()
[all …]
Dtest-oomd-util.c95 _cleanup_(oomd_cgroup_context_freep) OomdCGroupContext *ctx = NULL; in test_oomd_cgroup_context_acquire_and_insert()
129 assert_se(oomd_cgroup_context_acquire(cgroup, &ctx) == 0); in test_oomd_cgroup_context_acquire_and_insert()
131 assert_se(streq(ctx->path, cgroup)); in test_oomd_cgroup_context_acquire_and_insert()
132 assert_se(ctx->current_memory_usage > 0); in test_oomd_cgroup_context_acquire_and_insert()
133 assert_se(ctx->memory_min == 0); in test_oomd_cgroup_context_acquire_and_insert()
134 assert_se(ctx->memory_low == 0); in test_oomd_cgroup_context_acquire_and_insert()
135 assert_se(ctx->swap_usage == 0); in test_oomd_cgroup_context_acquire_and_insert()
136 assert_se(ctx->last_pgscan == 0); in test_oomd_cgroup_context_acquire_and_insert()
137 assert_se(ctx->pgscan == 0); in test_oomd_cgroup_context_acquire_and_insert()
140 assert_se(ctx->preference == MANAGED_OOM_PREFERENCE_OMIT); in test_oomd_cgroup_context_acquire_and_insert()
[all …]
Doomd-util.h49 OomdCGroupContext *oomd_cgroup_context_free(OomdCGroupContext *ctx);
64 bool oomd_mem_available_below(const OomdSystemContext *ctx, int threshold_permyriad);
67 bool oomd_swap_free_below(const OomdSystemContext *ctx, int threshold_permyriad);
134 void oomd_dump_swap_cgroup_context(const OomdCGroupContext *ctx, FILE *f, const char *prefix);
135 void oomd_dump_memory_pressure_cgroup_context(const OomdCGroupContext *ctx, FILE *f, const char *pr…
136 void oomd_dump_system_context(const OomdSystemContext *ctx, FILE *f, const char *prefix);
Doomd-manager.c68 OomdCGroupContext *ctx; in process_managed_oom_message() local
124 ctx = hashmap_get(monitor_hm, empty_to_root(message.path)); in process_managed_oom_message()
125 if (ctx) in process_managed_oom_message()
126 ctx->mem_pressure_limit = limit; in process_managed_oom_message()
248 OomdCGroupContext *ctx; in update_monitored_cgroup_contexts() local
257 HASHMAP_FOREACH(ctx, *monitored_cgroups) { in update_monitored_cgroup_contexts()
259 r = oomd_insert_cgroup_context(*monitored_cgroups, new_base, ctx->path); in update_monitored_cgroup_contexts()
263 … log_debug_errno(r, "Failed to insert context for %s, ignoring: %m", ctx->path); in update_monitored_cgroup_contexts()
274 OomdCGroupContext *ctx; in get_monitored_cgroup_contexts_candidates() local
284 HASHMAP_FOREACH(ctx, monitored_cgroups) { in get_monitored_cgroup_contexts_candidates()
[all …]
/systemd-251/src/shared/ !
Dfirewall-util.c23 static void firewall_backend_probe(FirewallContext *ctx) { in firewall_backend_probe() argument
24 assert(ctx); in firewall_backend_probe()
26 if (ctx->backend != _FW_BACKEND_INVALID) in firewall_backend_probe()
29 if (fw_nftables_init(ctx) >= 0) in firewall_backend_probe()
30 ctx->backend = FW_BACKEND_NFTABLES; in firewall_backend_probe()
33 ctx->backend = FW_BACKEND_IPTABLES; in firewall_backend_probe()
35 ctx->backend = FW_BACKEND_NONE; in firewall_backend_probe()
38 if (ctx->backend != FW_BACKEND_NONE) in firewall_backend_probe()
39 … log_debug("Using %s as firewall backend.", firewall_backend_to_string(ctx->backend)); in firewall_backend_probe()
45 _cleanup_free_ FirewallContext *ctx = NULL; in fw_ctx_new() local
[all …]
Dopenssl-util.c14 _cleanup_(EVP_MD_CTX_freep) EVP_MD_CTX *ctx = NULL; in openssl_hash()
18 ctx = EVP_MD_CTX_new(); in openssl_hash()
19 if (!ctx) in openssl_hash()
27 r = EVP_DigestInit_ex(ctx, alg, NULL); in openssl_hash()
31 r = EVP_DigestUpdate(ctx, msg, msg_len); in openssl_hash()
35 r = EVP_DigestFinal_ex(ctx, ret_hash, &len); in openssl_hash()
52 _cleanup_(EVP_PKEY_CTX_freep) EVP_PKEY_CTX *ctx = NULL; in rsa_encrypt_bytes()
56 ctx = EVP_PKEY_CTX_new(pkey, NULL); in rsa_encrypt_bytes()
57 if (!ctx) in rsa_encrypt_bytes()
60 if (EVP_PKEY_encrypt_init(ctx) <= 0) in rsa_encrypt_bytes()
[all …]
Dinstall.c1052 static void install_context_done(InstallContext *ctx) { in install_context_done() argument
1053 assert(ctx); in install_context_done()
1055ctx->will_process = ordered_hashmap_free_with_destructor(ctx->will_process, install_info_free); in install_context_done()
1056ctx->have_processed = ordered_hashmap_free_with_destructor(ctx->have_processed, install_info_free); in install_context_done()
1059 static UnitFileInstallInfo *install_info_find(InstallContext *ctx, const char *name) { in install_info_find() argument
1062 i = ordered_hashmap_get(ctx->have_processed, name); in install_info_find()
1066 return ordered_hashmap_get(ctx->will_process, name); in install_info_find()
1100 InstallContext *ctx, in install_info_add() argument
1110 assert(ctx); in install_info_add()
1123 i = install_info_find(ctx, name); in install_info_add()
[all …]
Dfirewall-util-nft.c750 int fw_nftables_init(FirewallContext *ctx) { in fw_nftables_init() argument
768 ctx->nfnl = TAKE_PTR(nfnl); in fw_nftables_init()
772 void fw_nftables_exit(FirewallContext *ctx) { in fw_nftables_exit() argument
773 ctx->nfnl = sd_netlink_unref(ctx->nfnl); in fw_nftables_exit()
852 FirewallContext *ctx, in fw_nftables_add_masquerade_internal() argument
868 r = sd_nfnl_message_batch_begin(ctx->nfnl, &transaction[0]); in fw_nftables_add_masquerade_internal()
873 …r = sd_nfnl_nft_message_new_setelems_begin(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_TABLE_N… in fw_nftables_add_masquerade_internal()
875 …r = sd_nfnl_nft_message_del_setelems_begin(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_TABLE_N… in fw_nftables_add_masquerade_internal()
888 r = sd_nfnl_message_batch_end(ctx->nfnl, &transaction[tsize]); in fw_nftables_add_masquerade_internal()
893 r = nfnl_netlink_sendv(ctx->nfnl, transaction, tsize); in fw_nftables_add_masquerade_internal()
[all …]
Dfirewall-util-private.h28 int fw_nftables_init(FirewallContext *ctx);
29 void fw_nftables_exit(FirewallContext *ctx);
32 FirewallContext *ctx,
39 FirewallContext *ctx,
Dfirewall-util.h12 FirewallContext *fw_ctx_free(FirewallContext *ctx);
17 FirewallContext **ctx,
24 FirewallContext **ctx,
/systemd-251/src/test/ !
Dtest-firewall-util.c12 static void test_v6(FirewallContext *ctx) { in test_v6() argument
17 assert_se(ctx); in test_v6()
19 log_info("/* %s(backend=%s) */", __func__, firewall_backend_to_string(ctx->backend)); in test_v6()
30 assert_se(fw_add_masquerade(&ctx, true, AF_INET6, &u1, 128) >= 0); in test_v6()
31 assert_se(fw_add_masquerade(&ctx, false, AF_INET6, &u1, 128) >= 0); in test_v6()
32 assert_se(fw_add_masquerade(&ctx, true, AF_INET6, &u1, 64) >= 0); in test_v6()
33 assert_se(fw_add_masquerade(&ctx, false, AF_INET6, &u1, 64) >= 0); in test_v6()
34 assert_se(fw_add_masquerade(&ctx, true, AF_INET6, &u3, prefixlen) >= 0); in test_v6()
35 assert_se(fw_add_masquerade(&ctx, false, AF_INET6, &u3, prefixlen) >= 0); in test_v6()
37 r = fw_add_local_dnat(&ctx, true, AF_INET6, IPPROTO_TCP, 4711, &u1, 815, NULL); in test_v6()
[all …]
Dtest-netlink-manual.c17 _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; in load_module() local
22 ctx = kmod_new(NULL, NULL); in load_module()
23 if (!ctx) in load_module()
26 r = kmod_module_new_from_lookup(ctx, mod_name, &list); in load_module()
/systemd-251/src/core/bpf/socket_bind/ !
Dsocket-bind.bpf.c64 struct bpf_sock_addr *ctx, in match_rules() argument
66 volatile __u32 user_port = ctx->user_port; in match_rules()
78 if (match(ctx->user_family, ctx->protocol, port, rule)) in match_rules()
85 static __always_inline int bind_socket(struct bpf_sock_addr *ctx) { in bind_socket() argument
86 if (match_rules(ctx, &sd_bind_allow)) in bind_socket()
89 if (match_rules(ctx, &sd_bind_deny)) in bind_socket()
96 int sd_bind4(struct bpf_sock_addr *ctx) { in sd_bind4() argument
97 if (ctx->user_family != AF_INET || ctx->family != AF_INET) in sd_bind4()
100 return bind_socket(ctx); in sd_bind4()
104 int sd_bind6(struct bpf_sock_addr *ctx) { in sd_bind6() argument
[all …]
/systemd-251/src/udev/ !
Dudev-builtin-kmod.c17 static struct kmod_ctx *ctx = NULL; variable
24 if (!ctx) in builtin_kmod()
32 (void) module_load_and_warn(ctx, argv[i], false); in builtin_kmod()
39 if (ctx) in builtin_kmod_init()
42 ctx = kmod_new(NULL, NULL); in builtin_kmod_init()
43 if (!ctx) in builtin_kmod_init()
47 kmod_set_log_fn(ctx, udev_kmod_log, NULL); in builtin_kmod_init()
48 kmod_load_resources(ctx); in builtin_kmod_init()
55 ctx = kmod_unref(ctx); in builtin_kmod_exit()
61 if (!ctx) in builtin_kmod_validate()
[all …]
Dudev-builtin-net_setup_link.c11 static LinkConfigContext *ctx = NULL; variable
20 r = link_new(ctx, rtnl, dev, &link); in builtin_net_setup_link()
31 r = link_get_config(ctx, link); in builtin_net_setup_link()
41 r = link_apply_config(ctx, rtnl, link); in builtin_net_setup_link()
57 if (ctx) in builtin_net_setup_link_init()
60 r = link_config_ctx_new(&ctx); in builtin_net_setup_link_init()
64 r = link_config_load(ctx); in builtin_net_setup_link_init()
73 ctx = link_config_ctx_free(ctx); in builtin_net_setup_link_exit()
79 if (!ctx) in builtin_net_setup_link_validate()
82 return link_config_should_reload(ctx); in builtin_net_setup_link_validate()
/systemd-251/src/udev/net/ !
Dlink-config.c71 static void link_configs_free(LinkConfigContext *ctx) { in link_configs_free() argument
72 if (!ctx) in link_configs_free()
75 ctx->stats_by_path = hashmap_free(ctx->stats_by_path); in link_configs_free()
77 LIST_FOREACH(configs, config, ctx->configs) in link_configs_free()
81 LinkConfigContext *link_config_ctx_free(LinkConfigContext *ctx) { in link_config_ctx_free() argument
82 if (!ctx) in link_config_ctx_free()
85 safe_close(ctx->ethtool_fd); in link_config_ctx_free()
86 link_configs_free(ctx); in link_config_ctx_free()
87 return mfree(ctx); in link_config_ctx_free()
91 _cleanup_(link_config_ctx_freep) LinkConfigContext *ctx = NULL; in link_config_ctx_new()
[all …]
Dlink-config.h89 LinkConfigContext* link_config_ctx_free(LinkConfigContext *ctx);
92 int link_load_one(LinkConfigContext *ctx, const char *filename);
93 int link_config_load(LinkConfigContext *ctx);
94 bool link_config_should_reload(LinkConfigContext *ctx);
96 int link_new(LinkConfigContext *ctx, sd_netlink **rtnl, sd_device *device, Link **ret);
100 int link_get_config(LinkConfigContext *ctx, Link *link);
101 int link_apply_config(LinkConfigContext *ctx, sd_netlink **rtnl, Link *link);
Dfuzz-link-parser.c10 _cleanup_(link_config_ctx_freep) LinkConfigContext *ctx = NULL; in LLVMFuzzerTestOneInput()
25 assert_se(link_config_ctx_new(&ctx) >= 0); in LLVMFuzzerTestOneInput()
26 (void) link_load_one(ctx, filename); in LLVMFuzzerTestOneInput()
/systemd-251/src/modules-load/ !
Dmodules-load.c63 static int apply_file(struct kmod_ctx *ctx, const char *path, bool ignore_enoent) { in apply_file() argument
68 assert(ctx); in apply_file()
97 k = module_load_and_warn(ctx, l, true); in apply_file()
162 _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; in run() local
177 ctx = kmod_new(NULL, NULL); in run()
178 if (!ctx) { in run()
183 kmod_load_resources(ctx); in run()
184 kmod_set_log_fn(ctx, systemd_kmod_log, NULL); in run()
190 k = apply_file(ctx, argv[i], false); in run()
199 k = module_load_and_warn(ctx, *i, true); in run()
[all …]
/systemd-251/src/core/ !
Dkmod-setup.c121 _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; in kmod_setup() local
139 if (!ctx) { in kmod_setup()
140 ctx = kmod_new(NULL, NULL); in kmod_setup()
141 if (!ctx) in kmod_setup()
144 kmod_set_log_fn(ctx, systemd_kmod_log, NULL); in kmod_setup()
145 kmod_load_resources(ctx); in kmod_setup()
148 … (void) module_load_and_warn(ctx, kmod_table[i].module, kmod_table[i].warn_if_unavailable); in kmod_setup()
/systemd-251/src/resolve/ !
Dresolved-dns-dnssec.c106 _cleanup_(EVP_PKEY_CTX_freep) EVP_PKEY_CTX *ctx = NULL; in dnssec_rsa_verify_raw()
136 ctx = EVP_PKEY_CTX_new(epubkey, NULL); in dnssec_rsa_verify_raw()
137 if (!ctx) in dnssec_rsa_verify_raw()
140 if (EVP_PKEY_verify_init(ctx) <= 0) in dnssec_rsa_verify_raw()
143 if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PADDING) <= 0) in dnssec_rsa_verify_raw()
146 if (EVP_PKEY_CTX_set_signature_md(ctx, hash_algorithm) <= 0) in dnssec_rsa_verify_raw()
149 r = EVP_PKEY_verify(ctx, signature, signature_size, data, data_size); in dnssec_rsa_verify_raw()
502 _cleanup_(EVP_MD_CTX_freep) EVP_MD_CTX *ctx = NULL; in dnssec_eddsa_verify_raw()
521 ctx = EVP_MD_CTX_new(); in dnssec_eddsa_verify_raw()
522 if (!ctx) in dnssec_eddsa_verify_raw()
[all …]
Dresolved-dnstls-openssl.c71 s = SSL_new(stream->manager->dnstls_data.ctx); in dnstls_stream_connect_tls()
411 manager->dnstls_data.ctx = SSL_CTX_new(TLS_client_method()); in dnstls_manager_init()
412 if (!manager->dnstls_data.ctx) in dnstls_manager_init()
415 r = SSL_CTX_set_min_proto_version(manager->dnstls_data.ctx, TLS1_2_VERSION); in dnstls_manager_init()
419 (void) SSL_CTX_set_options(manager->dnstls_data.ctx, SSL_OP_NO_COMPRESSION); in dnstls_manager_init()
421 r = SSL_CTX_set_default_verify_paths(manager->dnstls_data.ctx); in dnstls_manager_init()
433 if (manager->dnstls_data.ctx) in dnstls_manager_free()
434 SSL_CTX_free(manager->dnstls_data.ctx); in dnstls_manager_free()
/systemd-251/src/nspawn/ !
Dnspawn-seccomp.c25 scmp_filter_ctx ctx, in add_syscall_filters() argument
149 r = seccomp_add_syscall_filter_item(ctx, in add_syscall_filters()
160 … r = seccomp_add_syscall_filter_item(ctx, *p, SCMP_ACT_ALLOW, syscall_deny_list, true, &added); in add_syscall_filters()
168 … r = seccomp_add_syscall_filter_item(ctx, "@known", SCMP_ACT_ERRNO(EPERM), added, true, NULL); in add_syscall_filters()
175 r = seccomp_attr_set(ctx, SCMP_FLTATR_CTL_OPTIMIZE, 2); in add_syscall_filters()

12