ObjFW  Diff

Differences From Artifact [646021bd53]:

To Artifact [f271eb5ab9]:


126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

















153
154
155
156
157
158
159
160
161
162
163
164
			[OFStdOut writeString: @"; "];
		firstInterface = false;

		[OFStdOut writeFormat: @"%@(", name];

		if (etherAddr.itemSize == 1 && etherAddr.count == 6) {
			const unsigned char *addr = etherAddr.items;
			[OFStdOut writeFormat: @"%02X:%02X:%02X:%02X:%02X:%02X",

					       addr[0], addr[1], addr[2],
					       addr[3], addr[4], addr[5]];
			firstAddress = false;
		}

		addrs = [interface objectForKey: OFNetworkInterfaceAddresses];
		for (size_t i = 0; i < addrs.count; i++) {
			const OFSocketAddress *addr = [addrs itemAtIndex: i];
			OFString *string;

			@try {
				string = OFSocketAddressString(addr);
			} @catch (OFInvalidArgumentException *e) {
				continue;
			}

			if (!firstAddress)
				[OFStdOut writeString: @", "];
			firstAddress = nil;


















			[OFStdOut writeString: string];
		}

		[OFStdOut writeString: @")"];
	}
	[OFStdOut writeString: @"\n"];
#endif

	objc_autoreleasePoolPop(pool);
}
@end







|
>
|
|

















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>












126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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
			[OFStdOut writeString: @"; "];
		firstInterface = false;

		[OFStdOut writeFormat: @"%@(", name];

		if (etherAddr.itemSize == 1 && etherAddr.count == 6) {
			const unsigned char *addr = etherAddr.items;
			[OFStdOut writeFormat:
			    @"MAC=%02X:%02X:%02X:%02X:%02X:%02X",
			    addr[0], addr[1], addr[2], addr[3], addr[4],
			    addr[5]];
			firstAddress = false;
		}

		addrs = [interface objectForKey: OFNetworkInterfaceAddresses];
		for (size_t i = 0; i < addrs.count; i++) {
			const OFSocketAddress *addr = [addrs itemAtIndex: i];
			OFString *string;

			@try {
				string = OFSocketAddressString(addr);
			} @catch (OFInvalidArgumentException *e) {
				continue;
			}

			if (!firstAddress)
				[OFStdOut writeString: @", "];
			firstAddress = nil;

			switch (addr->family) {
			case OFSocketAddressFamilyIPv4:
				[OFStdOut writeString: @"IPv4="];
				break;
			case OFSocketAddressFamilyIPv6:
				[OFStdOut writeString: @"IPv6="];
				break;
			case OFSocketAddressFamilyIPX:
				[OFStdOut writeString: @"IPX="];
				break;
			case OFSocketAddressFamilyAppleTalk:
				[OFStdOut writeString: @"AppleTalk="];
				break;
			default:
				[OFStdOut writeString: @"unknown="];
			}

			[OFStdOut writeString: string];
		}

		[OFStdOut writeString: @")"];
	}
	[OFStdOut writeString: @"\n"];
#endif

	objc_autoreleasePoolPop(pool);
}
@end