comparison packages/redboot/current/src/load.c @ 1520:fc4fa5d81cba

Allow port for HTTP connections to be overridden - from Jani Monoses
author gthomas
date Thu, 26 Feb 2004 11:12:08 +0000
parents c4355f101bf6
children 996bb9a3d7fe
comparison
equal deleted inserted replaced
1519:9f0d02327506 1520:fc4fa5d81cba
582 bool verbose, raw; 582 bool verbose, raw;
583 bool base_addr_set, mode_str_set; 583 bool base_addr_set, mode_str_set;
584 char *mode_str; 584 char *mode_str;
585 #ifdef CYGPKG_REDBOOT_NETWORKING 585 #ifdef CYGPKG_REDBOOT_NETWORKING
586 struct sockaddr_in host; 586 struct sockaddr_in host;
587 bool hostname_set; 587 bool hostname_set, port_set;
588 char *hostname; 588 char *hostname;
589 #endif 589 #endif
590 bool decompress = false; 590 bool decompress = false;
591 int chan = -1; 591 int chan = -1;
592 #if CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS > 1 592 #if CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS > 1
598 char *filename = 0; 598 char *filename = 0;
599 struct option_info opts[7]; 599 struct option_info opts[7];
600 connection_info_t info; 600 connection_info_t info;
601 getc_io_funcs_t *io = NULL; 601 getc_io_funcs_t *io = NULL;
602 struct load_io_entry *io_tab; 602 struct load_io_entry *io_tab;
603 unsigned int port; //int because it's an OPTION_ARG_TYPE_NUM, but will be cast to short
603 #ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS 604 #ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
604 bool spillover_ok = false; 605 bool spillover_ok = false;
605 #endif 606 #endif
606 607
607 #ifdef CYGPKG_REDBOOT_NETWORKING 608 #ifdef CYGPKG_REDBOOT_NETWORKING
628 #endif 629 #endif
629 #ifdef CYGPKG_REDBOOT_NETWORKING 630 #ifdef CYGPKG_REDBOOT_NETWORKING
630 init_opts(&opts[num_options], 'h', true, OPTION_ARG_TYPE_STR, 631 init_opts(&opts[num_options], 'h', true, OPTION_ARG_TYPE_STR,
631 (void *)&hostname, (bool *)&hostname_set, "host name or IP address"); 632 (void *)&hostname, (bool *)&hostname_set, "host name or IP address");
632 num_options++; 633 num_options++;
634 init_opts(&opts[num_options], 'p', true, OPTION_ARG_TYPE_NUM,
635 (void *)&port, (bool *)&port_set, "TCP port");
636 num_options++;
633 #endif 637 #endif
634 #ifdef CYGBLD_BUILD_REDBOOT_WITH_ZLIB 638 #ifdef CYGBLD_BUILD_REDBOOT_WITH_ZLIB
635 init_opts(&opts[num_options], 'd', false, OPTION_ARG_TYPE_FLG, 639 init_opts(&opts[num_options], 'd', false, OPTION_ARG_TYPE_FLG,
636 (void *)&decompress, 0, "decompress"); 640 (void *)&decompress, 0, "decompress");
637 num_options++; 641 num_options++;
653 diag_printf("Unable to reach host %s (%s)\n", 657 diag_printf("Unable to reach host %s (%s)\n",
654 hostname, inet_ntoa((in_addr_t *)&host)); 658 hostname, inet_ntoa((in_addr_t *)&host));
655 return; 659 return;
656 } 660 }
657 } 661 }
662 if (port_set)
663 host.sin_port = port;
658 #endif 664 #endif
659 if (chan >= CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS) { 665 if (chan >= CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS) {
660 diag_printf("Invalid I/O channel: %d\n", chan); 666 diag_printf("Invalid I/O channel: %d\n", chan);
661 return; 667 return;
662 } 668 }