char* surf_parsed_filename = NULL; // to locate parse error messages
xbt_dynar_t parsed_link_list = NULL; /* temporary store of current list link of a route */
-extern AS_t current_routing;
/*
* Helping functions
*/
YY_BUFFER_STATE surf_input_buffer;
FILE *surf_file_to_parse = NULL;
-static void init_randomness(void);
-static void add_randomness(void);
-
/*
* Stuff relative to storage
*/
storage.content = A_surfxml_storage_content;
storage.content_type = A_surfxml_storage_content___type;
storage.properties = current_property_set;
+ storage.attach = A_surfxml_storage_attach;
sg_platf_new_storage(&storage);
current_property_set = NULL;
}
ASroute.gw_src = sg_routing_edge_by_name_or_null(A_surfxml_ASroute_gw___src);
ASroute.gw_dst = sg_routing_edge_by_name_or_null(A_surfxml_ASroute_gw___dst);
+ if (A_surfxml_ASroute_gw___src && !ASroute.gw_src)
+ surf_parse_error("gw_src=\"%s\" not found for ASroute from \"%s\" to \"%s\"",
+ A_surfxml_ASroute_gw___src, ASroute.src, ASroute.dst);
+ if (A_surfxml_ASroute_gw___dst && !ASroute.gw_dst)
+ surf_parse_error("gw_dst=\"%s\" not found for ASroute from \"%s\" to \"%s\"",
+ A_surfxml_ASroute_gw___dst, ASroute.src, ASroute.dst);
+
ASroute.link_list = parsed_link_list;
switch (A_surfxml_ASroute_symmetrical) {
* With XML parser
*/
-/* Random tag functions */
-
double get_cpu_power(const char *power)
{
double power_scale = 0.0;
e_random_generator_t random_generator;
char *random_id;
-static void init_randomness(void)
-{
- random_id = A_surfxml_random_id;
- random_min = surf_parse_get_double(A_surfxml_random_min);
- random_max = surf_parse_get_double(A_surfxml_random_max);
- random_mean = surf_parse_get_double(A_surfxml_random_mean);
- random_std_deviation = surf_parse_get_double(A_surfxml_random_std___deviation);
- switch (A_surfxml_random_generator) {
- case AU_surfxml_random_generator:
- case A_surfxml_random_generator_NONE:
- random_generator = NONE;
- break;
- case A_surfxml_random_generator_DRAND48:
- random_generator = DRAND48;
- break;
- case A_surfxml_random_generator_RAND:
- random_generator = RAND;
- break;
- case A_surfxml_random_generator_RNGSTREAM:
- random_generator = RNGSTREAM;
- break;
- default:
- surf_parse_error("Invalid random generator");
- break;
- }
-}
-
-static void add_randomness(void)
-{
- /* If needed, additional properties can be added by using the prop tag */
- random_data_t random =
- random_new(random_generator, 0, random_min, random_max, random_mean,
- random_std_deviation);
- xbt_dict_set(random_data_list, random_id, (void *) random,
- &xbt_free_ref);
-}
-
-
xbt_dict_t get_as_router_properties(const char* name)
{
return xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);