]> git.saurik.com Git - apple/configd.git/blob - EventFactory/SCLogParser.h
configd-1109.40.9.tar.gz
[apple/configd.git] / EventFactory / SCLogParser.h
1 /*
2 * Copyright (c) 2018 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 #import <os/log.h>
25
26 @class EFLogEventParser;
27
28 os_log_t __log_Spectacles(void);
29 #define specs_log_err(format, ...) os_log_error(__log_Spectacles(), format, ##__VA_ARGS__)
30 #define specs_log_notice(format, ...) os_log (__log_Spectacles(), format, ##__VA_ARGS__)
31 #define specs_log_info(format, ...) os_log_info (__log_Spectacles(), format, ##__VA_ARGS__)
32 #define specs_log_debug(format, ...) os_log_debug(__log_Spectacles(), format, ##__VA_ARGS__)
33
34 #define TokenInterfaceName "ifname"
35
36 @interface SCLogParser: NSObject
37 - (instancetype)initWithCategory:(NSString *)category eventParser:(EFLogEventParser *)eventParser;
38 - (NSData *)createSubsystemIdentifier;
39 - (NSArray<NSString *> *)addUniqueString:(NSString *)newString toArray:(NSArray<NSString *> *)array;
40 - (NSArray<NSString *> *)addUniqueStrings:(NSArray<NSString *> *)strings toArray:(NSArray<NSString *> *)array;
41 - (EFNetworkControlPathEvent *)createInterfaceEventWithLogEvent:(EFLogEvent *)logEvent matchResult:(NSTextCheckingResult *)matchResult;
42 - (EFNetworkControlPathEvent *)createInterfaceEventWithLogEvent:(EFLogEvent *)logEvent interfaceName:(NSString *)interfaceName;
43 - (void)addAddress:(NSString *)addressString toInterfaceEvent:(EFNetworkControlPathEvent *)event;
44 - (BOOL)removeAddress:(NSString *)addressString fromInterfaceEvent:(EFNetworkControlPathEvent *)event;
45 - (NSString *)substringOfString:(NSString *)matchedString forCaptureGroup:(NSString *)groupName inMatchResult:(NSTextCheckingResult *)result;
46 - (sa_family_t)getAddressFamilyOfAddress:(NSString *)addressString;
47 @property (readonly) EFLogEventParser *eventParser;
48 @property (readonly) NSString *category;
49 @property (class, readonly) NSMutableDictionary<NSString *, NSArray<NSString *> *> *interfaceMap;
50 @end