/*}}}*/
using namespace std;
+CFStringRef Firmware_;
const char *Machine_;
const char *SerialNumber_;
CFRelease(sr);
}
+ if (Firmware_ != NULL)
+ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Firmware"), Firmware_);
+
sr = CFStringCreateWithCString(kCFAllocatorDefault, Machine_, se);
CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Machine"), sr);
CFRelease(sr);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
Machine_ = machine;
+ const char *path = "/System/Library/CoreServices/SystemVersion.plist";
+ CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (uint8_t *) path, strlen(path), false);
+
+ CFPropertyListRef plist; {
+ CFReadStreamRef stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, url);
+ CFReadStreamOpen(stream);
+ plist = CFPropertyListCreateFromStream(kCFAllocatorDefault, stream, 0, kCFPropertyListImmutable, NULL, NULL);
+ CFReadStreamClose(stream);
+ }
+
+ CFRelease(url);
+
+ if (plist != NULL) {
+ Firmware_ = (CFStringRef) CFRetain(CFDictionaryGetValue((CFDictionaryRef) plist, CFSTR("ProductVersion")));
+ CFRelease(plist);
+ }
+
if (CFMutableDictionaryRef dict = IOServiceMatching("IOPlatformExpertDevice"))
if (io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, dict)) {
if (CFTypeRef serial = IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, 0)) {
/*}}}*/
using namespace std;
+CFStringRef Firmware_;
const char *Machine_;
const char *SerialNumber_;
CFRelease(sr);
}
+ if (Firmware_ != NULL)
+ CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Firmware"), Firmware_);
+
sr = CFStringCreateWithCString(kCFAllocatorDefault, Machine_, se);
CFHTTPMessageSetHeaderFieldValue(hm, CFSTR("X-Machine"), sr);
CFRelease(sr);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
Machine_ = machine;
+ const char *path = "/System/Library/CoreServices/SystemVersion.plist";
+ CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (uint8_t *) path, strlen(path), false);
+
+ CFPropertyListRef plist; {
+ CFReadStreamRef stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, url);
+ CFReadStreamOpen(stream);
+ plist = CFPropertyListCreateFromStream(kCFAllocatorDefault, stream, 0, kCFPropertyListImmutable, NULL, NULL);
+ CFReadStreamClose(stream);
+ }
+
+ CFRelease(url);
+
+ if (plist != NULL) {
+ Firmware_ = (CFStringRef) CFRetain(CFDictionaryGetValue((CFDictionaryRef) plist, CFSTR("ProductVersion")));
+ CFRelease(plist);
+ }
+
if (CFMutableDictionaryRef dict = IOServiceMatching("IOPlatformExpertDevice"))
if (io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, dict)) {
if (CFTypeRef serial = IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, 0)) {
# The http method
PROGRAM=http
-SLIBS = -lapt-pkg $(SOCKETLIBS) -framework CFNetwork -framework CoreFoundation -framework SystemConfiguration -framework IOKit
+SLIBS = -lapt-pkg $(SOCKETLIBS) -framework CoreFoundation -framework CFNetwork -framework SystemConfiguration -framework IOKit
LIB_MAKES = apt-pkg/makefile
SOURCE = http.cc rfc2553emu.cc connect.cc
include $(PROGRAM_H)