-int au_open(void);
-int au_write(int d, token_t *m);
-int au_close(int d, int keep, short event);
-token_t *au_to_file(char *file);
-token_t *au_to_header(int rec_size, au_event_t e_type,
- au_emod_t e_mod);
-token_t *au_to_header32(int rec_size, au_event_t e_type,
- au_emod_t e_mod);
-token_t *au_to_header64(int rec_size, au_event_t e_type,
- au_emod_t e_mod);
-token_t *au_to_me(void);
-
-token_t *au_to_arg(char n, char *text, u_int32_t v);
-token_t *au_to_arg32(char n, char *text, u_int32_t v);
-token_t *au_to_arg64(char n, char *text, u_int64_t v);
-token_t *au_to_attr(struct vnode_attr *attr);
-token_t *au_to_attr32(struct vnode_attr *attr);
-token_t *au_to_attr64(struct vnode_attr *attr);
-token_t *au_to_data(char unit_print, char unit_type,
- char unit_count, char *p);
-token_t *au_to_exit(int retval, int err);
-token_t *au_to_groups(int *groups);
-token_t *au_to_newgroups(u_int16_t n, gid_t *groups);
-token_t *au_to_in_addr(struct in_addr *internet_addr);
-token_t *au_to_in_addr_ex(struct in6_addr *internet_addr);
-token_t *au_to_ip(struct ip *ip);
-token_t *au_to_ipc(char type, int id);
-token_t *au_to_ipc_perm(struct ipc_perm *perm);
-token_t *au_to_iport(u_int16_t iport);
-token_t *au_to_opaque(char *data, u_int16_t bytes);
-token_t *au_to_path(char *path);
-token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid,
- uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_t *tid);
-token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid,
- uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_t *tid);
-token_t *au_to_process64(au_id_t auid, uid_t euid, gid_t egid,
- uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_t *tid);
-token_t *au_to_process_ex(au_id_t auid, uid_t euid,
- gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_addr_t *tid);
-token_t *au_to_process32_ex(au_id_t auid, uid_t euid,
- gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_addr_t *tid);
-token_t *au_to_process64_ex(au_id_t auid, uid_t euid,
- gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_addr_t *tid);
-token_t *au_to_return(char status, u_int32_t ret);
-token_t *au_to_return32(char status, u_int32_t ret);
-token_t *au_to_return64(char status, u_int64_t ret);
-token_t *au_to_seq(long audit_count);
-token_t *au_to_socket(struct socket *so);
-token_t *au_to_socket_ex_32(u_int16_t lp, u_int16_t rp,
- struct sockaddr *la, struct sockaddr *ta);
-token_t *au_to_socket_ex_128(u_int16_t lp, u_int16_t rp,
- struct sockaddr *la, struct sockaddr *ta);
-token_t *au_to_sock_inet(struct sockaddr_in *so);
-token_t *au_to_sock_inet32(struct sockaddr_in *so);
-token_t *au_to_sock_inet128(struct sockaddr_in6 *so);
-token_t *au_to_sock_unix(struct sockaddr_un *so);
-token_t *au_to_subject(au_id_t auid, uid_t euid, gid_t egid,
- uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_t *tid);
-token_t *au_to_subject32(au_id_t auid, uid_t euid, gid_t egid,
- uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_t *tid);
-token_t *au_to_subject64(au_id_t auid, uid_t euid, gid_t egid,
- uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_t *tid);
-token_t *au_to_subject_ex(au_id_t auid, uid_t euid,
- gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_addr_t *tid);
-token_t *au_to_subject32_ex(au_id_t auid, uid_t euid,
- gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_addr_t *tid);
-token_t *au_to_subject64_ex(au_id_t auid, uid_t euid,
- gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
- au_asid_t sid, au_tid_addr_t *tid);
-token_t *au_to_exec_args(const char **);
-token_t *au_to_exec_env(const char **);
-token_t *au_to_text(char *text);
-token_t *au_to_kevent(struct kevent *kev);
-token_t *au_to_trailer(int rec_size);
+struct in_addr;
+struct in6_addr;
+struct ip;
+struct ipc_perm;
+struct kevent;
+struct sockaddr;
+struct sockaddr_in;
+struct sockaddr_in6;
+struct sockaddr_un;
+#if defined(_KERNEL) || defined(KERNEL)
+struct vnode_au_info;
+#endif
+
+int au_open(void);
+int au_write(int d, token_t *m);
+int au_close(int d, int keep, short event);
+int au_close_buffer(int d, short event, u_char *buffer, size_t *buflen);
+int au_close_token(token_t *tok, u_char *buffer, size_t *buflen);
+
+token_t *au_to_file(const char *file, struct timeval tm);
+
+token_t *au_to_header32_tm(int rec_size, au_event_t e_type, au_emod_t e_mod,
+ struct timeval tm);
+token_t *au_to_header32_ex_tm(int rec_size, au_event_t e_type, au_emod_t e_mod,
+ struct timeval tm, struct auditinfo_addr *aia);
+token_t *au_to_header64_tm(int rec_size, au_event_t e_type, au_emod_t e_mod,
+ struct timeval tm);
+#if !defined(KERNEL) && !defined(_KERNEL)
+token_t *au_to_header(int rec_size, au_event_t e_type, au_emod_t e_mod);
+token_t *au_to_header_ex(int rec_size, au_event_t e_type, au_emod_t e_mod);
+token_t *au_to_header32(int rec_size, au_event_t e_type, au_emod_t e_mod);
+token_t *au_to_header64(int rec_size, au_event_t e_type, au_emod_t e_mod);
+token_t *au_to_header32_ex(int rec_size, au_event_t e_type, au_emod_t e_mod);
+#endif
+
+token_t *au_to_me(void);
+token_t *au_to_arg(char n, const char *text, uint32_t v);
+token_t *au_to_arg32(char n, const char *text, uint32_t v);
+token_t *au_to_arg64(char n, const char *text, uint64_t v);
+
+#if defined(_KERNEL) || defined(KERNEL)
+token_t *au_to_attr(struct vnode_au_info *vni);
+token_t *au_to_attr32(struct vnode_au_info *vni);
+token_t *au_to_attr64(struct vnode_au_info *vni);
+#endif
+
+token_t *au_to_data(char unit_print, char unit_type, char unit_count,
+ const char *p);
+token_t *au_to_exit(int retval, int err);
+token_t *au_to_groups(int *groups);
+token_t *au_to_newgroups(uint16_t n, gid_t *groups);
+token_t *au_to_in_addr(struct in_addr *internet_addr);
+token_t *au_to_in_addr_ex(struct in6_addr *internet_addr);
+token_t *au_to_ip(struct ip *ip);
+token_t *au_to_ipc(char type, int id);
+token_t *au_to_ipc_perm(struct ipc_perm *perm);
+token_t *au_to_iport(uint16_t iport);
+token_t *au_to_opaque(const char *data, uint16_t bytes);
+token_t *au_to_path(const char *path);
+token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
+token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
+token_t *au_to_process64(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
+token_t *au_to_process_ex(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid);
+token_t *au_to_process32_ex(au_id_t auid, uid_t euid, gid_t egid,
+ uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid,
+ au_tid_addr_t *tid);
+token_t *au_to_process64_ex(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid);
+token_t *au_to_return(char status, uint32_t ret);
+token_t *au_to_return32(char status, uint32_t ret);
+token_t *au_to_return64(char status, uint64_t ret);
+token_t *au_to_seq(long audit_count);
+token_t *au_to_socket_ex(u_short so_domain, u_short so_type,
+ struct sockaddr *sa_local, struct sockaddr *sa_remote);
+token_t *au_to_sock_inet(struct sockaddr_in *so);
+token_t *au_to_sock_inet32(struct sockaddr_in *so);
+token_t *au_to_sock_inet128(struct sockaddr_in6 *so);
+token_t *au_to_sock_unix(struct sockaddr_un *so);
+token_t *au_to_subject(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
+token_t *au_to_subject32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
+token_t *au_to_subject64(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
+token_t *au_to_subject_ex(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid);
+token_t *au_to_subject32_ex(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid);
+token_t *au_to_subject64_ex(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
+ gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid);
+#if defined(_KERNEL) || defined(KERNEL)
+token_t *au_to_exec_args(char *args, int argc);
+token_t *au_to_exec_env(char *envs, int envc);
+#else
+token_t *au_to_exec_args(char **argv);
+token_t *au_to_exec_env(char **envp);
+#endif
+token_t *au_to_text(const char *text);
+token_t *au_to_kevent(struct kevent *kev);
+token_t *au_to_trailer(int rec_size);
+token_t *au_to_zonename(const char *zonename);
+
+/*
+ * BSM library routines for converting between local and BSM constant spaces.
+ */
+int au_bsm_to_domain(u_short bsm_domain, int *local_domainp);
+int au_bsm_to_errno(u_char bsm_error, int *errorp);
+int au_bsm_to_fcntl_cmd(u_short bsm_fcntl_cmd, int *local_fcntl_cmdp);
+int au_bsm_to_socket_type(u_short bsm_socket_type,
+ int *local_socket_typep);
+u_short au_domain_to_bsm(int local_domain);
+u_char au_errno_to_bsm(int local_errno);
+u_short au_fcntl_cmd_to_bsm(int local_fcntl_command);
+u_short au_socket_type_to_bsm(int local_socket_type);