]> git.saurik.com Git - apple/libc.git/blame - gen/asl_private.h
Libc-825.40.1.tar.gz
[apple/libc.git] / gen / asl_private.h
CommitLineData
224c7076 1/*
ad3c9f2a 2 * Copyright (c) 2007-2011 Apple Inc. All rights reserved.
224c7076
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
1f2f436a
A
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.
224c7076
A
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,
1f2f436a
A
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.
224c7076
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
1f2f436a
A
23
24#ifndef __ASL_PRIVATE_H__
25#define __ASL_PRIVATE_H__
26
3d9156a7
A
27#include <stdint.h>
28#include <sys/socket.h>
29#include <sys/un.h>
30#include <netinet/in.h>
31#include <arpa/inet.h>
1f2f436a
A
32#include "asl_file.h"
33#include "asl_msg.h"
34#include <Availability.h>
3d9156a7
A
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"
34e8f829 42#define NOTIFY_RC "com.apple.asl.remote"
3d9156a7 43
224c7076
A
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
34e8f829
A
54#define ASL_OPT_IGNORE "ignore"
55#define ASL_OPT_STORE "store"
224c7076 56
511daa4c
A
57#define ASL_STORE_LOCATION_FILE 0
58#define ASL_STORE_LOCATION_MEMORY 1
59
1f2f436a
A
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
3d9156a7
A
65typedef 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;
224c7076
A
80 char **fd_mfmt;
81 char **fd_tfmt;
b5d655f7 82 uint32_t *fd_encoding;
1f2f436a
A
83 asl_file_t *aslfile;
84 uint64_t aslfileid;
3d9156a7
A
85 uint32_t reserved1;
86 void *reserved2;
ad3c9f2a 87 int32_t refcount;
3d9156a7
A
88} asl_client_t;
89
224c7076
A
90__BEGIN_DECLS
91
1f2f436a
A
92int 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);
93int asl_remove_output(aslclient asl, int fd) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
1f2f436a
A
94int asl_store_location() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
95int asl_get_filter(aslclient asl, int *local, int *master, int *remote, int *active) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
96char *asl_remote_notify_name() __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
224c7076
A
97
98__END_DECLS
99
1f2f436a 100#endif /* __ASL_PRIVATE_H__ */