Open SCAP Library
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
common
public
reporter.h
Go to the documentation of this file.
1
/*
2
* Copyright 2010 Red Hat Inc., Durham, North Carolina.
3
* All Rights Reserved.
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Authors:
20
* Lukas Kuklinek <lkuklinek@redhat.com>
21
*/
22
28
#ifndef OSCAP_REPORTER_H_
29
#define OSCAP_REPORTER_H_
30
31
#include <stdbool.h>
32
#include <stdarg.h>
33
73
74
typedef
enum
oscap_reporter_family
{
75
OSCAP_REPORTER_FAMILY_XML
= 1,
76
OSCAP_REPORTER_FAMILY_XCCDF
= 2,
77
OSCAP_REPORTER_FAMILY_OVAL
= 3,
78
OSCAP_REPORTER_FAMILY_USER_START = 1024
79
}
oscap_reporter_family_t
;
80
82
typedef
unsigned
int
oscap_reporter_code_t
;
83
85
extern
const
oscap_reporter_code_t
OSCAP_REPORTER_CODE_MAX
;
86
91
struct
oscap_reporter_message
;
92
96
typedef
int (*
oscap_reporter
)(
const
struct
oscap_reporter_message
*msg,
void
*arg);
97
98
100
struct
oscap_reporter_message
*
oscap_reporter_message_new
(
void
);
102
struct
oscap_reporter_message
*
oscap_reporter_message_new_fill
(
oscap_reporter_family_t
family,
oscap_reporter_code_t
code,
const
char
*
string
);
104
struct
oscap_reporter_message
*
oscap_reporter_message_new_fmt
(
oscap_reporter_family_t
family,
oscap_reporter_code_t
code,
const
char
*fmt, ...);
106
struct
oscap_reporter_message
*
oscap_reporter_message_clone
(
const
struct
oscap_reporter_message
*msg);
108
oscap_reporter_family_t
oscap_reporter_message_get_family
(
const
struct
oscap_reporter_message
*item);
110
oscap_reporter_code_t
oscap_reporter_message_get_code
(
const
struct
oscap_reporter_message
*item);
112
const
char
*
oscap_reporter_message_get_string
(
const
struct
oscap_reporter_message
*item);
113
115
const
char
*
oscap_reporter_message_get_user1str
(
const
struct
oscap_reporter_message
*msg);
117
int
oscap_reporter_message_get_user1num
(
const
struct
oscap_reporter_message
*msg);
119
void
*
oscap_reporter_message_get_user1ptr
(
const
struct
oscap_reporter_message
*msg);
121
const
char
*
oscap_reporter_message_get_user2str
(
const
struct
oscap_reporter_message
*msg);
123
int
oscap_reporter_message_get_user2num
(
const
struct
oscap_reporter_message
*msg);
125
void
*
oscap_reporter_message_get_user2ptr
(
const
struct
oscap_reporter_message
*msg);
127
const
char
*
oscap_reporter_message_get_user3str
(
const
struct
oscap_reporter_message
*msg);
129
int
oscap_reporter_message_get_user3num
(
const
struct
oscap_reporter_message
*msg);
131
void
*
oscap_reporter_message_get_user3ptr
(
const
struct
oscap_reporter_message
*msg);
132
133
139
int
oscap_reporter_dispatch(
oscap_reporter
reporter,
const
struct
oscap_reporter_message
*msg,
void
*arg);
140
148
int
oscap_reporter_report(
oscap_reporter
reporter,
struct
oscap_reporter_message
*msg,
void
*arg);
149
156
int
oscap_reporter_report_fmt(
oscap_reporter
reporter,
void
*arg,
oscap_reporter_family_t
family,
oscap_reporter_code_t
code,
const
char
*fmt, ...);
157
159
int
oscap_reporter_fd
(
const
struct
oscap_reporter_message
*msg,
void
*arg);
160
168
struct
oscap_reporter_switch_ctxt
;
170
struct
oscap_reporter_switch_ctxt
*
oscap_reporter_switch_ctxt_new
(
void
);
172
void
oscap_reporter_switch_ctxt_add_range_reporter
(
struct
oscap_reporter_switch_ctxt
*ctxt,
oscap_reporter
reporter,
void
*arg,
173
oscap_reporter_family_t
family,
oscap_reporter_code_t
min_code,
oscap_reporter_code_t
max_code);
175
void
oscap_reporter_switch_ctxt_add_family_reporter
(
struct
oscap_reporter_switch_ctxt
*ctxt,
oscap_reporter
reporter,
void
*arg,
oscap_reporter_family_t
family);
177
void
oscap_reporter_switch_ctxt_add_reporter
(
struct
oscap_reporter_switch_ctxt
*ctxt,
oscap_reporter
reporter,
void
*arg);
179
void
oscap_reporter_switch_ctxt_free
(
struct
oscap_reporter_switch_ctxt
*ctxt);
181
int
oscap_reporter_switch
(
const
struct
oscap_reporter_message
*msg,
void
*arg);
182
183
#endif // OSCAP_REPORTER_H_
Generated by
1.8.1.1