| 1 | /** |
| 2 | * @file fsdev.h |
| 3 | * @brief fsdev header file |
| 4 | * @author "Daniel Kopecek" <[email protected]> |
| 5 | * |
| 6 | */ |
| 7 | /* |
| 8 | * Copyright 2009 Red Hat Inc., Durham, North Carolina. |
| 9 | * All Rights Reserved. |
| 10 | * |
| 11 | * This library is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU Lesser General Public |
| 13 | * License as published by the Free Software Foundation; either |
| 14 | * version 2.1 of the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This library is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * Lesser General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU Lesser General Public |
| 22 | * License along with this library; if not, write to the Free Software |
| 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 24 | * |
| 25 | * Authors: |
| 26 | * "Daniel Kopecek" <[email protected]> |
| 27 | */ |
| 28 | |
| 29 | #pragma once |
| 30 | #ifndef FSDEV_H |
| 31 | #define FSDEV_Hcxx . . $ `src/OVAL/probes/fsdev.h:31:9`! |
| 32 | |
| 33 | #include <stddef.h> |
| 34 | #include <stdint.h> |
| 35 | #include <sys/stat.h> |
| 36 | #include "oscap_export.h"cxx . . $ `<file>/src/common/public/oscap_export.h`/ |
| 37 | |
| 38 | #if defined(__linux__cxx . . $ `<built-in>:397:9`!) || defined(_AIX) |
| 39 | #include <mntent.h> |
| 40 | #endif |
| 41 | |
| 42 | /** |
| 43 | * Filesystem device structure. |
| 44 | */ |
| 45 | typedef structcxx . . $ $anonymous_type_9ae834c88293f1e5_0# { |
| 46 | dev_tcxx . . $ dev_t# *idscxx . . $ $anonymous_type_9ae834c88293f1e5_0#ids.; /**< Sorted array of device ids */ |
| 47 | uint16_tcxx . . $ uint16_t# cntcxx . . $ $anonymous_type_9ae834c88293f1e5_0#cnt.; /**< Number of items in the array */ |
| 48 | } fsdev_tcxx . . $ fsdev_t#; |
| 49 | |
| 50 | /** |
| 51 | * Initialize the fsdev_t structure from an array of filesystem |
| 52 | * names. |
| 53 | */ |
| 54 | fsdev_tcxx . . $ fsdev_t# *fsdev_initcxx . . $ fsdev_init(7d22408f4c7e197c).(void); |
| 55 | |
| 56 | /** |
| 57 | * Free the fsdev_t structure. |
| 58 | */ |
| 59 | void fsdev_freecxx . . $ fsdev_free(27e1c92ef469a2f9).(fsdev_tcxx . . $ fsdev_t# *lfs); |
| 60 | |
| 61 | /** |
| 62 | * Search an id in the fsdev_t structure. |
| 63 | */ |
| 64 | int fsdev_searchcxx . . $ fsdev_search(a29fa8ec2853d098).(fsdev_tcxx . . $ fsdev_t# *lfs, void *id); |
| 65 | |
| 66 | /** |
| 67 | * Check whether a path points points to a place on any of the devices |
| 68 | * in the fsdev_t structure. |
| 69 | * @param lfs pointer to the fsdev_t structure |
| 70 | * @param path path |
| 71 | * @retval 1 if found |
| 72 | * @retval 0 otherwise |
| 73 | * @retval -1 error |
| 74 | */ |
| 75 | int fsdev_pathcxx . . $ fsdev_path(f173a51f6dfb99a9).(fsdev_tcxx . . $ fsdev_t# *lfs, const char *path); |
| 76 | |
| 77 | /** |
| 78 | * Check whether a file descriptor is associated with a file that resides |
| 79 | * on any of the devices in the fsdev_t structure. |
| 80 | * @param lfs pointer to the fsdev_t structure |
| 81 | * @param fd file descriptor |
| 82 | * @retval 1 if found |
| 83 | * @retval 0 otherwise |
| 84 | * @retval -1 error |
| 85 | */ |
| 86 | int fsdev_fdcxx . . $ fsdev_fd(4b26416c454d026a).(fsdev_tcxx . . $ fsdev_t# *lfs, int fd); |
| 87 | |
| 88 | #endif /* FSDEV_H */ |