| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
|
| 3 |
#include "sd-json.h" |
| 4 |
|
| 5 |
#include "automount.h" |
| 6 |
#include "json-util.h" |
| 7 |
#include "varlink-automount.h" |
| 8 |
|
| 9 |
int automount_context_build_json(sd_json_variant **ret, const char *name, void *userdata) { |
| 10 |
Automount *a = ASSERT_PTR(AUTOMOUNT(userdata)); |
| 11 |
return sd_json_buildo( |
| 12 |
ASSERT_PTR(ret), |
| 13 |
JSON_BUILD_PAIR_STRING_NON_EMPTY("Where", a->where), |
| 14 |
JSON_BUILD_PAIR_STRING_NON_EMPTY("ExtraOptions", a->extra_options), |
| 15 |
SD_JSON_BUILD_PAIR_UNSIGNED("DirectoryMode", a->directory_mode), |
| 16 |
JSON_BUILD_PAIR_FINITE_USEC("TimeoutIdleUSec", a->timeout_idle_usec)); |
| 17 |
} |
| 18 |
|
| 19 |
int automount_runtime_build_json(sd_json_variant **ret, const char *name, void *userdata) { |
| 20 |
Automount *a = ASSERT_PTR(AUTOMOUNT(userdata)); |
| 21 |
return sd_json_buildo(ASSERT_PTR(ret), JSON_BUILD_PAIR_ENUM("Result", automount_result_to_string(a->result))); |
| 22 |
} |