return 0;
}
-/*
+/*!
+ * Helper for processing cmd line options
+ *
+ * Process the parameters for the -audit-interface and -auditlog command line
+ * options
+ *
+ * @param[in] default_iface
+ * String for the default audit interface or NULL
+ * @param[in] audit_loglist
+ * Pointer to a cmd_item list of audit logs or NULL
+ *
+ * @return status
+ * @retval 0 - success
+ * @retval -1 - Error (message printed to stderr)
+ */
+
+int
+osi_audit_cmd_Options(char *default_iface, struct cmd_item *audit_loglist)
+{
+
+ if (default_iface) {
+ if (osi_audit_interface(default_iface)) {
+ fprintf(stderr, "Invalid auditinterface '%s'\n", default_iface);
+ return -1;
+ }
+ }
+
+ while (audit_loglist != NULL) {
+ if (osi_audit_file(audit_loglist->data)) {
+ fprintf(stderr, "Error processing auditlog options '%s'\n",
+ audit_loglist->data);
+ return -1;
+ }
+ audit_loglist = audit_loglist->next;
+ }
+ return 0;
+}
+
+ /*
* Handle parsing a string: [interface_name:]filespec[:options]
* The string a:b will parse 'a' as the interface name and 'b' as the filespec.
* Note that the string pointed by optionstr will be modified
* directory or online at http://www.openafs.org/dl/license10.html
*/
+#ifndef AFS_AUDIT_AUDIT_H
+#define AFS_AUDIT_AUDIT_H
+
+#include <afs/cmd.h>
+
#define AUD_END 0 /* End of variable list */
#define AUD_STR 1 /* String in variable list */
#define AUD_INT 2 /* int in variable list */
/* prototypes for audit functions */
int osi_audit(char *audEvent, afs_int32 errCode, ...);
int osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...);
+int osi_audit_cmd_Options(char *default_iface, struct cmd_item *audit_loglist);
int osi_audit_file(const char *fileplusoptions);
void osi_audit_init(void);
int osi_audit_interface(const char *interface);
void audit_PrintStats(FILE *out);
void osi_audit_open(void);
void osi_audit_close(void);
+
+#endif /* AFS_AUDIT_AUDIT_H */
\ No newline at end of file