예제 #1
0
indigo_error_t
ind_core_init(ind_core_config_t *config)
{
    ft_config_t ft_config;

    INDIGO_MEM_COPY(&ind_core_config, config, sizeof(*config));

    LOG_TRACE("OF state mgr init called");

    if (ind_core_init_done) {
        return INDIGO_ERROR_NONE;
    }

    ind_cfg_register(&ind_core_cfg_ops);

    /* Give some values to desc stats members */
    INIT_STR(ind_core_of_config.desc_stats.sw_desc,
             IND_CORE_SW_DESC_DEFAULT);
    INIT_STR(ind_core_of_config.desc_stats.hw_desc,
             IND_CORE_HW_DESC_DEFAULT);
    INIT_STR(ind_core_of_config.desc_stats.dp_desc,
             IND_CORE_DP_DESC_DEFAULT);
    INIT_STR(ind_core_of_config.desc_stats.mfr_desc,
             IND_CORE_MFR_DESC_DEFAULT);
    INIT_STR(ind_core_of_config.desc_stats.serial_num,
             IND_CORE_SERIAL_NUM_DEFAULT);

    /* Create flow table */
    if (config->max_flowtable_entries == 0) {
        /* Default value */
        config->max_flowtable_entries = 16384;
    }
    ft_config.strict_match_bucket_count = config->max_flowtable_entries;
    ft_config.flow_id_bucket_count = config->max_flowtable_entries;

    if ((ind_core_ft = ft_create(&ft_config)) == NULL) {
        LOG_ERROR("Unable to allocate flow table\n");
        return INDIGO_ERROR_RESOURCE;
    }

    ind_core_connection_count = 0;

    ind_core_init_done = 1;

    return INDIGO_ERROR_NONE;
}
예제 #2
0
int		ft_setenv(t_tab *t, t_struc *s)
{
	char	*tmp;
	char	*tmp2;

	tmp = get_line(t, s->arg[1]);
	tmp2 = ft_strjoin(s->arg[1], "=");
	if (tmp)
	{
		ft_redefine(t, tmp2, s, tmp);
		return (0);
	}
	else if (!tmp)
	{
		ft_create(t, s, tmp2);
		return (0);
	}
	return (0);
}
예제 #3
0
파일: ft_algo.c 프로젝트: floklein/42
void	ft_solve(t_piece **pieces, int size, int n)
{
	t_tet			tets[n + 1];
	char			**result;
	unsigned short	map[16];

	(tets + n)->blocs = 0;
	ft_memset(map, 0, 18);
	ft_get_tets(tets, pieces);
	ft_make_idents(tets, n);
	while (ft_rec(map, tets, tets, size) == -1)
		size++;
	result = ft_create(size);
	ft_fill(result, tets, pieces);
	ft_print(result);
	ft_clear((void **)result);
	ft_clear((void **)pieces);
	free(result);
}
예제 #4
0
파일: ft_init.c 프로젝트: pielo/select
sel_list			ft_init2(int ac, char **av)
{
	sel_list		llist;

	llist = ft_create(ac, av);
	tputs(tgetstr("ti", NULL), 1, ft_putc);
	tputs(tgetstr("us", NULL), 1, ft_putc);
	ft_putstr(llist.word);
	ft_putchar('\n');
	tputs(tgetstr("ue", NULL), 1, ft_putc);
	llist = *llist.next;
	while (llist.first != 1)
	{
		ft_putstr(llist.word);
		ft_putchar('\n');
		llist = *llist.next;
	}
	return (llist);
}