ObjFW
OFSystemInfo+NetworkInterfaces.h
1 /*
2  * Copyright (c) 2008-2025 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License version 3.0 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  * version 3.0 for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * version 3.0 along with this program. If not, see
17  * <https://www.gnu.org/licenses/>.
18  */
19 
20 #import "OFSystemInfo.h"
21 
22 OF_ASSUME_NONNULL_BEGIN
23 
31 typedef OFConstantString *OFNetworkInterfaceKey;
32 
39 typedef OFDictionary OF_GENERIC(OFNetworkInterfaceKey, id) *OFNetworkInterface;
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
49 extern OFNetworkInterfaceKey OFNetworkInterfaceIndex;
50 
56 extern OFNetworkInterfaceKey OFNetworkInterfaceHardwareAddress;
57 
63 extern OFNetworkInterfaceKey OFNetworkInterfaceIPv4Addresses;
64 
65 #ifdef OF_HAVE_IPV6
66 
71 extern OFNetworkInterfaceKey OFNetworkInterfaceIPv6Addresses;
72 #endif
73 
74 #ifdef OF_HAVE_IPX
75 
80 extern OFNetworkInterfaceKey OFNetworkInterfaceIPXAddresses;
81 #endif
82 
83 #ifdef OF_HAVE_APPLETALK
84 
89 extern OFNetworkInterfaceKey OFNetworkInterfaceAppleTalkAddresses;
90 #endif
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 @interface OFSystemInfo (NetworkInterfaces)
96 
97 #ifdef OF_HAVE_CLASS_PROPERTIES
98 @property (class, readonly, nullable, nonatomic)
99  OFDictionary OF_GENERIC(OFString *, OFNetworkInterface) *networkInterfaces;
100 #endif
101 
108 + (nullable OFDictionary OF_GENERIC(OFString *, OFNetworkInterface) *)
109  networkInterfaces;
110 @end
111 
112 OF_ASSUME_NONNULL_END
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:41
A class for handling strings.
Definition: OFString.h:142
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:82