]> git.saurik.com Git - apple/libc.git/blob - gen/asl_private.h
Libc-763.11.tar.gz
[apple/libc.git] / gen / asl_private.h
1 /*
2 * Copyright (c) 2007-2010 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 #ifndef __ASL_PRIVATE_H__
25 #define __ASL_PRIVATE_H__
26
27 #include <stdint.h>
28 #include <sys/socket.h>
29 #include <sys/un.h>
30 #include <netinet/in.h>
31 #include <arpa/inet.h>
32 #include "asl_file.h"
33 #include "asl_msg.h"
34 #include <Availability.h>
35
36 #define ASL_QUERY_OP_NULL 0x00000
37
38 #define NOTIFY_SYSTEM_MASTER "com.apple.system.syslog.master"
39 #define NOTIFY_SYSTEM_ASL_FILTER "com.apple.system.syslog.asl_filter"
40 #define NOTIFY_PREFIX_SYSTEM "com.apple.system.syslog"
41 #define NOTIFY_PREFIX_USER "user.syslog"
42 #define NOTIFY_RC "com.apple.asl.remote"
43
44 #define ASL_MSG_FMT_RAW "raw"
45 #define ASL_MSG_FMT_STD "std"
46 #define ASL_MSG_FMT_BSD "bsd"
47 #define ASL_MSG_FMT_XML "xml"
48 #define ASL_MSG_FMT_MSG "msg"
49
50 #define ASL_TIME_FMT_SEC "sec"
51 #define ASL_TIME_FMT_UTC "utc"
52 #define ASL_TIME_FMT_LCL "lcl"
53
54 #define ASL_ENCODE_NONE 0
55 #define ASL_ENCODE_SAFE 1
56 #define ASL_ENCODE_VIS 2
57 #define ASL_ENCODE_ASL 3
58
59 #define ASL_OPT_IGNORE "ignore"
60 #define ASL_OPT_STORE "store"
61
62 #define ASL_STORE_LOCATION_FILE 0
63 #define ASL_STORE_LOCATION_MEMORY 1
64
65 #define ASL_OPT_SYSLOG_LEGACY 0x00010000
66
67 /* SPI to enable ASL filter tunneling using asl_set_filter() */
68 #define ASL_FILTER_MASK_TUNNEL 0x100
69
70 typedef struct __aslclient
71 {
72 uint32_t options;
73 struct sockaddr_un server;
74 int sock;
75 pid_t pid;
76 uid_t uid;
77 gid_t gid;
78 char *name;
79 char *facility;
80 uint32_t filter;
81 int notify_token;
82 int notify_master_token;
83 uint32_t fd_count;
84 int *fd_list;
85 char **fd_mfmt;
86 char **fd_tfmt;
87 uint32_t *fd_encoding;
88 asl_file_t *aslfile;
89 uint64_t aslfileid;
90 uint32_t reserved1;
91 void *reserved2;
92 } asl_client_t;
93
94 typedef struct __aslresponse
95 {
96 uint32_t count;
97 uint32_t curr;
98 asl_msg_t **msg;
99 } asl_search_result_t;
100
101 __BEGIN_DECLS
102
103 int asl_add_output(aslclient asl, int fd, const char *msg_fmt, const char *time_fmt, uint32_t text_encoding) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
104 int asl_remove_output(aslclient asl, int fd) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
105 char *asl_format_message(asl_msg_t *msg, const char *msg_fmt, const char *time_fmt, uint32_t text_encoding, uint32_t *outlen) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
106 uint32_t asl_msg_string_length(asl_msg_t *msg) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
107 uint32_t asl_msg_to_string_buffer(asl_msg_t *msg, char *buf, uint32_t bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
108 char *asl_msg_to_string(asl_msg_t *in, uint32_t *len) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
109 asl_search_result_t *asl_list_from_string(const char *buf) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
110 char *asl_list_to_string(asl_search_result_t *, uint32_t *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
111 int asl_store_location() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
112 int asl_get_filter(aslclient asl, int *local, int *master, int *remote, int *active) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
113 char *asl_remote_notify_name() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
114
115 __END_DECLS
116
117 #endif /* __ASL_PRIVATE_H__ */