-static int src_id = -1;
-static int dst_id = -1;
-
-static void parse_route_set_endpoints(void)
-{
- src_id = network_card_new(A_surfxml_route_src);
- dst_id = network_card_new(A_surfxml_route_dst);
- route_action = A_surfxml_route_action;
-}
-
-static void parse_route_set_route(void)
-{
- char *name;
- if (src_id != -1 && dst_id != -1) {
- name = bprintf("%x#%x", src_id, dst_id);
- manage_route(route_table, name, route_action, 0);
- free(name);
- }
-}
-
-static void count_hosts(void)
-{
- host_number++;
-}
-
-static void define_callbacks(const char *file)
-{
- /* Figuring out the network links */
- surfxml_add_callback(STag_surfxml_host_cb_list, &count_hosts);
- surfxml_add_callback(STag_surfxml_route_cb_list,
- &parse_route_set_endpoints);
- surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);