/[dynamips]/upstream/dynamips-0.2.7-RC2/dynamips.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.7-RC2/dynamips.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7-RC1/dynamips.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC upstream/dynamips-0.2.7-RC2/dynamips.c revision 8 by dpavlin, Sat Oct 6 16:24:54 2007 UTC
# Line 32  Line 32 
32  #include "dev_c3725.h"  #include "dev_c3725.h"
33  #include "dev_c3745.h"  #include "dev_c3745.h"
34  #include "dev_c2600.h"  #include "dev_c2600.h"
35    #include "dev_msfc1.h"
36  #include "ppc32_vmtest.h"  #include "ppc32_vmtest.h"
37  #include "dev_vtty.h"  #include "dev_vtty.h"
38  #include "ptask.h"  #include "ptask.h"
# Line 58  Line 59 
59  /* Software version */  /* Software version */
60  const char *sw_version = DYNAMIPS_VERSION"-"JIT_ARCH;  const char *sw_version = DYNAMIPS_VERSION"-"JIT_ARCH;
61    
62    /* Software version tag */
63    const char *sw_version_tag = "2007030219";
64    
65  /* Hypervisor */  /* Hypervisor */
66  int hypervisor_mode = 0;  int hypervisor_mode = 0;
67  int hypervisor_tcp_port = 0;  int hypervisor_tcp_port = 0;
# Line 154  static void show_usage(int argc,char *ar Line 158  static void show_usage(int argc,char *ar
158  {  {
159     u_int def_ram_size,def_rom_size,def_nvram_size;     u_int def_ram_size,def_rom_size,def_nvram_size;
160     u_int def_conf_reg,def_clock_div;     u_int def_conf_reg,def_clock_div;
161     u_int def_disk0_size,def_disk1_size;     u_int def_disk0_size = 0,def_disk1_size = 0;
162     u_int def_nm_iomem_size = 0;     u_int def_nm_iomem_size = 0;
163    
164     switch(platform) {     switch(platform) {
# Line 215  static void show_usage(int argc,char *ar Line 219  static void show_usage(int argc,char *ar
219           def_clock_div  = C2600_DEFAULT_CLOCK_DIV;           def_clock_div  = C2600_DEFAULT_CLOCK_DIV;
220           def_disk0_size = C2600_DEFAULT_DISK0_SIZE;           def_disk0_size = C2600_DEFAULT_DISK0_SIZE;
221           def_disk1_size = C2600_DEFAULT_DISK1_SIZE;           def_disk1_size = C2600_DEFAULT_DISK1_SIZE;
222           def_nm_iomem_size = C3745_DEFAULT_IOMEM_SIZE;           def_nm_iomem_size = C2600_DEFAULT_IOMEM_SIZE;
223             break;
224          case VM_TYPE_MSFC1:
225             def_ram_size   = MSFC1_DEFAULT_RAM_SIZE;
226             def_rom_size   = MSFC1_DEFAULT_ROM_SIZE;
227             def_nvram_size = MSFC1_DEFAULT_NVRAM_SIZE;
228             def_conf_reg   = MSFC1_DEFAULT_CONF_REG;
229             def_clock_div  = MSFC1_DEFAULT_CLOCK_DIV;
230           break;           break;
231        case VM_TYPE_PPC32_TEST:        case VM_TYPE_PPC32_TEST:
232           def_ram_size   = PPC32_VMTEST_DEFAULT_RAM_SIZE;           def_ram_size   = PPC32_VMTEST_DEFAULT_RAM_SIZE;
# Line 322  static void show_usage(int argc,char *ar Line 333  static void show_usage(int argc,char *ar
333                  "Network Module\n",                  "Network Module\n",
334                  def_nm_iomem_size);                  def_nm_iomem_size);
335           break;           break;
336    
337          case VM_TYPE_MSFC1:
338             printf("  -s <pa_nio>        : Bind a Network IO interface to a "
339                    "Port Adapter\n");
340             break;
341    
342     }     }
343    
344     printf("\n"     printf("\n"
# Line 477  static int cli_get_platform_type(int arg Line 494  static int cli_get_platform_type(int arg
494           vm_type = VM_TYPE_C3745;           vm_type = VM_TYPE_C3745;
495        else if (!strcmp(str,"2600"))        else if (!strcmp(str,"2600"))
496           vm_type = VM_TYPE_C2600;           vm_type = VM_TYPE_C2600;
497          else if (!strcmp(str,"MSFC1"))
498             vm_type = VM_TYPE_MSFC1;
499        else if (!strcmp(str,"PPC32_TEST"))        else if (!strcmp(str,"PPC32_TEST"))
500           vm_type = VM_TYPE_PPC32_TEST;           vm_type = VM_TYPE_PPC32_TEST;
501        else        else
# Line 703  static int cli_parse_c2600_options(vm_in Line 722  static int cli_parse_c2600_options(vm_in
722     return(0);     return(0);
723  }  }
724    
725    /* Parse specific options for the MSFC1 platform */
726    static int cli_parse_msfc1_options(vm_instance_t *vm,int option)
727    {
728       msfc1_t *router;
729    
730       router = VM_MSFC1(vm);
731    
732       switch(option) {
733          /* PA NIO settings */
734          case 's':
735             return(msfc1_cmd_add_nio(router,optarg));
736    
737          /* Unknown option */
738          default:
739             return(-1);
740       }
741    
742       return(0);
743    }
744    
745  /* Create a router instance */  /* Create a router instance */
746  static vm_instance_t *cli_create_instance(char *name,int platform_type,  static vm_instance_t *cli_create_instance(char *name,int platform_type,
747                                            int instance_id)                                            int instance_id)
# Line 714  static vm_instance_t *cli_create_instanc Line 753  static vm_instance_t *cli_create_instanc
753     c3725_t *c3725;     c3725_t *c3725;
754     c3745_t *c3745;     c3745_t *c3745;
755     c2600_t *c2600;     c2600_t *c2600;
756       msfc1_t *msfc1;
757    
758     switch(platform_type) {     switch(platform_type) {
759        case VM_TYPE_C7200:        case VM_TYPE_C7200:
# Line 758  static vm_instance_t *cli_create_instanc Line 798  static vm_instance_t *cli_create_instanc
798           }           }
799           return(c2600->vm);           return(c2600->vm);
800    
801          case VM_TYPE_MSFC1:
802             if (!(msfc1 = msfc1_create_instance(name,instance_id))) {
803                fprintf(stderr,"MSFC1: unable to create instance!\n");
804                return NULL;
805             }
806             return(msfc1->vm);
807    
808        case VM_TYPE_PPC32_TEST:        case VM_TYPE_PPC32_TEST:
809           if (!(vm = ppc32_vmtest_create_instance(name,instance_id))) {           if (!(vm = ppc32_vmtest_create_instance(name,instance_id))) {
810              fprintf(stderr,"PPC32_TEST: unable to create instance!\n");              fprintf(stderr,"PPC32_TEST: unable to create instance!\n");
# Line 1031  static int parse_std_cmd_line(int argc,c Line 1078  static int parse_std_cmd_line(int argc,c
1078                case VM_TYPE_C2600:                case VM_TYPE_C2600:
1079                    res = cli_parse_c2600_options(vm,option);                    res = cli_parse_c2600_options(vm,option);
1080                    break;                    break;
1081                  case VM_TYPE_MSFC1:
1082                      res = cli_parse_msfc1_options(vm,option);
1083                      break;
1084              }              }
1085    
1086              if (res == -1)              if (res == -1)
# Line 1119  void dynamips_reset(void) Line 1169  void dynamips_reset(void)
1169     c3725_delete_all_instances();     c3725_delete_all_instances();
1170     c3745_delete_all_instances();     c3745_delete_all_instances();
1171     c2600_delete_all_instances();     c2600_delete_all_instances();
1172       msfc1_delete_all_instances();
1173     ppc32_vmtest_delete_all_instances();     ppc32_vmtest_delete_all_instances();
1174    
1175     /* Delete ATM and Frame-Relay switches + bridges */     /* Delete ATM and Frame-Relay switches + bridges */
# Line 1213  int main(int argc,char *argv[]) Line 1264  int main(int argc,char *argv[])
1264           case VM_TYPE_C2600:           case VM_TYPE_C2600:
1265              res = c2600_init_instance(VM_C2600(vm));              res = c2600_init_instance(VM_C2600(vm));
1266              break;              break;
1267             case VM_TYPE_MSFC1:
1268                res = msfc1_init_instance(VM_MSFC1(vm));
1269                break;
1270           case VM_TYPE_PPC32_TEST:           case VM_TYPE_PPC32_TEST:
1271              res = ppc32_vmtest_init_instance(vm);              res = ppc32_vmtest_init_instance(vm);
1272              break;              break;

Legend:
Removed from v.7  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26