veriexecctl.h revision 1.9 1 /* $NetBSD: veriexecctl.h,v 1.9 2006/11/28 22:22:03 elad Exp $ */
2
3 /*-
4 * Copyright 2005 Elad Efrat <elad (at) NetBSD.org>
5 * Copyright 2005 Brett Lymn <blymn (at) netbsd.org>
6 *
7 * All rights reserved.
8 *
9 * This code has been donated to The NetBSD Foundation by the Author.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. The name of the author may not be used to endorse or promote products
17 * derived from this software withough specific prior written permission
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 *
31 */
32
33 #ifndef _VERIEXECCTL_H_
34 #define _VERIEXECCTL_H_
35
36 #define STATUS_STRING(status) ((status) == FINGERPRINT_NOTEVAL ? \
37 "not evaluated" : \
38 (status) == FINGERPRINT_VALID ? \
39 "valid" : \
40 (status) == FINGERPRINT_NOMATCH ? \
41 "mismatch" : \
42 "<unknown>")
43
44 #define dict_sets(d, k, v) \
45 prop_dictionary_set(d, k, prop_string_create_cstring(v))
46
47 #define dict_gets(d, k) \
48 prop_string_cstring_nocopy(prop_dictionary_get(d, k))
49
50 #define dict_setd(d, k, v, n) \
51 prop_dictionary_set(d, k, prop_data_create_data(v, n))
52
53 #define dict_getd(d, k) \
54 prop_data_data_nocopy(prop_dictionary_get(d, k))
55
56 CIRCLEQ_HEAD(veriexec_ups, veriexec_up) params_list;
57 struct veriexec_up {
58 prop_dictionary_t vu_preload;
59 CIRCLEQ_ENTRY(veriexec_up) vu_list;
60 };
61
62 extern int gfd, verbose, phase;
63 extern size_t line;
64 extern char *infile;
65 extern FILE *yyin;
66
67 int yywrap(void);
68 int yylex(void);
69 int yyparse(void);
70 void yyerror(const char *);
71 struct veriexec_up *dev_lookup(char *);
72 struct veriexec_up *dev_add(char *);
73 void phase2_load(void);
74
75 #endif /* _VERIEXECCTL_H_ */
76