Open SCAP Library
seap-command.h
1 /*
2  * Copyright 2009 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  * "Daniel Kopecek" <dkopecek@redhat.com>
21  */
22 
23 #pragma once
24 #ifndef SEAP_COMMAND_H
25 #define SEAP_COMMAND_H
26 
27 #include <stdint.h>
28 #include <stdarg.h>
29 #include <sexp-types.h>
30 #include <seap-types.h>
31 #include "oscap_export.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 typedef SEXP_t * (*SEAP_cmdfn_t) (SEXP_t *, void *);
38 
39 typedef uint16_t SEAP_cmdcode_t;
40 typedef uint16_t SEAP_cmdid_t;
41 typedef uint8_t SEAP_cmdtype_t;
42 
43 #define SEAP_CMDTYPE_SYNC 1
44 #define SEAP_CMDTYPE_ASYNC 2
45 
46 #define SEAP_CMDREG_LOCAL 0x00000001
47 #define SEAP_CMDREG_USEARG 0x00000002
48 #define SEAP_CMDREG_THREAD 0x00000004
49 
50 OSCAP_API int SEAP_cmd_register (SEAP_CTX_t *ctx, SEAP_cmdcode_t code, uint32_t flags, SEAP_cmdfn_t func, ...);
51 OSCAP_API int SEAP_cmd_unregister (SEAP_CTX_t *ctx, SEAP_cmdcode_t code);
52 
53 #define SEAP_EXEC_LOCAL 0x01
54 #define SEAP_EXEC_LONLY 0x02
55 #define SEAP_EXEC_GFIRST 0x04
56 #define SEAP_EXEC_THREAD 0x08
57 #define SEAP_EXEC_WQUEUE 0x10
58 #define SEAP_EXEC_RECV 0x20
59 
60 SEXP_t *SEAP_cmd_exec (SEAP_CTX_t *ctx,
61  int sd,
62  uint32_t flags,
63  SEAP_cmdcode_t code,
64  SEXP_t *args,
65  SEAP_cmdtype_t type,
66  SEAP_cmdfn_t func,
67  void *funcarg);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* SEAP_COMMAND_H */
Definition: _seap-types.h:36
Definition: sexp-types.h:82