| 1 | /** |
| 2 | * @file family_probe.c |
| 3 | * @brief family probe |
| 4 | * @author "Tomas Heinrich" <[email protected]> |
| 5 | * @author "Daniel Kopecek" <[email protected]> |
| 6 | * |
| 7 | * 2010/06/13 [email protected] |
| 8 | * This probe is able to process a family_object as defined in OVAL 5.4 and 5.5. |
| 9 | * |
| 10 | */ |
| 11 | |
| 12 | /* |
| 13 | * Copyright 2009 Red Hat Inc., Durham, North Carolina. |
| 14 | * All Rights Reserved. |
| 15 | * |
| 16 | * This library is free software; you can redistribute it and/or |
| 17 | * modify it under the terms of the GNU Lesser General Public |
| 18 | * License as published by the Free Software Foundation; either |
| 19 | * version 2.1 of the License, or (at your option) any later version. |
| 20 | * |
| 21 | * This library is distributed in the hope that it will be useful, |
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 24 | * Lesser General Public License for more details. |
| 25 | * |
| 26 | * You should have received a copy of the GNU Lesser General Public |
| 27 | * License along with this library; if not, write to the Free Software |
| 28 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | * |
| 30 | * Authors: |
| 31 | * "Tomas Heinrich" <[email protected]> |
| 32 | * "Daniel Kopecek" <[email protected]> |
| 33 | */ |
| 34 | |
| 35 | /* |
| 36 | * family probe: |
| 37 | * |
| 38 | * family_object |
| 39 | * |
| 40 | * family_item |
| 41 | * attrs |
| 42 | * id |
| 43 | * status_enum status |
| 44 | * [0..1] string family |
| 45 | */ |
| 46 | |
| 47 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 48 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 49 | #endif |
| 50 | |
| 51 | #include "_seap.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/_seap.h`/ |
| 52 | #include <string.h> |
| 53 | #include <probe-api.h>cxx . . $ `<file>/src/OVAL/probes/public/probe-api.h`/ |
| 54 | #include <probe/probe.h>cxx . . $ `<file>/src/OVAL/probes/probe/probe.h`/ |
| 55 | #include <probe/option.h>cxx . . $ `<file>/src/OVAL/probes/probe/option.h`/ |
| 56 | #include "family_probe.h"cxx . . $ `<file>/src/OVAL/probes/independent/family_probe.h`/ |
| 57 | |
| 58 | int family_probe_offline_mode_supportedcxx . . $ family_probe_offline_mode_supported(b126dc7c1de90089).() |
| 59 | { |
| 60 | /* We say that the probe supports all offline modes, but in fact |
| 61 | it always returns the same hardocoded string. */ |
| 62 | return PROBE_OFFLINE_ALLcxx . . $ PROBE_OFFLINE_ALL.; |
| 63 | } |
| 64 | |
| 65 | int family_probe_maincxx . . $ family_probe_main(470536d3ffacaf10).(probe_ctxcxx . . $ probe_ctx# *ctx, void *arg) |
| 66 | { |
| 67 | SEXP_tcxx . . $ SEXP_t# *item; |
| 68 | |
| 69 | (void)arg; |
| 70 | |
| 71 | const char *family = |
| 72 | #if defined(OS_WINDOWS) |
| 73 | "windows"; |
| 74 | #elif defined(OS_OSX) |
| 75 | "macos"; |
| 76 | #elif defined(OSCAP_UNIXcxx . . $ `compat/compat.h:41:9`!) |
| 77 | "unix"; |
| 78 | #elif defined(CISCO_IOS) /* XXX: how to detect IOS? */ |
| 79 | "ios"; |
| 80 | #else |
| 81 | "error"; |
| 82 | #endif |
| 83 | |
| 84 | item = probe_item_createcxx . . $ probe_item_create(36b16a6622050a9c).(OVAL_INDEPENDENT_FAMILYcxx . . $ OVAL_INDEPENDENT_FAMILY., NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!, |
| 85 | "family", OVAL_DATATYPE_STRINGcxx . . $ OVAL_DATATYPE_STRING., family, |
| 86 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:419:9`!); |
| 87 | |
| 88 | probe_item_collectcxx . . $ probe_item_collect(11bb80e0c30650d7).(ctx, item); |
| 89 | |
| 90 | return (0); |
| 91 | } |