attr_optadd(struct attr_flags *attr, u_int8_t flags, u_int8_t type,
attr_optadd(struct rde_aspath *asp, u_int8_t flags, u_int8_t type,
attr_optadd(struct attr_flags *attr, u_int8_t flags, u_int8_t type,    void *data, u_int16_t len){	struct attr	*a, *p;	/* known optional attributes were validated previously */	a = calloc(1, sizeof(struct attr));	if (a == NULL)		fatal("attr_optadd");	a->flags = flags;	a->type = type;	a->len = len;	if (len != 0) {		a->data = malloc(len);		if (a->data == NULL)			fatal("attr_optadd");		memcpy(a->data, data, len);	} else		a->data = NULL;	/* keep a sorted list */	TAILQ_FOREACH_REVERSE(p, &attr->others, attr_list, entry) {		if (type == p->type) {			/* attribute only once allowed */			free(a->data);			free(a);			return (-1);		}		if (type > p->type) {			TAILQ_INSERT_AFTER(&attr->others, p, a, entry);			return (0);		}	}	TAILQ_INSERT_HEAD(&attr->others, a, entry);	return (0);}