]> git.saurik.com Git - apple/libc.git/blob - gen/asl_private.h
913f9cec20f2967808c9fc3a804d042c7a09fe1a
[apple/libc.git] / gen / asl_private.h
1 /*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * "Portions Copyright (c) 2007 Apple Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License."
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24 #include <stdint.h>
25 #include <sys/socket.h>
26 #include <sys/un.h>
27 #include <netinet/in.h>
28 #include <arpa/inet.h>
29
30 #define _PATH_ASL_OUT "/var/log/asl.log"
31
32 #define ASL_QUERY_OP_NULL 0x00000
33
34 #define NOTIFY_SYSTEM_MASTER "com.apple.system.syslog.master"
35 #define NOTIFY_SYSTEM_ASL_FILTER "com.apple.system.syslog.asl_filter"
36 #define NOTIFY_PREFIX_SYSTEM "com.apple.system.syslog"
37 #define NOTIFY_PREFIX_USER "user.syslog"
38
39 #define ASL_MSG_FMT_RAW "raw"
40 #define ASL_MSG_FMT_STD "std"
41 #define ASL_MSG_FMT_BSD "bsd"
42 #define ASL_MSG_FMT_XML "xml"
43 #define ASL_MSG_FMT_MSG "msg"
44
45 #define ASL_TIME_FMT_SEC "sec"
46 #define ASL_TIME_FMT_UTC "utc"
47 #define ASL_TIME_FMT_LCL "lcl"
48
49 #define ASL_KEY_REF_PID "RefPID"
50 #define ASL_KEY_REF_PROC "RefProc"
51
52 typedef struct __aslclient
53 {
54 uint32_t options;
55 struct sockaddr_un server;
56 int sock;
57 pid_t pid;
58 uid_t uid;
59 gid_t gid;
60 char *name;
61 char *facility;
62 uint32_t filter;
63 int notify_token;
64 int notify_master_token;
65 uint32_t fd_count;
66 int *fd_list;
67 char **fd_mfmt;
68 char **fd_tfmt;
69 uint32_t reserved1;
70 void *reserved2;
71 } asl_client_t;
72
73 typedef struct __aslmsg
74 {
75 uint32_t type;
76 uint32_t count;
77 char **key;
78 char **val;
79 uint32_t *op;
80 } asl_msg_t;
81
82 typedef struct __aslresponse
83 {
84 uint32_t count;
85 uint32_t curr;
86 asl_msg_t **msg;
87 } asl_search_result_t;
88
89
90 __BEGIN_DECLS
91
92 int asl_add_output(aslclient asl, int fd, const char *msg_fmt, const char *time_fmt);
93 int asl_remove_output(aslclient asl, int fd);
94 char *asl_format_message(aslmsg msg, const char *msg_fmt, const char *time_fmt, uint32_t *outlen);
95
96 __END_DECLS
97