]> git.saurik.com Git - apple/libc.git/blob - gen/asl_private.h
be092c797c0095eabd8760f85cb20cb30bd15340
[apple/libc.git] / gen / asl_private.h
1 /*
2 * Copyright (c) 2007-2011 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_OPT_IGNORE "ignore"
55 #define ASL_OPT_STORE "store"
56
57 #define ASL_STORE_LOCATION_FILE 0
58 #define ASL_STORE_LOCATION_MEMORY 1
59
60 #define ASL_OPT_SYSLOG_LEGACY 0x00010000
61
62 /* SPI to enable ASL filter tunneling using asl_set_filter() */
63 #define ASL_FILTER_MASK_TUNNEL 0x100
64
65 typedef struct __aslclient
66 {
67 uint32_t options;
68 struct sockaddr_un server;
69 int sock;
70 pid_t pid;
71 uid_t uid;
72 gid_t gid;
73 char *name;
74 char *facility;
75 uint32_t filter;
76 int notify_token;
77 int notify_master_token;
78 uint32_t fd_count;
79 int *fd_list;
80 char **fd_mfmt;
81 char **fd_tfmt;
82 uint32_t *fd_encoding;
83 asl_file_t *aslfile;
84 uint64_t aslfileid;
85 uint32_t reserved1;
86 void *reserved2;
87 int32_t refcount;
88 } asl_client_t;
89
90 __BEGIN_DECLS
91
92 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);
93 int asl_remove_output(aslclient asl, int fd) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
94 int asl_store_location() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
95 int asl_get_filter(aslclient asl, int *local, int *master, int *remote, int *active) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
96 char *asl_remote_notify_name() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
97
98 __END_DECLS
99
100 #endif /* __ASL_PRIVATE_H__ */