3 * Copyright (C) 2018 Cumulus Networks, Inc.
6 * FRR is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * FRR is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "agg_table.h"
25 static struct route_node
*agg_node_create(route_table_delegate_t
*delegate
,
26 struct route_table
*table
)
28 struct agg_node
*node
;
30 node
= XCALLOC(MTYPE_TMP
, sizeof(struct agg_node
));
32 return agg_node_to_rnode(node
);
35 static void agg_node_destroy(route_table_delegate_t
*delegate
,
36 struct route_table
*table
, struct route_node
*node
)
39 struct agg_node
*anode
= agg_node_from_rnode(node
);
41 XFREE(MTYPE_TMP
, anode
);
44 static route_table_delegate_t agg_table_delegate
= {
45 .create_node
= agg_node_create
,
46 .destroy_node
= agg_node_destroy
,
49 struct agg_table
*agg_table_init(void)
53 at
= XCALLOC(MTYPE_TMP
, sizeof(struct agg_table
));
55 at
->route_table
= route_table_init_with_delegate(&agg_table_delegate
);
56 route_table_set_info(at
->route_table
, at
);