1 /* $Id: kcontrol.c,v 1.1 2005-05-03 09:11:34 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 struct context_control {
28 void (*filter_destroy)(void *data);
31 static void my_inc(struct rset_key_control *kc)
33 struct context_control *cp;
40 static void my_dec(struct rset_key_control *kc)
42 struct context_control *cp;
47 if (cp->ref_count == 0)
49 if (cp->filter_destroy)
50 (*cp->filter_destroy)(kc->filter_data);
56 struct rset_key_control *zebra_key_control_create(ZebraHandle zh)
58 struct rset_key_control *kc = xmalloc(sizeof(*kc));
59 struct context_control *cp = xmalloc(sizeof(*cp));
62 kc->key_size = sizeof(struct it_key);
64 kc->cmp = key_compare_it;
65 kc->key_logdump_txt = key_logdump_txt;
66 kc->getseq = key_get_seq;
67 zebra_limit_for_rset(zh->m_limit,