1 |
/* |
/* |
2 |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: emul_parse.c,v 1.42 2006/06/22 13:22:41 debug Exp $ |
* $Id: emul_parse.c,v 1.45 2006/12/30 13:30:52 debug Exp $ |
29 |
* |
* |
30 |
* Set up an emulation by parsing a config file. |
* Set up an emulation by parsing a config file. |
31 |
* |
* |
321 |
line, EXPECT_LEFT_PARENTHESIS); |
line, EXPECT_LEFT_PARENTHESIS); |
322 |
|
|
323 |
/* Default net: */ |
/* Default net: */ |
324 |
strlcpy(cur_net_ipv4net, "10.0.0.0", sizeof(cur_net_ipv4net)); |
strlcpy(cur_net_ipv4net, NET_DEFAULT_IPV4_MASK, |
325 |
strlcpy(cur_net_ipv4len, "8", sizeof(cur_net_ipv4len)); |
sizeof(cur_net_ipv4net)); |
326 |
|
snprintf(cur_net_ipv4len, sizeof(cur_net_ipv4len), "%i", |
327 |
|
NET_DEFAULT_IPV4_LEN); |
328 |
strlcpy(cur_net_local_port, "", sizeof(cur_net_local_port)); |
strlcpy(cur_net_local_port, "", sizeof(cur_net_local_port)); |
329 |
cur_net_n_remote = 0; |
cur_net_n_remote = 0; |
330 |
return; |
return; |
399 |
e->net = net_init(e, NET_INIT_FLAG_GATEWAY, |
e->net = net_init(e, NET_INIT_FLAG_GATEWAY, |
400 |
cur_net_ipv4net, atoi(cur_net_ipv4len), |
cur_net_ipv4net, atoi(cur_net_ipv4len), |
401 |
cur_net_remote, cur_net_n_remote, |
cur_net_remote, cur_net_n_remote, |
402 |
atoi(cur_net_local_port)); |
atoi(cur_net_local_port), NULL); |
403 |
|
|
404 |
if (e->net == NULL) { |
if (e->net == NULL) { |
405 |
fatal("line %i: fatal error: could not create" |
fatal("line %i: fatal error: could not create" |
540 |
if (cur_machine_emulated_hz[0]) { |
if (cur_machine_emulated_hz[0]) { |
541 |
m->emulated_hz = mystrtoull(cur_machine_emulated_hz, |
m->emulated_hz = mystrtoull(cur_machine_emulated_hz, |
542 |
NULL, 0); |
NULL, 0); |
|
m->automatic_clock_adjustment = 0; |
|
543 |
} |
} |
544 |
|
|
545 |
/* NOTE: Default nr of CPUs is 0: */ |
/* NOTE: Default nr of CPUs is 0: */ |