Overview
Comment: | Obtain DNS settings from NetStack on MorphOS |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
79a7da11053e10c902150b3e35c7f0c6 |
User & Date: | js on 2020-12-22 16:43:13 |
Other Links: | manifest | tags |
References
2020-12-22
| ||
16:45 | • Fixed ticket [49d37c7998]: Support for obtaining the name servers on MorphOS plus 4 other changes artifact: 003dcf99ff user: js | |
Context
2020-12-22
| ||
18:25 | Rename hostname() to avoid shadowing check-in: 1a6dbb19bc user: js tags: trunk | |
16:43 | Obtain DNS settings from NetStack on MorphOS check-in: 79a7da1105 user: js tags: trunk | |
00:50 | Don't use stat() on MorphOS check-in: 46588d658c user: js tags: trunk | |
Changes
Modified src/OFDNSResolverSettings.m from [7c81772fe9] to [edf3853107].
︙ | |||
44 45 46 47 48 49 50 51 52 53 54 55 56 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 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 183 184 185 186 187 | + + + + + + - - - - - + - + - - - - - - - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #ifdef OF_NINTENDO_3DS /* Newer versions of libctru started using id as a parameter name. */ # define id id_3ds # include <3ds.h> # undef id #endif #ifdef OF_MORPHOS # include <proto/rexxsyslib.h> # include <rexx/errors.h> # include <rexx/storage.h> #endif #import "socket_helpers.h" #if defined(OF_HAIKU) # define HOSTS_PATH @"/system/settings/network/hosts" # define RESOLV_CONF_PATH @"/system/settings/network/resolv.conf" |
︙ | |||
159 160 161 162 163 164 165 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | - + - - - - + - - + - + - + - - - - + - - - | #ifndef OF_NINTENDO_3DS _configReloadInterval = 2; #else _configReloadInterval = 0; #endif } |
︙ | |||
384 385 386 387 388 389 390 391 392 393 394 395 396 397 | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if (fixedInfo->DomainName[0] != '\0') _localDomain = [[OFString alloc] initWithCString: fixedInfo->DomainName encoding: encoding]; } #endif #ifdef OF_MORPHOS - (void)obtainMorphOSSystemConfig { void *pool = objc_autoreleasePoolPush(); OFMutableDictionary *staticHosts; _nameServers = [parseNetStackArray(arexxCommand("NETSTACK", "QUERY NAMESERVERS")) copy]; _localDomain = [domainFromHostname(arexxCommand("NETSTACK", "QUERY HOSTNAME")) copy]; _searchDomains = [parseNetStackArray(arexxCommand("NETSTACK", "QUERY DOMAINS")) copy]; staticHosts = [OFMutableDictionary dictionary]; for (OFString *entry in parseNetStackArray(arexxCommand("NETSTACK", "QUERY HOSTS"))) { OFArray *components = [entry componentsSeparatedByString: @" "]; OFString *address; OFArray *hosts; if (components.count < 2) continue; address = components.firstObject; hosts = [components objectsInRange: of_range(1, components.count - 1)]; for (OFString *host in hosts) { OFMutableArray *addresses = [staticHosts objectForKey: host]; if (addresses == nil) { addresses = [OFMutableArray array]; [staticHosts setObject: addresses forKey: host]; } [addresses addObject: address]; } } for (OFMutableArray *addresses in [staticHosts objectEnumerator]) [addresses makeImmutable]; [staticHosts makeImmutable]; _staticHosts = [staticHosts copy]; objc_autoreleasePoolPop(pool); } #endif #ifdef OF_AMIGAOS4 - (void)obtainAmigaOS4SystemConfig { OFMutableArray *nameServers = [OFMutableArray array]; of_string_encoding_t encoding = [OFLocale encoding]; struct List *nameServerList = ObtainDomainNameServerList(); |
︙ | |||
506 507 508 509 510 511 512 513 514 515 516 517 518 519 | 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | + + | stringByExpandingWindowsEnvironmentStrings]; if (path != nil) [self parseHosts: path]; # endif [self obtainWindowsSystemConfig]; #elif defined(OF_MORPHOS) [self obtainMorphOSSystemConfig]; #elif defined(OF_AMIGAOS4) [self parseHosts: HOSTS_PATH]; [self obtainAmigaOS4SystemConfig]; #elif defined(OF_NINTENDO_3DS) [self obtainNintendo3DSSytemConfig]; #elif defined(OF_HAVE_FILES) [self parseHosts: HOSTS_PATH]; |
︙ | |||
537 538 539 540 541 542 543 | 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | - + - + | #ifdef OF_HAVE_IPV6 _nameServers = [[OFArray alloc] initWithObjects: @"127.0.0.1", @"::1", nil]; #else _nameServers = [[OFArray alloc] initWithObject: @"127.0.0.1"]; #endif |