132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
#ifdef OF_HAVE_SOCKETS
networkInterfaces = [OFSystemInfo networkInterfaces];
[OFStdOut writeString: @"[OFSystemInfo] Network interfaces: "];
for (OFString *name in networkInterfaces) {
bool firstAddress = true;
OFNetworkInterface interface;
if (!firstInterface)
[OFStdOut writeString: @"; "];
firstInterface = false;
[OFStdOut writeFormat: @"%@(", name];
|
>
|
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
#ifdef OF_HAVE_SOCKETS
networkInterfaces = [OFSystemInfo networkInterfaces];
[OFStdOut writeString: @"[OFSystemInfo] Network interfaces: "];
for (OFString *name in networkInterfaces) {
bool firstAddress = true;
OFNetworkInterface interface;
OFData *hardwareAddress;
if (!firstInterface)
[OFStdOut writeString: @"; "];
firstInterface = false;
[OFStdOut writeFormat: @"%@(", name];
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
printAddresses([interface objectForKey:
OFNetworkInterfaceIPXAddresses], &firstAddress);
# endif
# ifdef OF_HAVE_APPLETALK
printAddresses([interface objectForKey:
OFNetworkInterfaceAppleTalkAddresses], &firstAddress);
# endif
[OFStdOut writeString: @")"];
}
[OFStdOut writeString: @"\n"];
#endif
objc_autoreleasePoolPop(pool);
}
@end
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
printAddresses([interface objectForKey:
OFNetworkInterfaceIPXAddresses], &firstAddress);
# endif
# ifdef OF_HAVE_APPLETALK
printAddresses([interface objectForKey:
OFNetworkInterfaceAppleTalkAddresses], &firstAddress);
# endif
hardwareAddress = [interface
objectForKey: OFNetworkInterfaceHardwareAddress];
if (hardwareAddress != nil) {
const unsigned char *bytes = hardwareAddress.items;
size_t length = hardwareAddress.count;
if (!firstAddress)
[OFStdOut writeString: @", "];
for (size_t i = 0; i < length; i++) {
if (i > 0)
[OFStdOut writeString: @":"];
[OFStdOut writeFormat: @"%02X", bytes[i]];
}
}
[OFStdOut writeString: @")"];
}
[OFStdOut writeString: @"\n"];
#endif
objc_autoreleasePoolPop(pool);
}
@end
|