]> git.saurik.com Git - apple/libc.git/blob - gen/asl_core.h
Libc-583.tar.gz
[apple/libc.git] / gen / asl_core.h
1 #ifndef __ASL_CORE_H__
2 #define __ASL_CORE_H__
3
4 /*
5 * Copyright (c) 2007 Apple Inc. All rights reserved.
6 *
7 * @APPLE_LICENSE_HEADER_START@
8 *
9 * "Portions Copyright (c) 2007 Apple Inc. All Rights
10 * Reserved. This file contains Original Code and/or Modifications of
11 * Original Code as defined in and that are subject to the Apple Public
12 * Source License Version 1.0 (the 'License'). You may not use this file
13 * except in compliance with the License. Please obtain a copy of the
14 * License at http://www.apple.com/publicsource and read it before using
15 * this file.
16 *
17 * The Original Code and all software distributed under the License are
18 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
22 * License for the specific language governing rights and limitations
23 * under the License."
24 *
25 * @APPLE_LICENSE_HEADER_END@
26 */
27
28 #include <stdint.h>
29
30 #define asl_msg_list_t asl_search_result_t
31
32 #define ASL_STATUS_OK 0
33 #define ASL_STATUS_INVALID_ARG 1
34 #define ASL_STATUS_INVALID_STORE 2
35 #define ASL_STATUS_INVALID_STRING 3
36 #define ASL_STATUS_INVALID_ID 4
37 #define ASL_STATUS_INVALID_MESSAGE 5
38 #define ASL_STATUS_NOT_FOUND 6
39 #define ASL_STATUS_READ_FAILED 7
40 #define ASL_STATUS_WRITE_FAILED 8
41 #define ASL_STATUS_NO_MEMORY 9
42 #define ASL_STATUS_ACCESS_DENIED 10
43 #define ASL_STATUS_READ_ONLY 11
44 #define ASL_STATUS_WRITE_ONLY 12
45 #define ASL_STATUS_MATCH_FAILED 13
46 #define ASL_STATUS_NO_RECORDS 14
47 #define ASL_STATUS_FAILED 9999
48
49 #define ASL_REF_NULL 0xffffffffffffffffLL
50
51 #define ASL_MSG_FLAG_READ_UID_SET 0x0001
52 #define ASL_MSG_FLAG_READ_GID_SET 0x0002
53 #define ASL_MSG_FLAG_SEARCH_MATCH 0x8000
54 #define ASL_MSG_FLAG_SEARCH_CLEAR 0x7fff
55
56 #define ASL_QUERY_MATCH_SLOW 0x00000000
57 #define ASL_QUERY_MATCH_MSG_ID 0x00000001
58 #define ASL_QUERY_MATCH_TIME 0x00000002
59 #define ASL_QUERY_MATCH_NANO 0x00000004
60 #define ASL_QUERY_MATCH_LEVEL 0x00000008
61 #define ASL_QUERY_MATCH_PID 0x00000010
62 #define ASL_QUERY_MATCH_UID 0x00000020
63 #define ASL_QUERY_MATCH_GID 0x00000040
64 #define ASL_QUERY_MATCH_RUID 0x00000080
65 #define ASL_QUERY_MATCH_RGID 0x00000100
66 #define ASL_QUERY_MATCH_REF_PID 0x00000200
67 #define ASL_QUERY_MATCH_HOST 0x00000400
68 #define ASL_QUERY_MATCH_SENDER 0x00000800
69 #define ASL_QUERY_MATCH_FACILITY 0x00001000
70 #define ASL_QUERY_MATCH_MESSAGE 0x00002000
71 #define ASL_QUERY_MATCH_REF_PROC 0x00004000
72 #define ASL_QUERY_MATCH_SESSION 0x00008000
73 #define ASL_QUERY_MATCH_TRUE 0x80000000
74 #define ASL_QUERY_MATCH_FALSE 0x40000000
75 #define ASL_QUERY_MATCH_ERROR 0x20000000
76
77 uint32_t asl_core_string_hash(const char *str, uint32_t len);
78 const char *asl_core_error(uint32_t code);
79 uint32_t asl_core_check_access(int32_t msgu, int32_t msgg, int32_t readu, int32_t readg, uint16_t flags);
80 uint64_t asl_core_htonq(uint64_t n);
81 uint64_t asl_core_ntohq(uint64_t n);
82 uint64_t asl_core_new_msg_id(uint64_t start);
83
84 #endif __ASL_CORE_H__